diff --git a/openapi/spec.json b/openapi/spec.json index 3c93e1e..750f8bc 100644 --- a/openapi/spec.json +++ b/openapi/spec.json @@ -74,11 +74,6 @@ "format": "uuid", "description": "User id" }, - "AgentIdParam": { - "type": "string", - "format": "uuid", - "description": "Agent id" - }, "ProjectAutomationIdParam": { "type": "string", "format": "uuid", @@ -177,10 +172,6 @@ "type": "string", "description": "Name of the group to search for" }, - "AgentName": { - "type": "string", - "description": "Name of the agent to search for" - }, "ProjectAutomationName": { "type": "string", "description": "Name of the project_automation to search for" @@ -396,8 +387,7 @@ "role", "org_member", "project_log", - "org_project", - "org_audit_logs" + "org_project" ], "description": "The object type that the ACL applies to" }, @@ -419,8 +409,7 @@ "role", "org_member", "project_log", - "org_project", - "org_audit_logs" + "org_project" ], "description": "The object type that the ACL applies to" }, @@ -466,8 +455,7 @@ "role", "org_member", "project_log", - "org_project", - "org_audit_logs" + "org_project" ], "description": "The object type that the ACL applies to" }, @@ -5084,121 +5072,6 @@ "id" ] }, - "Agent": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the agent" - }, - "project_id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the project that the agent belongs under" - }, - "user_id": { - "type": "string", - "format": "uuid" - }, - "created": { - "type": "string", - "nullable": true, - "format": "date-time", - "description": "Date of agent creation" - }, - "name": { - "type": "string", - "description": "Name of the agent. Within a project, agent names are unique" - }, - "slug": { - "type": "string", - "description": "Stable, URL-safe identifier for the agent, unique within its project." - }, - "kind": { - "type": "string", - "description": "Agent classification: 'custom' for customer-defined agents, 'loop' for built-in Loop agents." - }, - "description": { - "type": "string", - "nullable": true, - "description": "Textual description of the agent" - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "User-controlled metadata about the agent" - } - }, - "required": [ - "id", - "project_id", - "user_id", - "name", - "slug", - "kind" - ], - "description": "An agent is a project-scoped durable object that identifies an AI agent or service emitting spans" - }, - "CreateAgent": { - "type": "object", - "properties": { - "project_id": { - "type": "string", - "format": "uuid", - "description": "Unique identifier for the project that the agent belongs under" - }, - "name": { - "type": "string", - "description": "Name of the agent. Within a project, agent names are unique" - }, - "description": { - "type": "string", - "nullable": true, - "description": "Textual description of the agent" - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "User-controlled metadata about the agent" - } - }, - "required": [ - "project_id", - "name" - ], - "description": "An agent is a project-scoped durable object that identifies an AI agent or service emitting spans" - }, - "PatchAgent": { - "type": "object", - "properties": { - "name": { - "type": "string", - "nullable": true, - "description": "Name of the agent. Within a project, agent names are unique" - }, - "description": { - "type": "string", - "nullable": true, - "description": "Textual description of the agent" - }, - "metadata": { - "type": "object", - "nullable": true, - "additionalProperties": { - "nullable": true - }, - "description": "User-controlled metadata about the agent" - } - }, - "description": "An agent is a project-scoped durable object that identifies an AI agent or service emitting spans" - }, "AutomationStatus": { "type": "string", "enum": [ @@ -5589,77 +5462,6 @@ "topic_map_functions" ] }, - "TopicDigestAutomationConfig": { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "topic_digest" - ], - "description": "The type of automation." - }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "window_seconds": { - "type": "integer", - "minimum": 3600, - "maximum": 2592000, - "default": 86400, - "description": "How much recent history to include in each digest" - }, - "scheduled_time_minutes_utc": { - "type": "integer", - "minimum": 0, - "maximum": 1439, - "description": "Minutes after midnight UTC when the digest should be sent" - }, - "action": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "slack" - ], - "description": "The type of action to take" - }, - "workspace_id": { - "type": "string", - "description": "The Slack workspace ID to post to" - }, - "channel": { - "type": "string", - "description": "The Slack channel ID to post to" - }, - "message_template": { - "type": "string", - "description": "Custom message template for the alert" - } - }, - "required": [ - "type", - "workspace_id", - "channel" - ], - "description": "The Slack action to take when the digest is sent" - }, - "topic_map_function_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 10, - "description": "Optional topic map function IDs to include in the digest" - } - }, - "required": [ - "event_type", - "scheduled_time_minutes_utc", - "action" - ] - }, "ProjectAutomation": { "type": "object", "properties": { @@ -5940,67 +5742,6 @@ "credentials" ] }, - { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "async_query" - ], - "description": "The type of automation." - }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "created_by_user_id": { - "type": "string", - "format": "uuid", - "description": "The user who submitted the async query" - }, - "object_type": { - "type": "string", - "enum": [ - "project_logs", - "experiment", - "dataset", - "playground_logs" - ], - "description": "The source object type for the async query" - }, - "object_id": { - "type": "string", - "description": "The source object ID for the async query" - }, - "query": { - "type": "string", - "description": "The SQL query to execute asynchronously" - }, - "format": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The materialized result format" - }, - "batch_size": { - "type": "integer", - "nullable": true, - "minimum": 0, - "exclusiveMinimum": true, - "maximum": 100000, - "description": "The maximum number of result rows to write per async query batch" - } - }, - "required": [ - "event_type", - "created_by_user_id", - "object_type", - "object_id", - "query", - "format" - ] - }, { "type": "object", "properties": { @@ -6105,9 +5846,6 @@ }, { "$ref": "#/components/schemas/TopicAutomationConfig" - }, - { - "$ref": "#/components/schemas/TopicDigestAutomationConfig" } ], "description": "The configuration for the automation rule" @@ -6383,67 +6121,6 @@ "credentials" ] }, - { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "async_query" - ], - "description": "The type of automation." - }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "created_by_user_id": { - "type": "string", - "format": "uuid", - "description": "The user who submitted the async query" - }, - "object_type": { - "type": "string", - "enum": [ - "project_logs", - "experiment", - "dataset", - "playground_logs" - ], - "description": "The source object type for the async query" - }, - "object_id": { - "type": "string", - "description": "The source object ID for the async query" - }, - "query": { - "type": "string", - "description": "The SQL query to execute asynchronously" - }, - "format": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The materialized result format" - }, - "batch_size": { - "type": "integer", - "nullable": true, - "minimum": 0, - "exclusiveMinimum": true, - "maximum": 100000, - "description": "The maximum number of result rows to write per async query batch" - } - }, - "required": [ - "event_type", - "created_by_user_id", - "object_type", - "object_id", - "query", - "format" - ] - }, { "type": "object", "properties": { @@ -6548,9 +6225,6 @@ }, { "$ref": "#/components/schemas/TopicAutomationConfig" - }, - { - "$ref": "#/components/schemas/TopicDigestAutomationConfig" } ], "description": "The configuration for the automation rule" @@ -6827,90 +6501,29 @@ "event_type": { "type": "string", "enum": [ - "async_query" + "retention" ], "description": "The type of automation." }, - "status": { - "$ref": "#/components/schemas/AutomationStatus" - }, - "created_by_user_id": { - "type": "string", - "format": "uuid", - "description": "The user who submitted the async query" - }, "object_type": { - "type": "string", - "enum": [ - "project_logs", - "experiment", - "dataset", - "playground_logs" - ], - "description": "The source object type for the async query" - }, - "object_id": { - "type": "string", - "description": "The source object ID for the async query" - }, - "query": { - "type": "string", - "description": "The SQL query to execute asynchronously" - }, - "format": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The materialized result format" - }, - "batch_size": { - "type": "integer", - "nullable": true, - "minimum": 0, - "exclusiveMinimum": true, - "maximum": 100000, - "description": "The maximum number of result rows to write per async query batch" - } - }, - "required": [ - "event_type", - "created_by_user_id", - "object_type", - "object_id", - "query", - "format" - ] - }, - { - "type": "object", - "properties": { - "event_type": { - "type": "string", - "enum": [ - "retention" - ], - "description": "The type of automation." - }, - "object_type": { - "$ref": "#/components/schemas/RetentionObjectType" - }, - "retention_days": { - "type": "number", - "minimum": 0, - "description": "The number of days to retain the object" - } - }, - "required": [ - "event_type", - "object_type", - "retention_days" - ] - }, - { - "type": "object", - "properties": { - "event_type": { + "$ref": "#/components/schemas/RetentionObjectType" + }, + "retention_days": { + "type": "number", + "minimum": 0, + "description": "The number of days to retain the object" + } + }, + "required": [ + "event_type", + "object_type", + "retention_days" + ] + }, + { + "type": "object", + "properties": { + "event_type": { "type": "string", "enum": [ "environment_update" @@ -6987,9 +6600,6 @@ { "$ref": "#/components/schemas/TopicAutomationConfig" }, - { - "$ref": "#/components/schemas/TopicDigestAutomationConfig" - }, { "nullable": true } @@ -7158,7 +6768,7 @@ "type": "null" } ], - "description": "The scope at which to run the functions. Defaults to span-level execution." + "description": "The scope at which to run the functions. Defaults to span-level execution. Trace/group scope requires all functions to be facets." } }, "required": [ @@ -7166,48 +6776,6 @@ "scorers" ] }, - "ProjectScoreCondition": { - "type": "object", - "nullable": true, - "properties": { - "when": { - "type": "object", - "properties": { - "clauses": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "subspan_clauses": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "trace_clauses": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - } - } - }, - "behavior": { - "type": "string", - "enum": [ - "hidden" - ], - "default": "hidden" - } - }, - "required": [ - "when" - ] - }, "ProjectScoreConfig": { "type": "object", "nullable": true, @@ -7220,43 +6788,8 @@ "type": "string", "nullable": true }, - "visibility": { - "type": "object", - "nullable": true, - "properties": { - "users": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - }, - "groups": { - "type": "array", - "nullable": true, - "items": { - "type": "string" - } - } - } - }, "online": { "$ref": "#/components/schemas/OnlineScoreConfig" - }, - "condition": { - "$ref": "#/components/schemas/ProjectScoreCondition" - }, - "object_types": { - "type": "array", - "nullable": true, - "items": { - "type": "string", - "enum": [ - "project_logs", - "dataset", - "experiment" - ] - } } } }, @@ -8413,14 +7946,6 @@ "distance_threshold": { "type": "number", "description": "Maximum distance to nearest centroid. If exceeded, returns no_match." - }, - "btql_filter": { - "type": "string", - "description": "Per-topic-map BTQL filter that was applied when this version was generated. Absent on versions generated before this was recorded." - }, - "automation_btql_filter": { - "type": "string", - "description": "Automation-level BTQL filter that was applied when this version was generated. Absent on versions generated before this was recorded." } }, "required": [ @@ -11714,15 +11239,6 @@ "name": "user_id", "in": "path" }, - "AgentIdParam": { - "schema": { - "$ref": "#/components/schemas/AgentIdParam" - }, - "required": true, - "description": "Agent id", - "name": "agent_id", - "in": "path" - }, "ProjectAutomationIdParam": { "schema": { "$ref": "#/components/schemas/ProjectAutomationIdParam" @@ -11919,16 +11435,6 @@ "in": "query", "allowReserved": true }, - "AgentName": { - "schema": { - "$ref": "#/components/schemas/AgentName" - }, - "required": false, - "description": "Name of the agent to search for", - "name": "agent_name", - "in": "query", - "allowReserved": true - }, "ProjectAutomationName": { "schema": { "$ref": "#/components/schemas/ProjectAutomationName" @@ -21100,858 +20606,6 @@ } } }, - "/v1/agent": { - "post": { - "tags": [ - "Agents" - ], - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "operationId": "postAgent", - "description": "Create a new agent. If there is an existing agent with the same name as the one specified in the request, will return the existing agent unmodified", - "summary": "Create agent", - "requestBody": { - "description": "Any desired information about the new agent object", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAgent" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the new agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "put": { - "tags": [ - "Agents" - ], - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "operationId": "putAgent", - "description": "Create or replace agent. If there is an existing agent with the same name as the one specified in the request, will replace the existing agent with the provided fields", - "summary": "Create or replace agent", - "requestBody": { - "description": "Any desired information about the new agent object", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateAgent" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the new agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "get": { - "operationId": "getAgent", - "tags": [ - "Agents" - ], - "description": "List out all agents. The agents are sorted by creation date, with the most recently-created agents coming first", - "summary": "List agents", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AppLimitParam" - }, - { - "$ref": "#/components/parameters/StartingAfter" - }, - { - "$ref": "#/components/parameters/EndingBefore" - }, - { - "$ref": "#/components/parameters/Ids" - }, - { - "$ref": "#/components/parameters/AgentName" - }, - { - "$ref": "#/components/parameters/OrgName" - } - ], - "responses": { - "200": { - "description": "Returns a list of agent objects", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "objects": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Agent" - }, - "description": "A list of agent objects" - } - }, - "required": [ - "objects" - ], - "additionalProperties": false - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "options": { - "operationId": "optionsAgent", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/agent`)", - "security": [], - "tags": [ - "CORS" - ], - "responses": { - "200": { - "description": "Response for CORS method", - "headers": { - "Access-Control-Allow-Credentials": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Headers": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Methods": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Origin": { - "schema": { - "type": "string" - } - }, - "Access-Control-Max-Age": { - "schema": { - "type": "string" - } - } - }, - "content": {} - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - } - }, - "/v1/agent/{agent_id}": { - "get": { - "operationId": "getAgentId", - "tags": [ - "Agents" - ], - "description": "Get a agent object by its id", - "summary": "Get agent", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AgentIdParam" - } - ], - "responses": { - "200": { - "description": "Returns the agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "patch": { - "operationId": "patchAgentId", - "tags": [ - "Agents" - ], - "description": "Partially update a agent object. Specify the fields to update in the payload. Any object-type fields will be deep-merged with existing content. Currently we do not support removing fields or setting them to null.", - "summary": "Partially update agent", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AgentIdParam" - } - ], - "requestBody": { - "description": "Fields to update", - "required": false, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PatchAgent" - } - } - } - }, - "responses": { - "200": { - "description": "Returns the agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "delete": { - "operationId": "deleteAgentId", - "tags": [ - "Agents" - ], - "description": "Delete a agent object by its id", - "summary": "Delete agent", - "security": [ - { - "bearerAuth": [] - }, - {} - ], - "parameters": [ - { - "$ref": "#/components/parameters/AgentIdParam" - } - ], - "responses": { - "200": { - "description": "Returns the deleted agent object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Agent" - } - } - } - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "401": { - "description": "No valid API key provided", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "403": { - "description": "The API key doesn’t have permissions to perform the request", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "429": { - "description": "Too many requests hit the API too quickly. We recommend an exponential backoff of your requests", - "headers": { - "Retry-After": { - "schema": { - "type": "string" - } - } - }, - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - }, - "500": { - "description": "Something went wrong on Braintrust's end. (These are rare.)", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - }, - "options": { - "operationId": "optionsAgentId", - "description": "Enable CORS", - "summary": "Enable CORS (`/v1/agent/{agent_id}`)", - "security": [], - "tags": [ - "CORS" - ], - "parameters": [ - { - "$ref": "#/components/parameters/AgentIdParam" - } - ], - "responses": { - "200": { - "description": "Response for CORS method", - "headers": { - "Access-Control-Allow-Credentials": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Headers": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Methods": { - "schema": { - "type": "string" - } - }, - "Access-Control-Allow-Origin": { - "schema": { - "type": "string" - } - }, - "Access-Control-Max-Age": { - "schema": { - "type": "string" - } - } - }, - "content": {} - }, - "400": { - "description": "The request was unacceptable, often due to missing a required parameter", - "content": { - "text/plain": { - "schema": { - "type": "string" - } - }, - "application/json": { - "schema": { - "nullable": true - } - } - } - } - } - } - }, "/v1/project_automation": { "post": { "tags": [ diff --git a/openapi/spec.yaml b/openapi/spec.yaml index b5ef197..6be9bdd 100644 --- a/openapi/spec.yaml +++ b/openapi/spec.yaml @@ -64,10 +64,6 @@ components: type: string format: uuid description: User id - AgentIdParam: - type: string - format: uuid - description: Agent id ProjectAutomationIdParam: type: string format: uuid @@ -145,9 +141,6 @@ components: GroupName: type: string description: Name of the group to search for - AgentName: - type: string - description: Name of the agent to search for ProjectAutomationName: type: string description: Name of the project_automation to search for @@ -391,7 +384,6 @@ components: - org_member - project_log - org_project - - org_audit_logs description: The object type that the ACL applies to AclObjectId: type: string @@ -411,7 +403,6 @@ components: - org_member - project_log - org_project - - org_audit_logs description: The object type that the ACL applies to AclListOrgObjectId: type: string @@ -459,7 +450,6 @@ components: - org_member - project_log - org_project - - org_audit_logs description: The object type that the ACL applies to AclListRoleId: type: string @@ -4586,98 +4576,6 @@ components: description: Date of user creation required: - id - Agent: - type: object - properties: - id: - type: string - format: uuid - description: Unique identifier for the agent - project_id: - type: string - format: uuid - description: Unique identifier for the project that the agent belongs under - user_id: - type: string - format: uuid - created: - type: string - nullable: true - format: date-time - description: Date of agent creation - name: - type: string - description: Name of the agent. Within a project, agent names are unique - slug: - type: string - description: Stable, URL-safe identifier for the agent, unique within its project. - kind: - type: string - description: "Agent classification: 'custom' for customer-defined agents, 'loop' - for built-in Loop agents." - description: - type: string - nullable: true - description: Textual description of the agent - metadata: - type: object - nullable: true - additionalProperties: - nullable: true - description: User-controlled metadata about the agent - required: - - id - - project_id - - user_id - - name - - slug - - kind - description: An agent is a project-scoped durable object that identifies an AI - agent or service emitting spans - CreateAgent: - type: object - properties: - project_id: - type: string - format: uuid - description: Unique identifier for the project that the agent belongs under - name: - type: string - description: Name of the agent. Within a project, agent names are unique - description: - type: string - nullable: true - description: Textual description of the agent - metadata: - type: object - nullable: true - additionalProperties: - nullable: true - description: User-controlled metadata about the agent - required: - - project_id - - name - description: An agent is a project-scoped durable object that identifies an AI - agent or service emitting spans - PatchAgent: - type: object - properties: - name: - type: string - nullable: true - description: Name of the agent. Within a project, agent names are unique - description: - type: string - nullable: true - description: Textual description of the agent - metadata: - type: object - nullable: true - additionalProperties: - nullable: true - description: User-controlled metadata about the agent - description: An agent is a project-scoped durable object that identifies an AI - agent or service emitting spans AutomationStatus: type: string enum: @@ -4936,59 +4834,6 @@ components: - sampling_rate - facet_functions - topic_map_functions - TopicDigestAutomationConfig: - type: object - properties: - event_type: - type: string - enum: - - topic_digest - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - window_seconds: - type: integer - minimum: 3600 - maximum: 2592000 - default: 86400 - description: How much recent history to include in each digest - scheduled_time_minutes_utc: - type: integer - minimum: 0 - maximum: 1439 - description: Minutes after midnight UTC when the digest should be sent - action: - type: object - properties: - type: - type: string - enum: - - slack - description: The type of action to take - workspace_id: - type: string - description: The Slack workspace ID to post to - channel: - type: string - description: The Slack channel ID to post to - message_template: - type: string - description: Custom message template for the alert - required: - - type - - workspace_id - - channel - description: The Slack action to take when the digest is sent - topic_map_function_ids: - type: array - items: - type: string - maxItems: 10 - description: Optional topic map function IDs to include in the digest - required: - - event_type - - scheduled_time_minutes_utc - - action ProjectAutomation: type: object properties: @@ -5183,52 +5028,6 @@ components: - format - interval_seconds - credentials - - type: object - properties: - event_type: - type: string - enum: - - async_query - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - created_by_user_id: - type: string - format: uuid - description: The user who submitted the async query - object_type: - type: string - enum: - - project_logs - - experiment - - dataset - - playground_logs - description: The source object type for the async query - object_id: - type: string - description: The source object ID for the async query - query: - type: string - description: The SQL query to execute asynchronously - format: - type: string - enum: - - jsonl - description: The materialized result format - batch_size: - type: integer - nullable: true - minimum: 0 - exclusiveMinimum: true - maximum: 100000 - description: The maximum number of result rows to write per async query batch - required: - - event_type - - created_by_user_id - - object_type - - object_id - - query - - format - type: object properties: event_type: @@ -5298,7 +5097,6 @@ components: - event_type - action - $ref: "#/components/schemas/TopicAutomationConfig" - - $ref: "#/components/schemas/TopicDigestAutomationConfig" description: The configuration for the automation rule required: - id @@ -5485,52 +5283,6 @@ components: - format - interval_seconds - credentials - - type: object - properties: - event_type: - type: string - enum: - - async_query - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - created_by_user_id: - type: string - format: uuid - description: The user who submitted the async query - object_type: - type: string - enum: - - project_logs - - experiment - - dataset - - playground_logs - description: The source object type for the async query - object_id: - type: string - description: The source object ID for the async query - query: - type: string - description: The SQL query to execute asynchronously - format: - type: string - enum: - - jsonl - description: The materialized result format - batch_size: - type: integer - nullable: true - minimum: 0 - exclusiveMinimum: true - maximum: 100000 - description: The maximum number of result rows to write per async query batch - required: - - event_type - - created_by_user_id - - object_type - - object_id - - query - - format - type: object properties: event_type: @@ -5600,7 +5352,6 @@ components: - event_type - action - $ref: "#/components/schemas/TopicAutomationConfig" - - $ref: "#/components/schemas/TopicDigestAutomationConfig" description: The configuration for the automation rule required: - project_id @@ -5782,52 +5533,6 @@ components: - format - interval_seconds - credentials - - type: object - properties: - event_type: - type: string - enum: - - async_query - description: The type of automation. - status: - $ref: "#/components/schemas/AutomationStatus" - created_by_user_id: - type: string - format: uuid - description: The user who submitted the async query - object_type: - type: string - enum: - - project_logs - - experiment - - dataset - - playground_logs - description: The source object type for the async query - object_id: - type: string - description: The source object ID for the async query - query: - type: string - description: The SQL query to execute asynchronously - format: - type: string - enum: - - jsonl - description: The materialized result format - batch_size: - type: integer - nullable: true - minimum: 0 - exclusiveMinimum: true - maximum: 100000 - description: The maximum number of result rows to write per async query batch - required: - - event_type - - created_by_user_id - - object_type - - object_id - - query - - format - type: object properties: event_type: @@ -5897,7 +5602,6 @@ components: - event_type - action - $ref: "#/components/schemas/TopicAutomationConfig" - - $ref: "#/components/schemas/TopicDigestAutomationConfig" - nullable: true description: The configuration for the automation rule ProjectScoreCategory: @@ -6006,39 +5710,10 @@ components: - $ref: "#/components/schemas/GroupScope" - type: "null" description: The scope at which to run the functions. Defaults to span-level - execution. + execution. Trace/group scope requires all functions to be facets. required: - sampling_rate - scorers - ProjectScoreCondition: - type: object - nullable: true - properties: - when: - type: object - properties: - clauses: - type: array - nullable: true - items: - type: string - subspan_clauses: - type: array - nullable: true - items: - type: string - trace_clauses: - type: array - nullable: true - items: - type: string - behavior: - type: string - enum: - - hidden - default: hidden - required: - - when ProjectScoreConfig: type: object nullable: true @@ -6049,33 +5724,8 @@ components: destination: type: string nullable: true - visibility: - type: object - nullable: true - properties: - users: - type: array - nullable: true - items: - type: string - groups: - type: array - nullable: true - items: - type: string online: $ref: "#/components/schemas/OnlineScoreConfig" - condition: - $ref: "#/components/schemas/ProjectScoreCondition" - object_types: - type: array - nullable: true - items: - type: string - enum: - - project_logs - - dataset - - experiment ProjectScore: type: object properties: @@ -6910,14 +6560,6 @@ components: distance_threshold: type: number description: Maximum distance to nearest centroid. If exceeded, returns no_match. - btql_filter: - type: string - description: Per-topic-map BTQL filter that was applied when this version was - generated. Absent on versions generated before this was recorded. - automation_btql_filter: - type: string - description: Automation-level BTQL filter that was applied when this version was - generated. Absent on versions generated before this was recorded. required: - type - source_facet @@ -9347,13 +8989,6 @@ components: description: User id name: user_id in: path - AgentIdParam: - schema: - $ref: "#/components/schemas/AgentIdParam" - required: true - description: Agent id - name: agent_id - in: path ProjectAutomationIdParam: schema: $ref: "#/components/schemas/ProjectAutomationIdParam" @@ -9508,14 +9143,6 @@ components: name: group_name in: query allowReserved: true - AgentName: - schema: - $ref: "#/components/schemas/AgentName" - required: false - description: Name of the agent to search for - name: agent_name - in: query - allowReserved: true ProjectAutomationName: schema: $ref: "#/components/schemas/ProjectAutomationName" @@ -15338,537 +14965,6 @@ paths: application/json: schema: nullable: true - /v1/agent: - post: - tags: - - Agents - security: - - bearerAuth: [] - - {} - operationId: postAgent - description: Create a new agent. If there is an existing agent with the same - name as the one specified in the request, will return the existing agent - unmodified - summary: Create agent - requestBody: - description: Any desired information about the new agent object - required: false - content: - application/json: - schema: - $ref: "#/components/schemas/CreateAgent" - responses: - "200": - description: Returns the new agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "429": - description: Too many requests hit the API too quickly. We recommend an - exponential backoff of your requests - headers: - Retry-After: - schema: - type: string - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - put: - tags: - - Agents - security: - - bearerAuth: [] - - {} - operationId: putAgent - description: Create or replace agent. If there is an existing agent with the - same name as the one specified in the request, will replace the existing - agent with the provided fields - summary: Create or replace agent - requestBody: - description: Any desired information about the new agent object - required: false - content: - application/json: - schema: - $ref: "#/components/schemas/CreateAgent" - responses: - "200": - description: Returns the new agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "429": - description: Too many requests hit the API too quickly. We recommend an - exponential backoff of your requests - headers: - Retry-After: - schema: - type: string - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - get: - operationId: getAgent - tags: - - Agents - description: List out all agents. The agents are sorted by creation date, with - the most recently-created agents coming first - summary: List agents - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AppLimitParam" - - $ref: "#/components/parameters/StartingAfter" - - $ref: "#/components/parameters/EndingBefore" - - $ref: "#/components/parameters/Ids" - - $ref: "#/components/parameters/AgentName" - - $ref: "#/components/parameters/OrgName" - responses: - "200": - description: Returns a list of agent objects - content: - application/json: - schema: - type: object - properties: - objects: - type: array - items: - $ref: "#/components/schemas/Agent" - description: A list of agent objects - required: - - objects - additionalProperties: false - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "429": - description: Too many requests hit the API too quickly. We recommend an - exponential backoff of your requests - headers: - Retry-After: - schema: - type: string - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - options: - operationId: optionsAgent - description: Enable CORS - summary: Enable CORS (`/v1/agent`) - security: [] - tags: - - CORS - responses: - "200": - description: Response for CORS method - headers: - Access-Control-Allow-Credentials: - schema: - type: string - Access-Control-Allow-Headers: - schema: - type: string - Access-Control-Allow-Methods: - schema: - type: string - Access-Control-Allow-Origin: - schema: - type: string - Access-Control-Max-Age: - schema: - type: string - content: {} - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - /v1/agent/{agent_id}: - get: - operationId: getAgentId - tags: - - Agents - description: Get a agent object by its id - summary: Get agent - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AgentIdParam" - responses: - "200": - description: Returns the agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "429": - description: Too many requests hit the API too quickly. We recommend an - exponential backoff of your requests - headers: - Retry-After: - schema: - type: string - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - patch: - operationId: patchAgentId - tags: - - Agents - description: Partially update a agent object. Specify the fields to update in - the payload. Any object-type fields will be deep-merged with existing - content. Currently we do not support removing fields or setting them to - null. - summary: Partially update agent - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AgentIdParam" - requestBody: - description: Fields to update - required: false - content: - application/json: - schema: - $ref: "#/components/schemas/PatchAgent" - responses: - "200": - description: Returns the agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "429": - description: Too many requests hit the API too quickly. We recommend an - exponential backoff of your requests - headers: - Retry-After: - schema: - type: string - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - delete: - operationId: deleteAgentId - tags: - - Agents - description: Delete a agent object by its id - summary: Delete agent - security: - - bearerAuth: [] - - {} - parameters: - - $ref: "#/components/parameters/AgentIdParam" - responses: - "200": - description: Returns the deleted agent object - content: - application/json: - schema: - $ref: "#/components/schemas/Agent" - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "401": - description: No valid API key provided - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "403": - description: The API key doesn’t have permissions to perform the request - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "429": - description: Too many requests hit the API too quickly. We recommend an - exponential backoff of your requests - headers: - Retry-After: - schema: - type: string - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - "500": - description: Something went wrong on Braintrust's end. (These are rare.) - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true - options: - operationId: optionsAgentId - description: Enable CORS - summary: Enable CORS (`/v1/agent/{agent_id}`) - security: [] - tags: - - CORS - parameters: - - $ref: "#/components/parameters/AgentIdParam" - responses: - "200": - description: Response for CORS method - headers: - Access-Control-Allow-Credentials: - schema: - type: string - Access-Control-Allow-Headers: - schema: - type: string - Access-Control-Allow-Methods: - schema: - type: string - Access-Control-Allow-Origin: - schema: - type: string - Access-Control-Max-Age: - schema: - type: string - content: {} - "400": - description: The request was unacceptable, often due to missing a required - parameter - content: - text/plain: - schema: - type: string - application/json: - schema: - nullable: true /v1/project_automation: post: tags: