Skip to main content

workspaces

Creates, updates, deletes, gets or lists a workspaces resource.

Overview

Nameworkspaces
TypeResource
Iddigitalocean.genai.workspaces

Fields

The following fields are returned by SELECT queries:

A successful response.

NameDatatypeDescription
namestringName of the workspace (example: example name)
agentsarrayAgents
created_atstring (date-time)Creation date (example: 2023-01-01T00:00:00Z)
created_bystring (uint64)The id of user who created this workspace (example: 12345)
created_by_emailstringThe email of the user who created this workspace (example: example@example.com)
deleted_atstring (date-time)Deleted date (example: 2023-01-01T00:00:00Z)
descriptionstringDescription of the workspace (example: example string)
evaluation_test_casesarrayEvaluations
updated_atstring (date-time)Update date (example: 2023-01-01T00:00:00Z)
uuidstringUnique id (example: 123e4567-e89b-12d3-a456-426614174000)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
genai_get_workspaceselectworkspace_uuidTo retrieve details of a workspace, GET request to /v2/gen-ai/workspaces/{workspace_uuid}. The response body is a JSON object containing the workspace.
genai_list_workspacesselectTo list all workspaces, send a GET request to /v2/gen-ai/workspaces.
genai_create_workspaceinsertTo create a new workspace, send a POST request to /v2/gen-ai/workspaces. The response body contains a JSON object with the newly created workspace object.
genai_update_workspacereplaceworkspace_uuidTo update a workspace, send a PUT request to /v2/gen-ai/workspaces/{workspace_uuid}. The response body is a JSON object containing the workspace.
genai_delete_workspacedeleteworkspace_uuidTo delete a workspace, send a DELETE request to /v2/gen-ai/workspace/{workspace_uuid}.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
workspace_uuidstringWorkspace UUID. (example: "123e4567-e89b-12d3-a456-426614174000")

SELECT examples

To retrieve details of a workspace, GET request to /v2/gen-ai/workspaces/{workspace_uuid}. The response body is a JSON object containing the workspace.

SELECT
name,
agents,
created_at,
created_by,
created_by_email,
deleted_at,
description,
evaluation_test_cases,
updated_at,
uuid
FROM digitalocean.genai.workspaces
WHERE workspace_uuid = '{{ workspace_uuid }}' -- required;

INSERT examples

To create a new workspace, send a POST request to /v2/gen-ai/workspaces. The response body contains a JSON object with the newly created workspace object.

INSERT INTO digitalocean.genai.workspaces (
data__agent_uuids,
data__description,
data__name
)
SELECT
'{{ agent_uuids }}',
'{{ description }}',
'{{ name }}'
RETURNING
workspace
;

REPLACE examples

To update a workspace, send a PUT request to /v2/gen-ai/workspaces/{workspace_uuid}. The response body is a JSON object containing the workspace.

REPLACE digitalocean.genai.workspaces
SET
data__description = '{{ description }}',
data__name = '{{ name }}',
data__workspace_uuid = '{{ workspace_uuid }}'
WHERE
workspace_uuid = '{{ workspace_uuid }}' --required
RETURNING
workspace;

DELETE examples

To delete a workspace, send a DELETE request to /v2/gen-ai/workspace/{workspace_uuid}.

DELETE FROM digitalocean.genai.workspaces
WHERE workspace_uuid = '{{ workspace_uuid }}' --required;