diff --git a/generated_types.json b/generated_types.json index d23c362f..3ab0c7a1 100644 --- a/generated_types.json +++ b/generated_types.json @@ -3722,6 +3722,237 @@ "title": "topic_map" } ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "simulation" + ] + }, + "config": { + "anyOf": [ + { + "type": "object", + "properties": { + "initiator": { + "type": "string", + "enum": [ + "agent", + "simulated_user" + ], + "default": "agent", + "description": "Who speaks first in the conversation" + }, + "timeout_seconds": { + "type": "integer", + "minimum": 15, + "maximum": 3600, + "default": 600, + "description": "Maximum conversation duration in seconds" + }, + "modality": { + "type": "string", + "enum": [ + "voice" + ], + "default": "voice" + }, + "agent": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "livekit" + ] + }, + "server_url": { + "type": "string", + "minLength": 1, + "description": "The WebSocket URL of the LiveKit project hosting the agent" + }, + "agent_name": { + "type": "string", + "minLength": 1, + "description": "The name of the LiveKit agent to dispatch" + } + }, + "required": [ + "type", + "server_url", + "agent_name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "phone" + ] + }, + "phone_number": { + "type": "string", + "pattern": "^\\+[1-9]\\d{7,14}$" + } + }, + "required": [ + "type", + "phone_number" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "sip" + ] + }, + "uri": { + "type": "string", + "pattern": "^sips?:[^\\s]+$" + } + }, + "required": [ + "type", + "uri" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "agent" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "initiator": { + "type": "string", + "enum": [ + "agent", + "simulated_user" + ], + "default": "agent", + "description": "Who speaks first in the conversation" + }, + "timeout_seconds": { + "type": "integer", + "minimum": 15, + "maximum": 3600, + "default": 600, + "description": "Maximum conversation duration in seconds" + }, + "modality": { + "type": "string", + "enum": [ + "text" + ] + }, + "agent": { + "oneOf": [ + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "livekit" + ] + }, + "server_url": { + "type": "string", + "minLength": 1, + "description": "The WebSocket URL of the LiveKit project hosting the agent" + }, + "agent_name": { + "type": "string", + "minLength": 1, + "description": "The name of the LiveKit agent to dispatch" + } + }, + "required": [ + "type", + "server_url", + "agent_name" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "acp" + ] + }, + "command": { + "type": "string", + "minLength": 1, + "description": "Executable for the ACP agent subprocess, communicating over stdio" + }, + "args": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "Arguments passed to the executable without shell interpretation" + }, + "cwd": { + "type": "string", + "pattern": "^(?:\\/|[A-Za-z]:[\\\\/]|\\\\\\\\)", + "description": "Absolute working directory for the ACP session on the execution host" + }, + "permissions": { + "type": "string", + "enum": [ + "deny" + ], + "default": "deny", + "description": "Deny ACP permission requests; this does not sandbox the subprocess" + } + }, + "required": [ + "type", + "command", + "cwd" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "modality", + "agent" + ], + "additionalProperties": false + } + ] + } + }, + "required": [ + "type", + "config" + ], + "additionalProperties": false, + "description": "A task function that runs a conversation between an agent and a simulated user.", + "title": "simulation" } ] }, @@ -3732,7 +3963,8 @@ "code", "global", "graph", - "topic_map" + "topic_map", + "simulation" ] }, "FunctionId": { diff --git a/py/src/braintrust/_generated_types.py b/py/src/braintrust/_generated_types.py index 2197fd94..494566dd 100644 --- a/py/src/braintrust/_generated_types.py +++ b/py/src/braintrust/_generated_types.py @@ -913,7 +913,100 @@ class FunctionDataFunctionData4(TypedDict): """ -FunctionFormat: TypeAlias = Literal['llm', 'code', 'global', 'graph', 'topic_map'] +class FunctionDataFunctionData5ConfigAgent(TypedDict): + type: Literal['livekit'] + server_url: str + """ + The WebSocket URL of the LiveKit project hosting the agent + """ + agent_name: str + """ + The name of the LiveKit agent to dispatch + """ + + +class FunctionDataFunctionData5ConfigAgent1(TypedDict): + type: Literal['phone'] + phone_number: str + + +class FunctionDataFunctionData5ConfigAgent2(TypedDict): + type: Literal['sip'] + uri: str + + +class FunctionDataFunctionData5Config(TypedDict): + initiator: NotRequired[Literal['agent', 'simulated_user'] | None] + """ + Who speaks first in the conversation + """ + timeout_seconds: NotRequired[int | None] + """ + Maximum conversation duration in seconds + """ + modality: NotRequired[Literal['voice'] | None] + agent: ( + FunctionDataFunctionData5ConfigAgent + | FunctionDataFunctionData5ConfigAgent1 + | FunctionDataFunctionData5ConfigAgent2 + ) + + +class FunctionDataFunctionData5Config1Agent(TypedDict): + type: Literal['livekit'] + server_url: str + """ + The WebSocket URL of the LiveKit project hosting the agent + """ + agent_name: str + """ + The name of the LiveKit agent to dispatch + """ + + +class FunctionDataFunctionData5Config1Agent1(TypedDict): + type: Literal['acp'] + command: str + """ + Executable for the ACP agent subprocess, communicating over stdio + """ + args: NotRequired[Sequence[str] | None] + """ + Arguments passed to the executable without shell interpretation + """ + cwd: str + """ + Absolute working directory for the ACP session on the execution host + """ + permissions: NotRequired[Literal['deny'] | None] + """ + Deny ACP permission requests; this does not sandbox the subprocess + """ + + +class FunctionDataFunctionData5Config1(TypedDict): + initiator: NotRequired[Literal['agent', 'simulated_user'] | None] + """ + Who speaks first in the conversation + """ + timeout_seconds: NotRequired[int | None] + """ + Maximum conversation duration in seconds + """ + modality: Literal['text'] + agent: ( + FunctionDataFunctionData5Config1Agent | FunctionDataFunctionData5Config1Agent1 + ) + + +class FunctionDataFunctionData5(TypedDict): + type: Literal['simulation'] + config: FunctionDataFunctionData5Config | FunctionDataFunctionData5Config1 + + +FunctionFormat: TypeAlias = Literal[ + 'llm', 'code', 'global', 'graph', 'topic_map', 'simulation' +] class FunctionIdFunctionId(TypedDict): @@ -4821,6 +4914,7 @@ class RunEval(TypedDict): | BatchedFacetData | FunctionDataFunctionData4 | TopicMapData + | FunctionDataFunctionData5 ) diff --git a/py/src/braintrust/generated_types.py b/py/src/braintrust/generated_types.py index 84db0a14..9203c116 100644 --- a/py/src/braintrust/generated_types.py +++ b/py/src/braintrust/generated_types.py @@ -1,4 +1,4 @@ -"""Auto-generated file (content hash 387034529ea006a9) -- do not modify""" +"""Auto-generated file (content hash 062c5cc3a447a7b7) -- do not modify""" from ._generated_types import ( Acl,