diff --git a/.github/workflows/bandit-security-check-python-agents-api.yml b/.github/workflows/bandit-security-check-python-agents-api.yml index f2981efbc..b6d4e828d 100644 --- a/.github/workflows/bandit-security-check-python-agents-api.yml +++ b/.github/workflows/bandit-security-check-python-agents-api.yml @@ -1,8 +1,13 @@ +name: Bandit security check python agents-api +run-name: ${{ github.actor }} is checking the security of the code + on: pull_request: - branches: - - main - - dev + paths: + - 'agents-api/**' + push: + paths: + - 'agents-api/**' jobs: bandit_check: diff --git a/.github/workflows/lint-agents-api-pr.yml b/.github/workflows/lint-agents-api-pr.yml index 90fdd0a4b..3721a8b59 100644 --- a/.github/workflows/lint-agents-api-pr.yml +++ b/.github/workflows/lint-agents-api-pr.yml @@ -1,10 +1,13 @@ -name: Lint and typecheck agents-api -run-name: ${{ github.actor }} is linting and typechecking the code - -# TODO: Fix CI github actions -# SCRUM-26 - -on: [pull_request] +name: Lint agents-api +run-name: ${{ github.actor }} is linting the code + +on: + pull_request: + paths: + - 'agents-api/**' + push: + paths: + - 'agents-api/**' jobs: Lint-And-Format: diff --git a/.github/workflows/test-agents-api-pr.yml b/.github/workflows/test-agents-api-pr.yml index b0f815634..95e676657 100644 --- a/.github/workflows/test-agents-api-pr.yml +++ b/.github/workflows/test-agents-api-pr.yml @@ -1,10 +1,13 @@ name: Test agents-api run-name: ${{ github.actor }} is testing the code -# TODO: Fix CI github actions -# SCRUM-26 - -on: [pull_request] +on: + pull_request: + paths: + - 'agents-api/**' + push: + paths: + - 'agents-api/**' jobs: Test: diff --git a/.github/workflows/typecheck-agents-api-pr.yml b/.github/workflows/typecheck-agents-api-pr.yml index 513390883..9fbc5d95c 100644 --- a/.github/workflows/typecheck-agents-api-pr.yml +++ b/.github/workflows/typecheck-agents-api-pr.yml @@ -1,10 +1,13 @@ name: Typecheck agents-api run-name: ${{ github.actor }} is typechecking the code -# TODO: Fix CI github actions -# SCRUM-26 - -on: [pull_request] +on: + pull_request: + paths: + - 'agents-api/**' + push: + paths: + - 'agents-api/**' jobs: Typecheck: diff --git a/agents-api/agents_api/activities/execute_system.py b/agents-api/agents_api/activities/execute_system.py new file mode 100644 index 000000000..8e4d71274 --- /dev/null +++ b/agents-api/agents_api/activities/execute_system.py @@ -0,0 +1,163 @@ +from typing import Any +from uuid import UUID + +from beartype import beartype +from temporalio import activity + +from ..autogen.Tools import SystemDef +from ..common.protocol.tasks import StepContext +from ..env import testing +from ..models.agent.create_agent import create_agent as create_agent_query +from ..models.agent.delete_agent import delete_agent as delete_agent_query +from ..models.agent.get_agent import get_agent as get_agent_query +from ..models.agent.list_agents import list_agents as list_agents_query +from ..models.agent.update_agent import update_agent as update_agent_query +from ..models.docs.create_doc import create_doc as create_doc_query +from ..models.docs.delete_doc import delete_doc as delete_doc_query +from ..models.docs.get_doc import get_doc as get_doc_query +from ..models.docs.list_docs import list_docs as list_docs_query +from ..models.session.create_session import create_session as create_session_query +from ..models.session.delete_session import delete_session as delete_session_query +from ..models.session.get_session import get_session as get_session_query +from ..models.session.list_sessions import list_sessions as list_sessions_query +from ..models.session.update_session import update_session as update_session_query +from ..models.task.create_task import create_task as create_task_query +from ..models.task.delete_task import delete_task as delete_task_query +from ..models.task.get_task import get_task as get_task_query +from ..models.task.list_tasks import list_tasks as list_tasks_query +from ..models.task.update_task import update_task as update_task_query +from ..models.user.create_user import create_user as create_user_query +from ..models.user.delete_user import delete_user as delete_user_query +from ..models.user.get_user import get_user as get_user_query +from ..models.user.list_users import list_users as list_users_query +from ..models.user.update_user import update_user as update_user_query + + +@beartype +async def execute_system( + context: StepContext, + system: SystemDef, +) -> Any: + arguments = system.arguments + arguments["developer_id"] = context.execution_input.developer_id + + # Convert all UUIDs to UUID objects + if "agent_id" in arguments: + arguments["agent_id"] = UUID(arguments["agent_id"]) + if "user_id" in arguments: + arguments["user_id"] = UUID(arguments["user_id"]) + if "task_id" in arguments: + arguments["task_id"] = UUID(arguments["task_id"]) + if "session_id" in arguments: + arguments["session_id"] = UUID(arguments["session_id"]) + if "doc_id" in arguments: + arguments["doc_id"] = UUID(arguments["doc_id"]) + + # FIXME: This is a total mess. Should be refactored. + try: + # AGENTS + if system.resource == "agent": + # DOCS SUBRESOURCE + if system.subresource == "doc": + # Define the arguments for the agent doc queries + agent_doc_args = { + **{ + "owner_type": "agent", + "owner_id": arguments.pop("agent_id"), + }, + **arguments, + } + if system.operation == "list": + return list_docs_query(**agent_doc_args) + elif system.operation == "create": + return create_doc_query(**agent_doc_args) + elif system.operation == "delete": + return delete_doc_query(**agent_doc_args) + + # NO SUBRESOURCE + elif system.subresource == None: + if system.operation == "list": + return list_agents_query(**arguments) + elif system.operation == "get": + return get_agent_query(**arguments) + elif system.operation == "create": + return create_agent_query(**arguments) + elif system.operation == "update": + return update_agent_query(**arguments) + elif system.operation == "delete": + return delete_agent_query(**arguments) + + # USERS + elif system.resource == "user": + # DOCS SUBRESOURCE + if system.subresource == "doc": + # Define the arguments for the user doc queries + user_doc_args = { + **{ + "owner_type": "user", + "owner_id": arguments.pop("user_id"), + }, + **arguments, + } + if system.operation == "list": + return list_docs_query(**user_doc_args) + elif system.operation == "create": + return create_doc_query(**user_doc_args) + elif system.operation == "delete": + return delete_doc_query(**user_doc_args) + + # NO SUBRESOURCE + elif system.subresource == None: + if system.operation == "list": + return list_users_query(**arguments) + elif system.operation == "get": + return get_user_query(**arguments) + elif system.operation == "create": + return create_user_query(**arguments) + elif system.operation == "update": + return update_user_query(**arguments) + elif system.operation == "delete": + return delete_user_query(**arguments) + + # SESSIONS + elif system.resource == "session": + if system.operation == "list": + return list_sessions_query(**arguments) + elif system.operation == "get": + return get_session_query(**arguments) + elif system.operation == "create": + return create_session_query(**arguments) + elif system.operation == "update": + return update_session_query(**arguments) + elif system.operation == "delete": + return update_session_query(**arguments) + elif system.operation == "delete": + return delete_session_query(**arguments) + # TASKS + elif system.resource == "task": + if system.operation == "list": + return list_tasks_query(**arguments) + elif system.operation == "get": + return get_task_query(**arguments) + elif system.operation == "create": + return create_task_query(**arguments) + elif system.operation == "update": + return update_task_query(**arguments) + elif system.operation == "delete": + return delete_task_query(**arguments) + + raise NotImplementedError(f"System call not implemented for { + system.resource}.{system.operation}") + + except BaseException as e: + if activity.in_activity(): + activity.logger.error(f"Error in execute_system_call: {e}") + raise + + +# Mock and activity definition +mock_execute_system = execute_system + +execute_system = activity.defn(name="execute_system")( + execute_system if not testing else mock_execute_system +) diff --git a/agents-api/agents_api/activities/task_steps/prompt_step.py b/agents-api/agents_api/activities/task_steps/prompt_step.py index e9b4daeb3..bdc8a5c6e 100644 --- a/agents-api/agents_api/activities/task_steps/prompt_step.py +++ b/agents-api/agents_api/activities/task_steps/prompt_step.py @@ -2,6 +2,7 @@ from temporalio import activity from temporalio.exceptions import ApplicationError +from ...autogen.Tools import Tool from ...clients import ( litellm, # We dont directly import `acompletion` so we can mock it ) @@ -10,6 +11,22 @@ from ...models.tools.list_tools import list_tools +# FIXME: This shouldn't be here. +def format_agent_tool(tool: Tool) -> dict: + if tool.function: + return { + "type": "function", + "function": { + "name": tool.name, + "description": tool.description, + "parameters": tool.function.parameters, + }, + } + # TODO: Add integration | system | api_call tool types + else: + return {} + + @activity.defn @beartype async def prompt_step(context: StepContext) -> StepOutcome: @@ -46,15 +63,7 @@ async def prompt_step(context: StepContext) -> StepOutcome: # Format agent_tools for litellm formatted_agent_tools = [ - { - "type": tool.type, - "function": { - "name": tool.function.name, - "description": tool.function.description, - "parameters": tool.function.parameters, - }, - } - for tool in agent_tools + format_agent_tool(tool) for tool in agent_tools if format_agent_tool(tool) ] if context.current_step.settings: diff --git a/agents-api/agents_api/activities/task_steps/tool_call_step.py b/agents-api/agents_api/activities/task_steps/tool_call_step.py index 3082d8706..8d5d2fc8c 100644 --- a/agents-api/agents_api/activities/task_steps/tool_call_step.py +++ b/agents-api/agents_api/activities/task_steps/tool_call_step.py @@ -6,13 +6,14 @@ from temporalio.exceptions import ApplicationError from ...activities.task_steps.base_evaluate import base_evaluate -from ...autogen.openapi_model import Tool, ToolCallStep +from ...autogen.openapi_model import TaskToolDef, Tool, ToolCallStep from ...common.protocol.tasks import ( StepContext, StepOutcome, ) +# FIXME: This shouldn't be here. def generate_call_id(): # Generate 18 random bytes (which will result in 24 base64 characters) random_bytes = secrets.token_bytes(18) @@ -22,6 +23,26 @@ def generate_call_id(): return f"call_{base64_string}" +# FIXME: This shouldn't be here, and shouldn't be done this way. Should be refactored. +def construct_tool_call(tool: TaskToolDef, arguments: dict, call_id: str) -> dict: + return { + tool.type: { + "arguments": arguments, + "name": tool.name, + } + if tool.type != "system" + else { + "resource": tool.spec["resource"], + "operation": tool.spec["operation"], + "resource_id": tool.spec["resource_id"], + "subresource": tool.spec["subresource"], + "arguments": arguments, + }, + "id": call_id, + "type": tool.type, + } + + @activity.defn @beartype async def tool_call_step(context: StepContext) -> StepOutcome: @@ -40,14 +61,6 @@ async def tool_call_step(context: StepContext) -> StepOutcome: ) call_id = generate_call_id() - - tool_call = { - tool.type: { - "arguments": arguments, - "name": tool_name, - }, - "id": call_id, - "type": tool.type, - } + tool_call = construct_tool_call(tool, arguments, call_id) return StepOutcome(output=tool_call) diff --git a/agents-api/agents_api/autogen/Tools.py b/agents-api/agents_api/autogen/Tools.py index 07bcbea43..ffe10302c 100644 --- a/agents-api/agents_api/autogen/Tools.py +++ b/agents-api/agents_api/autogen/Tools.py @@ -35,7 +35,7 @@ class ApiCallDef(BaseModel): """ The content as base64 to send with the request """ - data: dict[str, str] | None = None + data: dict[str, Any] | None = None """ The data to send as form data """ @@ -55,6 +55,10 @@ class ApiCallDef(BaseModel): """ Follow redirects """ + timeout: int | None = None + """ + The timeout for the request + """ class ApiCallDefUpdate(BaseModel): @@ -94,7 +98,7 @@ class ApiCallDefUpdate(BaseModel): """ The content as base64 to send with the request """ - data: dict[str, str] | None = None + data: dict[str, Any] | None = None """ The data to send as form data """ @@ -114,6 +118,10 @@ class ApiCallDefUpdate(BaseModel): """ Follow redirects """ + timeout: int | None = None + """ + The timeout for the request + """ class ChosenToolCall(BaseModel): @@ -188,9 +196,9 @@ class FunctionDef(BaseModel): """ DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. """ - description: str | None = None + description: Any | None = None """ - Description of the function + DO NOT USE: This will be overriden by the tool description. Here only for compatibility reasons. """ parameters: dict[str, Any] | None = None """ @@ -322,9 +330,34 @@ class SystemDef(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - call: str + resource: Literal["agent", "user", "task", "execution", "doc", "session", "job"] + """ + Resource is the name of the resource to use + """ + operation: Literal[ + "create", + "update", + "patch", + "create_or_update", + "embed", + "change_status", + "search", + "chat", + "history", + "delete", + "get", + "list", + ] """ - The name of the system call + Operation is the name of the operation to perform + """ + resource_id: UUID | None = None + """ + Resource id (if applicable) + """ + subresource: Literal["tool", "doc", "execution", "transition"] | None = None + """ + Sub-resource type (if applicable) """ arguments: dict[str, Any] | None = None """ @@ -340,9 +373,39 @@ class SystemDefUpdate(BaseModel): model_config = ConfigDict( populate_by_name=True, ) - call: str | None = None + resource: ( + Literal["agent", "user", "task", "execution", "doc", "session", "job"] | None + ) = None + """ + Resource is the name of the resource to use + """ + operation: ( + Literal[ + "create", + "update", + "patch", + "create_or_update", + "embed", + "change_status", + "search", + "chat", + "history", + "delete", + "get", + "list", + ] + | None + ) = None + """ + Operation is the name of the operation to perform + """ + resource_id: UUID | None = None + """ + Resource id (if applicable) + """ + subresource: Literal["tool", "doc", "execution", "transition"] | None = None """ - The name of the system call + Sub-resource type (if applicable) """ arguments: dict[str, Any] | None = None """ diff --git a/agents-api/agents_api/worker/worker.py b/agents-api/agents_api/worker/worker.py index 08322772f..dc02cb4a7 100644 --- a/agents-api/agents_api/worker/worker.py +++ b/agents-api/agents_api/worker/worker.py @@ -17,6 +17,7 @@ def create_worker(client: Client) -> Any: from ..activities.embed_docs import embed_docs from ..activities.excecute_api_call import execute_api_call from ..activities.execute_integration import execute_integration + from ..activities.execute_system import execute_system from ..activities.mem_mgmt import mem_mgmt from ..activities.mem_rating import mem_rating from ..activities.summarization import summarization @@ -53,6 +54,7 @@ def create_worker(client: Client) -> Any: demo_activity, embed_docs, execute_integration, + execute_system, execute_api_call, mem_mgmt, mem_rating, diff --git a/agents-api/agents_api/workflows/task_execution/__init__.py b/agents-api/agents_api/workflows/task_execution/__init__.py index 6023f6f25..3c6106267 100644 --- a/agents-api/agents_api/workflows/task_execution/__init__.py +++ b/agents-api/agents_api/workflows/task_execution/__init__.py @@ -13,6 +13,7 @@ from ...activities import task_steps from ...activities.excecute_api_call import execute_api_call from ...activities.execute_integration import execute_integration + from ...activities.execute_system import execute_system from ...autogen.openapi_model import ( ApiCallDef, EmbedStep, @@ -39,6 +40,7 @@ WorkflowStep, YieldStep, ) + from ...autogen.Tools import SystemDef from ...common.protocol.tasks import ( ExecutionInput, PartialTransition, @@ -545,9 +547,28 @@ async def run( state = PartialTransition(output=tool_call_response) - case ToolCallStep(), StepOutcome(output=_): - # FIXME: Handle system/api_call tool_calls - raise ApplicationError("Not implemented") + case ToolCallStep(), StepOutcome(output=tool_call) if tool_call[ + "type" + ] == "system": + call = tool_call.get("system") + + system_call = SystemDef(**call) + tool_call_response = await workflow.execute_activity( + execute_system, + args=[context, system_call], + schedule_to_close_timeout=timedelta( + seconds=30 if debug or testing else 600 + ), + ) + + # FIXME: This is a hack to make the output of the system call match + # the expected output format (convert uuid/datetime to strings) + def model_dump(obj): + if isinstance(obj, list): + return [model_dump(item) for item in obj] + return obj.model_dump(mode="json") + + state = PartialTransition(output=model_dump(tool_call_response)) case _: workflow.logger.error( diff --git a/agents-api/tests/test_execution_workflow.py b/agents-api/tests/test_execution_workflow.py index 2a4fd7f75..c701a2e2f 100644 --- a/agents-api/tests/test_execution_workflow.py +++ b/agents-api/tests/test_execution_workflow.py @@ -440,6 +440,66 @@ async def _( assert result["hello"] == data.input["test"] +@test("workflow: system call - list agents") +async def _( + client=cozo_client, + developer_id=test_developer_id, + agent=test_agent, +): + data = CreateExecutionRequest(input={}) + + task = create_task( + developer_id=developer_id, + agent_id=agent.id, + data=CreateTaskRequest( + **{ + "name": "Test system tool task", + "description": "List agents using system call", + "input_schema": {"type": "object"}, + "tools": [ + { + "name": "list_agents", + "description": "List all agents", + "type": "system", + "system": {"resource": "agent", "operation": "list"}, + }, + ], + "main": [ + { + "tool": "list_agents", + "arguments": { + "limit": "10", + }, + }, + ], + } + ), + client=client, + ) + + async with patch_testing_temporal() as (_, mock_run_task_execution_workflow): + execution, handle = await start_execution( + developer_id=developer_id, + task_id=task.id, + data=data, + client=client, + ) + + assert handle is not None + assert execution.task_id == task.id + assert execution.input == data.input + mock_run_task_execution_workflow.assert_called_once() + + result = await handle.result() + assert isinstance(result, list) + # Result's length should be less than or equal to the limit + assert len(result) <= 10 + # Check if all items are agent dictionaries + assert all(isinstance(agent, dict) for agent in result) + # Check if each agent has an 'id' field + assert all("id" in agent for agent in result) + + @test("workflow: tool call api_call") async def _( client=cozo_client, diff --git a/agents-api/tests/test_tool_queries.py b/agents-api/tests/test_tool_queries.py index c21b7fbfb..b41125aaf 100644 --- a/agents-api/tests/test_tool_queries.py +++ b/agents-api/tests/test_tool_queries.py @@ -142,6 +142,7 @@ def _( ): update_data = UpdateToolRequest( name="updated_tool", + description="An updated description", type="function", function={ "description": "An updated function that prints hello world", diff --git a/gateway/traefik.yml.template b/gateway/traefik.yml.template index 7423e3fde..4ab3b4367 100644 --- a/gateway/traefik.yml.template +++ b/gateway/traefik.yml.template @@ -36,7 +36,16 @@ http: middlewares: - agents-api-strip-prefix-api service: service-agents-api - priority: 2 + priority: 2 + + agents-api-redirect-to-docs: + entryPoints: + - web + rule: Path(`/`) + middlewares: + - agents-api-redirect-to-docs + service: service-agents-api + priority: 3 middlewares: corsHeaders: @@ -46,6 +55,11 @@ http: accessControlAllowOriginList: "*" addVaryHeader: true + agents-api-redirect-to-docs: + redirectRegex: + regex: "^(.*)$" + replacement: "/api/docs" + agents-api-add-headers: headers: customrequestheaders: diff --git a/typespec/.gitignore b/typespec/.gitignore index 98d4239d8..d0791ce2c 100644 --- a/typespec/.gitignore +++ b/typespec/.gitignore @@ -1 +1,8 @@ -/tsp-output/ +# Ignore everything in tsp-output +tsp-output/**/*.* + +# Don't ignore the openapi3 directory +!tsp-output/@typespec/openapi3/ + +# But don't ignore openapi-*.yaml files in tsp-output/@typespec/openapi3/ +!tsp-output/@typespec/openapi3/openapi-*.yaml diff --git a/typespec/tools/models.tsp b/typespec/tools/models.tsp index 94243d20f..61918a4f7 100644 --- a/typespec/tools/models.tsp +++ b/typespec/tools/models.tsp @@ -34,8 +34,8 @@ model FunctionDef { /** DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons. */ name?: null = null; - /** Description of the function */ - description?: string; + /** DO NOT USE: This will be overriden by the tool description. Here only for compatibility reasons. */ + description?: null = null; /** The parameters the function accepts */ parameters?: FunctionParameters; @@ -57,10 +57,55 @@ model IntegrationDef { arguments?: FunctionParameters; } +// +// SYSTEM TOOL MODELS +// + +alias resourceType = ( + | "agent" + | "user" + | "task" + | "execution" + | "doc" + | "session" + | "job" +); + +alias subresourceType = ( + | "tool" + | "doc" + | "execution" + | "transition" +); + +alias operationType = ( + | "create" + | "update" + | "patch" + | "create_or_update" + | "embed" + | "change_status" + | "search" + | "chat" + | "history" + | "delete" + | "get" + | "list" +); + /** System definition */ model SystemDef { - /** The name of the system call */ - call: string; + /** Resource is the name of the resource to use */ + resource: resourceType; + + /** Operation is the name of the operation to perform */ + operation: operationType; + + /** Resource id (if applicable) */ + resource_id?: uuid; + + /** Sub-resource type (if applicable) */ + subresource?: subresourceType; /** The arguments to pre-apply to the system call */ arguments?: FunctionParameters; @@ -81,7 +126,7 @@ model ApiCallDef { content?: string; /** The data to send as form data */ - data?: Record; + data?: Record; /** JSON body to send with the request */ json?: Record; @@ -94,6 +139,9 @@ model ApiCallDef { /** Follow redirects */ follow_redirects?: boolean; + + /** The timeout for the request */ + timeout?: uint8; } diff --git a/typespec/tsp-output/@typespec/openapi3/openapi-0.4.0.yaml b/typespec/tsp-output/@typespec/openapi3/openapi-0.4.0.yaml new file mode 100644 index 000000000..e578d26d9 --- /dev/null +++ b/typespec/tsp-output/@typespec/openapi3/openapi-0.4.0.yaml @@ -0,0 +1,6345 @@ +openapi: 3.0.0 +info: + title: Julep API + termsOfService: https://julep.ai/terms + contact: + name: Julep AI + url: https://julep.ai + email: developers@julep.ai + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + summary: A backend for creating stateful AI apps + description: Julep is a backend for creating stateful AI apps with background tasks and long-term memory easily. + version: 0.4.0 +externalDocs: + url: https://docs.julep.ai + description: Julep API documentation +tags: [] +paths: + /agents: + get: + operationId: AgentsRoute_list + description: List Agents (paginated) + parameters: + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Agents.Agent' + required: + - items + post: + operationId: AgentsRoute_create + description: Create a new Agent + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.CreateAgentRequest' + /agents/{id}: + post: + operationId: AgentsRoute_createOrUpdate + description: Create or update an Agent + parameters: + - $ref: '#/components/parameters/Agents.CreateOrUpdateAgentRequest.id' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.UpdateAgentRequest' + put: + operationId: AgentsRoute_update + description: Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.UpdateAgentRequest' + patch: + operationId: AgentsRoute_patch + description: Update an existing Agent by id (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.PatchAgentRequest' + delete: + operationId: AgentsRoute_delete + description: Delete Agent by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: AgentsRoute_get + description: Get an Agent by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.Agent' + /agents/{id}/docs: + get: + operationId: AgentDocsRoute_list + description: List Docs owned by an Agent + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Docs.Doc' + required: + - results + post: + operationId: AgentDocsRoute_create + description: Create a Doc for this Agent + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.CreateDocRequest' + /agents/{id}/docs/{child_id}: + delete: + operationId: AgentDocsRoute_delete + description: Delete a Doc for this Agent + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /agents/{id}/search: + post: + operationId: AgentsDocsSearchRoute_search + description: Search Docs owned by an Agent + parameters: + - name: id + in: path + required: true + description: ID of the parent + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.DocSearchResponse' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + body: + anyOf: + - $ref: '#/components/schemas/Docs.VectorDocSearchRequest' + - $ref: '#/components/schemas/Docs.TextOnlyDocSearchRequest' + - $ref: '#/components/schemas/Docs.HybridDocSearchRequest' + required: + - body + /agents/{id}/tasks: + get: + operationId: TasksRoute_list + description: List tasks (paginated) + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Tasks.Task' + required: + - results + post: + operationId: TasksRoute_create + description: Create a new task + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/x-yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + application/json: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + /agents/{id}/tasks/{child_id}: + put: + operationId: TasksRoute_update + description: Update an existing task (overwrite existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be updated + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tasks.UpdateTaskRequest' + patch: + operationId: TasksRoute_patch + description: Update an existing task (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be patched + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tasks.PatchTaskRequest' + delete: + operationId: TasksRoute_delete + description: Delete a task by its id + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /agents/{id}/tools: + get: + operationId: AgentToolsRoute_list + description: List tools of the given agent + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Tools.Tool' + required: + - results + post: + operationId: AgentToolsRoute_create + description: Create a new tool for this agent + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.CreateAgentRequest' + /agents/{id}/tools/{child_id}: + put: + operationId: AgentToolsRoute_update + description: Update an existing tool (overwrite existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be updated + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tools.UpdateToolRequest' + patch: + operationId: AgentToolsRoute_patch + description: Update an existing tool (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be patched + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tools.PatchToolRequest' + delete: + operationId: AgentToolsRoute_delete + description: Delete an existing tool by id + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /agents/{parent_id}/tasks/{id}: + post: + operationId: TasksCreateOrUpdateRoute_createOrUpdate + description: Create or update a task + parameters: + - name: parent_id + in: path + required: true + description: ID of the agent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Tasks.CreateOrUpdateTaskRequest.id' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/x-yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + application/json: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + /docs/{id}: + get: + operationId: IndividualDocsRoute_get + description: Get Doc by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.Doc' + /embed: + post: + operationId: EmbedRoute_embed + description: Embed a query for search + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.EmbedQueryResponse' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + body: + $ref: '#/components/schemas/Docs.EmbedQueryRequest' + required: + - body + /executions: + post: + operationId: ExecutionsRoute_resumeWithTaskToken + description: Resume an execution with a task token + parameters: + - name: task_token + in: query + required: true + description: A Task Token is a unique identifier for a specific Task Execution. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.TaskTokenResumeExecutionRequest' + description: Request to resume an execution with a task token + security: + - {} + /executions/{id}: + get: + operationId: ExecutionsRoute_get + description: Get an Execution by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.Execution' + put: + operationId: ExecutionsRoute_update + description: Update an existing Execution + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.UpdateExecutionRequest' + /executions/{id}/transitions: + get: + operationId: ExecutionTransitionsRoute_list + description: List the Transitions of an Execution by id + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + type: object + properties: + transitions: + type: array + items: + $ref: '#/components/schemas/Executions.Transition' + required: + - transitions + required: + - results + /executions/{id}/transitions.stream: + get: + operationId: ExecutionTransitionsStreamRoute_stream + description: Stream events emitted by the given execution + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - name: next_token + in: query + required: true + description: Next page token + schema: + type: string + nullable: true + default: null + explode: false + responses: + '200': + description: The request has succeeded. + content: + text/event-stream: + schema: + $ref: '#/components/schemas/Executions.TransitionEvent' + /jobs/{id}: + get: + operationId: JobRoute_get + description: Get the status of an existing Job by its id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Jobs.JobStatus' + /sessions: + get: + operationId: SessionsRoute_list + description: List sessions (paginated) + parameters: + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Sessions.Session' + required: + - items + post: + operationId: SessionsRoute_create + description: Create a new session + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.CreateSessionRequest' + /sessions/{id}: + post: + operationId: SessionsRoute_createOrUpdate + description: Create or update a session + parameters: + - $ref: '#/components/parameters/Sessions.CreateOrUpdateSessionRequest.id' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.CreateSessionRequest' + put: + operationId: SessionsRoute_update + description: Update an existing session by its id (overwrites all existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.UpdateSessionRequest' + patch: + operationId: SessionsRoute_patch + description: Update an existing session by its id (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.PatchSessionRequest' + delete: + operationId: SessionsRoute_delete + description: Delete a session by its id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: SessionsRoute_get + description: Get a session by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.Session' + /sessions/{id}/chat: + post: + operationId: ChatRoute_generate + description: Generate a response from the model + parameters: + - name: id + in: path + required: true + description: The session ID + schema: + $ref: '#/components/schemas/Common.uuid' + - name: x-custom-api-key + in: header + required: false + description: Custom API key + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/Chat.ChunkChatResponse' + - $ref: '#/components/schemas/Chat.MessageChatResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Chat.ChatInput' + description: Request to generate a response from the model + /sessions/{id}/history: + delete: + operationId: HistoryRoute_delete + description: Clear the history of a Session (resets the Session) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: HistoryRoute_history + description: Get history of a Session + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Entries.History' + /tasks/{id}/executions: + post: + operationId: TaskExecutionsRoute_create + description: Create an execution for the given task + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.CreateExecutionRequest' + get: + operationId: TaskExecutionsRoute_list + description: List executions of the given task + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Executions.Execution' + required: + - results + /users: + get: + operationId: UsersRoute_list + description: List users (paginated) + parameters: + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Users.User' + required: + - items + post: + operationId: UsersRoute_create + description: Create a new user + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.CreateUserRequest' + /users/{id}: + post: + operationId: UsersRoute_createOrUpdate + description: Create or update a user + parameters: + - $ref: '#/components/parameters/Users.CreateOrUpdateUserRequest' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.CreateUserRequest' + put: + operationId: UsersRoute_update + description: Update an existing user by id (overwrite existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.UpdateUserRequest' + patch: + operationId: UsersRoute_patch + description: Update an existing user by id (merge with existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.PatchUserRequest' + delete: + operationId: UsersRoute_delete + description: Delete a user by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: UsersRoute_get + description: Get a user by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Users.User' + /users/{id}/docs: + get: + operationId: UserDocsRoute_list + description: List Docs owned by a User + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Docs.Doc' + required: + - results + post: + operationId: UserDocsRoute_create + description: Create a Doc for this User + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.CreateDocRequest' + /users/{id}/docs/{child_id}: + delete: + operationId: UserDocsRoute_delete + description: Delete a Doc for this User + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /users/{id}/search: + post: + operationId: UserDocsSearchRoute_search + description: Search Docs owned by a User + parameters: + - name: id + in: path + required: true + description: ID of the parent + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.DocSearchResponse' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + body: + anyOf: + - $ref: '#/components/schemas/Docs.VectorDocSearchRequest' + - $ref: '#/components/schemas/Docs.TextOnlyDocSearchRequest' + - $ref: '#/components/schemas/Docs.HybridDocSearchRequest' + required: + - body +security: + - ApiKeyAuth: [] + - ApiKeyAuth_: [] +components: + parameters: + Agents.CreateOrUpdateAgentRequest.id: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + Common.PaginationOptions.direction: + name: direction + in: query + required: true + description: Sort direction + schema: + type: string + enum: + - asc + - desc + default: asc + explode: false + Common.PaginationOptions.limit: + name: limit + in: query + required: true + description: Limit the number of items returned + schema: + $ref: '#/components/schemas/Common.limit' + default: 100 + explode: false + Common.PaginationOptions.metadata_filter: + name: metadata_filter + in: query + required: true + description: JSON string of object that should be used to filter objects by metadata + schema: + type: string + default: '{}' + explode: false + Common.PaginationOptions.offset: + name: offset + in: query + required: true + description: Offset the items returned + schema: + $ref: '#/components/schemas/Common.offset' + default: 0 + explode: false + Common.PaginationOptions.sort_by: + name: sort_by + in: query + required: true + description: Sort by a field + schema: + type: string + enum: + - created_at + - updated_at + default: created_at + explode: false + Sessions.CreateOrUpdateSessionRequest.id: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + Tasks.CreateOrUpdateTaskRequest.id: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + Users.CreateOrUpdateUserRequest: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + schemas: + Agents.Agent: + type: object + required: + - id + - created_at + - updated_at + - name + - about + - model + - instructions + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + Agents.CreateAgentRequest: + type: object + required: + - name + - about + - model + - instructions + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + description: Payload for creating a agent (and associated documents) + Agents.CreateOrUpdateAgentRequest: + type: object + required: + - id + - name + - about + - model + - instructions + properties: + id: + $ref: '#/components/schemas/Common.uuid' + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + allOf: + - $ref: '#/components/schemas/Agents.CreateAgentRequest' + Agents.PatchAgentRequest: + type: object + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + description: Payload for patching a agent + Agents.UpdateAgentRequest: + type: object + required: + - name + - about + - model + - instructions + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + description: Payload for updating a agent + Chat.BaseChatOutput: + type: object + required: + - index + - finish_reason + properties: + index: + type: integer + format: uint32 + finish_reason: + allOf: + - $ref: '#/components/schemas/Chat.FinishReason' + description: The reason the model stopped generating tokens + default: stop + logprobs: + allOf: + - $ref: '#/components/schemas/Chat.LogProbResponse' + description: The log probabilities of tokens + Chat.BaseChatResponse: + type: object + required: + - jobs + - docs + - created_at + - id + properties: + usage: + allOf: + - $ref: '#/components/schemas/Chat.CompetionUsage' + description: Usage statistics for the completion request + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: Background job IDs that may have been spawned from this interaction. + default: [] + readOnly: true + docs: + type: array + items: + $ref: '#/components/schemas/Docs.DocReference' + description: Documents referenced for this request (for citation purposes). + default: [] + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + Chat.BaseTokenLogProb: + type: object + required: + - token + - logprob + properties: + token: + type: string + logprob: + type: number + format: float + description: The log probability of the token + bytes: + type: array + items: + type: integer + format: uint16 + Chat.ChatInput: + type: object + required: + - remember + - recall + - save + - stream + - stop + properties: + remember: + type: boolean + description: 'DISABLED: Whether this interaction should form new memories or not (will be enabled in a future release)' + default: false + readOnly: true + recall: + type: boolean + description: Whether previous memories and docs should be recalled or not + default: true + save: + type: boolean + description: Whether this interaction should be stored in the session history or not + default: true + model: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Identifier of the model to be used + stream: + type: boolean + description: Indicates if the server should stream the response as it's generated + default: false + stop: + type: array + items: + type: string + maxItems: 4 + description: Up to 4 sequences where the API will stop generating further tokens. + default: [] + seed: + type: integer + format: int16 + minimum: -1 + maximum: 1000 + description: If specified, the system will make a best effort to sample deterministically for that particular seed value + max_tokens: + type: integer + format: uint32 + minimum: 1 + description: The maximum number of tokens to generate in the chat completion + logit_bias: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.logit_bias' + description: Modify the likelihood of specified tokens appearing in the completion + response_format: + anyOf: + - $ref: '#/components/schemas/Chat.SimpleCompletionResponseFormat' + - $ref: '#/components/schemas/Chat.SchemaCompletionResponseFormat' + description: Response format (set to `json_object` to restrict output to JSON) + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + repetition_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + length_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + min_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Minimum probability compared to leading token to be considered + frequency_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + presence_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + temperature: + type: number + format: float + minimum: 0 + maximum: 5 + description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + top_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. + allOf: + - $ref: '#/components/schemas/Chat.ChatInputData' + Chat.ChatInputData: + type: object + required: + - messages + - tools + properties: + messages: + type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + minItems: 1 + description: A list of new input messages comprising the conversation so far. + tools: + type: array + items: + $ref: '#/components/schemas/Tools.Tool' + description: (Advanced) List of tools that are provided in addition to agent's default set of tools. + default: [] + tool_choice: + anyOf: + - type: string + enum: + - auto + - none + - $ref: '#/components/schemas/Tools.NamedToolChoice' + description: Can be one of existing tools given to the agent earlier or the ones provided in this request. + Chat.ChatOutputChunk: + type: object + required: + - delta + properties: + delta: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + description: The message generated by the model + allOf: + - $ref: '#/components/schemas/Chat.BaseChatOutput' + description: Streaming chat completion output + Chat.ChatSettings: + type: object + required: + - stream + - stop + properties: + model: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Identifier of the model to be used + stream: + type: boolean + description: Indicates if the server should stream the response as it's generated + default: false + stop: + type: array + items: + type: string + maxItems: 4 + description: Up to 4 sequences where the API will stop generating further tokens. + default: [] + seed: + type: integer + format: int16 + minimum: -1 + maximum: 1000 + description: If specified, the system will make a best effort to sample deterministically for that particular seed value + max_tokens: + type: integer + format: uint32 + minimum: 1 + description: The maximum number of tokens to generate in the chat completion + logit_bias: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.logit_bias' + description: Modify the likelihood of specified tokens appearing in the completion + response_format: + anyOf: + - $ref: '#/components/schemas/Chat.SimpleCompletionResponseFormat' + - $ref: '#/components/schemas/Chat.SchemaCompletionResponseFormat' + description: Response format (set to `json_object` to restrict output to JSON) + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + Chat.ChunkChatResponse: + type: object + required: + - choices + properties: + choices: + type: array + items: + $ref: '#/components/schemas/Chat.ChatOutputChunk' + description: The deltas generated by the model + allOf: + - $ref: '#/components/schemas/Chat.BaseChatResponse' + Chat.CompetionUsage: + type: object + properties: + completion_tokens: + type: integer + format: uint32 + description: Number of tokens in the generated completion + readOnly: true + prompt_tokens: + type: integer + format: uint32 + description: Number of tokens in the prompt + readOnly: true + total_tokens: + type: integer + format: uint32 + description: Total number of tokens used in the request (prompt + completion) + readOnly: true + description: Usage statistics for the completion request + Chat.DefaultChatSettings: + type: object + properties: + repetition_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + length_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + min_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Minimum probability compared to leading token to be considered + allOf: + - $ref: '#/components/schemas/Chat.OpenAISettings' + description: Default settings for the chat session (also used by the agent) + Chat.FinishReason: + type: string + enum: + - stop + - length + - content_filter + - tool_calls + description: |- + The reason the model stopped generating tokens. This will be `stop` + if the model hit a natural stop point or a provided stop sequence, + `length` if the maximum number of tokens specified in the request + was reached, `content_filter` if content was omitted due to a flag + from our content filters, `tool_calls` if the model called a tool. + Chat.LogProbResponse: + type: object + required: + - content + properties: + content: + type: array + items: + $ref: '#/components/schemas/Chat.TokenLogProb' + nullable: true + description: The log probabilities of the tokens + Chat.MessageChatResponse: + type: object + required: + - choices + properties: + choices: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Chat.SingleChatOutput' + - $ref: '#/components/schemas/Chat.MultipleChatOutput' + description: The deltas generated by the model + allOf: + - $ref: '#/components/schemas/Chat.BaseChatResponse' + Chat.MultipleChatOutput: + type: object + required: + - messages + properties: + messages: + type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + tool_calls: + type: array + items: + $ref: '#/components/schemas/Tools.ChosenToolCall' + nullable: true + description: Tool calls generated by the model. + default: [] + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + minItems: 1 + readOnly: true + allOf: + - $ref: '#/components/schemas/Chat.BaseChatOutput' + description: The output returned by the model. Note that, depending on the model provider, they might return more than one message. + Chat.OpenAISettings: + type: object + properties: + frequency_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + presence_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + temperature: + type: number + format: float + minimum: 0 + maximum: 5 + description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + top_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. + Chat.SchemaCompletionResponseFormat: + type: object + required: + - type + - json_schema + properties: + type: + type: string + enum: + - json_schema + description: The format of the response + default: json_schema + json_schema: + type: object + additionalProperties: {} + description: The schema of the response + Chat.SimpleCompletionResponseFormat: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + - json_object + description: The format of the response + default: text + Chat.SingleChatOutput: + type: object + required: + - message + properties: + message: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + tool_calls: + type: array + items: + $ref: '#/components/schemas/Tools.ChosenToolCall' + nullable: true + description: Tool calls generated by the model. + default: [] + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + allOf: + - $ref: '#/components/schemas/Chat.BaseChatOutput' + description: The output returned by the model. Note that, depending on the model provider, they might return more than one message. + Chat.TokenLogProb: + type: object + required: + - top_logprobs + properties: + top_logprobs: + type: array + items: + $ref: '#/components/schemas/Chat.BaseTokenLogProb' + minItems: 1 + description: The log probabilities of the tokens + readOnly: true + allOf: + - $ref: '#/components/schemas/Chat.BaseTokenLogProb' + Common.JinjaTemplate: + type: string + description: A valid jinja template. + Common.PyExpression: + type: string + description: A simple python expression compatible with SimpleEval. + Common.ResourceCreatedResponse: + type: object + required: + - id + - created_at + - jobs + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: ID of created resource + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: IDs (if any) of jobs created as part of this request + default: [] + readOnly: true + Common.ResourceDeletedResponse: + type: object + required: + - id + - deleted_at + - jobs + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: ID of deleted resource + deleted_at: + type: string + format: date-time + description: When this resource was deleted as UTC date-time + readOnly: true + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: IDs (if any) of jobs created as part of this request + default: [] + readOnly: true + Common.ResourceUpdatedResponse: + type: object + required: + - id + - updated_at + - jobs + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: ID of updated resource + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: IDs (if any) of jobs created as part of this request + default: [] + readOnly: true + Common.identifierSafeUnicode: + type: string + maxLength: 120 + pattern: ^[\p{L}\p{Nl}\p{Pattern_Syntax}\p{Pattern_White_Space}]+[\p{ID_Start}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\p{Pattern_Syntax}\p{Pattern_White_Space}]*$ + description: |- + For Unicode character safety + See: https://unicode.org/reports/tr31/ + See: https://www.unicode.org/reports/tr39/#Identifier_Characters + Common.limit: + type: integer + format: uint16 + minimum: 1 + maximum: 1000 + exclusiveMaximum: true + description: Limit the number of results + Common.logit_bias: + type: number + format: float + minimum: -100 + maximum: 100 + Common.offset: + type: integer + format: uint32 + minimum: 0 + description: Offset to apply to the results + Common.uuid: + type: string + format: uuid + Common.validPythonIdentifier: + type: string + maxLength: 40 + pattern: ^[^\W0-9]\w*$ + description: Valid python identifier names + Docs.BaseDocSearchRequest: + type: object + required: + - limit + - lang + properties: + limit: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + default: 10 + lang: + type: string + enum: + - en-US + description: The language to be used for text-only search. Support for other languages coming soon. + default: en-US + Docs.CreateDocRequest: + type: object + required: + - title + - content + properties: + metadata: + type: object + additionalProperties: {} + title: + type: string + maxLength: 800 + description: Title describing what this document contains + content: + anyOf: + - type: string + - type: array + items: + type: string + description: Contents of the document + description: Payload for creating a doc + Docs.Doc: + type: object + required: + - id + - created_at + - title + - content + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + title: + type: string + maxLength: 800 + description: Title describing what this document contains + content: + anyOf: + - type: string + - type: array + items: + type: string + description: Contents of the document + embeddings: + anyOf: + - type: array + items: + type: number + format: float + - type: array + items: + type: array + items: + type: number + format: float + description: Embeddings for the document + readOnly: true + Docs.DocOwner: + type: object + required: + - id + - role + properties: + id: + anyOf: + - allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + - allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + role: + type: string + enum: + - user + - agent + Docs.DocReference: + type: object + required: + - owner + - id + - snippets + - distance + properties: + owner: + allOf: + - $ref: '#/components/schemas/Docs.DocOwner' + description: The owner of this document. + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + description: ID of the document + title: + type: string + snippets: + type: array + items: + $ref: '#/components/schemas/Docs.Snippet' + minItems: 1 + distance: + type: number + nullable: true + default: null + Docs.DocSearchResponse: + type: object + required: + - docs + - time + properties: + docs: + type: array + items: + $ref: '#/components/schemas/Docs.DocReference' + description: The documents that were found + time: + type: number + minimum: 0 + exclusiveMinimum: true + description: The time taken to search in seconds + Docs.EmbedQueryRequest: + type: object + required: + - text + properties: + text: + anyOf: + - type: string + - type: array + items: + type: string + description: Text or texts to embed + Docs.EmbedQueryResponse: + type: object + required: + - vectors + properties: + vectors: + type: array + items: + type: array + items: + type: number + description: The embedded vectors + Docs.HybridDocSearchRequest: + type: object + required: + - confidence + - alpha + - text + - vector + properties: + confidence: + type: number + minimum: 0 + maximum: 1 + description: The confidence cutoff level + default: 0.5 + alpha: + type: number + minimum: 0 + maximum: 1 + description: The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + default: 0.75 + text: + type: string + description: Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. + vector: + type: array + items: + type: number + description: Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + allOf: + - $ref: '#/components/schemas/Docs.BaseDocSearchRequest' + Docs.Snippet: + type: object + required: + - index + - content + properties: + index: + type: integer + format: uint16 + content: + type: string + Docs.TextOnlyDocSearchRequest: + type: object + required: + - text + properties: + text: + type: string + description: Text to use in the search. + allOf: + - $ref: '#/components/schemas/Docs.BaseDocSearchRequest' + Docs.VectorDocSearchRequest: + type: object + required: + - confidence + - vector + properties: + confidence: + type: number + minimum: 0 + maximum: 1 + description: The confidence cutoff level + default: 0.5 + vector: + type: array + items: + type: number + description: Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + allOf: + - $ref: '#/components/schemas/Docs.BaseDocSearchRequest' + Entries.BaseEntry: + type: object + required: + - role + - name + - content + - source + - tokenizer + - token_count + - timestamp + properties: + role: + $ref: '#/components/schemas/Entries.ChatMLRole' + name: + type: string + nullable: true + default: null + content: + anyOf: + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + - $ref: '#/components/schemas/Tools.Tool' + - $ref: '#/components/schemas/Tools.ChosenToolCall' + - type: string + - $ref: '#/components/schemas/Tools.ToolResponse' + - type: array + items: + anyOf: + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + - $ref: '#/components/schemas/Tools.Tool' + - $ref: '#/components/schemas/Tools.ChosenToolCall' + - type: string + - $ref: '#/components/schemas/Tools.ToolResponse' + source: + type: string + enum: + - api_request + - api_response + - tool_response + - internal + - summarizer + - meta + tokenizer: + type: string + token_count: + type: integer + format: uint16 + timestamp: + type: number + minimum: 0 + description: This is the time that this event refers to. + Entries.ChatMLRole: + type: string + enum: + - user + - assistant + - system + - function + - function_response + - function_call + - auto + description: ChatML role (system|assistant|user|function_call|function|function_response|auto) + Entries.Entry: + type: object + required: + - created_at + - id + properties: + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + allOf: + - $ref: '#/components/schemas/Entries.BaseEntry' + Entries.History: + type: object + required: + - entries + - relations + - session_id + - created_at + properties: + entries: + type: array + items: + $ref: '#/components/schemas/Entries.Entry' + relations: + type: array + items: + $ref: '#/components/schemas/Entries.Relation' + session_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + Entries.ImageDetail: + type: string + enum: + - low + - high + - auto + description: Image detail level + Entries.Relation: + type: object + required: + - head + - relation + - tail + properties: + head: + $ref: '#/components/schemas/Common.uuid' + relation: + type: string + tail: + $ref: '#/components/schemas/Common.uuid' + Executions.CreateExecutionRequest: + type: object + required: + - input + properties: + input: + type: object + additionalProperties: {} + description: The input to the execution + output: + description: The output of the execution if it succeeded + error: + type: string + description: The error of the execution if it failed + metadata: + type: object + additionalProperties: {} + description: Payload for creating an execution + Executions.Execution: + type: object + required: + - task_id + - status + - input + - created_at + - updated_at + - id + properties: + task_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + description: The ID of the task that the execution is running + status: + type: string + enum: + - queued + - starting + - running + - awaiting_input + - succeeded + - failed + - cancelled + description: The status of the execution + readOnly: true + input: + type: object + additionalProperties: {} + description: The input to the execution + output: + description: The output of the execution if it succeeded + error: + type: string + description: The error of the execution if it failed + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + metadata: + type: object + additionalProperties: {} + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + Executions.ResumeExecutionRequest: + type: object + required: + - status + properties: + status: + type: string + enum: + - running + default: running + input: + type: object + additionalProperties: {} + description: The input to resume the execution with + allOf: + - $ref: '#/components/schemas/Executions.UpdateExecutionRequest' + Executions.StopExecutionRequest: + type: object + required: + - status + - reason + properties: + status: + type: string + enum: + - cancelled + default: cancelled + reason: + type: string + nullable: true + description: The reason for stopping the execution + default: null + allOf: + - $ref: '#/components/schemas/Executions.UpdateExecutionRequest' + Executions.TaskTokenResumeExecutionRequest: + type: object + required: + - status + properties: + status: + type: string + enum: + - running + default: running + input: + type: object + additionalProperties: {} + description: The input to resume the execution with + Executions.Transition: + type: object + required: + - execution_id + - current + - next + - id + properties: + execution_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + current: + allOf: + - $ref: '#/components/schemas/Executions.TransitionTarget' + readOnly: true + next: + type: object + allOf: + - $ref: '#/components/schemas/Executions.TransitionTarget' + nullable: true + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + allOf: + - $ref: '#/components/schemas/Executions.TransitionEvent' + Executions.TransitionEvent: + type: object + required: + - type + - output + - created_at + - updated_at + properties: + type: + type: string + enum: + - init + - init_branch + - finish + - finish_branch + - wait + - resume + - error + - step + - cancelled + readOnly: true + output: + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + Executions.TransitionTarget: + type: object + required: + - workflow + - step + properties: + workflow: + $ref: '#/components/schemas/Common.identifierSafeUnicode' + step: + type: integer + format: uint16 + Executions.UpdateExecutionRequest: + type: object + required: + - status + properties: + status: + type: string + enum: + - queued + - starting + - running + - awaiting_input + - succeeded + - failed + - cancelled + discriminator: + propertyName: status + mapping: + cancelled: '#/components/schemas/Executions.StopExecutionRequest' + running: '#/components/schemas/Executions.ResumeExecutionRequest' + Jobs.JobState: + type: string + enum: + - pending + - in_progress + - retrying + - succeeded + - aborted + - failed + - unknown + description: 'Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed)' + Jobs.JobStatus: + type: object + required: + - id + - created_at + - updated_at + - name + - reason + - has_progress + - progress + - state + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the job + default: '' + reason: + type: string + description: Reason for the current state of the job + default: '' + has_progress: + type: boolean + description: Whether this Job supports progress updates + default: false + progress: + type: number + format: float + minimum: 0 + maximum: 100 + description: Progress percentage + default: 0 + state: + allOf: + - $ref: '#/components/schemas/Jobs.JobState' + description: Current state of the job + default: pending + Sessions.ContextOverflowType: + type: string + enum: + - truncate + - adaptive + Sessions.CreateOrUpdateSessionRequest: + type: object + required: + - id + - situation + - render_templates + - token_budget + - context_overflow + - forward_tool_results + properties: + id: + $ref: '#/components/schemas/Common.uuid' + user: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: User ID of user associated with this session + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of agent associated with this session + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + allOf: + - $ref: '#/components/schemas/Sessions.CreateSessionRequest' + Sessions.CreateSessionRequest: + type: object + required: + - situation + - render_templates + - token_budget + - context_overflow + - forward_tool_results + properties: + user: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: User ID of user associated with this session + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of agent associated with this session + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + description: Payload for creating a session + Sessions.MultiAgentMultiUserSession: + type: object + required: + - agents + - users + properties: + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.MultiAgentNoUserSession: + type: object + required: + - agents + properties: + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.MultiAgentSingleUserSession: + type: object + required: + - agents + - user + properties: + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + user: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.PatchSessionRequest: + type: object + properties: + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + description: Payload for patching a session + Sessions.Session: + type: object + required: + - situation + - summary + - render_templates + - token_budget + - context_overflow + - forward_tool_results + - id + - created_at + - updated_at + properties: + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + summary: + type: string + nullable: true + description: Summary (null at the beginning) - generated automatically after every interaction + default: null + readOnly: true + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + kind: + type: string + description: Discriminator property for Session. + discriminator: + propertyName: kind + mapping: + single_agent_no_user: '#/components/schemas/Sessions.SingleAgentNoUserSession' + single_agent_single_user: '#/components/schemas/Sessions.SingleAgentSingleUserSession' + single_agent_multi_user: '#/components/schemas/Sessions.SingleAgentMultiUserSession' + multi_agent_no_user: '#/components/schemas/Sessions.MultiAgentNoUserSession' + multi_agent_single_user: '#/components/schemas/Sessions.MultiAgentSingleUserSession' + multi_agent_multi_user: '#/components/schemas/Sessions.MultiAgentMultiUserSession' + Sessions.SingleAgentMultiUserSession: + type: object + required: + - agent + - users + properties: + agent: + $ref: '#/components/schemas/Common.uuid' + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.SingleAgentNoUserSession: + type: object + required: + - agent + properties: + agent: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.SingleAgentSingleUserSession: + type: object + required: + - agent + - user + properties: + agent: + $ref: '#/components/schemas/Common.uuid' + user: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.UpdateSessionRequest: + type: object + required: + - situation + - render_templates + - token_budget + - context_overflow + - forward_tool_results + properties: + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + description: Payload for updating a session + Tasks.CaseThen: + type: object + required: + - case + - then + properties: + case: + anyOf: + - $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + Tasks.CaseThenUpdateItem: + type: object + required: + - case + - then + properties: + case: + anyOf: + - $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + Tasks.CreateTaskRequest: + type: object + required: + - name + - description + - main + - input_schema + - tools + - inherit_tools + properties: + name: + type: string + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + description: Payload for creating a task + Tasks.EmbedStep: + type: object + required: + - kind_ + - embed + properties: + kind_: + type: string + enum: + - embed + default: embed + readOnly: true + embed: + allOf: + - $ref: '#/components/schemas/Docs.EmbedQueryRequest' + description: The text to embed + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - embed + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ErrorWorkflowStep: + type: object + required: + - kind_ + - error + properties: + kind_: + type: string + enum: + - error + default: error + readOnly: true + error: + type: string + description: The error message + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - error + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.EvaluateStep: + type: object + required: + - kind_ + - evaluate + properties: + kind_: + type: string + enum: + - evaluate + default: evaluate + readOnly: true + evaluate: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: The expression to evaluate + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - evaluate + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ForeachDo: + type: object + required: + - in + - do + properties: + in: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The variable to iterate over. + VALIDATION: Should NOT return more than 1000 elements. + do: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + Tasks.ForeachDoUpdateItem: + type: object + required: + - in + - do + properties: + in: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The variable to iterate over. + VALIDATION: Should NOT return more than 1000 elements. + do: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + Tasks.ForeachStep: + type: object + required: + - kind_ + - foreach + properties: + kind_: + type: string + enum: + - foreach + default: foreach + readOnly: true + foreach: + allOf: + - $ref: '#/components/schemas/Tasks.ForeachDo' + description: The steps to run for each iteration + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - foreach + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ForeachStepUpdateItem: + type: object + required: + - foreach + properties: + foreach: + allOf: + - $ref: '#/components/schemas/Tasks.ForeachDoUpdateItem' + description: The steps to run for each iteration + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.GetStep: + type: object + required: + - kind_ + - get + properties: + kind_: + type: string + enum: + - get + default: get + readOnly: true + get: + type: string + description: The key to get + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - get + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.IfElseWorkflowStep: + type: object + required: + - kind_ + - if + - then + - else + properties: + kind_: + type: string + enum: + - if_else + default: if_else + readOnly: true + if: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + else: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + nullable: true + description: The steps to run if the condition is false + default: null + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - if_else + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.IfElseWorkflowStepUpdateItem: + type: object + required: + - if + - then + - else + properties: + if: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + else: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + nullable: true + description: The steps to run if the condition is false + default: null + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.LogStep: + type: object + required: + - kind_ + - log + properties: + kind_: + type: string + enum: + - log + default: log + readOnly: true + log: + allOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + description: The value to log + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - log + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ParallelStep: + type: object + required: + - kind_ + - parallel + properties: + kind_: + type: string + enum: + - parallel + default: parallel + readOnly: true + parallel: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + maxItems: 100 + description: The steps to run in parallel. Max concurrency will depend on the platform. + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - parallel + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ParallelStepUpdateItem: + type: object + required: + - parallel + properties: + parallel: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + maxItems: 100 + description: The steps to run in parallel. Max concurrency will depend on the platform. + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.PatchTaskRequest: + type: object + properties: + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStepUpdateItem' + - $ref: '#/components/schemas/Tasks.SwitchStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ForeachStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ParallelStepUpdateItem' + - type: object + required: + - over + - map + properties: + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStepUpdateItem' + - $ref: '#/components/schemas/Tasks.SwitchStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ForeachStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ParallelStepUpdateItem' + - type: object + required: + - over + - map + properties: + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + description: Payload for patching a task + Tasks.PromptStep: + type: object + required: + - kind_ + - prompt + - tools + - forward_tool_results + properties: + kind_: + type: string + enum: + - prompt + default: prompt + readOnly: true + prompt: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + $ref: '#/components/schemas/Common.JinjaTemplate' + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + description: The prompt to run + tools: + anyOf: + - type: string + enum: + - all + - type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.ToolRef' + - $ref: '#/components/schemas/Tools.CreateToolRequest' + description: The tools to use for the prompt + default: [] + tool_choice: + anyOf: + - type: string + enum: + - auto + - none + - $ref: '#/components/schemas/Tools.NamedToolChoice' + description: The tool choice for the prompt + settings: + allOf: + - $ref: '#/components/schemas/Chat.ChatSettings' + description: Settings for the prompt + unwrap: + type: boolean + description: Whether to unwrap the output of the prompt step, equivalent to `response.choices[0].message.content` + default: false + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be used as the model's input. + If a tool call is not made, the model's output will be used as the next step's input. + default: null + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - prompt + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.PromptStepUpdateItem: + type: object + required: + - prompt + - tools + - forward_tool_results + properties: + prompt: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + $ref: '#/components/schemas/Common.JinjaTemplate' + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + description: The prompt to run + tools: + anyOf: + - type: string + enum: + - all + - type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.ToolRefUpdateItem' + - $ref: '#/components/schemas/Tools.CreateToolRequest' + description: The tools to use for the prompt + default: [] + tool_choice: + anyOf: + - type: string + enum: + - auto + - none + - $ref: '#/components/schemas/Tools.NamedToolChoice' + description: The tool choice for the prompt + settings: + allOf: + - $ref: '#/components/schemas/Chat.ChatSettings' + description: Settings for the prompt + unwrap: + type: boolean + description: Whether to unwrap the output of the prompt step, equivalent to `response.choices[0].message.content` + default: false + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be used as the model's input. + If a tool call is not made, the model's output will be used as the next step's input. + default: null + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ReturnStep: + type: object + required: + - kind_ + - return + properties: + kind_: + type: string + enum: + - return + default: return + readOnly: true + return: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: The value to return + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - return + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SearchStep: + type: object + required: + - kind_ + - search + properties: + kind_: + type: string + enum: + - search + default: search + readOnly: true + search: + anyOf: + - $ref: '#/components/schemas/Docs.VectorDocSearchRequest' + - $ref: '#/components/schemas/Docs.TextOnlyDocSearchRequest' + - $ref: '#/components/schemas/Docs.HybridDocSearchRequest' + description: The search query + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - search + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SetStep: + type: object + required: + - kind_ + - set + properties: + kind_: + type: string + enum: + - set + default: set + readOnly: true + set: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: The value to set + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - set + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SleepFor: + type: object + required: + - seconds + - minutes + - hours + - days + properties: + seconds: + type: integer + format: uint16 + minimum: 0 + maximum: 60 + description: The number of seconds to sleep for + default: 0 + minutes: + type: integer + format: uint16 + minimum: 0 + maximum: 60 + description: The number of minutes to sleep for + default: 0 + hours: + type: integer + format: uint16 + minimum: 0 + maximum: 24 + description: The number of hours to sleep for + default: 0 + days: + type: integer + format: uint16 + minimum: 0 + maximum: 30 + description: The number of days to sleep for + default: 0 + Tasks.SleepStep: + type: object + required: + - kind_ + - sleep + properties: + kind_: + type: string + enum: + - sleep + default: sleep + readOnly: true + sleep: + allOf: + - $ref: '#/components/schemas/Tasks.SleepFor' + description: The duration to sleep for (max 31 days) + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - sleep + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SwitchStep: + type: object + required: + - kind_ + - switch + properties: + kind_: + type: string + enum: + - switch + default: switch + readOnly: true + switch: + type: array + items: + $ref: '#/components/schemas/Tasks.CaseThen' + minItems: 1 + description: The cond tree + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - switch + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SwitchStepUpdateItem: + type: object + required: + - switch + properties: + switch: + type: array + items: + $ref: '#/components/schemas/Tasks.CaseThenUpdateItem' + minItems: 1 + description: The cond tree + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.Task: + type: object + required: + - name + - description + - main + - input_schema + - tools + - inherit_tools + - id + - created_at + - updated_at + properties: + name: + type: string + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + description: Object describing a Task + Tasks.TaskTool: + type: object + properties: + inherited: + type: boolean + description: 'Read-only: Whether the tool was inherited or not. Only applies within tasks.' + default: false + readOnly: true + allOf: + - $ref: '#/components/schemas/Tools.CreateToolRequest' + Tasks.ToolCallStep: + type: object + required: + - kind_ + - tool + - arguments + properties: + kind_: + type: string + enum: + - tool_call + default: tool_call + readOnly: true + tool: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: The tool to run + arguments: + anyOf: + - type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/Common.PyExpression' + - type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The input parameters for the tool (defaults to last step output) + default: _ + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - tool_call + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ToolRef: + type: object + required: + - ref + properties: + ref: + anyOf: + - $ref: '#/components/schemas/Tasks.ToolRefById' + - $ref: '#/components/schemas/Tasks.ToolRefByName' + description: Reference to a tool + Tasks.ToolRefById: + type: object + properties: + id: + $ref: '#/components/schemas/Common.uuid' + description: Reference to a tool by id + Tasks.ToolRefByName: + type: object + properties: + name: + $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Reference to a tool by name + Tasks.ToolRefUpdateItem: + type: object + description: Reference to a tool + Tasks.UpdateTaskRequest: + type: object + required: + - description + - main + - input_schema + - tools + - inherit_tools + properties: + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + description: Payload for updating a task + Tasks.WaitForInputInfo: + type: object + required: + - info + properties: + info: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: Any additional info or data + Tasks.WaitForInputStep: + type: object + required: + - kind_ + - wait_for_input + properties: + kind_: + type: string + enum: + - wait_for_input + default: wait_for_input + readOnly: true + wait_for_input: + allOf: + - $ref: '#/components/schemas/Tasks.WaitForInputInfo' + description: Any additional info or data + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - wait_for_input + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.YieldStep: + type: object + required: + - kind_ + - workflow + - arguments + properties: + kind_: + type: string + enum: + - yield + default: yield + readOnly: true + workflow: + type: string + description: |- + The subworkflow to run. + VALIDATION: Should resolve to a defined subworkflow. + arguments: + anyOf: + - type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The input parameters for the subworkflow (defaults to last step output) + default: _ + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - yield + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tools.ApiCallDef: + type: object + required: + - method + - url + properties: + method: + type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - HEAD + - OPTIONS + - CONNECT + - TRACE + description: The HTTP method to use + url: + type: string + format: uri + description: The URL to call + headers: + type: object + additionalProperties: + type: string + description: The headers to send with the request + content: + type: string + description: The content as base64 to send with the request + data: + type: object + additionalProperties: {} + description: The data to send as form data + json: + type: object + additionalProperties: {} + description: JSON body to send with the request + cookies: + type: object + additionalProperties: + type: string + description: Cookies + params: + anyOf: + - type: string + - type: object + additionalProperties: {} + description: The parameters to send with the request + follow_redirects: + type: boolean + description: Follow redirects + timeout: + type: integer + format: uint8 + description: The timeout for the request + description: API call definition + Tools.ApiCallDefUpdate: + type: object + properties: + method: + type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - HEAD + - OPTIONS + - CONNECT + - TRACE + description: The HTTP method to use + url: + type: string + format: uri + description: The URL to call + headers: + type: object + additionalProperties: + type: string + description: The headers to send with the request + content: + type: string + description: The content as base64 to send with the request + data: + type: object + additionalProperties: {} + description: The data to send as form data + json: + type: object + additionalProperties: {} + description: JSON body to send with the request + cookies: + type: object + additionalProperties: + type: string + description: Cookies + params: + anyOf: + - type: string + - type: object + additionalProperties: {} + description: The parameters to send with the request + follow_redirects: + type: boolean + description: Follow redirects + timeout: + type: integer + format: uint8 + description: The timeout for the request + description: API call definition + Tools.ChosenFunctionCall: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionCallOption' + description: The function to call + allOf: + - $ref: '#/components/schemas/Tools.ChosenToolCall' + Tools.ChosenToolCall: + type: object + required: + - type + - id + properties: + type: + allOf: + - $ref: '#/components/schemas/Tools.ToolType' + description: Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + function: + $ref: '#/components/schemas/Tools.FunctionCallOption' + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + discriminator: + propertyName: type + mapping: + function: '#/components/schemas/Tools.ChosenFunctionCall' + description: The response tool value generated by the model + Tools.CreateToolRequest: + type: object + required: + - name + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDef' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDef' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDef' + description: The API call to make + description: Payload for creating a tool + Tools.FunctionCallOption: + type: object + required: + - name + properties: + name: + type: string + description: The name of the function + Tools.FunctionDef: + type: object + properties: + name: + nullable: true + description: 'DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons.' + default: null + description: + nullable: true + description: 'DO NOT USE: This will be overriden by the tool description. Here only for compatibility reasons.' + default: null + parameters: + type: object + additionalProperties: {} + description: The parameters the function accepts + description: Function definition + Tools.IntegrationDef: + type: object + required: + - provider + properties: + provider: + anyOf: + - type: string + enum: + - dummy + - hacker_news + - weather + - wikipedia + - spider + - brave + - browserbase + - type: string + description: The provider of the integration + method: + type: string + description: The specific method of the integration to call + setup: + type: object + additionalProperties: {} + description: The setup parameters the integration accepts + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the integration call + description: Integration definition + Tools.IntegrationDefUpdate: + type: object + properties: + provider: + anyOf: + - type: string + enum: + - dummy + - hacker_news + - weather + - wikipedia + - spider + - brave + - browserbase + - type: string + description: The provider of the integration + method: + type: string + description: The specific method of the integration to call + setup: + type: object + additionalProperties: {} + description: The setup parameters the integration accepts + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the integration call + description: Integration definition + Tools.NamedToolChoice: + type: object + properties: + function: + $ref: '#/components/schemas/Tools.FunctionCallOption' + Tools.PatchToolRequest: + type: object + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDefUpdate' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDefUpdate' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDefUpdate' + description: The API call to make + description: Payload for patching a tool + Tools.SystemDef: + type: object + required: + - resource + - operation + properties: + resource: + type: string + enum: + - agent + - user + - task + - execution + - doc + - session + - job + description: Resource is the name of the resource to use + operation: + type: string + enum: + - create + - update + - patch + - create_or_update + - embed + - change_status + - search + - chat + - history + - delete + - get + - list + description: Operation is the name of the operation to perform + resource_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Resource id (if applicable) + subresource: + type: string + enum: + - tool + - doc + - execution + - transition + description: Sub-resource type (if applicable) + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the system call + description: System definition + Tools.SystemDefUpdate: + type: object + properties: + resource: + type: string + enum: + - agent + - user + - task + - execution + - doc + - session + - job + description: Resource is the name of the resource to use + operation: + type: string + enum: + - create + - update + - patch + - create_or_update + - embed + - change_status + - search + - chat + - history + - delete + - get + - list + description: Operation is the name of the operation to perform + resource_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Resource id (if applicable) + subresource: + type: string + enum: + - tool + - doc + - execution + - transition + description: Sub-resource type (if applicable) + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the system call + description: System definition + Tools.Tool: + type: object + required: + - name + - created_at + - updated_at + - id + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDef' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDef' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDef' + description: The API call to make + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + Tools.ToolResponse: + type: object + required: + - id + - output + properties: + id: + $ref: '#/components/schemas/Common.uuid' + output: + type: object + additionalProperties: {} + description: The output of the tool + Tools.ToolType: + type: string + enum: + - function + - integration + - system + - api_call + Tools.UpdateToolRequest: + type: object + required: + - name + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDef' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDef' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDef' + description: The API call to make + description: Payload for updating a tool + Users.CreateOrUpdateUserRequest: + type: object + required: + - id + properties: + id: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Users.CreateUserRequest' + Users.CreateUserRequest: + type: object + required: + - name + - about + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + description: Payload for creating a user (and associated documents) + Users.PatchUserRequest: + type: object + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + description: Payload for patching a user + Users.UpdateUserRequest: + type: object + required: + - name + - about + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + description: Payload for updating a user + Users.User: + type: object + required: + - id + - created_at + - updated_at + - name + - about + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization + ApiKeyAuth_: + type: apiKey + in: header + name: X-Auth-Key +servers: + - url: https://{serverEnv}.julep.ai/api + description: The julep cloud service endpoint + variables: + serverEnv: + default: api-alpha + description: The environment to use + enum: + - api + - api-alpha diff --git a/typespec/tsp-output/@typespec/openapi3/openapi-1.0.0.yaml b/typespec/tsp-output/@typespec/openapi3/openapi-1.0.0.yaml new file mode 100644 index 000000000..e5a5f99e6 --- /dev/null +++ b/typespec/tsp-output/@typespec/openapi3/openapi-1.0.0.yaml @@ -0,0 +1,6345 @@ +openapi: 3.0.0 +info: + title: Julep API + termsOfService: https://julep.ai/terms + contact: + name: Julep AI + url: https://julep.ai + email: developers@julep.ai + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + summary: A backend for creating stateful AI apps + description: Julep is a backend for creating stateful AI apps with background tasks and long-term memory easily. + version: 1.0.0 +externalDocs: + url: https://docs.julep.ai + description: Julep API documentation +tags: [] +paths: + /agents: + get: + operationId: AgentsRoute_list + description: List Agents (paginated) + parameters: + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Agents.Agent' + required: + - items + post: + operationId: AgentsRoute_create + description: Create a new Agent + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.CreateAgentRequest' + /agents/{id}: + post: + operationId: AgentsRoute_createOrUpdate + description: Create or update an Agent + parameters: + - $ref: '#/components/parameters/Agents.CreateOrUpdateAgentRequest.id' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.UpdateAgentRequest' + put: + operationId: AgentsRoute_update + description: Update an existing Agent by id (overwrites existing values; use PATCH for merging instead) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.UpdateAgentRequest' + patch: + operationId: AgentsRoute_patch + description: Update an existing Agent by id (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.PatchAgentRequest' + delete: + operationId: AgentsRoute_delete + description: Delete Agent by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: AgentsRoute_get + description: Get an Agent by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.Agent' + /agents/{id}/docs: + get: + operationId: AgentDocsRoute_list + description: List Docs owned by an Agent + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Docs.Doc' + required: + - results + post: + operationId: AgentDocsRoute_create + description: Create a Doc for this Agent + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.CreateDocRequest' + /agents/{id}/docs/{child_id}: + delete: + operationId: AgentDocsRoute_delete + description: Delete a Doc for this Agent + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /agents/{id}/search: + post: + operationId: AgentsDocsSearchRoute_search + description: Search Docs owned by an Agent + parameters: + - name: id + in: path + required: true + description: ID of the parent + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.DocSearchResponse' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + body: + anyOf: + - $ref: '#/components/schemas/Docs.VectorDocSearchRequest' + - $ref: '#/components/schemas/Docs.TextOnlyDocSearchRequest' + - $ref: '#/components/schemas/Docs.HybridDocSearchRequest' + required: + - body + /agents/{id}/tasks: + get: + operationId: TasksRoute_list + description: List tasks (paginated) + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Tasks.Task' + required: + - results + post: + operationId: TasksRoute_create + description: Create a new task + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/x-yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + application/json: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + /agents/{id}/tasks/{child_id}: + put: + operationId: TasksRoute_update + description: Update an existing task (overwrite existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be updated + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tasks.UpdateTaskRequest' + patch: + operationId: TasksRoute_patch + description: Update an existing task (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be patched + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tasks.PatchTaskRequest' + delete: + operationId: TasksRoute_delete + description: Delete a task by its id + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /agents/{id}/tools: + get: + operationId: AgentToolsRoute_list + description: List tools of the given agent + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Tools.Tool' + required: + - results + post: + operationId: AgentToolsRoute_create + description: Create a new tool for this agent + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Agents.CreateAgentRequest' + /agents/{id}/tools/{child_id}: + put: + operationId: AgentToolsRoute_update + description: Update an existing tool (overwrite existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be updated + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tools.UpdateToolRequest' + patch: + operationId: AgentToolsRoute_patch + description: Update an existing tool (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be patched + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Tools.PatchToolRequest' + delete: + operationId: AgentToolsRoute_delete + description: Delete an existing tool by id + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /agents/{parent_id}/tasks/{id}: + post: + operationId: TasksCreateOrUpdateRoute_createOrUpdate + description: Create or update a task + parameters: + - name: parent_id + in: path + required: true + description: ID of the agent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Tasks.CreateOrUpdateTaskRequest.id' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/x-yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + text/yaml: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + application/json: + schema: + $ref: '#/components/schemas/Tasks.CreateTaskRequest' + /docs/{id}: + get: + operationId: IndividualDocsRoute_get + description: Get Doc by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.Doc' + /embed: + post: + operationId: EmbedRoute_embed + description: Embed a query for search + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.EmbedQueryResponse' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + body: + $ref: '#/components/schemas/Docs.EmbedQueryRequest' + required: + - body + /executions: + post: + operationId: ExecutionsRoute_resumeWithTaskToken + description: Resume an execution with a task token + parameters: + - name: task_token + in: query + required: true + description: A Task Token is a unique identifier for a specific Task Execution. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.TaskTokenResumeExecutionRequest' + description: Request to resume an execution with a task token + security: + - {} + /executions/{id}: + get: + operationId: ExecutionsRoute_get + description: Get an Execution by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.Execution' + put: + operationId: ExecutionsRoute_update + description: Update an existing Execution + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.UpdateExecutionRequest' + /executions/{id}/transitions: + get: + operationId: ExecutionTransitionsRoute_list + description: List the Transitions of an Execution by id + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + type: object + properties: + transitions: + type: array + items: + $ref: '#/components/schemas/Executions.Transition' + required: + - transitions + required: + - results + /executions/{id}/transitions.stream: + get: + operationId: ExecutionTransitionsStreamRoute_stream + description: Stream events emitted by the given execution + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - name: next_token + in: query + required: true + description: Next page token + schema: + type: string + nullable: true + default: null + explode: false + responses: + '200': + description: The request has succeeded. + content: + text/event-stream: + schema: + $ref: '#/components/schemas/Executions.TransitionEvent' + /jobs/{id}: + get: + operationId: JobRoute_get + description: Get the status of an existing Job by its id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Jobs.JobStatus' + /sessions: + get: + operationId: SessionsRoute_list + description: List sessions (paginated) + parameters: + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Sessions.Session' + required: + - items + post: + operationId: SessionsRoute_create + description: Create a new session + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.CreateSessionRequest' + /sessions/{id}: + post: + operationId: SessionsRoute_createOrUpdate + description: Create or update a session + parameters: + - $ref: '#/components/parameters/Sessions.CreateOrUpdateSessionRequest.id' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.CreateSessionRequest' + put: + operationId: SessionsRoute_update + description: Update an existing session by its id (overwrites all existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.UpdateSessionRequest' + patch: + operationId: SessionsRoute_patch + description: Update an existing session by its id (merges with existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.PatchSessionRequest' + delete: + operationId: SessionsRoute_delete + description: Delete a session by its id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: SessionsRoute_get + description: Get a session by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Sessions.Session' + /sessions/{id}/chat: + post: + operationId: ChatRoute_generate + description: Generate a response from the model + parameters: + - name: id + in: path + required: true + description: The session ID + schema: + $ref: '#/components/schemas/Common.uuid' + - name: x-custom-api-key + in: header + required: false + description: Custom API key + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + anyOf: + - $ref: '#/components/schemas/Chat.ChunkChatResponse' + - $ref: '#/components/schemas/Chat.MessageChatResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Chat.ChatInput' + description: Request to generate a response from the model + /sessions/{id}/history: + delete: + operationId: HistoryRoute_delete + description: Clear the history of a Session (resets the Session) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: HistoryRoute_history + description: Get history of a Session + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Entries.History' + /tasks/{id}/executions: + post: + operationId: TaskExecutionsRoute_create + description: Create an execution for the given task + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Executions.CreateExecutionRequest' + get: + operationId: TaskExecutionsRoute_list + description: List executions of the given task + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Executions.Execution' + required: + - results + /users: + get: + operationId: UsersRoute_list + description: List users (paginated) + parameters: + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/Users.User' + required: + - items + post: + operationId: UsersRoute_create + description: Create a new user + parameters: [] + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.CreateUserRequest' + /users/{id}: + post: + operationId: UsersRoute_createOrUpdate + description: Create or update a user + parameters: + - $ref: '#/components/parameters/Users.CreateOrUpdateUserRequest' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.CreateUserRequest' + put: + operationId: UsersRoute_update + description: Update an existing user by id (overwrite existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.UpdateUserRequest' + patch: + operationId: UsersRoute_patch + description: Update an existing user by id (merge with existing values) + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceUpdatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Users.PatchUserRequest' + delete: + operationId: UsersRoute_delete + description: Delete a user by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + get: + operationId: UsersRoute_get + description: Get a user by id + parameters: + - name: id + in: path + required: true + description: ID of the resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Users.User' + /users/{id}/docs: + get: + operationId: UserDocsRoute_list + description: List Docs owned by a User + parameters: + - name: id + in: path + required: true + description: ID of parent + schema: + $ref: '#/components/schemas/Common.uuid' + - $ref: '#/components/parameters/Common.PaginationOptions.limit' + - $ref: '#/components/parameters/Common.PaginationOptions.offset' + - $ref: '#/components/parameters/Common.PaginationOptions.sort_by' + - $ref: '#/components/parameters/Common.PaginationOptions.direction' + - $ref: '#/components/parameters/Common.PaginationOptions.metadata_filter' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Docs.Doc' + required: + - results + post: + operationId: UserDocsRoute_create + description: Create a Doc for this User + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceCreatedResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.CreateDocRequest' + /users/{id}/docs/{child_id}: + delete: + operationId: UserDocsRoute_delete + description: Delete a Doc for this User + parameters: + - name: id + in: path + required: true + description: ID of parent resource + schema: + $ref: '#/components/schemas/Common.uuid' + - name: child_id + in: path + required: true + description: ID of the resource to be deleted + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '202': + description: The request has been accepted for processing, but processing has not yet completed. + content: + application/json: + schema: + $ref: '#/components/schemas/Common.ResourceDeletedResponse' + /users/{id}/search: + post: + operationId: UserDocsSearchRoute_search + description: Search Docs owned by a User + parameters: + - name: id + in: path + required: true + description: ID of the parent + schema: + $ref: '#/components/schemas/Common.uuid' + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/Docs.DocSearchResponse' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + body: + anyOf: + - $ref: '#/components/schemas/Docs.VectorDocSearchRequest' + - $ref: '#/components/schemas/Docs.TextOnlyDocSearchRequest' + - $ref: '#/components/schemas/Docs.HybridDocSearchRequest' + required: + - body +security: + - ApiKeyAuth: [] + - ApiKeyAuth_: [] +components: + parameters: + Agents.CreateOrUpdateAgentRequest.id: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + Common.PaginationOptions.direction: + name: direction + in: query + required: true + description: Sort direction + schema: + type: string + enum: + - asc + - desc + default: asc + explode: false + Common.PaginationOptions.limit: + name: limit + in: query + required: true + description: Limit the number of items returned + schema: + $ref: '#/components/schemas/Common.limit' + default: 100 + explode: false + Common.PaginationOptions.metadata_filter: + name: metadata_filter + in: query + required: true + description: JSON string of object that should be used to filter objects by metadata + schema: + type: string + default: '{}' + explode: false + Common.PaginationOptions.offset: + name: offset + in: query + required: true + description: Offset the items returned + schema: + $ref: '#/components/schemas/Common.offset' + default: 0 + explode: false + Common.PaginationOptions.sort_by: + name: sort_by + in: query + required: true + description: Sort by a field + schema: + type: string + enum: + - created_at + - updated_at + default: created_at + explode: false + Sessions.CreateOrUpdateSessionRequest.id: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + Tasks.CreateOrUpdateTaskRequest.id: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + Users.CreateOrUpdateUserRequest: + name: id + in: path + required: true + schema: + $ref: '#/components/schemas/Common.uuid' + schemas: + Agents.Agent: + type: object + required: + - id + - created_at + - updated_at + - name + - about + - model + - instructions + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + Agents.CreateAgentRequest: + type: object + required: + - name + - about + - model + - instructions + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + description: Payload for creating a agent (and associated documents) + Agents.CreateOrUpdateAgentRequest: + type: object + required: + - id + - name + - about + - model + - instructions + properties: + id: + $ref: '#/components/schemas/Common.uuid' + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + allOf: + - $ref: '#/components/schemas/Agents.CreateAgentRequest' + Agents.PatchAgentRequest: + type: object + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + description: Payload for patching a agent + Agents.UpdateAgentRequest: + type: object + required: + - name + - about + - model + - instructions + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the agent + default: '' + about: + type: string + description: About the agent + default: '' + model: + type: string + description: Model name to use (gpt-4-turbo, gemini-nano etc) + default: '' + instructions: + anyOf: + - type: string + - type: array + items: + type: string + description: Instructions for the agent + default: [] + default_settings: + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + description: Default settings for all sessions created by this agent + description: Payload for updating a agent + Chat.BaseChatOutput: + type: object + required: + - index + - finish_reason + properties: + index: + type: integer + format: uint32 + finish_reason: + allOf: + - $ref: '#/components/schemas/Chat.FinishReason' + description: The reason the model stopped generating tokens + default: stop + logprobs: + allOf: + - $ref: '#/components/schemas/Chat.LogProbResponse' + description: The log probabilities of tokens + Chat.BaseChatResponse: + type: object + required: + - jobs + - docs + - created_at + - id + properties: + usage: + allOf: + - $ref: '#/components/schemas/Chat.CompetionUsage' + description: Usage statistics for the completion request + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: Background job IDs that may have been spawned from this interaction. + default: [] + readOnly: true + docs: + type: array + items: + $ref: '#/components/schemas/Docs.DocReference' + description: Documents referenced for this request (for citation purposes). + default: [] + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + Chat.BaseTokenLogProb: + type: object + required: + - token + - logprob + properties: + token: + type: string + logprob: + type: number + format: float + description: The log probability of the token + bytes: + type: array + items: + type: integer + format: uint16 + Chat.ChatInput: + type: object + required: + - remember + - recall + - save + - stream + - stop + properties: + remember: + type: boolean + description: 'DISABLED: Whether this interaction should form new memories or not (will be enabled in a future release)' + default: false + readOnly: true + recall: + type: boolean + description: Whether previous memories and docs should be recalled or not + default: true + save: + type: boolean + description: Whether this interaction should be stored in the session history or not + default: true + model: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Identifier of the model to be used + stream: + type: boolean + description: Indicates if the server should stream the response as it's generated + default: false + stop: + type: array + items: + type: string + maxItems: 4 + description: Up to 4 sequences where the API will stop generating further tokens. + default: [] + seed: + type: integer + format: int16 + minimum: -1 + maximum: 1000 + description: If specified, the system will make a best effort to sample deterministically for that particular seed value + max_tokens: + type: integer + format: uint32 + minimum: 1 + description: The maximum number of tokens to generate in the chat completion + logit_bias: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.logit_bias' + description: Modify the likelihood of specified tokens appearing in the completion + response_format: + anyOf: + - $ref: '#/components/schemas/Chat.SimpleCompletionResponseFormat' + - $ref: '#/components/schemas/Chat.SchemaCompletionResponseFormat' + description: Response format (set to `json_object` to restrict output to JSON) + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + repetition_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + length_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + min_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Minimum probability compared to leading token to be considered + frequency_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + presence_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + temperature: + type: number + format: float + minimum: 0 + maximum: 5 + description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + top_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. + allOf: + - $ref: '#/components/schemas/Chat.ChatInputData' + Chat.ChatInputData: + type: object + required: + - messages + - tools + properties: + messages: + type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + minItems: 1 + description: A list of new input messages comprising the conversation so far. + tools: + type: array + items: + $ref: '#/components/schemas/Tools.Tool' + description: (Advanced) List of tools that are provided in addition to agent's default set of tools. + default: [] + tool_choice: + anyOf: + - type: string + enum: + - auto + - none + - $ref: '#/components/schemas/Tools.NamedToolChoice' + description: Can be one of existing tools given to the agent earlier or the ones provided in this request. + Chat.ChatOutputChunk: + type: object + required: + - delta + properties: + delta: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + description: The message generated by the model + allOf: + - $ref: '#/components/schemas/Chat.BaseChatOutput' + description: Streaming chat completion output + Chat.ChatSettings: + type: object + required: + - stream + - stop + properties: + model: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Identifier of the model to be used + stream: + type: boolean + description: Indicates if the server should stream the response as it's generated + default: false + stop: + type: array + items: + type: string + maxItems: 4 + description: Up to 4 sequences where the API will stop generating further tokens. + default: [] + seed: + type: integer + format: int16 + minimum: -1 + maximum: 1000 + description: If specified, the system will make a best effort to sample deterministically for that particular seed value + max_tokens: + type: integer + format: uint32 + minimum: 1 + description: The maximum number of tokens to generate in the chat completion + logit_bias: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.logit_bias' + description: Modify the likelihood of specified tokens appearing in the completion + response_format: + anyOf: + - $ref: '#/components/schemas/Chat.SimpleCompletionResponseFormat' + - $ref: '#/components/schemas/Chat.SchemaCompletionResponseFormat' + description: Response format (set to `json_object` to restrict output to JSON) + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of the agent to use for this interaction. (Only applicable for multi-agent sessions) + allOf: + - $ref: '#/components/schemas/Chat.DefaultChatSettings' + Chat.ChunkChatResponse: + type: object + required: + - choices + properties: + choices: + type: array + items: + $ref: '#/components/schemas/Chat.ChatOutputChunk' + description: The deltas generated by the model + allOf: + - $ref: '#/components/schemas/Chat.BaseChatResponse' + Chat.CompetionUsage: + type: object + properties: + completion_tokens: + type: integer + format: uint32 + description: Number of tokens in the generated completion + readOnly: true + prompt_tokens: + type: integer + format: uint32 + description: Number of tokens in the prompt + readOnly: true + total_tokens: + type: integer + format: uint32 + description: Total number of tokens used in the request (prompt + completion) + readOnly: true + description: Usage statistics for the completion request + Chat.DefaultChatSettings: + type: object + properties: + repetition_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + length_penalty: + type: number + format: float + minimum: 0 + maximum: 2 + description: Number between 0 and 2.0. 1.0 is neutral and values larger than that penalize number of tokens generated. + min_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Minimum probability compared to leading token to be considered + allOf: + - $ref: '#/components/schemas/Chat.OpenAISettings' + description: Default settings for the chat session (also used by the agent) + Chat.FinishReason: + type: string + enum: + - stop + - length + - content_filter + - tool_calls + description: |- + The reason the model stopped generating tokens. This will be `stop` + if the model hit a natural stop point or a provided stop sequence, + `length` if the maximum number of tokens specified in the request + was reached, `content_filter` if content was omitted due to a flag + from our content filters, `tool_calls` if the model called a tool. + Chat.LogProbResponse: + type: object + required: + - content + properties: + content: + type: array + items: + $ref: '#/components/schemas/Chat.TokenLogProb' + nullable: true + description: The log probabilities of the tokens + Chat.MessageChatResponse: + type: object + required: + - choices + properties: + choices: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Chat.SingleChatOutput' + - $ref: '#/components/schemas/Chat.MultipleChatOutput' + description: The deltas generated by the model + allOf: + - $ref: '#/components/schemas/Chat.BaseChatResponse' + Chat.MultipleChatOutput: + type: object + required: + - messages + properties: + messages: + type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + tool_calls: + type: array + items: + $ref: '#/components/schemas/Tools.ChosenToolCall' + nullable: true + description: Tool calls generated by the model. + default: [] + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + minItems: 1 + readOnly: true + allOf: + - $ref: '#/components/schemas/Chat.BaseChatOutput' + description: The output returned by the model. Note that, depending on the model provider, they might return more than one message. + Chat.OpenAISettings: + type: object + properties: + frequency_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + presence_penalty: + type: number + format: float + minimum: -2 + maximum: 2 + description: Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + temperature: + type: number + format: float + minimum: 0 + maximum: 5 + description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + top_p: + type: number + format: float + minimum: 0 + maximum: 1 + description: Defaults to 1 An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. + Chat.SchemaCompletionResponseFormat: + type: object + required: + - type + - json_schema + properties: + type: + type: string + enum: + - json_schema + description: The format of the response + default: json_schema + json_schema: + type: object + additionalProperties: {} + description: The schema of the response + Chat.SimpleCompletionResponseFormat: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + - json_object + description: The format of the response + default: text + Chat.SingleChatOutput: + type: object + required: + - message + properties: + message: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + tool_calls: + type: array + items: + $ref: '#/components/schemas/Tools.ChosenToolCall' + nullable: true + description: Tool calls generated by the model. + default: [] + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + allOf: + - $ref: '#/components/schemas/Chat.BaseChatOutput' + description: The output returned by the model. Note that, depending on the model provider, they might return more than one message. + Chat.TokenLogProb: + type: object + required: + - top_logprobs + properties: + top_logprobs: + type: array + items: + $ref: '#/components/schemas/Chat.BaseTokenLogProb' + minItems: 1 + description: The log probabilities of the tokens + readOnly: true + allOf: + - $ref: '#/components/schemas/Chat.BaseTokenLogProb' + Common.JinjaTemplate: + type: string + description: A valid jinja template. + Common.PyExpression: + type: string + description: A simple python expression compatible with SimpleEval. + Common.ResourceCreatedResponse: + type: object + required: + - id + - created_at + - jobs + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: ID of created resource + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: IDs (if any) of jobs created as part of this request + default: [] + readOnly: true + Common.ResourceDeletedResponse: + type: object + required: + - id + - deleted_at + - jobs + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: ID of deleted resource + deleted_at: + type: string + format: date-time + description: When this resource was deleted as UTC date-time + readOnly: true + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: IDs (if any) of jobs created as part of this request + default: [] + readOnly: true + Common.ResourceUpdatedResponse: + type: object + required: + - id + - updated_at + - jobs + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: ID of updated resource + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + jobs: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + description: IDs (if any) of jobs created as part of this request + default: [] + readOnly: true + Common.identifierSafeUnicode: + type: string + maxLength: 120 + pattern: ^[\p{L}\p{Nl}\p{Pattern_Syntax}\p{Pattern_White_Space}]+[\p{ID_Start}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\p{Pattern_Syntax}\p{Pattern_White_Space}]*$ + description: |- + For Unicode character safety + See: https://unicode.org/reports/tr31/ + See: https://www.unicode.org/reports/tr39/#Identifier_Characters + Common.limit: + type: integer + format: uint16 + minimum: 1 + maximum: 1000 + exclusiveMaximum: true + description: Limit the number of results + Common.logit_bias: + type: number + format: float + minimum: -100 + maximum: 100 + Common.offset: + type: integer + format: uint32 + minimum: 0 + description: Offset to apply to the results + Common.uuid: + type: string + format: uuid + Common.validPythonIdentifier: + type: string + maxLength: 40 + pattern: ^[^\W0-9]\w*$ + description: Valid python identifier names + Docs.BaseDocSearchRequest: + type: object + required: + - limit + - lang + properties: + limit: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + default: 10 + lang: + type: string + enum: + - en-US + description: The language to be used for text-only search. Support for other languages coming soon. + default: en-US + Docs.CreateDocRequest: + type: object + required: + - title + - content + properties: + metadata: + type: object + additionalProperties: {} + title: + type: string + maxLength: 800 + description: Title describing what this document contains + content: + anyOf: + - type: string + - type: array + items: + type: string + description: Contents of the document + description: Payload for creating a doc + Docs.Doc: + type: object + required: + - id + - created_at + - title + - content + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + title: + type: string + maxLength: 800 + description: Title describing what this document contains + content: + anyOf: + - type: string + - type: array + items: + type: string + description: Contents of the document + embeddings: + anyOf: + - type: array + items: + type: number + format: float + - type: array + items: + type: array + items: + type: number + format: float + description: Embeddings for the document + readOnly: true + Docs.DocOwner: + type: object + required: + - id + - role + properties: + id: + anyOf: + - allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + - allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + role: + type: string + enum: + - user + - agent + Docs.DocReference: + type: object + required: + - owner + - id + - snippets + - distance + properties: + owner: + allOf: + - $ref: '#/components/schemas/Docs.DocOwner' + description: The owner of this document. + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + description: ID of the document + title: + type: string + snippets: + type: array + items: + $ref: '#/components/schemas/Docs.Snippet' + minItems: 1 + distance: + type: number + nullable: true + default: null + Docs.DocSearchResponse: + type: object + required: + - docs + - time + properties: + docs: + type: array + items: + $ref: '#/components/schemas/Docs.DocReference' + description: The documents that were found + time: + type: number + minimum: 0 + exclusiveMinimum: true + description: The time taken to search in seconds + Docs.EmbedQueryRequest: + type: object + required: + - text + properties: + text: + anyOf: + - type: string + - type: array + items: + type: string + description: Text or texts to embed + Docs.EmbedQueryResponse: + type: object + required: + - vectors + properties: + vectors: + type: array + items: + type: array + items: + type: number + description: The embedded vectors + Docs.HybridDocSearchRequest: + type: object + required: + - confidence + - alpha + - text + - vector + properties: + confidence: + type: number + minimum: 0 + maximum: 1 + description: The confidence cutoff level + default: 0.5 + alpha: + type: number + minimum: 0 + maximum: 1 + description: The weight to apply to BM25 vs Vector search results. 0 => pure BM25; 1 => pure vector; + default: 0.75 + text: + type: string + description: Text to use in the search. In `hybrid` search mode, either `text` or both `text` and `vector` fields are required. + vector: + type: array + items: + type: number + description: Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + allOf: + - $ref: '#/components/schemas/Docs.BaseDocSearchRequest' + Docs.Snippet: + type: object + required: + - index + - content + properties: + index: + type: integer + format: uint16 + content: + type: string + Docs.TextOnlyDocSearchRequest: + type: object + required: + - text + properties: + text: + type: string + description: Text to use in the search. + allOf: + - $ref: '#/components/schemas/Docs.BaseDocSearchRequest' + Docs.VectorDocSearchRequest: + type: object + required: + - confidence + - vector + properties: + confidence: + type: number + minimum: 0 + maximum: 1 + description: The confidence cutoff level + default: 0.5 + vector: + type: array + items: + type: number + description: Vector to use in the search. Must be the same dimensions as the embedding model or else an error will be thrown. + allOf: + - $ref: '#/components/schemas/Docs.BaseDocSearchRequest' + Entries.BaseEntry: + type: object + required: + - role + - name + - content + - source + - tokenizer + - token_count + - timestamp + properties: + role: + $ref: '#/components/schemas/Entries.ChatMLRole' + name: + type: string + nullable: true + default: null + content: + anyOf: + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + - $ref: '#/components/schemas/Tools.Tool' + - $ref: '#/components/schemas/Tools.ChosenToolCall' + - type: string + - $ref: '#/components/schemas/Tools.ToolResponse' + - type: array + items: + anyOf: + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + type: string + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + - $ref: '#/components/schemas/Tools.Tool' + - $ref: '#/components/schemas/Tools.ChosenToolCall' + - type: string + - $ref: '#/components/schemas/Tools.ToolResponse' + source: + type: string + enum: + - api_request + - api_response + - tool_response + - internal + - summarizer + - meta + tokenizer: + type: string + token_count: + type: integer + format: uint16 + timestamp: + type: number + minimum: 0 + description: This is the time that this event refers to. + Entries.ChatMLRole: + type: string + enum: + - user + - assistant + - system + - function + - function_response + - function_call + - auto + description: ChatML role (system|assistant|user|function_call|function|function_response|auto) + Entries.Entry: + type: object + required: + - created_at + - id + properties: + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + allOf: + - $ref: '#/components/schemas/Entries.BaseEntry' + Entries.History: + type: object + required: + - entries + - relations + - session_id + - created_at + properties: + entries: + type: array + items: + $ref: '#/components/schemas/Entries.Entry' + relations: + type: array + items: + $ref: '#/components/schemas/Entries.Relation' + session_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + Entries.ImageDetail: + type: string + enum: + - low + - high + - auto + description: Image detail level + Entries.Relation: + type: object + required: + - head + - relation + - tail + properties: + head: + $ref: '#/components/schemas/Common.uuid' + relation: + type: string + tail: + $ref: '#/components/schemas/Common.uuid' + Executions.CreateExecutionRequest: + type: object + required: + - input + properties: + input: + type: object + additionalProperties: {} + description: The input to the execution + output: + description: The output of the execution if it succeeded + error: + type: string + description: The error of the execution if it failed + metadata: + type: object + additionalProperties: {} + description: Payload for creating an execution + Executions.Execution: + type: object + required: + - task_id + - status + - input + - created_at + - updated_at + - id + properties: + task_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + description: The ID of the task that the execution is running + status: + type: string + enum: + - queued + - starting + - running + - awaiting_input + - succeeded + - failed + - cancelled + description: The status of the execution + readOnly: true + input: + type: object + additionalProperties: {} + description: The input to the execution + output: + description: The output of the execution if it succeeded + error: + type: string + description: The error of the execution if it failed + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + metadata: + type: object + additionalProperties: {} + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + Executions.ResumeExecutionRequest: + type: object + required: + - status + properties: + status: + type: string + enum: + - running + default: running + input: + type: object + additionalProperties: {} + description: The input to resume the execution with + allOf: + - $ref: '#/components/schemas/Executions.UpdateExecutionRequest' + Executions.StopExecutionRequest: + type: object + required: + - status + - reason + properties: + status: + type: string + enum: + - cancelled + default: cancelled + reason: + type: string + nullable: true + description: The reason for stopping the execution + default: null + allOf: + - $ref: '#/components/schemas/Executions.UpdateExecutionRequest' + Executions.TaskTokenResumeExecutionRequest: + type: object + required: + - status + properties: + status: + type: string + enum: + - running + default: running + input: + type: object + additionalProperties: {} + description: The input to resume the execution with + Executions.Transition: + type: object + required: + - execution_id + - current + - next + - id + properties: + execution_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + current: + allOf: + - $ref: '#/components/schemas/Executions.TransitionTarget' + readOnly: true + next: + type: object + allOf: + - $ref: '#/components/schemas/Executions.TransitionTarget' + nullable: true + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + allOf: + - $ref: '#/components/schemas/Executions.TransitionEvent' + Executions.TransitionEvent: + type: object + required: + - type + - output + - created_at + - updated_at + properties: + type: + type: string + enum: + - init + - init_branch + - finish + - finish_branch + - wait + - resume + - error + - step + - cancelled + readOnly: true + output: + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + Executions.TransitionTarget: + type: object + required: + - workflow + - step + properties: + workflow: + $ref: '#/components/schemas/Common.identifierSafeUnicode' + step: + type: integer + format: uint16 + Executions.UpdateExecutionRequest: + type: object + required: + - status + properties: + status: + type: string + enum: + - queued + - starting + - running + - awaiting_input + - succeeded + - failed + - cancelled + discriminator: + propertyName: status + mapping: + cancelled: '#/components/schemas/Executions.StopExecutionRequest' + running: '#/components/schemas/Executions.ResumeExecutionRequest' + Jobs.JobState: + type: string + enum: + - pending + - in_progress + - retrying + - succeeded + - aborted + - failed + - unknown + description: 'Current state (one of: pending, in_progress, retrying, succeeded, aborted, failed)' + Jobs.JobStatus: + type: object + required: + - id + - created_at + - updated_at + - name + - reason + - has_progress + - progress + - state + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the job + default: '' + reason: + type: string + description: Reason for the current state of the job + default: '' + has_progress: + type: boolean + description: Whether this Job supports progress updates + default: false + progress: + type: number + format: float + minimum: 0 + maximum: 100 + description: Progress percentage + default: 0 + state: + allOf: + - $ref: '#/components/schemas/Jobs.JobState' + description: Current state of the job + default: pending + Sessions.ContextOverflowType: + type: string + enum: + - truncate + - adaptive + Sessions.CreateOrUpdateSessionRequest: + type: object + required: + - id + - situation + - render_templates + - token_budget + - context_overflow + - forward_tool_results + properties: + id: + $ref: '#/components/schemas/Common.uuid' + user: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: User ID of user associated with this session + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of agent associated with this session + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + allOf: + - $ref: '#/components/schemas/Sessions.CreateSessionRequest' + Sessions.CreateSessionRequest: + type: object + required: + - situation + - render_templates + - token_budget + - context_overflow + - forward_tool_results + properties: + user: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: User ID of user associated with this session + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + agent: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Agent ID of agent associated with this session + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + description: Payload for creating a session + Sessions.MultiAgentMultiUserSession: + type: object + required: + - agents + - users + properties: + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.MultiAgentNoUserSession: + type: object + required: + - agents + properties: + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.MultiAgentSingleUserSession: + type: object + required: + - agents + - user + properties: + agents: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + user: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.PatchSessionRequest: + type: object + properties: + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + description: Payload for patching a session + Sessions.Session: + type: object + required: + - situation + - summary + - render_templates + - token_budget + - context_overflow + - forward_tool_results + - id + - created_at + - updated_at + properties: + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + summary: + type: string + nullable: true + description: Summary (null at the beginning) - generated automatically after every interaction + default: null + readOnly: true + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + kind: + type: string + description: Discriminator property for Session. + discriminator: + propertyName: kind + mapping: + single_agent_no_user: '#/components/schemas/Sessions.SingleAgentNoUserSession' + single_agent_single_user: '#/components/schemas/Sessions.SingleAgentSingleUserSession' + single_agent_multi_user: '#/components/schemas/Sessions.SingleAgentMultiUserSession' + multi_agent_no_user: '#/components/schemas/Sessions.MultiAgentNoUserSession' + multi_agent_single_user: '#/components/schemas/Sessions.MultiAgentSingleUserSession' + multi_agent_multi_user: '#/components/schemas/Sessions.MultiAgentMultiUserSession' + Sessions.SingleAgentMultiUserSession: + type: object + required: + - agent + - users + properties: + agent: + $ref: '#/components/schemas/Common.uuid' + users: + type: array + items: + $ref: '#/components/schemas/Common.uuid' + minItems: 2 + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.SingleAgentNoUserSession: + type: object + required: + - agent + properties: + agent: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.SingleAgentSingleUserSession: + type: object + required: + - agent + - user + properties: + agent: + $ref: '#/components/schemas/Common.uuid' + user: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Sessions.Session' + Sessions.UpdateSessionRequest: + type: object + required: + - situation + - render_templates + - token_budget + - context_overflow + - forward_tool_results + properties: + situation: + type: string + description: A specific situation that sets the background for this session + default: |- + {%- if agent.name -%} + You are {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if agent.about -%} + About you: {{agent.name}}.{{" "}} + {%- endif -%} + + {%- if user -%} + You are talking to a user + {%- if user.name -%}{{" "}} and their name is {{user.name}} + {%- if user.about -%}. About the user: {{user.about}}.{%- else -%}.{%- endif -%} + {%- endif -%} + {%- endif -%} + + {{" + + "}} + + {%- if agent.instructions -%} + Instructions:{{" + "}} + {%- if agent.instructions is string -%} + {{agent.instructions}}{{" + "}} + {%- else -%} + {%- for instruction in agent.instructions -%} + - {{instruction}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{" + "}} + {%- endif -%} + + {%- if tools -%} + Tools:{{" + "}} + {%- for tool in tools -%} + {%- if tool.type == "function" -%} + - {{tool.function.name}} + {%- if tool.function.description -%}: {{tool.function.description}}{%- endif -%}{{" + "}} + {%- else -%} + - {{ 0/0 }} {# Error: Other tool types aren't supported yet. #} + {%- endif -%} + {%- endfor -%} + {{" + + "}} + {%- endif -%} + + {%- if docs -%} + Relevant documents:{{" + "}} + {%- for doc in docs -%} + {{doc.title}}{{" + "}} + {%- if doc.content is string -%} + {{doc.content}}{{" + "}} + {%- else -%} + {%- for snippet in doc.content -%} + {{snippet}}{{" + "}} + {%- endfor -%} + {%- endif -%} + {{"---"}} + {%- endfor -%} + {%- endif -%} + render_templates: + type: boolean + description: Render system and assistant message content as jinja templates + default: true + token_budget: + type: integer + format: uint16 + nullable: true + description: Threshold value for the adaptive context functionality + default: null + context_overflow: + oneOf: + - $ref: '#/components/schemas/Sessions.ContextOverflowType' + nullable: true + description: Action to start on context window overflow + default: null + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be sent back to the model as the model's input. + If a tool call is not made, the model's output will be returned as is. + default: null + metadata: + type: object + additionalProperties: {} + description: Payload for updating a session + Tasks.CaseThen: + type: object + required: + - case + - then + properties: + case: + anyOf: + - $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + Tasks.CaseThenUpdateItem: + type: object + required: + - case + - then + properties: + case: + anyOf: + - $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + Tasks.CreateTaskRequest: + type: object + required: + - name + - description + - main + - input_schema + - tools + - inherit_tools + properties: + name: + type: string + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + description: Payload for creating a task + Tasks.EmbedStep: + type: object + required: + - kind_ + - embed + properties: + kind_: + type: string + enum: + - embed + default: embed + readOnly: true + embed: + allOf: + - $ref: '#/components/schemas/Docs.EmbedQueryRequest' + description: The text to embed + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - embed + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ErrorWorkflowStep: + type: object + required: + - kind_ + - error + properties: + kind_: + type: string + enum: + - error + default: error + readOnly: true + error: + type: string + description: The error message + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - error + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.EvaluateStep: + type: object + required: + - kind_ + - evaluate + properties: + kind_: + type: string + enum: + - evaluate + default: evaluate + readOnly: true + evaluate: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: The expression to evaluate + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - evaluate + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ForeachDo: + type: object + required: + - in + - do + properties: + in: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The variable to iterate over. + VALIDATION: Should NOT return more than 1000 elements. + do: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + Tasks.ForeachDoUpdateItem: + type: object + required: + - in + - do + properties: + in: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The variable to iterate over. + VALIDATION: Should NOT return more than 1000 elements. + do: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + Tasks.ForeachStep: + type: object + required: + - kind_ + - foreach + properties: + kind_: + type: string + enum: + - foreach + default: foreach + readOnly: true + foreach: + allOf: + - $ref: '#/components/schemas/Tasks.ForeachDo' + description: The steps to run for each iteration + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - foreach + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ForeachStepUpdateItem: + type: object + required: + - foreach + properties: + foreach: + allOf: + - $ref: '#/components/schemas/Tasks.ForeachDoUpdateItem' + description: The steps to run for each iteration + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.GetStep: + type: object + required: + - kind_ + - get + properties: + kind_: + type: string + enum: + - get + default: get + readOnly: true + get: + type: string + description: The key to get + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - get + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.IfElseWorkflowStep: + type: object + required: + - kind_ + - if + - then + - else + properties: + kind_: + type: string + enum: + - if_else + default: if_else + readOnly: true + if: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + else: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + nullable: true + description: The steps to run if the condition is false + default: null + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - if_else + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.IfElseWorkflowStepUpdateItem: + type: object + required: + - if + - then + - else + properties: + if: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The condition to evaluate + then: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + description: The steps to run if the condition is true + else: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + nullable: true + description: The steps to run if the condition is false + default: null + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.LogStep: + type: object + required: + - kind_ + - log + properties: + kind_: + type: string + enum: + - log + default: log + readOnly: true + log: + allOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + description: The value to log + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - log + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ParallelStep: + type: object + required: + - kind_ + - parallel + properties: + kind_: + type: string + enum: + - parallel + default: parallel + readOnly: true + parallel: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + maxItems: 100 + description: The steps to run in parallel. Max concurrency will depend on the platform. + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - parallel + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ParallelStepUpdateItem: + type: object + required: + - parallel + properties: + parallel: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + maxItems: 100 + description: The steps to run in parallel. Max concurrency will depend on the platform. + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.PatchTaskRequest: + type: object + properties: + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStepUpdateItem' + - $ref: '#/components/schemas/Tasks.SwitchStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ForeachStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ParallelStepUpdateItem' + - type: object + required: + - over + - map + properties: + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStepUpdateItem' + - $ref: '#/components/schemas/Tasks.SwitchStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ForeachStepUpdateItem' + - $ref: '#/components/schemas/Tasks.ParallelStepUpdateItem' + - type: object + required: + - over + - map + properties: + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStepUpdateItem' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + description: Payload for patching a task + Tasks.PromptStep: + type: object + required: + - kind_ + - prompt + - tools + - forward_tool_results + properties: + kind_: + type: string + enum: + - prompt + default: prompt + readOnly: true + prompt: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + $ref: '#/components/schemas/Common.JinjaTemplate' + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + description: The prompt to run + tools: + anyOf: + - type: string + enum: + - all + - type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.ToolRef' + - $ref: '#/components/schemas/Tools.CreateToolRequest' + description: The tools to use for the prompt + default: [] + tool_choice: + anyOf: + - type: string + enum: + - auto + - none + - $ref: '#/components/schemas/Tools.NamedToolChoice' + description: The tool choice for the prompt + settings: + allOf: + - $ref: '#/components/schemas/Chat.ChatSettings' + description: Settings for the prompt + unwrap: + type: boolean + description: Whether to unwrap the output of the prompt step, equivalent to `response.choices[0].message.content` + default: false + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be used as the model's input. + If a tool call is not made, the model's output will be used as the next step's input. + default: null + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - prompt + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.PromptStepUpdateItem: + type: object + required: + - prompt + - tools + - forward_tool_results + properties: + prompt: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/Entries.ChatMLRole' + description: The role of the message + content: + anyOf: + - $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + $ref: '#/components/schemas/Common.JinjaTemplate' + - type: array + items: + anyOf: + - type: object + required: + - text + - type + properties: + text: + $ref: '#/components/schemas/Common.JinjaTemplate' + type: + type: string + enum: + - text + description: The type (fixed to 'text') + default: text + - type: object + required: + - image_url + - type + properties: + image_url: + type: object + required: + - url + - detail + properties: + url: + type: string + description: Image URL or base64 data url (e.g. `data:image/jpeg;base64,`) + detail: + allOf: + - $ref: '#/components/schemas/Entries.ImageDetail' + description: The detail level of the image + default: auto + description: The image URL + type: + type: string + enum: + - image_url + description: The type (fixed to 'image_url') + default: image_url + description: The content parts of the message + name: + type: string + description: Name + continue: + type: boolean + description: Whether to continue this message or return a new one + description: The prompt to run + tools: + anyOf: + - type: string + enum: + - all + - type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.ToolRefUpdateItem' + - $ref: '#/components/schemas/Tools.CreateToolRequest' + description: The tools to use for the prompt + default: [] + tool_choice: + anyOf: + - type: string + enum: + - auto + - none + - $ref: '#/components/schemas/Tools.NamedToolChoice' + description: The tool choice for the prompt + settings: + allOf: + - $ref: '#/components/schemas/Chat.ChatSettings' + description: Settings for the prompt + unwrap: + type: boolean + description: Whether to unwrap the output of the prompt step, equivalent to `response.choices[0].message.content` + default: false + forward_tool_results: + type: boolean + nullable: true + description: |- + Whether to forward the tool results to the model when available. + "true" => always forward + "false" => never forward + null => forward if applicable (default) + + If a tool call is made, the tool's output will be used as the model's input. + If a tool call is not made, the model's output will be used as the next step's input. + default: null + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ReturnStep: + type: object + required: + - kind_ + - return + properties: + kind_: + type: string + enum: + - return + default: return + readOnly: true + return: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: The value to return + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - return + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SearchStep: + type: object + required: + - kind_ + - search + properties: + kind_: + type: string + enum: + - search + default: search + readOnly: true + search: + anyOf: + - $ref: '#/components/schemas/Docs.VectorDocSearchRequest' + - $ref: '#/components/schemas/Docs.TextOnlyDocSearchRequest' + - $ref: '#/components/schemas/Docs.HybridDocSearchRequest' + description: The search query + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - search + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SetStep: + type: object + required: + - kind_ + - set + properties: + kind_: + type: string + enum: + - set + default: set + readOnly: true + set: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: The value to set + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - set + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SleepFor: + type: object + required: + - seconds + - minutes + - hours + - days + properties: + seconds: + type: integer + format: uint16 + minimum: 0 + maximum: 60 + description: The number of seconds to sleep for + default: 0 + minutes: + type: integer + format: uint16 + minimum: 0 + maximum: 60 + description: The number of minutes to sleep for + default: 0 + hours: + type: integer + format: uint16 + minimum: 0 + maximum: 24 + description: The number of hours to sleep for + default: 0 + days: + type: integer + format: uint16 + minimum: 0 + maximum: 30 + description: The number of days to sleep for + default: 0 + Tasks.SleepStep: + type: object + required: + - kind_ + - sleep + properties: + kind_: + type: string + enum: + - sleep + default: sleep + readOnly: true + sleep: + allOf: + - $ref: '#/components/schemas/Tasks.SleepFor' + description: The duration to sleep for (max 31 days) + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - sleep + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SwitchStep: + type: object + required: + - kind_ + - switch + properties: + kind_: + type: string + enum: + - switch + default: switch + readOnly: true + switch: + type: array + items: + $ref: '#/components/schemas/Tasks.CaseThen' + minItems: 1 + description: The cond tree + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - switch + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.SwitchStepUpdateItem: + type: object + required: + - switch + properties: + switch: + type: array + items: + $ref: '#/components/schemas/Tasks.CaseThenUpdateItem' + minItems: 1 + description: The cond tree + allOf: + - type: object + properties: + kind_: + type: string + description: Discriminator property for BaseWorkflowStep. + discriminator: + propertyName: kind_ + mapping: {} + Tasks.Task: + type: object + required: + - name + - description + - main + - input_schema + - tools + - inherit_tools + - id + - created_at + - updated_at + properties: + name: + type: string + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + description: Object describing a Task + Tasks.TaskTool: + type: object + properties: + inherited: + type: boolean + description: 'Read-only: Whether the tool was inherited or not. Only applies within tasks.' + default: false + readOnly: true + allOf: + - $ref: '#/components/schemas/Tools.CreateToolRequest' + Tasks.ToolCallStep: + type: object + required: + - kind_ + - tool + - arguments + properties: + kind_: + type: string + enum: + - tool_call + default: tool_call + readOnly: true + tool: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: The tool to run + arguments: + anyOf: + - type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/Common.PyExpression' + - type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The input parameters for the tool (defaults to last step output) + default: _ + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - tool_call + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.ToolRef: + type: object + required: + - ref + properties: + ref: + anyOf: + - $ref: '#/components/schemas/Tasks.ToolRefById' + - $ref: '#/components/schemas/Tasks.ToolRefByName' + description: Reference to a tool + Tasks.ToolRefById: + type: object + properties: + id: + $ref: '#/components/schemas/Common.uuid' + description: Reference to a tool by id + Tasks.ToolRefByName: + type: object + properties: + name: + $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Reference to a tool by name + Tasks.ToolRefUpdateItem: + type: object + description: Reference to a tool + Tasks.UpdateTaskRequest: + type: object + required: + - description + - main + - input_schema + - tools + - inherit_tools + properties: + description: + type: string + default: '' + main: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + minItems: 1 + description: The entrypoint of the task. + input_schema: + type: object + additionalProperties: {} + nullable: true + description: The schema for the input to the task. `null` means all inputs are valid. + default: null + tools: + type: array + items: + $ref: '#/components/schemas/Tasks.TaskTool' + description: Tools defined specifically for this task not included in the Agent itself. + default: [] + inherit_tools: + type: boolean + description: Whether to inherit tools from the parent agent or not. Defaults to true. + default: true + metadata: + type: object + additionalProperties: {} + additionalProperties: + type: array + items: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.ReturnStep' + - $ref: '#/components/schemas/Tasks.SleepStep' + - $ref: '#/components/schemas/Tasks.ErrorWorkflowStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + - $ref: '#/components/schemas/Tasks.WaitForInputStep' + - $ref: '#/components/schemas/Tasks.IfElseWorkflowStep' + - $ref: '#/components/schemas/Tasks.SwitchStep' + - $ref: '#/components/schemas/Tasks.ForeachStep' + - $ref: '#/components/schemas/Tasks.ParallelStep' + - type: object + required: + - kind_ + - over + - map + properties: + kind_: + type: string + enum: + - map_reduce + default: map_reduce + readOnly: true + over: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: The variable to iterate over + map: + anyOf: + - $ref: '#/components/schemas/Tasks.EvaluateStep' + - $ref: '#/components/schemas/Tasks.ToolCallStep' + - $ref: '#/components/schemas/Tasks.PromptStep' + - $ref: '#/components/schemas/Tasks.GetStep' + - $ref: '#/components/schemas/Tasks.SetStep' + - $ref: '#/components/schemas/Tasks.LogStep' + - $ref: '#/components/schemas/Tasks.EmbedStep' + - $ref: '#/components/schemas/Tasks.SearchStep' + - $ref: '#/components/schemas/Tasks.YieldStep' + description: The steps to run for each iteration + reduce: + allOf: + - $ref: '#/components/schemas/Common.PyExpression' + description: |- + The expression to reduce the results. + If not provided, the results are collected and returned as a list. + A special parameter named `results` is the accumulator and `_` is the current value. + initial: + description: The initial value of the reduce expression + default: [] + parallelism: + type: integer + format: uint16 + minimum: 1 + maximum: 100 + description: Whether to run the reduce expression in parallel and how many items to run in each batch + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - map_reduce + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + description: Payload for updating a task + Tasks.WaitForInputInfo: + type: object + required: + - info + properties: + info: + type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + description: Any additional info or data + Tasks.WaitForInputStep: + type: object + required: + - kind_ + - wait_for_input + properties: + kind_: + type: string + enum: + - wait_for_input + default: wait_for_input + readOnly: true + wait_for_input: + allOf: + - $ref: '#/components/schemas/Tasks.WaitForInputInfo' + description: Any additional info or data + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - wait_for_input + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tasks.YieldStep: + type: object + required: + - kind_ + - workflow + - arguments + properties: + kind_: + type: string + enum: + - yield + default: yield + readOnly: true + workflow: + type: string + description: |- + The subworkflow to run. + VALIDATION: Should resolve to a defined subworkflow. + arguments: + anyOf: + - type: object + additionalProperties: + $ref: '#/components/schemas/Common.PyExpression' + - type: string + enum: + - _ + description: The input parameters for the subworkflow (defaults to last step output) + default: _ + allOf: + - type: object + required: + - kind_ + properties: + kind_: + type: string + enum: + - yield + description: The kind of step + readOnly: true + discriminator: + propertyName: kind_ + mapping: {} + Tools.ApiCallDef: + type: object + required: + - method + - url + properties: + method: + type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - HEAD + - OPTIONS + - CONNECT + - TRACE + description: The HTTP method to use + url: + type: string + format: uri + description: The URL to call + headers: + type: object + additionalProperties: + type: string + description: The headers to send with the request + content: + type: string + description: The content as base64 to send with the request + data: + type: object + additionalProperties: {} + description: The data to send as form data + json: + type: object + additionalProperties: {} + description: JSON body to send with the request + cookies: + type: object + additionalProperties: + type: string + description: Cookies + params: + anyOf: + - type: string + - type: object + additionalProperties: {} + description: The parameters to send with the request + follow_redirects: + type: boolean + description: Follow redirects + timeout: + type: integer + format: uint8 + description: The timeout for the request + description: API call definition + Tools.ApiCallDefUpdate: + type: object + properties: + method: + type: string + enum: + - GET + - POST + - PUT + - DELETE + - PATCH + - HEAD + - OPTIONS + - CONNECT + - TRACE + description: The HTTP method to use + url: + type: string + format: uri + description: The URL to call + headers: + type: object + additionalProperties: + type: string + description: The headers to send with the request + content: + type: string + description: The content as base64 to send with the request + data: + type: object + additionalProperties: {} + description: The data to send as form data + json: + type: object + additionalProperties: {} + description: JSON body to send with the request + cookies: + type: object + additionalProperties: + type: string + description: Cookies + params: + anyOf: + - type: string + - type: object + additionalProperties: {} + description: The parameters to send with the request + follow_redirects: + type: boolean + description: Follow redirects + timeout: + type: integer + format: uint8 + description: The timeout for the request + description: API call definition + Tools.ChosenFunctionCall: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionCallOption' + description: The function to call + allOf: + - $ref: '#/components/schemas/Tools.ChosenToolCall' + Tools.ChosenToolCall: + type: object + required: + - type + - id + properties: + type: + allOf: + - $ref: '#/components/schemas/Tools.ToolType' + description: Whether this tool is a `function`, `api_call`, `system` etc. (Only `function` tool supported right now) + function: + $ref: '#/components/schemas/Tools.FunctionCallOption' + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + discriminator: + propertyName: type + mapping: + function: '#/components/schemas/Tools.ChosenFunctionCall' + description: The response tool value generated by the model + Tools.CreateToolRequest: + type: object + required: + - name + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDef' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDef' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDef' + description: The API call to make + description: Payload for creating a tool + Tools.FunctionCallOption: + type: object + required: + - name + properties: + name: + type: string + description: The name of the function + Tools.FunctionDef: + type: object + properties: + name: + nullable: true + description: 'DO NOT USE: This will be overriden by the tool name. Here only for compatibility reasons.' + default: null + description: + nullable: true + description: 'DO NOT USE: This will be overriden by the tool description. Here only for compatibility reasons.' + default: null + parameters: + type: object + additionalProperties: {} + description: The parameters the function accepts + description: Function definition + Tools.IntegrationDef: + type: object + required: + - provider + properties: + provider: + anyOf: + - type: string + enum: + - dummy + - hacker_news + - weather + - wikipedia + - spider + - brave + - browserbase + - type: string + description: The provider of the integration + method: + type: string + description: The specific method of the integration to call + setup: + type: object + additionalProperties: {} + description: The setup parameters the integration accepts + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the integration call + description: Integration definition + Tools.IntegrationDefUpdate: + type: object + properties: + provider: + anyOf: + - type: string + enum: + - dummy + - hacker_news + - weather + - wikipedia + - spider + - brave + - browserbase + - type: string + description: The provider of the integration + method: + type: string + description: The specific method of the integration to call + setup: + type: object + additionalProperties: {} + description: The setup parameters the integration accepts + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the integration call + description: Integration definition + Tools.NamedToolChoice: + type: object + properties: + function: + $ref: '#/components/schemas/Tools.FunctionCallOption' + Tools.PatchToolRequest: + type: object + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDefUpdate' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDefUpdate' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDefUpdate' + description: The API call to make + description: Payload for patching a tool + Tools.SystemDef: + type: object + required: + - resource + - operation + properties: + resource: + type: string + enum: + - agent + - user + - task + - execution + - doc + - session + - job + description: Resource is the name of the resource to use + operation: + type: string + enum: + - create + - update + - patch + - create_or_update + - embed + - change_status + - search + - chat + - history + - delete + - get + - list + description: Operation is the name of the operation to perform + resource_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Resource id (if applicable) + subresource: + type: string + enum: + - tool + - doc + - execution + - transition + description: Sub-resource type (if applicable) + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the system call + description: System definition + Tools.SystemDefUpdate: + type: object + properties: + resource: + type: string + enum: + - agent + - user + - task + - execution + - doc + - session + - job + description: Resource is the name of the resource to use + operation: + type: string + enum: + - create + - update + - patch + - create_or_update + - embed + - change_status + - search + - chat + - history + - delete + - get + - list + description: Operation is the name of the operation to perform + resource_id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + description: Resource id (if applicable) + subresource: + type: string + enum: + - tool + - doc + - execution + - transition + description: Sub-resource type (if applicable) + arguments: + type: object + additionalProperties: {} + description: The arguments to pre-apply to the system call + description: System definition + Tools.Tool: + type: object + required: + - name + - created_at + - updated_at + - id + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDef' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDef' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDef' + description: The API call to make + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + Tools.ToolResponse: + type: object + required: + - id + - output + properties: + id: + $ref: '#/components/schemas/Common.uuid' + output: + type: object + additionalProperties: {} + description: The output of the tool + Tools.ToolType: + type: string + enum: + - function + - integration + - system + - api_call + Tools.UpdateToolRequest: + type: object + required: + - name + properties: + name: + allOf: + - $ref: '#/components/schemas/Common.validPythonIdentifier' + description: Name of the tool (must be unique for this agent and a valid python identifier string ) + description: + type: string + description: Description of the tool + function: + allOf: + - $ref: '#/components/schemas/Tools.FunctionDef' + description: The function to call + integration: + allOf: + - $ref: '#/components/schemas/Tools.IntegrationDef' + description: The integration to call + system: + allOf: + - $ref: '#/components/schemas/Tools.SystemDef' + description: The system to call + api_call: + allOf: + - $ref: '#/components/schemas/Tools.ApiCallDef' + description: The API call to make + description: Payload for updating a tool + Users.CreateOrUpdateUserRequest: + type: object + required: + - id + properties: + id: + $ref: '#/components/schemas/Common.uuid' + allOf: + - $ref: '#/components/schemas/Users.CreateUserRequest' + Users.CreateUserRequest: + type: object + required: + - name + - about + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + description: Payload for creating a user (and associated documents) + Users.PatchUserRequest: + type: object + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + description: Payload for patching a user + Users.UpdateUserRequest: + type: object + required: + - name + - about + properties: + metadata: + type: object + additionalProperties: {} + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + description: Payload for updating a user + Users.User: + type: object + required: + - id + - created_at + - updated_at + - name + - about + properties: + id: + allOf: + - $ref: '#/components/schemas/Common.uuid' + readOnly: true + metadata: + type: object + additionalProperties: {} + created_at: + type: string + format: date-time + description: When this resource was created as UTC date-time + readOnly: true + updated_at: + type: string + format: date-time + description: When this resource was updated as UTC date-time + readOnly: true + name: + allOf: + - $ref: '#/components/schemas/Common.identifierSafeUnicode' + description: Name of the user + default: '' + about: + type: string + description: About the user + default: '' + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: Authorization + ApiKeyAuth_: + type: apiKey + in: header + name: X-Auth-Key +servers: + - url: https://{serverEnv}.julep.ai/api + description: The julep cloud service endpoint + variables: + serverEnv: + default: api-alpha + description: The environment to use + enum: + - api + - api-alpha diff --git a/typespec/versions.tsp b/typespec/versions.tsp index 590e07a59..4739bbdf2 100644 --- a/typespec/versions.tsp +++ b/typespec/versions.tsp @@ -2,4 +2,5 @@ namespace Versions; enum ApiVersions { v0_4: "0.4.0", + v1_0: "1.0.0", }