From 7073900212768a56bab1c37b22306c5a0c06034d Mon Sep 17 00:00:00 2001 From: Paul Cayet Date: Thu, 30 Jul 2026 12:00:12 +0000 Subject: [PATCH 1/2] feat(pyagentspec): add code executor components --- .../source/_components/all_components.json | 10 + .../json_spec/agentspec_json_spec_26_3_0.json | 9619 +++++++++++++++++ .../agentspec/language_spec_nightly.rst | 74 +- docs/pyagentspec/source/api/codeexecutors.rst | 20 + docs/pyagentspec/source/changelog.rst | 11 + docs/pyagentspec/source/conf.py | 5 + pyagentspec/src/pyagentspec/__init__.py | 10 + .../src/pyagentspec/_component_registry.py | 10 + pyagentspec/src/pyagentspec/tools/__init__.py | 10 + .../src/pyagentspec/tools/codeexecutors.py | 71 + pyagentspec/src/pyagentspec/versioning.py | 5 +- pyagentspec/tests/test_codeexecutors.py | 187 + pyagentspec/tests/test_versioning.py | 8 +- 13 files changed, 10033 insertions(+), 7 deletions(-) create mode 100644 docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json create mode 100644 docs/pyagentspec/source/api/codeexecutors.rst create mode 100644 pyagentspec/src/pyagentspec/tools/codeexecutors.py create mode 100644 pyagentspec/tests/test_codeexecutors.py diff --git a/docs/pyagentspec/source/_components/all_components.json b/docs/pyagentspec/source/_components/all_components.json index a0ce07bd..24dfbbb9 100644 --- a/docs/pyagentspec/source/_components/all_components.json +++ b/docs/pyagentspec/source/_components/all_components.json @@ -207,6 +207,16 @@ } ] }, + { + "name": "Code Executors", + "path": "codeexecutors", + "classes": [ + {"path": "pyagentspec.tools.codeexecutors.CodeExecutor"}, + {"path": "pyagentspec.tools.codeexecutors.SubProcessCodeExecutor"}, + {"path": "pyagentspec.tools.codeexecutors.LocalContainerCodeExecutor"}, + {"path": "pyagentspec.tools.codeexecutors.EndpointCodeExecutor"} + ] + }, { "name": "IO Properties", "path": "ioproperties", diff --git a/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json b/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json new file mode 100644 index 00000000..a4b5db70 --- /dev/null +++ b/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json @@ -0,0 +1,9619 @@ +{ + "$defs": { + "A2AAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseA2AAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "A2AConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseA2AConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "A2ASessionParameters": { + "description": "Class to specify parameters of the A2A session.", + "properties": { + "timeout": { + "default": 60.0, + "title": "Timeout", + "type": "number" + }, + "poll_interval": { + "default": 2.0, + "title": "Poll Interval", + "type": "number" + }, + "max_retries": { + "default": 5, + "title": "Max Retries", + "type": "integer" + } + }, + "title": "A2ASessionParameters", + "type": "object" + }, + "Agent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "AgentNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgentNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "AgentSpecVersionEnum": { + "description": "An Enumeration for different versions of Agent Spec.", + "enum": [ + "25.4.1", + "25.4.2", + "26.1.0", + "26.1.2", + "26.2.0", + "26.3.0" + ], + "title": "AgentSpecVersionEnum", + "type": "string" + }, + "AgentSpecializationParameters": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgentSpecializationParameters" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "AgenticComponent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgenticComponent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ApiNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseApiNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "AuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "BranchingNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseBranchingNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "BuiltinTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseBuiltinTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "CatchExceptionNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseCatchExceptionNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ClientTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseClientTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ClientTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseClientTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "CodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ComponentWithIO": { + "anyOf": [ + { + "$ref": "#/$defs/BaseComponentWithIO" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ControlFlowEdge": { + "anyOf": [ + { + "$ref": "#/$defs/BaseControlFlowEdge" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ConversationSummarizationTransform": { + "anyOf": [ + { + "$ref": "#/$defs/BaseConversationSummarizationTransform" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "DataFlowEdge": { + "anyOf": [ + { + "$ref": "#/$defs/BaseDataFlowEdge" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "Datastore": { + "anyOf": [ + { + "$ref": "#/$defs/BaseDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "EndNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseEndNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "EndpointCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseEndpointCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "Flow": { + "anyOf": [ + { + "$ref": "#/$defs/BaseFlow" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "FlowNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseFlowNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "GeminiAIStudioAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiAIStudioAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "GeminiAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "GeminiConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "GeminiVertexAIAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiVertexAIAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "HandoffMode": { + "description": "Controls how agents in a Swarm may delegate work to one another.\n\nThis setting determines whether an agent is equipped with:\n\n * *send_message* \u2014 a tool for asking another agent to perform a sub-task and reply back.\n\n * *handoff_conversation* \u2014 a tool for transferring the full user\u2013agent conversation to another agent.\n\nDepending on the selected mode, agents have different capabilities for delegation and collaboration.", + "enum": [ + "always", + "never", + "optional" + ], + "title": "HandoffMode", + "type": "string" + }, + "InMemoryCollectionDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BaseInMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "InputMessageNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseInputMessageNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "LlmConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLlmConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "LlmGenerationConfig": { + "additionalProperties": true, + "description": "A configuration object defining LLM generation parameters.\n\nParameters include number of tokens, sampling parameters, etc.", + "properties": { + "max_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Max Tokens" + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Temperature" + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Top P" + } + }, + "title": "LlmGenerationConfig", + "type": "object" + }, + "LlmNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLlmNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "LocalContainerCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MCPTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMCPTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MCPToolBox": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMCPToolBox" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MCPToolSpec": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMCPToolSpec" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MTlsOracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ManagerWorkers": { + "anyOf": [ + { + "$ref": "#/$defs/BaseManagerWorkers" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MapNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMapNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MessageSummarizationTransform": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMessageSummarizationTransform" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "MessageTransform": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMessageTransform" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ModelProvider": { + "description": "Provider of the model. It is used to ensure the requests to this model respect\nthe format expected by the provider.", + "enum": [ + "COHERE", + "GROK", + "META", + "OTHER", + "XAI" + ], + "title": "ModelProvider", + "type": "string" + }, + "Node": { + "anyOf": [ + { + "$ref": "#/$defs/BaseNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OAuthClientConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOAuthClientConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OAuthEndpoints": { + "description": "Explicit OAuth endpoint configuration.\n\nUse this component when endpoint discovery is not available or not desired.\nThis groups the relevant endpoints required to execute OAuth authorization\ncode flows and token refresh.", + "properties": { + "authorization_endpoint": { + "title": "Authorization Endpoint", + "type": "string" + }, + "token_endpoint": { + "title": "Token Endpoint", + "type": "string" + }, + "refresh_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Refresh Endpoint" + }, + "revocation_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Revocation Endpoint" + }, + "userinfo_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Userinfo Endpoint" + } + }, + "required": [ + "authorization_endpoint", + "token_endpoint" + ], + "title": "OAuthEndpoints", + "type": "object" + }, + "OciAPIType": { + "description": "Enumeration of API Types.", + "enum": [ + "oci", + "openai_chat_completions", + "openai_responses" + ], + "title": "OciAPIType", + "type": "string" + }, + "OciAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OciClientConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OciClientConfigWithApiKey": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithApiKey" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OciClientConfigWithInstancePrincipal": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithInstancePrincipal" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OciClientConfigWithResourcePrincipal": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithResourcePrincipal" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OciClientConfigWithSecurityToken": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithSecurityToken" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OciGenAiConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciGenAiConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OllamaConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOllamaConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OpenAIAPIType": { + "description": "Enumeration of OpenAI API Types.\n\nchat completions: Chat Completions API\nresponses: Responses API", + "enum": [ + "chat_completions", + "responses" + ], + "title": "OpenAIAPIType", + "type": "string" + }, + "OpenAiCompatibleConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOpenAiCompatibleConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OpenAiConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOpenAiConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OracleDatabaseDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "OutputMessageNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOutputMessageNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "PKCEMethod": { + "enum": [ + "S256", + "plain" + ], + "title": "PKCEMethod", + "type": "string" + }, + "PKCEPolicy": { + "description": "Policy configuration for Proof Key for Code Exchange (PKCE).\n\nPKCE mitigates authorization code interception and injection attacks in\nauthorization code flows. Some protocols (such as MCP OAuth) require PKCE.", + "properties": { + "required": { + "default": true, + "title": "Required", + "type": "boolean" + }, + "method": { + "$ref": "#/$defs/PKCEMethod", + "default": "S256" + } + }, + "title": "PKCEPolicy", + "type": "object" + }, + "ParallelFlowNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseParallelFlowNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ParallelMapNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseParallelMapNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "PostgresDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BasePostgresDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "PostgresDatabaseDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BasePostgresDatabaseDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "Property": { + "description": "This object must be a valid JSON Schema", + "type": "object" + }, + "ReductionMethod": { + "description": "Enumerator for the types of reduction available in the MapNode.", + "enum": [ + "append", + "average", + "max", + "min", + "sum" + ], + "title": "ReductionMethod", + "type": "string" + }, + "RemoteAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseRemoteAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "RemoteTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseRemoteTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "RemoteTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseRemoteTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "RetryPolicy": { + "additionalProperties": false, + "properties": { + "max_attempts": { + "default": 2, + "minimum": 0, + "title": "Max Attempts", + "type": "integer" + }, + "request_timeout": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Request Timeout" + }, + "initial_retry_delay": { + "default": 1.0, + "minimum": 0, + "title": "Initial Retry Delay", + "type": "number" + }, + "max_retry_delay": { + "default": 8.0, + "minimum": 0, + "title": "Max Retry Delay", + "type": "number" + }, + "backoff_factor": { + "default": 2.0, + "exclusiveMinimum": 0, + "title": "Backoff Factor", + "type": "number" + }, + "jitter": { + "anyOf": [ + { + "enum": [ + "decorrelated", + "equal", + "full", + "full_and_equal_for_throttle" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "full_and_equal_for_throttle", + "title": "Jitter" + }, + "service_error_retry_on_any_5xx": { + "default": true, + "title": "Service Error Retry On Any 5Xx", + "type": "boolean" + }, + "recoverable_statuses": { + "additionalProperties": { + "items": { + "type": "string" + }, + "type": "array" + }, + "title": "Recoverable Statuses", + "type": "object" + } + }, + "title": "RetryPolicy", + "type": "object" + }, + "SSETransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSSETransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "SSEmTLSTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSSEmTLSTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ScopePolicy": { + "enum": [ + "fixed", + "use_challenge_or_supported" + ], + "title": "ScopePolicy", + "type": "string" + }, + "ServerTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseServerTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ServingMode": { + "description": "Serving mode to use for the GenAI service", + "enum": [ + "DEDICATED", + "ON_DEMAND" + ], + "title": "ServingMode", + "type": "string" + }, + "SessionParameters": { + "description": "Class to specify parameters of the MCP client session.", + "properties": { + "read_timeout_seconds": { + "default": 60.0, + "title": "Read Timeout Seconds", + "type": "number" + } + }, + "title": "SessionParameters", + "type": "object" + }, + "SpecializedAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSpecializedAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "StartNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStartNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "StdioTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStdioTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "StreamableHTTPTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStreamableHTTPTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "StreamableHTTPmTLSTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "SubProcessCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSubProcessCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "Swarm": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSwarm" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "TlsOracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "TlsPostgresDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseTlsPostgresDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "Tool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ToolBox": { + "anyOf": [ + { + "$ref": "#/$defs/BaseToolBox" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "ToolNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseToolNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "VllmConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseVllmConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, + "BaseA2AAgent": { + "additionalProperties": false, + "description": "Component which communicates with a remote server agent using the A2A Protocol.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "agent_url": { + "title": "Agent Url", + "type": "string" + }, + "connection_config": { + "$ref": "#/$defs/A2AConnectionConfig" + }, + "session_parameters": { + "$ref": "#/$defs/A2ASessionParameters", + "default": { + "timeout": 60.0, + "poll_interval": 2.0, + "max_retries": 5 + } + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "A2AAgent" + } + }, + "required": [ + "agent_url", + "connection_config", + "name" + ], + "title": "A2AAgent", + "type": "object", + "x-abstract-component": false + }, + "BaseA2AConnectionConfig": { + "additionalProperties": false, + "description": "Class to specify configuration settings for establishing a connection in A2A communication.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout": { + "default": 600.0, + "title": "Timeout", + "type": "number" + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "verify": { + "default": true, + "title": "Verify", + "type": "boolean" + }, + "key_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Key File" + }, + "cert_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cert File" + }, + "ssl_ca_cert": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Ssl Ca Cert" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "A2AConnectionConfig" + } + }, + "required": [ + "name" + ], + "title": "A2AConnectionConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseAgent": { + "additionalProperties": false, + "description": "An agent is a component that can do several rounds of conversation to solve a task.\n\nIt can be executed by itself, or be executed in a flow using an AgentNode.\n\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.property import Property\n>>> expertise_property=Property(\n... json_schema={\"title\": \"domain_of_expertise\", \"type\": \"string\"}\n... )\n>>> system_prompt = '''You are an expert in {{domain_of_expertise}}.\n... Please help the users with their requests.'''\n>>> agent = Agent(\n... name=\"Adaptive expert agent\",\n... system_prompt=system_prompt,\n... llm_config=llm_config,\n... inputs=[expertise_property],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "llm_config": { + "$ref": "#/$defs/LlmConfig" + }, + "system_prompt": { + "title": "System Prompt", + "type": "string" + }, + "tools": { + "items": { + "$ref": "#/$defs/Tool" + }, + "title": "Tools", + "type": "array" + }, + "toolboxes": { + "items": { + "$ref": "#/$defs/ToolBox" + }, + "title": "Toolboxes", + "type": "array" + }, + "human_in_the_loop": { + "default": true, + "title": "Human In The Loop", + "type": "boolean" + }, + "transforms": { + "items": { + "$ref": "#/$defs/MessageTransform" + }, + "title": "Transforms", + "type": "array" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "Agent" + } + }, + "required": [ + "llm_config", + "name", + "system_prompt" + ], + "title": "Agent", + "type": "object", + "x-abstract-component": false + }, + "BaseAgentNode": { + "additionalProperties": false, + "description": "The agent execution node is a node that will execute an agent as part of a flow.\n\nIf branches are configured, the agent will be prompted to select a branch before the agent node\ncompletes to transition to another node of the Flow.\n\n- **Inputs**\n Inferred from the definition of the agent to execute.\n- **Outputs**\n Inferred from the definition of the agent to execute.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.nodes import AgentNode, StartNode, EndNode\n>>> from pyagentspec.tools import ServerTool\n>>> query_property = Property(json_schema={\"title\": \"query\", \"type\": \"string\"})\n>>> search_results_property = Property(\n... json_schema={\"title\": \"search_results\", \"type\": \"array\", \"items\": {\"type\": \"string\"}}\n... )\n>>> search_tool = ServerTool(\n... name=\"search_tool\",\n... description=(\n... \"This tool runs a web search with the given query \"\n... \"and returns the most relevant results\"\n... ),\n... inputs=[query_property],\n... outputs=[search_results_property],\n... )\n>>> agent = Agent(\n... name=\"Search agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to gather the required information for the user: {{query}}\"\n... ),\n... tools=[search_tool],\n... outputs=[search_results_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[query_property])\n>>> end_node = EndNode(name=\"end\", outputs=[search_results_property])\n>>> agent_node = AgentNode(\n... name=\"Search agent node\",\n... agent=agent,\n... )\n>>> flow = Flow(\n... name=\"Search agent flow\",\n... start_node=start_node,\n... nodes=[start_node, agent_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_agent\", from_node=start_node, to_node=agent_node),\n... ControlFlowEdge(name=\"agent_to_end\", from_node=agent_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"query\",\n... destination_node=agent_node,\n... destination_input=\"query\",\n... ),\n... DataFlowEdge(\n... name=\"search_results_edge\",\n... source_node=agent_node,\n... source_output=\"search_results\",\n... destination_node=end_node,\n... destination_input=\"search_results\"\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "agent": { + "$ref": "#/$defs/AgenticComponent" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "AgentNode" + } + }, + "required": [ + "agent", + "name" + ], + "title": "AgentNode", + "type": "object", + "x-abstract-component": false + }, + "BaseAgentSpecializationParameters": { + "additionalProperties": false, + "description": "Parameters used to specialize an agent for a certain goal or task.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "additional_instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Additional Instructions" + }, + "additional_tools": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Tool" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Additional Tools" + }, + "human_in_the_loop": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Human In The Loop" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "AgentSpecializationParameters" + } + }, + "required": [ + "name" + ], + "title": "AgentSpecializationParameters", + "type": "object", + "x-abstract-component": false + }, + "BaseAgenticComponent": { + "anyOf": [ + { + "$ref": "#/$defs/A2AAgent" + }, + { + "$ref": "#/$defs/Agent" + }, + { + "$ref": "#/$defs/Flow" + }, + { + "$ref": "#/$defs/ManagerWorkers" + }, + { + "$ref": "#/$defs/OciAgent" + }, + { + "$ref": "#/$defs/RemoteAgent" + }, + { + "$ref": "#/$defs/SpecializedAgent" + }, + { + "$ref": "#/$defs/Swarm" + } + ], + "x-abstract-component": true + }, + "BaseApiNode": { + "additionalProperties": false, + "description": "Make an API call.\n\nThis node is intended to be a part of a Flow.\n\n- **Inputs**\n Inferred from the json spec retrieved from API Spec URI, if available and reachable.\n Otherwise, users have to manually specify them.\n- **Outputs**\n Inferred from the json spec retrieved from API Spec URI, if available and reachable.\n Otherwise, users should manually specify them.\n\n If None is given, ``pyagentspec`` infers a generic property of any type named ``response``.\n- **Branches**\n One, the default next.\n\n\nExamples\n--------\n>>> from pyagentspec.flows.nodes import ApiNode\n>>> from pyagentspec.property import Property\n>>> weather_result_property = Property(\n... json_schema={\n... \"title\": \"zurich_weather\",\n... \"type\": \"object\",\n... \"properties\": {\n... \"temperature\": {\n... \"type\": \"number\",\n... \"description\": \"Temperature in celsius degrees\",\n... },\n... \"weather\": {\"type\": \"string\"}\n... },\n... }\n... )\n>>> call_current_weather_step = ApiNode(\n... name=\"Weather API call node\",\n... url=\"https://example.com/weather\",\n... http_method = \"GET\",\n... query_params={\n... \"location\": \"zurich\",\n... },\n... outputs=[weather_result_property]\n... )\n>>>\n>>> item_id_property = Property(\n... json_schema={\"title\": \"item_id\", \"type\": \"string\"}\n... )\n>>> order_id_property = Property(\n... json_schema={\"title\": \"order_id\", \"type\": \"string\"}\n... )\n>>> store_id_property = Property(\n... json_schema={\"title\": \"store_id\", \"type\": \"string\"}\n... )\n>>> session_id_property = Property(\n... json_schema={\"title\": \"session_id\", \"type\": \"string\"}\n... )\n>>> create_order_step = ApiNode(\n... name=\"Orders api call node\",\n... url=\"https://example.com/orders/{{ order_id }}\",\n... http_method=\"POST\",\n... # sending an object which will automatically be transformed into JSON\n... data={\n... # define a static body parameter\n... \"topic_id\": 12345,\n... # define a templated body parameter.\n... # The value for {{ item_id }} will be taken from the IO system at runtime\n... \"item_id\": \"{{ item_id }}\",\n... },\n... query_params={\n... # provide one templated query parameter called \"store_id\"\n... # which will take its value from the IO system from key \"store_id\"\n... \"store_id\": \"{{ store_id }}\",\n... },\n... headers={\n... # set header session_id. the value is coming from the IO system\n... \"session_id\": \"{{ session_id }}\",\n... },\n... inputs=[item_id_property, order_id_property, store_id_property, session_id_property],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "url": { + "title": "Url", + "type": "string" + }, + "http_method": { + "title": "Http Method", + "type": "string" + }, + "api_spec_uri": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Spec Uri" + }, + "data": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "binary", + "type": "string" + }, + {} + ], + "title": "Data" + }, + "query_params": { + "additionalProperties": true, + "title": "Query Params", + "type": "object" + }, + "headers": { + "additionalProperties": true, + "title": "Headers", + "type": "object" + }, + "sensitive_headers": { + "additionalProperties": true, + "title": "Sensitive Headers", + "type": "object" + }, + "url_allow_list": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url Allow List" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ApiNode" + } + }, + "required": [ + "http_method", + "name", + "url" + ], + "title": "ApiNode", + "type": "object", + "x-abstract-component": false + }, + "BaseAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/OAuthConfig" + } + ], + "x-abstract-component": true + }, + "BaseBranchingNode": { + "additionalProperties": false, + "description": "Select the next node to transition to based on a mapping.\n\nThe input is used as key for the mapping. If the input does not correspond to any of the keys\nof the mapping the branch 'default' will be selected. This node is intended to be a part of a\nFlow.\n\n- **Inputs**\n The input value that should be used as key for the mapping.\n\n If None is given, ``pyagentspec`` infers a string property named ``branching_mapping_key``.\n- **Outputs**\n None.\n- **Branches**\n One for each value in the mapping, plus a branch called ``default``,\n which is the branch taken by the flow when mapping fails\n (i.e., the input does not match any key in the mapping).\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import AgentNode, BranchingNode, StartNode, EndNode\n>>> from pyagentspec.property import Property\n>>> CORRECT_PASSWORD_BRANCH = \"PASSWORD_OK\"\n>>> password_property = Property(\n... json_schema={\"title\": \"password\", \"type\": \"string\"}\n... )\n>>> agent = Agent(\n... name=\"User input agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to ask the password to the user. \"\n... \"Once you get it, submit it and end.\"\n... ),\n... outputs=[password_property],\n... )\n>>> start_node = StartNode(name=\"start\")\n>>> access_granted_end_node = EndNode(\n... name=\"access granted end\", branch_name=\"ACCESS_GRANTED\"\n... )\n>>> access_denied_end_node = EndNode(\n... name=\"access denied end\", branch_name=\"ACCESS_DENIED\"\n... )\n>>> branching_node = BranchingNode(\n... name=\"password check\",\n... mapping={\"123456\": CORRECT_PASSWORD_BRANCH},\n... inputs=[password_property]\n... )\n>>> agent_node = AgentNode(\n... name=\"User input agent node\",\n... agent=agent,\n... )\n>>> assistant = Flow(\n... name=\"Check access flow\",\n... start_node=start_node,\n... nodes=[\n... start_node,\n... agent_node,\n... branching_node,\n... access_granted_end_node,\n... access_denied_end_node\n... ],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_agent\",\n... from_node=start_node,\n... to_node=agent_node\n... ),\n... ControlFlowEdge(\n... name=\"agent_to_branching\",\n... from_node=agent_node,\n... to_node=branching_node\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_access_granted\",\n... from_node=branching_node,\n... from_branch=CORRECT_PASSWORD_BRANCH,\n... to_node=access_granted_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_access_denied\",\n... from_node=branching_node,\n... from_branch=BranchingNode.DEFAULT_BRANCH,\n... to_node=access_denied_end_node,\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"password_edge\",\n... source_node=agent_node,\n... source_output=\"password\",\n... destination_node=branching_node,\n... destination_input=\"password\",\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "mapping": { + "additionalProperties": { + "type": "string" + }, + "title": "Mapping", + "type": "object" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "BranchingNode" + } + }, + "required": [ + "mapping", + "name" + ], + "title": "BranchingNode", + "type": "object", + "x-abstract-component": false + }, + "BaseBuiltinTool": { + "additionalProperties": false, + "description": "A tool that is built into and executed by the orchestrator", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "tool_type": { + "title": "Tool Type", + "type": "string" + }, + "configuration": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Configuration" + }, + "executor_name": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Executor Name" + }, + "tool_version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tool Version" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "BuiltinTool" + } + }, + "required": [ + "name", + "tool_type" + ], + "title": "BuiltinTool", + "type": "object", + "x-abstract-component": false + }, + "BaseCatchExceptionNode": { + "additionalProperties": false, + "description": "Node to execute a Flow and catch exceptions.\n\n- If no exception is caught, the node will transition to the branches of its subflow.\n- If an exception is caught, it will transition to an exception branch.\n\nInputs\n------\nSame as the inputs from the ``subflow``.\n\nOutputs\n-------\n\n- The outputs of the ``subflow``.\n If an exception is raised, the default values of each output property are used.\n- An additional output named ``caught_exception_info`` with type ``string | null``\n and default value ``null``. Executors may populate it with a non-sensitive\n error description when an exception is caught.\n\nBranches\n--------\n\n- The branches of the ``subflow``\n- One additional branch named ``caught_exception_branch``\n\nSecurity Considerations\n-----------------------\n\nSee security considerations regarding exception catching in\nthe :ref:`Security Considerations `", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "subflow": { + "$ref": "#/$defs/Flow" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "CatchExceptionNode" + } + }, + "required": [ + "name", + "subflow" + ], + "title": "CatchExceptionNode", + "type": "object", + "x-abstract-component": false + }, + "BaseClientTool": { + "additionalProperties": false, + "description": "A tool that needs to be run by the client application.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ClientTool" + } + }, + "required": [ + "name" + ], + "title": "ClientTool", + "type": "object", + "x-abstract-component": false + }, + "BaseClientTransport": { + "anyOf": [ + { + "$ref": "#/$defs/RemoteTransport" + }, + { + "$ref": "#/$defs/SSETransport" + }, + { + "$ref": "#/$defs/SSEmTLSTransport" + }, + { + "$ref": "#/$defs/StdioTransport" + }, + { + "$ref": "#/$defs/StreamableHTTPTransport" + }, + { + "$ref": "#/$defs/StreamableHTTPmTLSTransport" + } + ], + "x-abstract-component": true + }, + "BaseCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/EndpointCodeExecutor" + }, + { + "$ref": "#/$defs/LocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/SubProcessCodeExecutor" + } + ], + "x-abstract-component": true + }, + "BaseComponentWithIO": { + "anyOf": [ + { + "$ref": "#/$defs/A2AAgent" + }, + { + "$ref": "#/$defs/Agent" + }, + { + "$ref": "#/$defs/AgentNode" + }, + { + "$ref": "#/$defs/AgentSpecializationParameters" + }, + { + "$ref": "#/$defs/AgenticComponent" + }, + { + "$ref": "#/$defs/ApiNode" + }, + { + "$ref": "#/$defs/BranchingNode" + }, + { + "$ref": "#/$defs/BuiltinTool" + }, + { + "$ref": "#/$defs/CatchExceptionNode" + }, + { + "$ref": "#/$defs/ClientTool" + }, + { + "$ref": "#/$defs/EndNode" + }, + { + "$ref": "#/$defs/Flow" + }, + { + "$ref": "#/$defs/FlowNode" + }, + { + "$ref": "#/$defs/InputMessageNode" + }, + { + "$ref": "#/$defs/LlmNode" + }, + { + "$ref": "#/$defs/MCPTool" + }, + { + "$ref": "#/$defs/MCPToolSpec" + }, + { + "$ref": "#/$defs/ManagerWorkers" + }, + { + "$ref": "#/$defs/MapNode" + }, + { + "$ref": "#/$defs/Node" + }, + { + "$ref": "#/$defs/OciAgent" + }, + { + "$ref": "#/$defs/OutputMessageNode" + }, + { + "$ref": "#/$defs/ParallelFlowNode" + }, + { + "$ref": "#/$defs/ParallelMapNode" + }, + { + "$ref": "#/$defs/RemoteAgent" + }, + { + "$ref": "#/$defs/RemoteTool" + }, + { + "$ref": "#/$defs/ServerTool" + }, + { + "$ref": "#/$defs/SpecializedAgent" + }, + { + "$ref": "#/$defs/StartNode" + }, + { + "$ref": "#/$defs/Swarm" + }, + { + "$ref": "#/$defs/Tool" + }, + { + "$ref": "#/$defs/ToolNode" + } + ], + "x-abstract-component": true + }, + "BaseControlFlowEdge": { + "additionalProperties": false, + "description": "A control flow edge specifies a possible transition from a node to another in a flow.\n\nA single node can have several potential next nodes, in which case several control flow edges\nshould be present in the control flow connections of that flow.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "from_node": { + "$ref": "#/$defs/Node" + }, + "from_branch": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "From Branch" + }, + "to_node": { + "$ref": "#/$defs/Node" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ControlFlowEdge" + } + }, + "required": [ + "from_node", + "name", + "to_node" + ], + "title": "ControlFlowEdge", + "type": "object", + "x-abstract-component": false + }, + "BaseConversationSummarizationTransform": { + "additionalProperties": false, + "description": "Summarizes conversations exceeding a configured size threshold using an LLM and caches\nconversation summaries in a ``Datastore``.\n\nThis is useful to reduce long conversation history into a concise context for downstream LLM calls.\n\nExamples\n--------\n>>> from pyagentspec.transforms import ConversationSummarizationTransform\n>>> summarization_transform = ConversationSummarizationTransform(\n... name=\"conversation-summarizer\",\n... llm=llm_config,\n... max_num_messages=30,\n... min_num_messages=10\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "llm": { + "$ref": "#/$defs/LlmConfig" + }, + "max_num_messages": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 50, + "title": "Max Num Messages" + }, + "max_num_characters": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Max Num Characters" + }, + "min_num_messages": { + "default": 10, + "exclusiveMinimum": 0, + "title": "Min Num Messages", + "type": "integer" + }, + "summarization_instructions": { + "default": "Please make a summary of this conversation. Include relevant information and keep it short. Your response will replace the messages, so just output the summary directly, no introduction needed.", + "title": "Summarization Instructions", + "type": "string" + }, + "summarized_conversation_template": { + "default": "Summarized conversation: {{summary}}", + "title": "Summarized Conversation Template", + "type": "string" + }, + "max_cache_size": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 10000, + "title": "Max Cache Size" + }, + "max_cache_lifetime": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 14400, + "title": "Max Cache Lifetime" + }, + "cache_collection_name": { + "default": "summarized_conversations_cache", + "title": "Cache Collection Name", + "type": "string" + }, + "datastore": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/InMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/OracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/PostgresDatabaseDatastore" + } + ], + "title": "Datastore" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ConversationSummarizationTransform" + } + }, + "required": [ + "llm", + "name" + ], + "title": "ConversationSummarizationTransform", + "type": "object", + "x-abstract-component": false + }, + "BaseDataFlowEdge": { + "additionalProperties": false, + "description": "A data flow edge specifies how the output of a node propagates as input of another node.\n\nAn outputs can be propagated as input of several nodes.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "source_node": { + "$ref": "#/$defs/Node" + }, + "source_output": { + "title": "Source Output", + "type": "string" + }, + "destination_node": { + "$ref": "#/$defs/Node" + }, + "destination_input": { + "title": "Destination Input", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "DataFlowEdge" + } + }, + "required": [ + "destination_input", + "destination_node", + "name", + "source_node", + "source_output" + ], + "title": "DataFlowEdge", + "type": "object", + "x-abstract-component": false + }, + "BaseDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/InMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/OracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/PostgresDatabaseDatastore" + } + ], + "x-abstract-component": true + }, + "BaseEndNode": { + "additionalProperties": false, + "description": "End nodes denote the end of the execution of a flow.\n\nThere might be several end nodes in a flow, in which case the executor of the flow\nshould be able to track which one was reached and pass that back to the caller.\n\n- **Inputs**\n The list of inputs of the step. If both input and output properties are specified they\n must be an exact match\n\n If None is given, ``pyagentspec`` copies the outputs provided, if any. Otherwise, no input is exposed.\n- **Outputs**\n The list of outputs that should be exposed by the flow. If both input and output properties\n are specified they must be an exact match\n\n If None is given, ``pyagentspec`` copies the inputs provided, if any. Otherwise, no output is exposed.\n- **Branches**\n None.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import AgentNode, BranchingNode, StartNode, EndNode\n>>> from pyagentspec.property import Property\n>>> languages_to_branch_name = {\n... \"english\": \"ENGLISH\",\n... \"spanish\": \"SPANISH\",\n... \"italian\": \"ITALIAN\",\n... }\n>>> language_property = Property(\n... json_schema={\"title\": \"language\", \"type\": \"string\"}\n... )\n>>> agent = Agent(\n... name=\"Language detector agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to understand the language spoken by the user.\"\n... \"Please output only the language in lowercase and submit.\"\n... ),\n... outputs=[language_property],\n... )\n>>> start_node = StartNode(name=\"start\")\n>>> english_end_node = EndNode(\n... name=\"english end\", branch_name=languages_to_branch_name[\"english\"]\n... )\n>>> spanish_end_node = EndNode(\n... name=\"spanish end\", branch_name=languages_to_branch_name[\"spanish\"]\n... )\n>>> italian_end_node = EndNode(\n... name=\"italian end\", branch_name=languages_to_branch_name[\"italian\"]\n... )\n>>> unknown_end_node = EndNode(name=\"unknown language end\", branch_name=\"unknown\")\n>>> branching_node = BranchingNode(\n... name=\"language check\",\n... mapping=languages_to_branch_name,\n... inputs=[language_property]\n... )\n>>> agent_node = AgentNode(\n... name=\"User input agent node\",\n... agent=agent,\n... )\n>>> assistant = Flow(\n... name=\"Check access flow\",\n... start_node=start_node,\n... nodes=[\n... start_node,\n... agent_node,\n... branching_node,\n... english_end_node,\n... spanish_end_node,\n... italian_end_node,\n... unknown_end_node,\n... ],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_agent\", from_node=start_node, to_node=agent_node\n... ),\n... ControlFlowEdge(\n... name=\"agent_to_branching\", from_node=agent_node, to_node=branching_node\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_english_end\",\n... from_node=branching_node,\n... from_branch=languages_to_branch_name[\"english\"],\n... to_node=english_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_spanish_end\",\n... from_node=branching_node,\n... from_branch=languages_to_branch_name[\"spanish\"],\n... to_node=spanish_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_italian_end\",\n... from_node=branching_node,\n... from_branch=languages_to_branch_name[\"italian\"],\n... to_node=italian_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_unknown_end\",\n... from_node=branching_node,\n... from_branch=BranchingNode.DEFAULT_BRANCH,\n... to_node=unknown_end_node,\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"language_edge\",\n... source_node=agent_node,\n... source_output=\"language\",\n... destination_node=branching_node,\n... destination_input=\"language\",\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "branch_name": { + "default": "next", + "title": "Branch Name", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "EndNode" + } + }, + "required": [ + "name" + ], + "title": "EndNode", + "type": "object", + "x-abstract-component": false + }, + "BaseEndpointCodeExecutor": { + "additionalProperties": false, + "description": "Code executor that sends execution requests to an endpoint.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout_seconds": { + "default": 30.0, + "exclusiveMinimum": 0, + "title": "Timeout Seconds", + "type": "number" + }, + "max_code_chars": { + "default": 50000, + "exclusiveMinimum": 0, + "title": "Max Code Chars", + "type": "integer" + }, + "url": { + "title": "Url", + "type": "string" + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "sensitive_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sensitive Headers" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "EndpointCodeExecutor" + } + }, + "required": [ + "name", + "url" + ], + "title": "EndpointCodeExecutor", + "type": "object", + "x-abstract-component": false + }, + "BaseFlow": { + "additionalProperties": false, + "description": "A flow is a component to model sequences of operations to do in a precised order.\n\nThe operations and sequence is defined by the nodes and transitions associated to the flow.\nSteps can be deterministic, or for some use LLMs.\n\nExample\n-------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import LlmNode, StartNode, EndNode\n>>> prompt_property = Property(\n... json_schema={\"title\": \"prompt\", \"type\": \"string\"}\n... )\n>>> llm_output_property = Property(\n... json_schema={\"title\": \"llm_output\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[prompt_property])\n>>> end_node = EndNode(name=\"end\", outputs=[llm_output_property])\n>>> llm_node = LlmNode(\n... name=\"simple llm node\",\n... llm_config=llm_config,\n... prompt_template=\"{{prompt}}\",\n... inputs=[prompt_property],\n... outputs=[llm_output_property],\n... )\n>>> flow = Flow(\n... name=\"Simple prompting flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"prompt_edge\",\n... source_node=start_node,\n... source_output=\"prompt\",\n... destination_node=llm_node,\n... destination_input=\"prompt\",\n... ),\n... DataFlowEdge(\n... name=\"llm_output_edge\",\n... source_node=llm_node,\n... source_output=\"llm_output\",\n... destination_node=end_node,\n... destination_input=\"llm_output\"\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "start_node": { + "$ref": "#/$defs/Node" + }, + "nodes": { + "items": { + "$ref": "#/$defs/Node" + }, + "title": "Nodes", + "type": "array" + }, + "control_flow_connections": { + "items": { + "$ref": "#/$defs/ControlFlowEdge" + }, + "title": "Control Flow Connections", + "type": "array" + }, + "data_flow_connections": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/DataFlowEdge" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Data Flow Connections" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "Flow" + } + }, + "required": [ + "control_flow_connections", + "name", + "nodes", + "start_node" + ], + "title": "Flow", + "type": "object", + "x-abstract-component": false + }, + "BaseFlowNode": { + "additionalProperties": false, + "description": "The flow node executes a subflow as part of a flow.\n\n- **Inputs**\n Inferred from the inner structure. It's the sets of inputs\n required by the StartNode of the inner flow.\n- **Outputs**\n Inferred from the inner structure. It's the union of the\n sets of outputs exposed by the EndNodes of the inner flow.\n- **Branches**\n Inferred from the inner flow, one per each different value of the attribute\n ``branch_name`` of the nodes of type EndNode in the inner flow.\n\nExample\n-------\nThe ``FlowNode`` is particularly suitable when subflows can be reused inside a project.\nLet's see an example with a flow that estimates numerical value\nusing the \"wisdowm of the crowd\" effect:\n\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import MapNode, LlmNode, ToolNode, StartNode, EndNode\n>>> from pyagentspec.tools import ServerTool\n>>> duplication_tool = ServerTool(\n... name=\"duplication_tool\",\n... description=\"\",\n... inputs=[\n... Property(\n... json_schema={\"title\": \"element\", \"description\": \"\", \"type\": \"string\"}\n... ),\n... Property(\n... json_schema={\"title\": \"n\", \"description\": \"\", \"type\": \"integer\"}\n... ),\n... ],\n... outputs=[\n... Property(\n... json_schema={\n... \"title\": \"flow_iterable_queries\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"string\"}\n... },\n... )\n... ],\n... )\n>>> reduce_tool = ServerTool(\n... name=\"reduce_tool\",\n... description=\"\",\n... inputs=[\n... Property(\n... json_schema={\"title\": \"elements\", \"type\": \"array\", \"items\": {\"type\": \"string\"}}\n... ),\n... ],\n... outputs=[Property(json_schema={\"title\": \"flow_processed_query\", \"type\": \"string\"})],\n... )\n>>> # Defining a simple prompt\n>>> REASONING_PROMPT_TEMPLATE = '''Provide your best numerical estimate for: {{user_input}}\n... Your answer should be a single number.\n... Do not include any units, reasoning, or extra text.'''\n>>> # Defining the subflow for the map step\n>>> user_input_property = Property(\n... json_schema={\"title\": \"user_input\", \"type\": \"string\"}\n... )\n>>> flow_processed_query_property = Property(\n... json_schema={\"title\": \"flow_processed_query\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[user_input_property])\n>>> end_node = EndNode(name=\"end\", outputs=[flow_processed_query_property])\n>>> llm_node = LlmNode(\n... name=\"reasoning llm node\",\n... llm_config=llm_config,\n... prompt_template=REASONING_PROMPT_TEMPLATE,\n... inputs=[user_input_property],\n... outputs=[flow_processed_query_property],\n... )\n>>> inner_map_flow = Flow(\n... name=\"Map flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"user_input\",\n... destination_node=llm_node,\n... destination_input=\"user_input\",\n... ),\n... DataFlowEdge(\n... name=\"search_results_edge\",\n... source_node=llm_node,\n... source_output=\"flow_processed_query\",\n... destination_node=end_node,\n... destination_input=\"flow_processed_query\"\n... ),\n... ],\n... )\n>>> user_query_property = Property(\n... json_schema={\"title\": \"user_query\", \"type\": \"string\"}\n... )\n>>> n_repeat_property = Property(\n... json_schema={\"title\": \"n_repeat\", \"type\": \"integer\"}\n... )\n>>> flow_iterable_queries_property = Property(\n... json_schema={\n... \"title\": \"iterated_user_input\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"string\"},\n... }\n... )\n>>> flow_processed_queries_property = Property(\n... json_schema={\n... \"title\": \"collected_flow_processed_query\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"string\"},\n... }\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[user_query_property, n_repeat_property])\n>>> end_node = EndNode(name=\"end\", outputs=[flow_processed_query_property])\n>>> duplication_node = ToolNode(\n... name=\"duplication_tool node\",\n... tool=duplication_tool,\n... )\n>>> reduce_node = ToolNode(\n... name=\"reduce_tool node\",\n... tool=reduce_tool,\n... )\n>>> map_node = MapNode(\n... name=\"map node\",\n... subflow=inner_map_flow,\n... inputs=[flow_iterable_queries_property],\n... outputs=[flow_processed_queries_property],\n... )\n>>> mapreduce_flow = Flow(\n... name=\"Map-reduce flow\",\n... start_node=start_node,\n... nodes=[start_node, duplication_node, map_node, reduce_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_duplication\", from_node=start_node, to_node=duplication_node\n... ),\n... ControlFlowEdge(\n... name=\"duplication_to_map\", from_node=duplication_node, to_node=map_node\n... ),\n... ControlFlowEdge(name=\"map_to_reduce\", from_node=map_node, to_node=reduce_node),\n... ControlFlowEdge(name=\"reduce_to_end\", from_node=reduce_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"user_query\",\n... destination_node=duplication_node,\n... destination_input=\"element\",\n... ),\n... DataFlowEdge(\n... name=\"n_repeat_edge\",\n... source_node=start_node,\n... source_output=\"n_repeat\",\n... destination_node=duplication_node,\n... destination_input=\"n\",\n... ),\n... DataFlowEdge(\n... name=\"flow_iterables_edge\",\n... source_node=duplication_node,\n... source_output=\"flow_iterable_queries\",\n... destination_node=map_node,\n... destination_input=\"iterated_user_input\",\n... ),\n... DataFlowEdge(\n... name=\"flow_processed_queries_edge\",\n... source_node=map_node,\n... source_output=\"collected_flow_processed_query\",\n... destination_node=reduce_node,\n... destination_input=\"elements\",\n... ),\n... DataFlowEdge(\n... name=\"flow_processed_query_edge\",\n... source_node=reduce_node,\n... source_output=\"flow_processed_query\",\n... destination_node=end_node,\n... destination_input=\"flow_processed_query\",\n... ),\n... ],\n... )\n\nOnce the subflow is created we can simply integrate it with the ``FlowNode``:\n\n>>> from pyagentspec.flows.nodes import FlowNode, AgentNode\n>>> from pyagentspec.agent import Agent\n>>> start_node = StartNode(name=\"start\")\n>>> end_node = EndNode(name=\"end\", outputs=[flow_processed_query_property])\n>>> flow_node = FlowNode(name=\"flow node\", subflow=mapreduce_flow)\n>>> agent = Agent(\n... name=\"User interaction agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to gather from the user the query and the number of times \"\n... \"it should be asked to an LLM. Once you have this information, submit and exit.\"\n... ),\n... outputs=[user_query_property, n_repeat_property],\n... )\n>>> agent_node = AgentNode(name=\"flow node\", agent=agent)\n>>> flow = Flow(\n... name=\"Map flow\",\n... start_node=start_node,\n... nodes=[start_node, agent_node, flow_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_agent\", from_node=start_node, to_node=agent_node),\n... ControlFlowEdge(name=\"agent_to_flow\", from_node=agent_node, to_node=flow_node),\n... ControlFlowEdge(name=\"flow_to_end\", from_node=flow_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=agent_node,\n... source_output=\"user_query\",\n... destination_node=flow_node,\n... destination_input=\"user_query\",\n... ),\n... DataFlowEdge(\n... name=\"n_rep_edge\",\n... source_node=agent_node,\n... source_output=\"n_repeat\",\n... destination_node=flow_node,\n... destination_input=\"n_repeat\"\n... ),\n... DataFlowEdge(\n... name=\"n_rep_edge\",\n... source_node=flow_node,\n... source_output=\"flow_processed_query\",\n... destination_node=end_node,\n... destination_input=\"flow_processed_query\"\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "subflow": { + "$ref": "#/$defs/Flow" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "FlowNode" + } + }, + "required": [ + "name", + "subflow" + ], + "title": "FlowNode", + "type": "object", + "x-abstract-component": false + }, + "BaseGeminiAIStudioAuthConfig": { + "additionalProperties": false, + "description": "Authentication settings for Gemini via Google AI Studio.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "GeminiAIStudioAuthConfig" + } + }, + "required": [ + "name" + ], + "title": "GeminiAIStudioAuthConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseGeminiAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/GeminiAIStudioAuthConfig" + }, + { + "$ref": "#/$defs/GeminiVertexAIAuthConfig" + } + ], + "x-abstract-component": true + }, + "BaseGeminiConfig": { + "additionalProperties": false, + "description": "Configure a connection to a Gemini LLM (AI Studio or Vertex AI).", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "const": "google", + "default": "google", + "title": "Provider", + "type": "string" + }, + "api_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Provider" + }, + "api_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Type" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "auth": { + "$ref": "#/$defs/GeminiAuthConfig" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "GeminiConfig" + } + }, + "required": [ + "auth", + "model_id", + "name" + ], + "title": "GeminiConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseGeminiVertexAIAuthConfig": { + "additionalProperties": false, + "description": "Authentication settings for Gemini via Google Vertex AI.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "project_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Project Id" + }, + "location": { + "default": "global", + "title": "Location", + "type": "string" + }, + "credentials": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Credentials" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "GeminiVertexAIAuthConfig" + } + }, + "required": [ + "name" + ], + "title": "GeminiVertexAIAuthConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseInMemoryCollectionDatastore": { + "additionalProperties": false, + "description": "In-memory datastore for testing and development purposes.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "datastore_schema": { + "additionalProperties": { + "$ref": "#/$defs/Property" + }, + "title": "Datastore Schema", + "type": "object" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "InMemoryCollectionDatastore" + } + }, + "required": [ + "datastore_schema", + "name" + ], + "title": "InMemoryCollectionDatastore", + "type": "object", + "x-abstract-component": false + }, + "BaseInputMessageNode": { + "additionalProperties": false, + "description": "This node interrupts the execution of the flow in order to wait for a user input, and restarts after receiving it.\nAn agent message, if given, is appended to the conversation before waiting for input.\nUser input is appended to the conversation as a user message, and it is returned as a string property from the node.\n\n- **Inputs**\n One per variable in the message\n- **Outputs**\n One string property that represents the content of the input user message.\n\n If None is given, ``pyagentspec`` infers a string property named ``user_input``.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import StartNode, EndNode, InputMessageNode, OutputMessageNode, LlmNode\n>>> from pyagentspec.property import StringProperty\n>>> start_node = StartNode(name=\"start\")\n>>> prompt_node = OutputMessageNode(name=\"ask_input\", message=\"What is the paragraph you want to rephrase?\")\n>>> input_node = InputMessageNode(name=\"user_input\", outputs=[StringProperty(title=\"user_input\")])\n>>> llm_node = LlmNode(\n... name=\"rephrase\",\n... llm_config=llm_config,\n... prompt_template=\"Rephrase {{user_input}}\",\n... outputs=[StringProperty(title=\"rephrased_user_input\")],\n... )\n>>> output_node = OutputMessageNode(name=\"ask_input\", message=\"{{rephrased_user_input}}\")\n>>> end_node = EndNode(name=\"end\")\n>>> flow = Flow(\n... name=\"rephrase_paragraph_flow\",\n... start_node=start_node,\n... nodes=[start_node, prompt_node, input_node, llm_node, output_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"ce1\", from_node=start_node, to_node=prompt_node),\n... ControlFlowEdge(name=\"ce2\", from_node=prompt_node, to_node=input_node),\n... ControlFlowEdge(name=\"ce3\", from_node=input_node, to_node=llm_node),\n... ControlFlowEdge(name=\"ce4\", from_node=llm_node, to_node=output_node),\n... ControlFlowEdge(name=\"ce5\", from_node=output_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"de1\",\n... source_node=input_node,\n... source_output=\"user_input\",\n... destination_node=llm_node,\n... destination_input=\"user_input\",\n... ),\n... DataFlowEdge(\n... name=\"de2\",\n... source_node=llm_node,\n... source_output=\"rephrased_user_input\",\n... destination_node=output_node,\n... destination_input=\"rephrased_user_input\",\n... ),\n... ]\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Message" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "InputMessageNode" + } + }, + "required": [ + "name" + ], + "title": "InputMessageNode", + "type": "object", + "x-abstract-component": false + }, + "BaseLlmConfig": { + "anyOf": [ + { + "$ref": "#/$defs/GeminiConfig" + }, + { + "$ref": "#/$defs/OciGenAiConfig" + }, + { + "$ref": "#/$defs/OllamaConfig" + }, + { + "$ref": "#/$defs/OpenAiCompatibleConfig" + }, + { + "$ref": "#/$defs/OpenAiConfig" + }, + { + "$ref": "#/$defs/VllmConfig" + }, + { + "additionalProperties": false, + "description": "A LLM configuration defines how to connect to a LLM to do generation requests.\n\nThis class can be used directly with the ``provider``, ``api_provider``, and ``api_type``\nfields to describe any LLM without a dedicated subclass. Concrete subclasses provide\nadditional configuration for specific LLM providers.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Provider" + }, + "api_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Provider" + }, + "api_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Type" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "LlmConfig" + } + }, + "required": [ + "model_id", + "name" + ], + "title": "LlmConfig", + "type": "object" + } + ], + "x-abstract-component": false + }, + "BaseLlmNode": { + "additionalProperties": false, + "description": "Execute a prompt template with a given LLM.\n\nThis node is intended to be a part of a Flow.\n\n- **Inputs**\n One per placeholder in the prompt template.\n- **Outputs**\n The output text generated by the LLM.\n\n If None is given, ``pyagentspec`` infers a string property named ``generated_text``.\n- **Branches**\n One, the default next.\n\nExample\n-------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import LlmNode, StartNode, EndNode\n>>> country_property = Property(\n... json_schema={\"title\": \"country\", \"type\": \"string\"}\n... )\n>>> capital_property = Property(\n... json_schema={\"title\": \"capital\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[country_property])\n>>> end_node = EndNode(name=\"end\", outputs=[capital_property])\n>>> llm_node = LlmNode(\n... name=\"simple llm node\",\n... llm_config=llm_config,\n... prompt_template=\"What is the capital of {{ country }}?\",\n... inputs=[country_property],\n... outputs=[capital_property],\n... )\n>>> flow = Flow(\n... name=\"Get the country's capital flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"country_edge\",\n... source_node=start_node,\n... source_output=\"country\",\n... destination_node=llm_node,\n... destination_input=\"country\",\n... ),\n... DataFlowEdge(\n... name=\"capital_edge\",\n... source_node=llm_node,\n... source_output=\"capital\",\n... destination_node=end_node,\n... destination_input=\"capital\"\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "llm_config": { + "$ref": "#/$defs/LlmConfig" + }, + "prompt_template": { + "title": "Prompt Template", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "LlmNode" + } + }, + "required": [ + "llm_config", + "name", + "prompt_template" + ], + "title": "LlmNode", + "type": "object", + "x-abstract-component": false + }, + "BaseLocalContainerCodeExecutor": { + "additionalProperties": false, + "description": "Code executor that declares local container execution.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout_seconds": { + "default": 30.0, + "exclusiveMinimum": 0, + "title": "Timeout Seconds", + "type": "number" + }, + "max_code_chars": { + "default": 50000, + "exclusiveMinimum": 0, + "title": "Max Code Chars", + "type": "integer" + }, + "image": { + "title": "Image", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "LocalContainerCodeExecutor" + } + }, + "required": [ + "image", + "name" + ], + "title": "LocalContainerCodeExecutor", + "type": "object", + "x-abstract-component": false + }, + "BaseMCPTool": { + "additionalProperties": false, + "description": "Class for tools exposed by MCP servers", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "client_transport": { + "$ref": "#/$defs/ClientTransport" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "MCPTool" + } + }, + "required": [ + "client_transport", + "name" + ], + "title": "MCPTool", + "type": "object", + "x-abstract-component": false + }, + "BaseMCPToolBox": { + "additionalProperties": false, + "description": "Class to dynamically expose a list of tools from a MCP Server.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "client_transport": { + "$ref": "#/$defs/ClientTransport" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "tool_filter": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/$defs/MCPToolSpec" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Tool Filter" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "MCPToolBox" + } + }, + "required": [ + "client_transport", + "name" + ], + "title": "MCPToolBox", + "type": "object", + "x-abstract-component": false + }, + "BaseMCPToolSpec": { + "additionalProperties": false, + "description": "Specification of MCP tool", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "MCPToolSpec" + } + }, + "required": [ + "name" + ], + "title": "MCPToolSpec", + "type": "object", + "x-abstract-component": false + }, + "BaseMTlsOracleDatabaseConnectionConfig": { + "additionalProperties": false, + "description": "Mutual-TLS Connection Configuration to Oracle Database.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "user": { + "title": "User", + "type": "string" + }, + "password": { + "title": "Password", + "type": "string" + }, + "dsn": { + "title": "Dsn", + "type": "string" + }, + "config_dir": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Config Dir" + }, + "protocol": { + "default": "tcps", + "enum": [ + "tcp", + "tcps" + ], + "title": "Protocol", + "type": "string" + }, + "wallet_location": { + "title": "Wallet Location", + "type": "string" + }, + "wallet_password": { + "title": "Wallet Password", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "MTlsOracleDatabaseConnectionConfig" + } + }, + "required": [ + "dsn", + "name", + "password", + "user", + "wallet_location", + "wallet_password" + ], + "title": "MTlsOracleDatabaseConnectionConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseManagerWorkers": { + "additionalProperties": false, + "description": "Defines a ``ManagerWorkers`` conversational component.\n\nA ``ManagerWorkers`` is a multi-agent conversational component in which a group manager\nassigns tasks to the workers. The group manager and workers can be instantiated from\nany ``AgenticComponent`` type.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.managerworkers import ManagerWorkers\n>>> manager_agent = Agent(\n... name=\"manager_agent\",\n... description=\"Agent that manages a group of math agents\",\n... llm_config=llm_config,\n... system_prompt=\"You are the manager of a group of math agents\"\n... )\n>>> multiplication_agent = Agent(\n... name=\"multiplication_agent\",\n... description=\"Agent that can do multiplication\",\n... llm_config=llm_config,\n... system_prompt=\"You can do multiplication.\"\n... )\n>>> division_agent = Agent(\n... name=\"division_agent\",\n... description=\"Agent that can do division\",\n... llm_config=llm_config,\n... system_prompt=\"You can do division.\"\n... )\n>>> group = ManagerWorkers(\n... name=\"managerworkers\",\n... group_manager=manager_agent,\n... workers=[multiplication_agent, division_agent],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "group_manager": { + "$ref": "#/$defs/AgenticComponent" + }, + "workers": { + "items": { + "$ref": "#/$defs/AgenticComponent" + }, + "title": "Workers", + "type": "array" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ManagerWorkers" + } + }, + "required": [ + "group_manager", + "name", + "workers" + ], + "title": "ManagerWorkers", + "type": "object", + "x-abstract-component": false + }, + "BaseMapNode": { + "additionalProperties": false, + "description": "The map node executes a subflow on each element of a given input as part of a flow.\n\n- **Inputs**\n Inferred from the inner structure. It's the sets of inputs\n required by the StartNode of the inner flow.\n The names of the inputs will be the ones of the inner flow,\n complemented with the ``iterated_`` prefix. Their type is\n ``Union[inner_type, List[inner_type]]``, where ``inner_type``\n is the type of the respective input in the inner flow.\n\n If None is given, ``pyagentspec`` infers input properties directly from the inner flow,\n specifying title and type according to the rules defined above.\n\n- **Outputs**\n Inferred from the inner structure. It's the union of the\n sets of outputs exposed by the EndNodes of the inner flow,\n combined with the reducer method of each output.\n The names of the outputs will be the ones of the inner flow,\n complemented with the ``collected_`` prefix. Their type depends\n on the ``reduce`` method specified for that output:\n\n - ``List`` of the respective output type in case of ``append``\n - same type of the respective output type in case of ``sum``, ``avg``\n\n If None is given, ``pyagentspec`` infers outputs by exposing\n an output property for each entry in the ``reducers`` dictionary, specifying title\n and type according to the rules defined above.\n\n- **Branches**\n One, the default next.\n\nExamples\n--------\nIn this example we will create a flow that returns\nan L2-normalized version of a given list of numbers.\n\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import EndNode, StartNode, MapNode, ToolNode\n>>> from pyagentspec.tools import ServerTool\n\nFirst, we define a MapNode that returns the square of all the elements in a list.\nIt will be used to compute the L2-norm.\n\n>>> x_property = Property(json_schema={\"title\": \"x\", \"type\": \"number\"})\n>>> x_square_property = Property(\n... json_schema={\"title\": \"x_square\", \"type\": \"number\"}\n... )\n>>> square_tool = ServerTool(\n... name=\"compute_square_tool\",\n... description=\"Computes the square of a number\",\n... inputs=[x_property],\n... outputs=[x_square_property],\n... )\n>>> list_of_x_property = Property(\n... json_schema={\"title\": \"x_list\", \"type\": \"array\", \"items\": {\"type\": \"number\"}}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[x_property])\n>>> end_node = EndNode(name=\"end\", outputs=[x_square_property])\n>>> square_tool_node = ToolNode(name=\"square tool node\", tool=square_tool)\n>>> square_number_flow = Flow(\n... name=\"Square number flow\",\n... start_node=start_node,\n... nodes=[start_node, square_tool_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_tool\", from_node=start_node, to_node=square_tool_node\n... ),\n... ControlFlowEdge(\n... name=\"tool_to_end\", from_node=square_tool_node, to_node=end_node\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"x_edge\",\n... source_node=start_node,\n... source_output=\"x\",\n... destination_node=square_tool_node,\n... destination_input=\"x\",\n... ),\n... DataFlowEdge(\n... name=\"x_square_edge\",\n... source_node=square_tool_node,\n... source_output=\"x_square\",\n... destination_node=end_node,\n... destination_input=\"x_square\",\n... ),\n... ],\n... )\n>>> list_of_x_square_property = Property(\n... json_schema={\"title\": \"x_square_list\", \"type\": \"array\", \"items\": {\"type\": \"number\"}}\n... )\n>>> square_numbers_map_node = MapNode(\n... name=\"square number map node\",\n... subflow=square_number_flow,\n... )\n\nNow we define the MapNode responsible for normalizing the given list of input numbers.\nThe denominator is the same for all of the numbers,\nwe are going to map only the numerators (i.e., the input numbers).\n\n>>> numerator_property = Property(\n... json_schema={\"title\": \"numerator\", \"type\": \"number\"}\n... )\n>>> denominator_property = Property(\n... json_schema={\"title\": \"denominator\", \"type\": \"number\"}\n... )\n>>> result_property = Property(\n... json_schema={\"title\": \"result\", \"type\": \"number\"}\n... )\n>>> division_tool = ServerTool(\n... name=\"division_tool\",\n... description=\"Computes the ratio between two numbers\",\n... inputs=[numerator_property, denominator_property],\n... outputs=[result_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[numerator_property, denominator_property])\n>>> end_node = EndNode(name=\"end\", outputs=[result_property])\n>>> divide_node = ToolNode(name=\"divide node\", tool=division_tool)\n>>> normalize_flow = Flow(\n... name=\"Normalize flow\",\n... start_node=start_node,\n... nodes=[start_node, divide_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_tool\", from_node=start_node, to_node=divide_node),\n... ControlFlowEdge(name=\"tool_to_end\", from_node=divide_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"numerator_edge\",\n... source_node=start_node,\n... source_output=\"numerator\",\n... destination_node=divide_node,\n... destination_input=\"numerator\",\n... ),\n... DataFlowEdge(\n... name=\"denominator_edge\",\n... source_node=start_node,\n... source_output=\"denominator\",\n... destination_node=divide_node,\n... destination_input=\"denominator\",\n... ),\n... DataFlowEdge(\n... name=\"result_edge\",\n... source_node=divide_node,\n... source_output=\"result\",\n... destination_node=end_node,\n... destination_input=\"result\",\n... ),\n... ],\n... )\n\nFinally, we define the overall flow:\n\n- The list of inputs is squared\n- The squared list is summed and root squared\n- The list of inputs is normalized based on the outcomes of the previous 2 steps\n\n>>> squared_sum_property = Property(\n... json_schema={\"title\": \"squared_sum\", \"type\": \"number\"}\n... )\n>>> normalized_list_of_x_property = Property(\n... json_schema={\n... \"title\": \"x_list_normalized\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"number\"},\n... }\n... )\n>>> normalize_map_node = MapNode(\n... name=\"normalize map node\",\n... subflow=normalize_flow,\n... )\n>>> squared_sum_tool = ServerTool(\n... name=\"squared_sum_tool\",\n... description=\"Computes the squared sum of a list of numbers\",\n... inputs=[list_of_x_property],\n... outputs=[squared_sum_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[list_of_x_property])\n>>> end_node = EndNode(name=\"end\", outputs=[normalized_list_of_x_property])\n>>> squared_sum_tool_node = ToolNode(name=\"squared sum tool node\", tool=squared_sum_tool)\n>>> flow = Flow(\n... name=\"L2 normalize flow\",\n... start_node=start_node,\n... nodes=[\n... start_node,\n... square_numbers_map_node,\n... squared_sum_tool_node,\n... normalize_map_node,\n... end_node,\n... ],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_square_numbers\",\n... from_node=start_node,\n... to_node=square_numbers_map_node\n... ),\n... ControlFlowEdge(\n... name=\"square_numbers_to_squared_sum_tool\",\n... from_node=square_numbers_map_node,\n... to_node=squared_sum_tool_node\n... ),\n... ControlFlowEdge(\n... name=\"squared_sum_tool_to_normalize\",\n... from_node=squared_sum_tool_node,\n... to_node=normalize_map_node\n... ),\n... ControlFlowEdge(\n... name=\"normalize_to_end\",\n... from_node=normalize_map_node,\n... to_node=end_node\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"list_of_x_edge\",\n... source_node=start_node,\n... source_output=\"x_list\",\n... destination_node=square_numbers_map_node,\n... destination_input=\"iterated_x\",\n... ),\n... DataFlowEdge(\n... name=\"x_square_list_edge\",\n... source_node=square_numbers_map_node,\n... source_output=\"collected_x_square\",\n... destination_node=squared_sum_tool_node,\n... destination_input=\"x_list\",\n... ),\n... DataFlowEdge(\n... name=\"numerator_edge\",\n... source_node=start_node,\n... source_output=\"x_list\",\n... destination_node=normalize_map_node,\n... destination_input=\"iterated_numerator\",\n... ),\n... DataFlowEdge(\n... name=\"denominator_edge\",\n... source_node=squared_sum_tool_node,\n... source_output=\"squared_sum\",\n... destination_node=normalize_map_node,\n... destination_input=\"iterated_denominator\",\n... ),\n... DataFlowEdge(\n... name=\"x_list_normalized_edge\",\n... source_node=normalize_map_node,\n... source_output=\"collected_result\",\n... destination_node=end_node,\n... destination_input=\"x_list_normalized\",\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "subflow": { + "$ref": "#/$defs/Flow" + }, + "reducers": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/$defs/ReductionMethod" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reducers" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "MapNode" + } + }, + "required": [ + "name", + "subflow" + ], + "title": "MapNode", + "type": "object", + "x-abstract-component": false + }, + "BaseMessageSummarizationTransform": { + "additionalProperties": false, + "description": "Summarizes oversized messages using an LLM and optionally caches summaries.\n\nThis is useful for long conversations where the context can become too large for the LLM to handle.\n\nExamples\n--------\n>>> from pyagentspec.transforms import MessageSummarizationTransform\n>>> summarization_transform = MessageSummarizationTransform(\n... name=\"message-summarizer\",\n... llm=llm_config,\n... max_message_size=30_000\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "llm": { + "$ref": "#/$defs/LlmConfig" + }, + "max_message_size": { + "default": 20000, + "title": "Max Message Size", + "type": "integer" + }, + "summarization_instructions": { + "default": "Please make a summary of this message. Include relevant information and keep it short. Your response will replace the message, so just output the summary directly, no introduction needed.", + "title": "Summarization Instructions", + "type": "string" + }, + "summarized_message_template": { + "default": "Summarized message: {{summary}}", + "title": "Summarized Message Template", + "type": "string" + }, + "max_cache_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 10000, + "title": "Max Cache Size" + }, + "max_cache_lifetime": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 14400, + "title": "Max Cache Lifetime" + }, + "cache_collection_name": { + "default": "summarized_messages_cache", + "title": "Cache Collection Name", + "type": "string" + }, + "datastore": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/InMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/OracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/PostgresDatabaseDatastore" + } + ], + "title": "Datastore" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "MessageSummarizationTransform" + } + }, + "required": [ + "llm", + "name" + ], + "title": "MessageSummarizationTransform", + "type": "object", + "x-abstract-component": false + }, + "BaseMessageTransform": { + "anyOf": [ + { + "$ref": "#/$defs/ConversationSummarizationTransform" + }, + { + "$ref": "#/$defs/MessageSummarizationTransform" + } + ], + "x-abstract-component": true + }, + "BaseNode": { + "anyOf": [ + { + "$ref": "#/$defs/AgentNode" + }, + { + "$ref": "#/$defs/ApiNode" + }, + { + "$ref": "#/$defs/BranchingNode" + }, + { + "$ref": "#/$defs/CatchExceptionNode" + }, + { + "$ref": "#/$defs/EndNode" + }, + { + "$ref": "#/$defs/FlowNode" + }, + { + "$ref": "#/$defs/InputMessageNode" + }, + { + "$ref": "#/$defs/LlmNode" + }, + { + "$ref": "#/$defs/MapNode" + }, + { + "$ref": "#/$defs/OutputMessageNode" + }, + { + "$ref": "#/$defs/ParallelFlowNode" + }, + { + "$ref": "#/$defs/ParallelMapNode" + }, + { + "$ref": "#/$defs/StartNode" + }, + { + "$ref": "#/$defs/ToolNode" + } + ], + "x-abstract-component": true + }, + "BaseOAuthClientConfig": { + "additionalProperties": false, + "description": "OAuth client identity / registration configuration.\n\nThis configuration describes how the runtime establishes the OAuth client\nidentity to use with the authorization server. It supports:\n- Pre-registered clients (static client_id/client_secret)\n- Client ID Metadata Documents (URL-formatted client_id)\n- Dynamic client registration (RFC 7591)", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "min_agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum", + "default": "26.1.2" + }, + "type": { + "enum": [ + "client_id_metadata_document", + "dynamic_registration", + "pre_registered" + ], + "title": "Type", + "type": "string" + }, + "client_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Client Id" + }, + "client_secret": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Client Secret" + }, + "token_endpoint_auth_method": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Token Endpoint Auth Method" + }, + "client_id_metadata_url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Client Id Metadata Url" + }, + "registration_endpoint": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Registration Endpoint" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OAuthClientConfig" + } + }, + "required": [ + "name", + "type" + ], + "title": "OAuthClientConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseOAuthConfig": { + "additionalProperties": false, + "description": "Configure OAuth-based authentication for a tool or transport.\n\nOAuthConfig is a generic configuration that can be used for both MCP servers\nand non-MCP remote API tools. It supports discovery-based configuration (via\n``issuer``) and explicit endpoints (via ``endpoints``).", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "min_agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum", + "default": "26.1.2" + }, + "issuer": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Issuer" + }, + "endpoints": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/OAuthEndpoints" + } + ], + "default": null + }, + "client": { + "$ref": "#/$defs/OAuthClientConfig" + }, + "redirect_uri": { + "title": "Redirect Uri", + "type": "string" + }, + "scopes": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Scopes" + }, + "scope_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ScopePolicy" + } + ], + "default": null + }, + "pkce": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/PKCEPolicy" + } + ], + "default": null + }, + "resource": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Resource" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OAuthConfig" + } + }, + "required": [ + "client", + "name", + "redirect_uri" + ], + "title": "OAuthConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseOciAgent": { + "additionalProperties": false, + "description": "An agent is a component that can do several rounds of conversation to solve a task.\n\nThe agent is defined on the OCI console and this is only a wrapper to connect to it.\nIt can be executed by itself, or be executed in a flow using an AgentNode.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "agent_endpoint_id": { + "title": "Agent Endpoint Id", + "type": "string" + }, + "client_config": { + "$ref": "#/$defs/OciClientConfig" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OciAgent" + } + }, + "required": [ + "agent_endpoint_id", + "client_config", + "name" + ], + "title": "OciAgent", + "type": "object", + "x-abstract-component": false + }, + "BaseOciClientConfig": { + "anyOf": [ + { + "$ref": "#/$defs/OciClientConfigWithApiKey" + }, + { + "$ref": "#/$defs/OciClientConfigWithInstancePrincipal" + }, + { + "$ref": "#/$defs/OciClientConfigWithResourcePrincipal" + }, + { + "$ref": "#/$defs/OciClientConfigWithSecurityToken" + } + ], + "x-abstract-component": true + }, + "BaseOciClientConfigWithApiKey": { + "additionalProperties": false, + "description": "OCI client config class for authentication using API_KEY and a config file.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "service_endpoint": { + "title": "Service Endpoint", + "type": "string" + }, + "auth_type": { + "const": "API_KEY", + "default": "API_KEY", + "title": "Auth Type", + "type": "string" + }, + "auth_profile": { + "title": "Auth Profile", + "type": "string" + }, + "auth_file_location": { + "title": "Auth File Location", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OciClientConfigWithApiKey" + } + }, + "required": [ + "auth_file_location", + "auth_profile", + "name", + "service_endpoint" + ], + "title": "OciClientConfigWithApiKey", + "type": "object", + "x-abstract-component": false + }, + "BaseOciClientConfigWithInstancePrincipal": { + "additionalProperties": false, + "description": "OCI client config class for authentication using INSTANCE_PRINCIPAL.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "service_endpoint": { + "title": "Service Endpoint", + "type": "string" + }, + "auth_type": { + "const": "INSTANCE_PRINCIPAL", + "default": "INSTANCE_PRINCIPAL", + "title": "Auth Type", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OciClientConfigWithInstancePrincipal" + } + }, + "required": [ + "name", + "service_endpoint" + ], + "title": "OciClientConfigWithInstancePrincipal", + "type": "object", + "x-abstract-component": false + }, + "BaseOciClientConfigWithResourcePrincipal": { + "additionalProperties": false, + "description": "OCI client config class for authentication using RESOURCE_PRINCIPAL.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "service_endpoint": { + "title": "Service Endpoint", + "type": "string" + }, + "auth_type": { + "const": "RESOURCE_PRINCIPAL", + "default": "RESOURCE_PRINCIPAL", + "title": "Auth Type", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OciClientConfigWithResourcePrincipal" + } + }, + "required": [ + "name", + "service_endpoint" + ], + "title": "OciClientConfigWithResourcePrincipal", + "type": "object", + "x-abstract-component": false + }, + "BaseOciClientConfigWithSecurityToken": { + "additionalProperties": false, + "description": "OCI client config class for authentication using SECURITY_TOKEN.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "service_endpoint": { + "title": "Service Endpoint", + "type": "string" + }, + "auth_type": { + "const": "SECURITY_TOKEN", + "default": "SECURITY_TOKEN", + "title": "Auth Type", + "type": "string" + }, + "auth_profile": { + "title": "Auth Profile", + "type": "string" + }, + "auth_file_location": { + "title": "Auth File Location", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OciClientConfigWithSecurityToken" + } + }, + "required": [ + "auth_file_location", + "auth_profile", + "name", + "service_endpoint" + ], + "title": "OciClientConfigWithSecurityToken", + "type": "object", + "x-abstract-component": false + }, + "BaseOciGenAiConfig": { + "additionalProperties": false, + "description": "Class to configure a connection to a OCI GenAI hosted model.\n\nRequires to specify the model id and the client configuration to the OCI GenAI service.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/ModelProvider" + } + ], + "default": null + }, + "api_provider": { + "const": "oci", + "default": "oci", + "title": "Api Provider", + "type": "string" + }, + "api_type": { + "$ref": "#/$defs/OciAPIType", + "default": "oci" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "compartment_id": { + "title": "Compartment Id", + "type": "string" + }, + "serving_mode": { + "$ref": "#/$defs/ServingMode", + "default": "ON_DEMAND" + }, + "client_config": { + "$ref": "#/$defs/OciClientConfig" + }, + "conversation_store_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Conversation Store Id" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OciGenAiConfig" + } + }, + "required": [ + "client_config", + "compartment_id", + "model_id", + "name" + ], + "title": "OciGenAiConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseOllamaConfig": { + "additionalProperties": false, + "description": "Class to configure a connection to a local model ran with Ollama.\n\nRequires to specify the url and port at which the model is running.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Provider" + }, + "api_provider": { + "const": "ollama", + "default": "ollama", + "title": "Api Provider", + "type": "string" + }, + "api_type": { + "$ref": "#/$defs/OpenAIAPIType", + "default": "chat_completions" + }, + "url": { + "title": "Url", + "type": "string" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "key_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Key File" + }, + "cert_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cert File" + }, + "ca_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Ca File" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OllamaConfig" + } + }, + "required": [ + "model_id", + "name", + "url" + ], + "title": "OllamaConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseOpenAiCompatibleConfig": { + "anyOf": [ + { + "$ref": "#/$defs/OllamaConfig" + }, + { + "$ref": "#/$defs/VllmConfig" + }, + { + "additionalProperties": false, + "description": "Class to configure a connection to an LLM that is compatible with OpenAI completions APIs.\n\nRequires to specify the url of the APIs to contact.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Provider" + }, + "api_provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Provider" + }, + "api_type": { + "$ref": "#/$defs/OpenAIAPIType", + "default": "chat_completions" + }, + "url": { + "title": "Url", + "type": "string" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "key_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Key File" + }, + "cert_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cert File" + }, + "ca_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Ca File" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OpenAiCompatibleConfig" + } + }, + "required": [ + "model_id", + "name", + "url" + ], + "title": "OpenAiCompatibleConfig", + "type": "object" + } + ], + "x-abstract-component": false + }, + "BaseOpenAiConfig": { + "additionalProperties": false, + "description": "Class to configure a connection to a OpenAI LLM.\n\nRequires to specify the identity of the model to use.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "const": "openai", + "default": "openai", + "title": "Provider", + "type": "string" + }, + "api_provider": { + "const": "openai", + "default": "openai", + "title": "Api Provider", + "type": "string" + }, + "api_type": { + "$ref": "#/$defs/OpenAIAPIType", + "default": "chat_completions" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OpenAiConfig" + } + }, + "required": [ + "model_id", + "name" + ], + "title": "OpenAiConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseOracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/MTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/TlsOracleDatabaseConnectionConfig" + } + ], + "x-abstract-component": true + }, + "BaseOracleDatabaseDatastore": { + "additionalProperties": false, + "description": "Datastore that uses Oracle Database as the storage mechanism.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "datastore_schema": { + "additionalProperties": { + "$ref": "#/$defs/Property" + }, + "title": "Datastore Schema", + "type": "object" + }, + "connection_config": { + "$ref": "#/$defs/OracleDatabaseConnectionConfig" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OracleDatabaseDatastore" + } + }, + "required": [ + "connection_config", + "datastore_schema", + "name" + ], + "title": "OracleDatabaseDatastore", + "type": "object", + "x-abstract-component": false + }, + "BaseOutputMessageNode": { + "additionalProperties": false, + "description": "This node appends an agent message to the ongoing flow conversation.\n\n- **Inputs**\n One per variable in the message.\n- **Outputs**\n No outputs.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import StartNode, EndNode, InputMessageNode, OutputMessageNode, LlmNode\n>>> from pyagentspec.property import StringProperty\n>>> start_node = StartNode(name=\"start\")\n>>> prompt_node = OutputMessageNode(name=\"ask_input\", message=\"What is the paragraph you want to rephrase?\")\n>>> input_node = InputMessageNode(name=\"user_input\", outputs=[StringProperty(title=\"user_input\")])\n>>> llm_node = LlmNode(\n... name=\"rephrase\",\n... llm_config=llm_config,\n... prompt_template=\"Rephrase {{user_input}}\",\n... outputs=[StringProperty(title=\"rephrased_user_input\")],\n... )\n>>> output_node = OutputMessageNode(name=\"ask_input\", message=\"{{rephrased_user_input}}\")\n>>> end_node = EndNode(name=\"end\")\n>>> flow = Flow(\n... name=\"rephrase_paragraph_flow\",\n... start_node=start_node,\n... nodes=[start_node, prompt_node, input_node, llm_node, output_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"ce1\", from_node=start_node, to_node=prompt_node),\n... ControlFlowEdge(name=\"ce2\", from_node=prompt_node, to_node=input_node),\n... ControlFlowEdge(name=\"ce3\", from_node=input_node, to_node=llm_node),\n... ControlFlowEdge(name=\"ce4\", from_node=llm_node, to_node=output_node),\n... ControlFlowEdge(name=\"ce5\", from_node=output_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"de1\",\n... source_node=input_node,\n... source_output=\"user_input\",\n... destination_node=llm_node,\n... destination_input=\"user_input\",\n... ),\n... DataFlowEdge(\n... name=\"de2\",\n... source_node=llm_node,\n... source_output=\"rephrased_user_input\",\n... destination_node=output_node,\n... destination_input=\"rephrased_user_input\",\n... ),\n... ]\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "message": { + "title": "Message", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "OutputMessageNode" + } + }, + "required": [ + "message", + "name" + ], + "title": "OutputMessageNode", + "type": "object", + "x-abstract-component": false + }, + "BaseParallelFlowNode": { + "additionalProperties": false, + "description": "The parallel flow node executes multiple subflows in parallel.\n\n- **Inputs**\n Inferred from the inner structure. It's the union of the sets of inputs of the inner flows.\n Inputs of different inner flows that have the same name are merged if they have the same type.\n\n- **Outputs**\n Inferred from the inner structure. It's the union of the outputs of the inner flows.\n Outputs of different inner flows that have the same name are not allowed.\n\n- **Branches**\n One, the default next.\n\nExamples\n--------", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "subflows": { + "items": { + "$ref": "#/$defs/Flow" + }, + "title": "Subflows", + "type": "array" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ParallelFlowNode" + } + }, + "required": [ + "name" + ], + "title": "ParallelFlowNode", + "type": "object", + "x-abstract-component": false + }, + "BaseParallelMapNode": { + "additionalProperties": false, + "description": "The parallel map node executes a subflow on each element of a given input in a parallel manner.\n\n- **Inputs**\n Inferred from the inner structure. It's the sets of inputs\n required by the StartNode of the inner flow.\n The names of the inputs will be the ones of the inner flow,\n complemented with the ``iterated_`` prefix. Their type is\n ``Union[inner_type, List[inner_type]]``, where ``inner_type``\n is the type of the respective input in the inner flow.\n\n If None is given, ``pyagentspec`` infers input properties directly from the inner flow,\n specifying title and type according to the rules defined above.\n\n- **Outputs**\n Inferred from the inner structure. It's the union of the\n sets of outputs exposed by the EndNodes of the inner flow,\n combined with the reducer method of each output.\n The names of the outputs will be the ones of the inner flow,\n complemented with the ``collected_`` prefix. Their type depends\n on the ``reduce`` method specified for that output:\n\n - ``List`` of the respective output type in case of ``append``\n - same type of the respective output type in case of ``sum``, ``avg``\n\n If None is given, ``pyagentspec`` infers outputs by exposing\n an output property for each entry in the ``reducers`` dictionary, specifying title\n and type according to the rules defined above.\n\n- **Branches**\n One, the default next.\n\nExamples\n--------\nIn this example we create a flow that generates a summary of the given articles that talk about LLMs.\n\n>>> from pyagentspec.property import BooleanProperty, StringProperty, ListProperty\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import EndNode, StartNode, ParallelMapNode, LlmNode, BranchingNode\n>>> from pyagentspec.flows.node import Node\n\nFirst we define the flow that determines if an article talks about LLMs or not:\n\n- if it does, we return it, so that we will use it for our summary\n- if it does not, we don't return its text\n\n>>> def create_data_flow_edge(source_node: Node, destination_node: Node, property_name: str) -> DataFlowEdge:\n... return DataFlowEdge(\n... name=f\"{source_node.name}_{destination_node.name}_{property_name}_edge\",\n... source_node=source_node,\n... source_output=property_name,\n... destination_node=destination_node,\n... destination_input=property_name,\n... )\n>>>\n>>> article_property = StringProperty(title=\"article\")\n>>> is_llm_article_property = StringProperty(title=\"is_article\")\n>>> llm_node = LlmNode(\n... name=\"check_if_article_talks_about_llms_node\",\n... prompt_template=\"Look at this article: {{article}}. Does it talk about LLMs? Answer `yes` or `no`.\",\n... llm_config=llm_config,\n... inputs=[article_property],\n... outputs=[is_llm_article_property],\n... )\n>>>\n>>> branching_node = BranchingNode(\n... name=\"decide_if_we_should_return_the_article\",\n... mapping={\"yes\": \"yes\"},\n... inputs=[is_llm_article_property],\n... )\n>>>\n>>> start_node = StartNode(name=\"start\", inputs=[article_property])\n>>> end_node_with_output = EndNode(name=\"end_with_output\", outputs=[article_property])\n>>> end_node_without_output = EndNode(name=\"end_without_output\", outputs=[])\n>>>\n>>> check_if_article_is_about_llm_flow = Flow(\n... name=\"is_article_about_llm_flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node_with_output, end_node_without_output, branching_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_branching\", from_node=llm_node, to_node=branching_node),\n... ControlFlowEdge(name=\"branching_to_end_with\", from_node=branching_node, to_node=end_node_with_output),\n... ControlFlowEdge(name=\"branching_to_end_without\", from_node=branching_node, to_node=end_node_without_output),\n... ],\n... data_flow_connections=[\n... create_data_flow_edge(start_node, llm_node, article_property.title),\n... create_data_flow_edge(llm_node, branching_node, is_llm_article_property.title),\n... create_data_flow_edge(start_node, end_node_with_output, article_property.title),\n... ],\n... outputs=[StringProperty(title=article_property.title, default=\"\")],\n... )\n\nWe put this flow into a ``ParallelMapNode``, so that we can perform the check\nin parallel on multiple articles at the same time.\n\n>>> list_of_articles_property = ListProperty(title=\"iterated_article\", item_type=article_property)\n>>> list_of_articles_about_llm_property = ListProperty(title=\"collected_article\", item_type=article_property)\n>>> parallel_article_check_node = ParallelMapNode(\n... name=\"parallel_check_if_articles_talk_about_llms_node\",\n... subflow=check_if_article_is_about_llm_flow,\n... inputs=[list_of_articles_property],\n... outputs=[list_of_articles_about_llm_property],\n... )\n\nFinally, we create the flow that takes the list of articles as input, filters them through the\n``ParallelMapNode`` we have just created, and we generate the summary with the remaining articles.\n\n>>> summary_property = StringProperty(title=\"summary\")\n>>> summary_llm_node = LlmNode(\n... name=\"generate_summary_of_llm_articles_node\",\n... prompt_template=\"Summarize the following articles that talk about LLMs: {{collected_article}}\",\n... llm_config=llm_config,\n... inputs=[list_of_articles_about_llm_property],\n... outputs=[summary_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[list_of_articles_property])\n>>> end_node = EndNode(name=\"end\", outputs=[summary_property])\n>>> generate_summary_of_llm_articles_flow = Flow(\n... name=\"Generate summary of articles about LLMs flow\",\n... start_node=start_node,\n... nodes=[start_node, parallel_article_check_node, summary_llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_parallelmap\", from_node=start_node, to_node=parallel_article_check_node),\n... ControlFlowEdge(name=\"parallelmap_to_llm\", from_node=parallel_article_check_node, to_node=summary_llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=summary_llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... create_data_flow_edge(start_node, parallel_article_check_node, list_of_articles_property.title),\n... create_data_flow_edge(parallel_article_check_node, summary_llm_node, list_of_articles_about_llm_property.title),\n... create_data_flow_edge(summary_llm_node, end_node, summary_property.title),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "subflow": { + "$ref": "#/$defs/Flow" + }, + "reducers": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/$defs/ReductionMethod" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reducers" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ParallelMapNode" + } + }, + "required": [ + "name", + "subflow" + ], + "title": "ParallelMapNode", + "type": "object", + "x-abstract-component": false + }, + "BasePostgresDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/TlsPostgresDatabaseConnectionConfig" + } + ], + "x-abstract-component": true + }, + "BasePostgresDatabaseDatastore": { + "additionalProperties": false, + "description": "Datastore that uses PostgreSQL Database as the storage mechanism.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "datastore_schema": { + "additionalProperties": { + "$ref": "#/$defs/Property" + }, + "title": "Datastore Schema", + "type": "object" + }, + "connection_config": { + "$ref": "#/$defs/PostgresDatabaseConnectionConfig" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "PostgresDatabaseDatastore" + } + }, + "required": [ + "connection_config", + "datastore_schema", + "name" + ], + "title": "PostgresDatabaseDatastore", + "type": "object", + "x-abstract-component": false + }, + "BaseRemoteAgent": { + "anyOf": [ + { + "$ref": "#/$defs/A2AAgent" + }, + { + "$ref": "#/$defs/OciAgent" + } + ], + "x-abstract-component": true + }, + "BaseRemoteTool": { + "additionalProperties": false, + "description": "A tool that is run remotely and called through REST.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "url": { + "title": "Url", + "type": "string" + }, + "http_method": { + "title": "Http Method", + "type": "string" + }, + "api_spec_uri": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Spec Uri" + }, + "data": { + "anyOf": [ + { + "type": "string" + }, + { + "format": "binary", + "type": "string" + }, + {} + ], + "title": "Data" + }, + "query_params": { + "additionalProperties": true, + "title": "Query Params", + "type": "object" + }, + "headers": { + "additionalProperties": true, + "title": "Headers", + "type": "object" + }, + "sensitive_headers": { + "additionalProperties": true, + "title": "Sensitive Headers", + "type": "object" + }, + "url_allow_list": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Url Allow List" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "RemoteTool" + } + }, + "required": [ + "http_method", + "name", + "url" + ], + "title": "RemoteTool", + "type": "object", + "x-abstract-component": false + }, + "BaseRemoteTransport": { + "anyOf": [ + { + "$ref": "#/$defs/SSETransport" + }, + { + "$ref": "#/$defs/SSEmTLSTransport" + }, + { + "$ref": "#/$defs/StreamableHTTPTransport" + }, + { + "$ref": "#/$defs/StreamableHTTPmTLSTransport" + } + ], + "x-abstract-component": true + }, + "BaseSSETransport": { + "anyOf": [ + { + "$ref": "#/$defs/SSEmTLSTransport" + }, + { + "additionalProperties": false, + "description": "Transport implementation that connects to an MCP server via Server-Sent Events.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "session_parameters": { + "$ref": "#/$defs/SessionParameters" + }, + "url": { + "title": "Url", + "type": "string" + }, + "auth": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/AuthConfig" + } + ], + "default": null + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "sensitive_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sensitive Headers" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "SSETransport" + } + }, + "required": [ + "name", + "url" + ], + "title": "SSETransport", + "type": "object" + } + ], + "x-abstract-component": false + }, + "BaseSSEmTLSTransport": { + "additionalProperties": false, + "description": "Transport layer for SSE with mTLS (mutual Transport Layer Security).\n\nThis transport establishes a secure, mutually authenticated TLS connection to the MCP server using client\ncertificates. Production deployments MUST use this transport to ensure both client and server identities\nare verified.\n\nNotes\n-----\n- Users MUST provide a valid client certificate (PEM format) and private key.\n- Users MUST provide (or trust) the correct certificate authority (CA) for the server they're connecting to.\n- The client certificate/key and CA certificate paths can be managed via secrets, config files, or secure\n environment variables in any production system.\n- Executors should ensure that these files are rotated and managed securely.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "session_parameters": { + "$ref": "#/$defs/SessionParameters" + }, + "url": { + "title": "Url", + "type": "string" + }, + "auth": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/AuthConfig" + } + ], + "default": null + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "sensitive_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sensitive Headers" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "key_file": { + "title": "Key File", + "type": "string" + }, + "cert_file": { + "title": "Cert File", + "type": "string" + }, + "ca_file": { + "title": "Ca File", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "SSEmTLSTransport" + } + }, + "required": [ + "ca_file", + "cert_file", + "key_file", + "name", + "url" + ], + "title": "SSEmTLSTransport", + "type": "object", + "x-abstract-component": false + }, + "BaseServerTool": { + "additionalProperties": false, + "description": "A tool that is registered to and executed by the orchestrator.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "requires_confirmation": { + "default": false, + "title": "Requires Confirmation", + "type": "boolean" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ServerTool" + } + }, + "required": [ + "name" + ], + "title": "ServerTool", + "type": "object", + "x-abstract-component": false + }, + "BaseSpecializedAgent": { + "additionalProperties": false, + "description": "A specialized agent is an agent that uses an existing generic agent and\nspecializes it to solve a given task.\n\nIt can be executed anywhere an Agent can be executed.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.property import StringProperty\n>>> from pyagentspec.specialized_agent import AgentSpecializationParameters, SpecializedAgent\n>>> from pyagentspec.tools import ServerTool\n>>> expertise_property = StringProperty(title=\"domain_of_expertise\")\n>>> system_prompt = '''You are an expert in {{domain_of_expertise}}.\n... Please help the users with their requests.'''\n>>> agent = Agent(\n... name=\"Adaptive expert agent\",\n... system_prompt=system_prompt,\n... llm_config=llm_config,\n... inputs=[expertise_property],\n... )\n>>> websearch_tool = ServerTool(\n... name=\"websearch_tool\",\n... description=\"Search the web for information\",\n... inputs=[StringProperty(title=\"query\")],\n... outputs=[StringProperty(title=\"search_result\")],\n... )\n>>> agent_specialization_parameters = AgentSpecializationParameters(\n... name=\"essay_agent\",\n... additional_instructions=\"Your goal is to help the user write an essay around the domain of expertise.\",\n... additional_tools=[websearch_tool]\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "agent": { + "$ref": "#/$defs/Agent" + }, + "agent_specialization_parameters": { + "$ref": "#/$defs/AgentSpecializationParameters" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "SpecializedAgent" + } + }, + "required": [ + "agent", + "agent_specialization_parameters", + "name" + ], + "title": "SpecializedAgent", + "type": "object", + "x-abstract-component": false + }, + "BaseStartNode": { + "additionalProperties": false, + "description": "Start nodes denote the start of the execution of a flow.\n\n- **Inputs**\n The list of inputs that should be the inputs of the flow. If both input and output\n properties are specified they must be an exact match\n\n If None is given, ``pyagentspec`` copies the outputs provided, if any. Otherwise, no input is exposed.\n- **Outputs**\n The list of outputs of the step. If both input and output properties are specified they\n must be an exact match\n\n If None is given, ``pyagentspec`` copies the inputs provided, if any. Otherwise, no output is exposed.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import EndNode, LlmNode, StartNode\n>>> user_question_property = Property(\n... json_schema=dict(\n... title=\"user_question\",\n... description=\"The user question.\",\n... type=\"string\",\n... )\n... )\n>>> answer_property = Property(json_schema=dict(title=\"answer\", type=\"string\"))\n>>> start_node = StartNode(name=\"start\", inputs=[user_question_property])\n>>> end_node = EndNode(name=\"end\", outputs=[answer_property])\n>>> llm_node = LlmNode(\n... name=\"llm node\",\n... prompt_template=\"Answer the user question: {{user_question}}\",\n... llm_config=llm_config,\n... )\n>>> flow = Flow(\n... name=\"flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"user_question\",\n... destination_node=llm_node,\n... destination_input=\"user_question\",\n... ),\n... DataFlowEdge(\n... name=\"answer_edge\",\n... source_node=llm_node,\n... source_output=\"generated_text\",\n... destination_node=end_node,\n... destination_input=\"answer\"\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "StartNode" + } + }, + "required": [ + "name" + ], + "title": "StartNode", + "type": "object", + "x-abstract-component": false + }, + "BaseStdioTransport": { + "additionalProperties": false, + "description": "Base transport for connecting to an MCP server via subprocess with stdio.\n\nThis is a base class that can be subclassed for specific command-based\ntransports like Python, Node, Uvx, etc.\n\n.. warning::\n Stdio should be used for local prototyping only.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "session_parameters": { + "$ref": "#/$defs/SessionParameters" + }, + "command": { + "title": "Command", + "type": "string" + }, + "args": { + "items": { + "type": "string" + }, + "title": "Args", + "type": "array" + }, + "env": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Env" + }, + "cwd": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cwd" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "StdioTransport" + } + }, + "required": [ + "command", + "name" + ], + "title": "StdioTransport", + "type": "object", + "x-abstract-component": false + }, + "BaseStreamableHTTPTransport": { + "anyOf": [ + { + "$ref": "#/$defs/StreamableHTTPmTLSTransport" + }, + { + "additionalProperties": false, + "description": "Transport implementation that connects to an MCP server via Streamable HTTP.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "session_parameters": { + "$ref": "#/$defs/SessionParameters" + }, + "url": { + "title": "Url", + "type": "string" + }, + "auth": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/AuthConfig" + } + ], + "default": null + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "sensitive_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sensitive Headers" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "StreamableHTTPTransport" + } + }, + "required": [ + "name", + "url" + ], + "title": "StreamableHTTPTransport", + "type": "object" + } + ], + "x-abstract-component": false + }, + "BaseStreamableHTTPmTLSTransport": { + "additionalProperties": false, + "description": "Transport layer for streamable HTTP with mTLS (mutual Transport Layer Security).\n\nThis transport establishes a secure, mutually authenticated TLS connection to the MCP server using client\ncertificates. Production deployments MUST use this transport to ensure both client and server identities\nare verified.\n\nNotes\n-----\n- Users MUST provide a valid client certificate (PEM format) and private key.\n- Users MUST provide (or trust) the correct certificate authority (CA) for the server they're connecting to.\n- The client certificate/key and CA certificate paths can be managed via secrets, config files, or secure\n environment variables in any production system.\n- Executors should ensure that these files are rotated and managed securely.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "session_parameters": { + "$ref": "#/$defs/SessionParameters" + }, + "url": { + "title": "Url", + "type": "string" + }, + "auth": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/AuthConfig" + } + ], + "default": null + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "sensitive_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sensitive Headers" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "key_file": { + "title": "Key File", + "type": "string" + }, + "cert_file": { + "title": "Cert File", + "type": "string" + }, + "ca_file": { + "title": "Ca File", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "StreamableHTTPmTLSTransport" + } + }, + "required": [ + "ca_file", + "cert_file", + "key_file", + "name", + "url" + ], + "title": "StreamableHTTPmTLSTransport", + "type": "object", + "x-abstract-component": false + }, + "BaseSubProcessCodeExecutor": { + "additionalProperties": false, + "description": "Code executor that declares local process execution.\n\nNote: The subprocess executor is intended for prototyping only and must\nnot be used in production deployments.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout_seconds": { + "default": 30.0, + "exclusiveMinimum": 0, + "title": "Timeout Seconds", + "type": "number" + }, + "max_code_chars": { + "default": 50000, + "exclusiveMinimum": 0, + "title": "Max Code Chars", + "type": "integer" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "SubProcessCodeExecutor" + } + }, + "required": [ + "name" + ], + "title": "SubProcessCodeExecutor", + "type": "object", + "x-abstract-component": false + }, + "BaseSwarm": { + "additionalProperties": false, + "description": "Defines a ``Swarm`` conversational component.\n\nA ``Swarm`` is a multi-agent conversational component in which each agent determines\nthe next agent to be executed, based on a list of pre-defined relationships.\nAgents in Swarm can be any ``AgenticComponent``.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.swarm import Swarm\n>>> addition_agent = Agent(name=\"addition_agent\", description=\"Agent that can do additions\", llm_config=llm_config, system_prompt=\"You can do additions.\")\n>>> multiplication_agent = Agent(name=\"multiplication_agent\", description=\"Agent that can do multiplication\", llm_config=llm_config, system_prompt=\"You can do multiplication.\")\n>>> division_agent = Agent(name=\"division_agent\", description=\"Agent that can do division\", llm_config=llm_config, system_prompt=\"You can do division.\")\n>>>\n>>> swarm = Swarm(\n... name=\"swarm\",\n... first_agent=addition_agent,\n... relationships=[\n... (addition_agent, multiplication_agent),\n... (addition_agent, division_agent),\n... (multiplication_agent, division_agent),\n... ]\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "first_agent": { + "$ref": "#/$defs/AgenticComponent" + }, + "relationships": { + "items": { + "maxItems": 2, + "minItems": 2, + "prefixItems": [ + { + "$ref": "#/$defs/AgenticComponent" + }, + { + "$ref": "#/$defs/AgenticComponent" + } + ], + "type": "array" + }, + "title": "Relationships", + "type": "array" + }, + "handoff": { + "anyOf": [ + { + "type": "boolean" + }, + { + "$ref": "#/$defs/HandoffMode" + } + ], + "default": "optional", + "title": "Handoff" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "Swarm" + } + }, + "required": [ + "first_agent", + "name", + "relationships" + ], + "title": "Swarm", + "type": "object", + "x-abstract-component": false + }, + "BaseTlsOracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/MTlsOracleDatabaseConnectionConfig" + }, + { + "additionalProperties": false, + "description": "TLS Connection Configuration to Oracle Database.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "user": { + "title": "User", + "type": "string" + }, + "password": { + "title": "Password", + "type": "string" + }, + "dsn": { + "title": "Dsn", + "type": "string" + }, + "config_dir": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Config Dir" + }, + "protocol": { + "default": "tcps", + "enum": [ + "tcp", + "tcps" + ], + "title": "Protocol", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "TlsOracleDatabaseConnectionConfig" + } + }, + "required": [ + "dsn", + "name", + "password", + "user" + ], + "title": "TlsOracleDatabaseConnectionConfig", + "type": "object" + } + ], + "x-abstract-component": false + }, + "BaseTlsPostgresDatabaseConnectionConfig": { + "additionalProperties": false, + "description": "Configuration for a PostgreSQL connection with TLS/SSL support.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "user": { + "title": "User", + "type": "string" + }, + "password": { + "title": "Password", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + }, + "sslmode": { + "default": "require", + "enum": [ + "allow", + "disable", + "prefer", + "require", + "verify-ca", + "verify-full" + ], + "title": "Sslmode", + "type": "string" + }, + "sslcert": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sslcert" + }, + "sslkey": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sslkey" + }, + "sslrootcert": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sslrootcert" + }, + "sslcrl": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sslcrl" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "TlsPostgresDatabaseConnectionConfig" + } + }, + "required": [ + "name", + "password", + "url", + "user" + ], + "title": "TlsPostgresDatabaseConnectionConfig", + "type": "object", + "x-abstract-component": false + }, + "BaseTool": { + "anyOf": [ + { + "$ref": "#/$defs/BuiltinTool" + }, + { + "$ref": "#/$defs/ClientTool" + }, + { + "$ref": "#/$defs/MCPTool" + }, + { + "$ref": "#/$defs/RemoteTool" + }, + { + "$ref": "#/$defs/ServerTool" + } + ], + "x-abstract-component": true + }, + "BaseToolBox": { + "anyOf": [ + { + "$ref": "#/$defs/MCPToolBox" + } + ], + "x-abstract-component": true + }, + "BaseToolNode": { + "additionalProperties": false, + "description": "The tool execution node is a node that will execute a tool as part of a flow.\n\n- **Inputs**\n Inferred from the definition of the tool to execute.\n- **Outputs**\n Inferred from the definition of the tool to execute.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import ToolNode, StartNode, EndNode\n>>> from pyagentspec.tools import ServerTool\n>>> from pyagentspec.property import Property\n>>>\n>>> x_property = Property(json_schema={\"title\": \"x\", \"type\": \"number\"})\n>>> x_square_root_property = Property(\n... json_schema={\"title\": \"x_square_root\", \"type\": \"number\"}\n... )\n>>> square_root_tool = ServerTool(\n... name=\"compute_square_root\",\n... description=\"Computes the square root of a number\",\n... inputs=[x_property],\n... outputs=[x_square_root_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[x_property])\n>>> end_node = EndNode(name=\"end\", outputs=[x_square_root_property])\n>>> tool_node = ToolNode(name=\"\", tool=square_root_tool)\n>>> flow = Flow(\n... name=\"Compute square root flow\",\n... start_node=start_node,\n... nodes=[start_node, tool_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_tool\", from_node=start_node, to_node=tool_node),\n... ControlFlowEdge(name=\"tool_to_end\", from_node=tool_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"x_edge\",\n... source_node=start_node,\n... source_output=\"x\",\n... destination_node=tool_node,\n... destination_input=\"x\",\n... ),\n... DataFlowEdge(\n... name=\"x_square_root_edge\",\n... source_node=tool_node,\n... source_output=\"x_square_root\",\n... destination_node=end_node,\n... destination_input=\"x_square_root\"\n... ),\n... ],\n... )", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "inputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inputs" + }, + "outputs": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Property" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Outputs" + }, + "branches": { + "items": { + "type": "string" + }, + "title": "Branches", + "type": "array" + }, + "tool": { + "$ref": "#/$defs/Tool" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "ToolNode" + } + }, + "required": [ + "name", + "tool" + ], + "title": "ToolNode", + "type": "object", + "x-abstract-component": false + }, + "BaseVllmConfig": { + "additionalProperties": false, + "description": "Class to configure a connection to a vLLM-hosted LLM.\n\nRequires to specify the url at which the instance is running.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "model_id": { + "title": "Model Id", + "type": "string" + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Provider" + }, + "api_provider": { + "const": "vllm", + "default": "vllm", + "title": "Api Provider", + "type": "string" + }, + "api_type": { + "$ref": "#/$defs/OpenAIAPIType", + "default": "chat_completions" + }, + "url": { + "title": "Url", + "type": "string" + }, + "api_key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Api Key" + }, + "default_generation_parameters": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/LlmGenerationConfig" + } + ], + "default": null + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "key_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Key File" + }, + "cert_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Cert File" + }, + "ca_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Ca File" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "VllmConfig" + } + }, + "required": [ + "model_id", + "name", + "url" + ], + "title": "VllmConfig", + "type": "object", + "x-abstract-component": false + }, + "ReferencedComponents": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "$ref": "#/$defs/BaseA2AAgent" + }, + { + "$ref": "#/$defs/BaseA2AConnectionConfig" + }, + { + "$ref": "#/$defs/BaseAgent" + }, + { + "$ref": "#/$defs/BaseAgentNode" + }, + { + "$ref": "#/$defs/BaseAgentSpecializationParameters" + }, + { + "$ref": "#/$defs/BaseAgenticComponent" + }, + { + "$ref": "#/$defs/BaseApiNode" + }, + { + "$ref": "#/$defs/BaseAuthConfig" + }, + { + "$ref": "#/$defs/BaseBranchingNode" + }, + { + "$ref": "#/$defs/BaseBuiltinTool" + }, + { + "$ref": "#/$defs/BaseCatchExceptionNode" + }, + { + "$ref": "#/$defs/BaseClientTool" + }, + { + "$ref": "#/$defs/BaseClientTransport" + }, + { + "$ref": "#/$defs/BaseCodeExecutor" + }, + { + "$ref": "#/$defs/BaseComponentWithIO" + }, + { + "$ref": "#/$defs/BaseControlFlowEdge" + }, + { + "$ref": "#/$defs/BaseConversationSummarizationTransform" + }, + { + "$ref": "#/$defs/BaseDataFlowEdge" + }, + { + "$ref": "#/$defs/BaseDatastore" + }, + { + "$ref": "#/$defs/BaseEndNode" + }, + { + "$ref": "#/$defs/BaseEndpointCodeExecutor" + }, + { + "$ref": "#/$defs/BaseFlow" + }, + { + "$ref": "#/$defs/BaseFlowNode" + }, + { + "$ref": "#/$defs/BaseGeminiAIStudioAuthConfig" + }, + { + "$ref": "#/$defs/BaseGeminiAuthConfig" + }, + { + "$ref": "#/$defs/BaseGeminiConfig" + }, + { + "$ref": "#/$defs/BaseGeminiVertexAIAuthConfig" + }, + { + "$ref": "#/$defs/BaseInMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/BaseInputMessageNode" + }, + { + "$ref": "#/$defs/BaseLlmConfig" + }, + { + "$ref": "#/$defs/BaseLlmNode" + }, + { + "$ref": "#/$defs/BaseLocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/BaseMCPTool" + }, + { + "$ref": "#/$defs/BaseMCPToolBox" + }, + { + "$ref": "#/$defs/BaseMCPToolSpec" + }, + { + "$ref": "#/$defs/BaseMTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/BaseManagerWorkers" + }, + { + "$ref": "#/$defs/BaseMapNode" + }, + { + "$ref": "#/$defs/BaseMessageSummarizationTransform" + }, + { + "$ref": "#/$defs/BaseMessageTransform" + }, + { + "$ref": "#/$defs/BaseNode" + }, + { + "$ref": "#/$defs/BaseOAuthClientConfig" + }, + { + "$ref": "#/$defs/BaseOAuthConfig" + }, + { + "$ref": "#/$defs/BaseOciAgent" + }, + { + "$ref": "#/$defs/BaseOciClientConfig" + }, + { + "$ref": "#/$defs/BaseOciClientConfigWithApiKey" + }, + { + "$ref": "#/$defs/BaseOciClientConfigWithInstancePrincipal" + }, + { + "$ref": "#/$defs/BaseOciClientConfigWithResourcePrincipal" + }, + { + "$ref": "#/$defs/BaseOciClientConfigWithSecurityToken" + }, + { + "$ref": "#/$defs/BaseOciGenAiConfig" + }, + { + "$ref": "#/$defs/BaseOllamaConfig" + }, + { + "$ref": "#/$defs/BaseOpenAiCompatibleConfig" + }, + { + "$ref": "#/$defs/BaseOpenAiConfig" + }, + { + "$ref": "#/$defs/BaseOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/BaseOracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/BaseOutputMessageNode" + }, + { + "$ref": "#/$defs/BaseParallelFlowNode" + }, + { + "$ref": "#/$defs/BaseParallelMapNode" + }, + { + "$ref": "#/$defs/BasePostgresDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/BasePostgresDatabaseDatastore" + }, + { + "$ref": "#/$defs/BaseRemoteAgent" + }, + { + "$ref": "#/$defs/BaseRemoteTool" + }, + { + "$ref": "#/$defs/BaseRemoteTransport" + }, + { + "$ref": "#/$defs/BaseSSETransport" + }, + { + "$ref": "#/$defs/BaseSSEmTLSTransport" + }, + { + "$ref": "#/$defs/BaseServerTool" + }, + { + "$ref": "#/$defs/BaseSpecializedAgent" + }, + { + "$ref": "#/$defs/BaseStartNode" + }, + { + "$ref": "#/$defs/BaseStdioTransport" + }, + { + "$ref": "#/$defs/BaseStreamableHTTPTransport" + }, + { + "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" + }, + { + "$ref": "#/$defs/BaseSubProcessCodeExecutor" + }, + { + "$ref": "#/$defs/BaseSwarm" + }, + { + "$ref": "#/$defs/BaseTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/BaseTlsPostgresDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/BaseTool" + }, + { + "$ref": "#/$defs/BaseToolBox" + }, + { + "$ref": "#/$defs/BaseToolNode" + }, + { + "$ref": "#/$defs/BaseVllmConfig" + }, + { + "$ref": "#/$defs/ComponentReferenceWithNestedReferences" + } + ] + } + }, + "ComponentReference": { + "type": "object", + "properties": { + "$component_ref": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "$component_ref" + ] + }, + "ComponentReferenceWithNestedReferences": { + "type": "object", + "properties": { + "$component_ref": { + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + } + }, + "additionalProperties": false, + "required": [ + "$component_ref", + "$referenced_components" + ] + }, + "VersionedA2AAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseA2AAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedA2AConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseA2AConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedAgentNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgentNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedAgentSpecializationParameters": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgentSpecializationParameters" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedAgenticComponent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseAgenticComponent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedApiNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseApiNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedBranchingNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseBranchingNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedBuiltinTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseBuiltinTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedCatchExceptionNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseCatchExceptionNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedClientTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseClientTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedClientTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseClientTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedComponentWithIO": { + "anyOf": [ + { + "$ref": "#/$defs/BaseComponentWithIO" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedControlFlowEdge": { + "anyOf": [ + { + "$ref": "#/$defs/BaseControlFlowEdge" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedConversationSummarizationTransform": { + "anyOf": [ + { + "$ref": "#/$defs/BaseConversationSummarizationTransform" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedDataFlowEdge": { + "anyOf": [ + { + "$ref": "#/$defs/BaseDataFlowEdge" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BaseDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedEndNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseEndNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedEndpointCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseEndpointCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedFlow": { + "anyOf": [ + { + "$ref": "#/$defs/BaseFlow" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedFlowNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseFlowNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedGeminiAIStudioAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiAIStudioAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedGeminiAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedGeminiConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedGeminiVertexAIAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseGeminiVertexAIAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedInMemoryCollectionDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BaseInMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedInputMessageNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseInputMessageNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedLlmConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLlmConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedLlmNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLlmNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedLocalContainerCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedMCPTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMCPTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedMCPToolBox": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMCPToolBox" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedMCPToolSpec": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMCPToolSpec" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedMTlsOracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedManagerWorkers": { + "anyOf": [ + { + "$ref": "#/$defs/BaseManagerWorkers" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedMapNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMapNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedMessageSummarizationTransform": { + "anyOf": [ + { + "$ref": "#/$defs/BaseMessageSummarizationTransform" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOAuthClientConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOAuthClientConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOAuthConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOAuthConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciClientConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciClientConfigWithApiKey": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithApiKey" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciClientConfigWithInstancePrincipal": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithInstancePrincipal" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciClientConfigWithResourcePrincipal": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithResourcePrincipal" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciClientConfigWithSecurityToken": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciClientConfigWithSecurityToken" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOciGenAiConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOciGenAiConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOllamaConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOllamaConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOpenAiCompatibleConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOpenAiCompatibleConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOpenAiConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOpenAiConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOracleDatabaseDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedOutputMessageNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseOutputMessageNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedParallelFlowNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseParallelFlowNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedParallelMapNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseParallelMapNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedPostgresDatabaseDatastore": { + "anyOf": [ + { + "$ref": "#/$defs/BasePostgresDatabaseDatastore" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedRemoteAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseRemoteAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedRemoteTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseRemoteTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedRemoteTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseRemoteTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedSSETransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSSETransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedSSEmTLSTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSSEmTLSTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedServerTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseServerTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedSpecializedAgent": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSpecializedAgent" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedStartNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStartNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedStdioTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStdioTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedStreamableHTTPTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStreamableHTTPTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedStreamableHTTPmTLSTransport": { + "anyOf": [ + { + "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedSubProcessCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSubProcessCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedSwarm": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSwarm" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedTlsOracleDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedTlsPostgresDatabaseConnectionConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseTlsPostgresDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedTool": { + "anyOf": [ + { + "$ref": "#/$defs/BaseTool" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedToolBox": { + "anyOf": [ + { + "$ref": "#/$defs/BaseToolBox" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedToolNode": { + "anyOf": [ + { + "$ref": "#/$defs/BaseToolNode" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedVllmConfig": { + "anyOf": [ + { + "$ref": "#/$defs/BaseVllmConfig" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, + "VersionedComponentReferenceWithNestedReferences": { + "type": "object", + "properties": { + "$component_ref": { + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + }, + "additionalProperties": false, + "required": [ + "$component_ref", + "$referenced_components" + ] + } + }, + "anyOf": [ + { + "$ref": "#/$defs/VersionedA2AAgent" + }, + { + "$ref": "#/$defs/VersionedA2AConnectionConfig" + }, + { + "$ref": "#/$defs/VersionedAgent" + }, + { + "$ref": "#/$defs/VersionedAgentNode" + }, + { + "$ref": "#/$defs/VersionedAgentSpecializationParameters" + }, + { + "$ref": "#/$defs/VersionedAgenticComponent" + }, + { + "$ref": "#/$defs/VersionedApiNode" + }, + { + "$ref": "#/$defs/VersionedBranchingNode" + }, + { + "$ref": "#/$defs/VersionedBuiltinTool" + }, + { + "$ref": "#/$defs/VersionedCatchExceptionNode" + }, + { + "$ref": "#/$defs/VersionedClientTool" + }, + { + "$ref": "#/$defs/VersionedClientTransport" + }, + { + "$ref": "#/$defs/VersionedCodeExecutor" + }, + { + "$ref": "#/$defs/VersionedComponentReferenceWithNestedReferences" + }, + { + "$ref": "#/$defs/VersionedComponentWithIO" + }, + { + "$ref": "#/$defs/VersionedControlFlowEdge" + }, + { + "$ref": "#/$defs/VersionedConversationSummarizationTransform" + }, + { + "$ref": "#/$defs/VersionedDataFlowEdge" + }, + { + "$ref": "#/$defs/VersionedDatastore" + }, + { + "$ref": "#/$defs/VersionedEndNode" + }, + { + "$ref": "#/$defs/VersionedEndpointCodeExecutor" + }, + { + "$ref": "#/$defs/VersionedFlow" + }, + { + "$ref": "#/$defs/VersionedFlowNode" + }, + { + "$ref": "#/$defs/VersionedGeminiAIStudioAuthConfig" + }, + { + "$ref": "#/$defs/VersionedGeminiAuthConfig" + }, + { + "$ref": "#/$defs/VersionedGeminiConfig" + }, + { + "$ref": "#/$defs/VersionedGeminiVertexAIAuthConfig" + }, + { + "$ref": "#/$defs/VersionedInMemoryCollectionDatastore" + }, + { + "$ref": "#/$defs/VersionedInputMessageNode" + }, + { + "$ref": "#/$defs/VersionedLlmConfig" + }, + { + "$ref": "#/$defs/VersionedLlmNode" + }, + { + "$ref": "#/$defs/VersionedLocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/VersionedMCPTool" + }, + { + "$ref": "#/$defs/VersionedMCPToolBox" + }, + { + "$ref": "#/$defs/VersionedMCPToolSpec" + }, + { + "$ref": "#/$defs/VersionedMTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/VersionedManagerWorkers" + }, + { + "$ref": "#/$defs/VersionedMapNode" + }, + { + "$ref": "#/$defs/VersionedMessageSummarizationTransform" + }, + { + "$ref": "#/$defs/VersionedNode" + }, + { + "$ref": "#/$defs/VersionedOAuthClientConfig" + }, + { + "$ref": "#/$defs/VersionedOAuthConfig" + }, + { + "$ref": "#/$defs/VersionedOciAgent" + }, + { + "$ref": "#/$defs/VersionedOciClientConfig" + }, + { + "$ref": "#/$defs/VersionedOciClientConfigWithApiKey" + }, + { + "$ref": "#/$defs/VersionedOciClientConfigWithInstancePrincipal" + }, + { + "$ref": "#/$defs/VersionedOciClientConfigWithResourcePrincipal" + }, + { + "$ref": "#/$defs/VersionedOciClientConfigWithSecurityToken" + }, + { + "$ref": "#/$defs/VersionedOciGenAiConfig" + }, + { + "$ref": "#/$defs/VersionedOllamaConfig" + }, + { + "$ref": "#/$defs/VersionedOpenAiCompatibleConfig" + }, + { + "$ref": "#/$defs/VersionedOpenAiConfig" + }, + { + "$ref": "#/$defs/VersionedOracleDatabaseDatastore" + }, + { + "$ref": "#/$defs/VersionedOutputMessageNode" + }, + { + "$ref": "#/$defs/VersionedParallelFlowNode" + }, + { + "$ref": "#/$defs/VersionedParallelMapNode" + }, + { + "$ref": "#/$defs/VersionedPostgresDatabaseDatastore" + }, + { + "$ref": "#/$defs/VersionedRemoteAgent" + }, + { + "$ref": "#/$defs/VersionedRemoteTool" + }, + { + "$ref": "#/$defs/VersionedRemoteTransport" + }, + { + "$ref": "#/$defs/VersionedSSETransport" + }, + { + "$ref": "#/$defs/VersionedSSEmTLSTransport" + }, + { + "$ref": "#/$defs/VersionedServerTool" + }, + { + "$ref": "#/$defs/VersionedSpecializedAgent" + }, + { + "$ref": "#/$defs/VersionedStartNode" + }, + { + "$ref": "#/$defs/VersionedStdioTransport" + }, + { + "$ref": "#/$defs/VersionedStreamableHTTPTransport" + }, + { + "$ref": "#/$defs/VersionedStreamableHTTPmTLSTransport" + }, + { + "$ref": "#/$defs/VersionedSubProcessCodeExecutor" + }, + { + "$ref": "#/$defs/VersionedSwarm" + }, + { + "$ref": "#/$defs/VersionedTlsOracleDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/VersionedTlsPostgresDatabaseConnectionConfig" + }, + { + "$ref": "#/$defs/VersionedTool" + }, + { + "$ref": "#/$defs/VersionedToolBox" + }, + { + "$ref": "#/$defs/VersionedToolNode" + }, + { + "$ref": "#/$defs/VersionedVllmConfig" + } + ] +} \ No newline at end of file diff --git a/docs/pyagentspec/source/agentspec/language_spec_nightly.rst b/docs/pyagentspec/source/agentspec/language_spec_nightly.rst index 80aeb86d..b6e087a7 100644 --- a/docs/pyagentspec/source/agentspec/language_spec_nightly.rst +++ b/docs/pyagentspec/source/agentspec/language_spec_nightly.rst @@ -366,6 +366,9 @@ following goals : - A Flow consists of a series of Node instances. There is a "standard library" of nodes for things such as executing a prompt with a LLM, branching, etc. - * A step in the execution of a flow, it corresponds to a specific action + * - Code Executor + - A component that configures a backend for executing code. + - A local container executor using a configured image, or an endpoint executor connected to a hosted sandbox service. * - Relations / edges (flow) - Flow of control and I/O (data) are defined by explicit relationships in Agent Spec. - * Define which is the sequence of nodes that should be executed @@ -1294,6 +1297,75 @@ and raise an error if the values are not expected. **Tool Version:** Our vector_retrieval_tool is not versioned. +Code Executors +^^^^^^^^^^^^^^ + +Agent Spec runtimes can provide backends for executing code. A CodeExecutor +component describes one such backend in a serialized Agent Spec configuration. + +Code executor components do not execute code by themselves and do not contain +the code to execute. They configure runtime-provided execution backends that are +used by other components or runtime features. + +The base CodeExecutor is abstract. Code executor components define +the executor configuration. + +.. code-block:: python + + class CodeExecutor(Component): + timeout_seconds: float + max_code_chars: int + + class SubProcessCodeExecutor(CodeExecutor): + pass + + class LocalContainerCodeExecutor(CodeExecutor): + image: str + + class EndpointCodeExecutor(CodeExecutor): + url: str + headers: Optional[Dictstr, str] + sensitive_headers: SensitiveField[Optional[Dictstr, str]] + retry_policy: OptionalRetryPolicy + +- ``timeout_seconds``: The maximum wall-clock time allowed for one execution. + The default value is 30. +- ``max_code_chars``: The maximum accepted source length in characters. + The default value is 50000. +- ``SubProcessCodeExecutor``: Declares that code execution happens in a local + process managed by the runtime. It does not expose process launch details. +- ``LocalContainerCodeExecutor.image``: Identifies the local container image + used by the runtime for code execution. +- ``EndpointCodeExecutor.url``: Identifies the code execution endpoint. +- ``EndpointCodeExecutor.headers``: Contains non-sensitive headers sent to the + endpoint. +- ``EndpointCodeExecutor.sensitive_headers``: Contains sensitive headers sent + to the endpoint. +- ``EndpointCodeExecutor.retry_policy``: Configures retries for requests sent + to the endpoint. + +Runtime responsibilities +'''''''''''''''''''''''' + +Agent Spec configurations store the executor configuration and shared limits. Runtime +implementations may determine the supported languages, execution modes, dependency +policy, isolation strength, result shape, and any additional execution policy, +or they may defer this responsibility to the code execution server entirely. + +Security considerations +''''''''''''''''''''''' + +Code executor components configure execution backends, and executing code is +security-sensitive. Runtimes document the security properties of each +supported executor component, including isolation boundary, network access, +filesystem access, resource limits, dependency policy, and whether the backend +is appropriate for untrusted code. + +Local process execution is a local execution mechanism, not a strong sandbox. +Hardened deployments use execution backends with stronger isolation, such as +containers, virtual machines, or hosted sandbox services, together with +defense-in-depth controls. + Execution flows ~~~~~~~~~~~~~~~ @@ -3218,7 +3290,7 @@ We put here the current JSON spec of the Agent Spec language. .. collapse:: JSON Schema - .. literalinclude:: json_spec/agentspec_json_spec_26_2_0.json + .. literalinclude:: json_spec/agentspec_json_spec_26_3_0.json :language: json Note about serialization of components diff --git a/docs/pyagentspec/source/api/codeexecutors.rst b/docs/pyagentspec/source/api/codeexecutors.rst new file mode 100644 index 00000000..463d0296 --- /dev/null +++ b/docs/pyagentspec/source/api/codeexecutors.rst @@ -0,0 +1,20 @@ +Code Executors +============== + +This page presents all APIs and classes related to code execution backends. + +.. _codeexecutor: +.. autoclass:: pyagentspec.tools.codeexecutors.CodeExecutor + :exclude-members: model_post_init, model_config + +.. _subprocesscodeexecutor: +.. autoclass:: pyagentspec.tools.codeexecutors.SubProcessCodeExecutor + :exclude-members: model_post_init, model_config + +.. _localcontainercodeexecutor: +.. autoclass:: pyagentspec.tools.codeexecutors.LocalContainerCodeExecutor + :exclude-members: model_post_init, model_config + +.. _endpointcodeexecutor: +.. autoclass:: pyagentspec.tools.codeexecutors.EndpointCodeExecutor + :exclude-members: model_post_init, model_config diff --git a/docs/pyagentspec/source/changelog.rst b/docs/pyagentspec/source/changelog.rst index db693b2a..84139a61 100644 --- a/docs/pyagentspec/source/changelog.rst +++ b/docs/pyagentspec/source/changelog.rst @@ -4,6 +4,17 @@ Changelog Agent Spec |release| -------------------- +New features +^^^^^^^^^^^^ + +* **Code executor components** + + Added ``CodeExecutor``, ``SubProcessCodeExecutor``, ``LocalContainerCodeExecutor``, + and ``EndpointCodeExecutor`` components for configuring runtime-provided code execution + backends with shared timeout and source-length limits. + + + Improvements ^^^^^^^^^^^^ diff --git a/docs/pyagentspec/source/conf.py b/docs/pyagentspec/source/conf.py index 69c33aae..f7082cc5 100644 --- a/docs/pyagentspec/source/conf.py +++ b/docs/pyagentspec/source/conf.py @@ -84,6 +84,11 @@ "sphinx_design", ] +# The API index is generated with a hidden toctree during the build. Sphinx's +# consistency check reports the generated API pages as not included even +# though they are intentionally reachable through that index. +suppress_warnings = ["toc.not_included"] + if docs_version == "dev": language_spec_file = "language_spec_nightly" else: diff --git a/pyagentspec/src/pyagentspec/__init__.py b/pyagentspec/src/pyagentspec/__init__.py index bb22c86b..2fc3420b 100644 --- a/pyagentspec/src/pyagentspec/__init__.py +++ b/pyagentspec/src/pyagentspec/__init__.py @@ -19,6 +19,12 @@ from .a2aagent import A2AAgent, A2AConnectionConfig, A2ASessionParameters from .agent import Agent from .component import Component +from .tools.codeexecutors import ( + CodeExecutor, + EndpointCodeExecutor, + LocalContainerCodeExecutor, + SubProcessCodeExecutor, +) from .managerworkers import ManagerWorkers from .ociagent import OciAgent from .property import Property @@ -35,6 +41,10 @@ "Property", "RetryPolicy", "Component", + "CodeExecutor", + "SubProcessCodeExecutor", + "LocalContainerCodeExecutor", + "EndpointCodeExecutor", "Agent", "OpenAiAgent", "OciAgent", diff --git a/pyagentspec/src/pyagentspec/_component_registry.py b/pyagentspec/src/pyagentspec/_component_registry.py index be871a30..a85199e8 100644 --- a/pyagentspec/src/pyagentspec/_component_registry.py +++ b/pyagentspec/src/pyagentspec/_component_registry.py @@ -13,6 +13,12 @@ from pyagentspec.agenticcomponent import AgenticComponent from pyagentspec.auth import OAuthClientConfig, OAuthConfig from pyagentspec.component import Component, ComponentWithIO +from pyagentspec.tools.codeexecutors import ( + CodeExecutor, + EndpointCodeExecutor, + LocalContainerCodeExecutor, + SubProcessCodeExecutor, +) from pyagentspec.datastores.datastore import Datastore, InMemoryCollectionDatastore from pyagentspec.datastores.oracle import ( MTlsOracleDatabaseConnectionConfig, @@ -100,16 +106,19 @@ "ClientTransport": ClientTransport, "Component": Component, "ComponentWithIO": ComponentWithIO, + "CodeExecutor": CodeExecutor, "ClientTool": ClientTool, "BuiltinTool": BuiltinTool, "ControlFlowEdge": ControlFlowEdge, "DataFlowEdge": DataFlowEdge, "Datastore": Datastore, + "EndpointCodeExecutor": EndpointCodeExecutor, "EndNode": EndNode, "Flow": Flow, "FlowNode": FlowNode, "InMemoryCollectionDatastore": InMemoryCollectionDatastore, "InputMessageNode": InputMessageNode, + "LocalContainerCodeExecutor": LocalContainerCodeExecutor, "LlmConfig": LlmConfig, "LlmNode": LlmNode, "MapNode": MapNode, @@ -145,6 +154,7 @@ "StdioTransport": StdioTransport, "StreamableHTTPTransport": StreamableHTTPTransport, "StreamableHTTPmTLSTransport": StreamableHTTPmTLSTransport, + "SubProcessCodeExecutor": SubProcessCodeExecutor, "Tool": Tool, "ToolBox": ToolBox, "ToolNode": ToolNode, diff --git a/pyagentspec/src/pyagentspec/tools/__init__.py b/pyagentspec/src/pyagentspec/tools/__init__.py index d3a768dd..fb1d8b75 100644 --- a/pyagentspec/src/pyagentspec/tools/__init__.py +++ b/pyagentspec/src/pyagentspec/tools/__init__.py @@ -8,6 +8,12 @@ from .builtintool import BuiltinTool from .clienttool import ClientTool +from .codeexecutors import ( + CodeExecutor, + EndpointCodeExecutor, + LocalContainerCodeExecutor, + SubProcessCodeExecutor, +) from .remotetool import RemoteTool from .servertool import ServerTool from .tool import Tool @@ -15,6 +21,10 @@ __all__ = [ "ClientTool", + "CodeExecutor", + "SubProcessCodeExecutor", + "LocalContainerCodeExecutor", + "EndpointCodeExecutor", "ServerTool", "BuiltinTool", "RemoteTool", diff --git a/pyagentspec/src/pyagentspec/tools/codeexecutors.py b/pyagentspec/src/pyagentspec/tools/codeexecutors.py new file mode 100644 index 00000000..591369d0 --- /dev/null +++ b/pyagentspec/src/pyagentspec/tools/codeexecutors.py @@ -0,0 +1,71 @@ +# Copyright © 2026 Oracle and/or its affiliates. +# +# This software is under the Apache License 2.0 +# (http://www.apache.org/licenses/LICENSE-2.0) or Universal Permissive License +# (https://oss.oracle.com/licenses/upl), at your option. + +"""Code execution backend configuration components.""" + +from typing import Dict, Optional + +from pydantic import Field +from pydantic.json_schema import SkipJsonSchema + +from pyagentspec.component import Component +from pyagentspec.retrypolicy import RetryPolicy +from pyagentspec.sensitive_field import SensitiveField +from pyagentspec.versioning import AgentSpecVersionEnum + +__all__ = [ + "CodeExecutor", + "SubProcessCodeExecutor", + "LocalContainerCodeExecutor", + "EndpointCodeExecutor", +] + + +class CodeExecutor(Component, abstract=True): + """Base component for code execution backends.""" + + timeout_seconds: float = Field(default=30.0, gt=0) + """Maximum wall-clock seconds allowed for one execution.""" + + max_code_chars: int = Field(default=50_000, gt=0) + """Maximum accepted source length in characters.""" + + min_agentspec_version: SkipJsonSchema[AgentSpecVersionEnum] = Field( + default=AgentSpecVersionEnum.v26_3_0, + init=False, + exclude=True, + ) + + +class SubProcessCodeExecutor(CodeExecutor): + """Code executor that declares local process execution. + + Note: The subprocess executor is intended for prototyping only and must + not be used in production deployments. + """ + + +class LocalContainerCodeExecutor(CodeExecutor): + """Code executor that declares local container execution.""" + + image: str + """Local container image used by the runtime for code execution.""" + + +class EndpointCodeExecutor(CodeExecutor): + """Code executor that sends execution requests to an endpoint.""" + + url: str + """Code execution endpoint URL.""" + + headers: Optional[Dict[str, str]] = None + """Non-sensitive headers sent to the endpoint.""" + + sensitive_headers: SensitiveField[Optional[Dict[str, str]]] = None + """Sensitive headers sent to the endpoint.""" + + retry_policy: Optional[RetryPolicy] = None + """Optional retry configuration for requests sent to the endpoint.""" diff --git a/pyagentspec/src/pyagentspec/versioning.py b/pyagentspec/src/pyagentspec/versioning.py index d0dacda5..809d5471 100644 --- a/pyagentspec/src/pyagentspec/versioning.py +++ b/pyagentspec/src/pyagentspec/versioning.py @@ -38,8 +38,9 @@ class AgentSpecVersionEnum(Enum): v26_1_0 = "26.1.0" v26_1_2 = "26.1.2" v26_2_0 = "26.2.0" - current_version = "26.2.0" - latest_supported_version = "26.2.0" + v26_3_0 = "26.3.0" + current_version = "26.3.0" + latest_supported_version = "26.3.0" def __lt__(self, other: "AgentSpecVersionEnum") -> bool: return _version_lt(self.value, other.value) diff --git a/pyagentspec/tests/test_codeexecutors.py b/pyagentspec/tests/test_codeexecutors.py new file mode 100644 index 00000000..cfeae740 --- /dev/null +++ b/pyagentspec/tests/test_codeexecutors.py @@ -0,0 +1,187 @@ +# Copyright © 2026 Oracle and/or its affiliates. +# +# This software is under the Apache License 2.0 +# (http://www.apache.org/licenses/LICENSE-2.0) or Universal Permissive License +# (https://oss.oracle.com/licenses/upl), at your option. + +import json +from typing import Callable + +import pytest +from pydantic import ValidationError + +from pyagentspec import ( + AgentSpecDeserializer, + AgentSpecSerializer, + CodeExecutor, + EndpointCodeExecutor, + LocalContainerCodeExecutor, + RetryPolicy, + SubProcessCodeExecutor, +) +from pyagentspec._component_registry import BUILTIN_CLASS_MAP +from pyagentspec.versioning import AgentSpecVersionEnum + + +def test_code_executor_defaults() -> None: + executor = SubProcessCodeExecutor(name="subprocess") + + assert executor.timeout_seconds == 30.0 + assert executor.max_code_chars == 50_000 + assert executor.component_type == "SubProcessCodeExecutor" + assert executor.min_agentspec_version == AgentSpecVersionEnum.v26_3_0 + + +@pytest.mark.parametrize( + ("field_name", "invalid_value"), + [ + ("timeout_seconds", 0), + ("timeout_seconds", -1), + ("max_code_chars", 0), + ("max_code_chars", -1), + ], +) +def test_code_executor_rejects_non_positive_limits(field_name: str, invalid_value: int) -> None: + with pytest.raises(ValidationError): + SubProcessCodeExecutor(name="subprocess", **{field_name: invalid_value}) + + +@pytest.mark.parametrize( + "executor_class", + [LocalContainerCodeExecutor, EndpointCodeExecutor], +) +def test_code_executor_required_backend_fields(executor_class: type[CodeExecutor]) -> None: + with pytest.raises(ValidationError): + executor_class(name="executor") + + +def test_local_container_executor_and_endpoint_executor_configuration() -> None: + container = LocalContainerCodeExecutor(name="container", image="python:3.12") + endpoint = EndpointCodeExecutor( + name="endpoint", + url="https://executor.example.invalid/run", + headers={"X-Request-Id": "request-id"}, + sensitive_headers={"Authorization": "Bearer secret"}, + ) + + assert container.image == "python:3.12" + assert endpoint.url == "https://executor.example.invalid/run" + assert endpoint.headers == {"X-Request-Id": "request-id"} + assert endpoint.sensitive_headers == {"Authorization": "Bearer secret"} + + +def test_endpoint_sensitive_headers_are_excluded_by_default_and_exported_on_opt_in() -> None: + endpoint = EndpointCodeExecutor( + name="endpoint", + url="https://executor.example.invalid/run", + headers={"X-Request-Id": "request-id"}, + sensitive_headers={"Authorization": "Bearer secret"}, + ) + + serialized = AgentSpecSerializer().to_dict(endpoint) + assert serialized["headers"] == {"X-Request-Id": "request-id"} + # Default serialization replaces non-empty sensitive values with references. + assert serialized["sensitive_headers"] == { + "$component_ref": f"{endpoint.id}.sensitive_headers" + } + + # Sensitive values require an explicit opt-in before they are serialized. + with pytest.warns(UserWarning): + serialized_with_sensitive_headers = AgentSpecSerializer().to_dict( + endpoint, include_sensitive_fields=True + ) + assert serialized_with_sensitive_headers["sensitive_headers"] == { + "Authorization": "Bearer secret" + } + + +def test_endpoint_retry_policy_roundtrip() -> None: + endpoint = EndpointCodeExecutor( + name="endpoint", + url="https://executor.example.invalid/run", + retry_policy=RetryPolicy(max_attempts=3, request_timeout=0.5), + ) + + serialized = AgentSpecSerializer().to_dict(endpoint) + deserialized = AgentSpecDeserializer().from_dict(serialized) + + assert isinstance(deserialized, EndpointCodeExecutor) + assert deserialized.retry_policy == endpoint.retry_policy + assert AgentSpecSerializer().to_dict(deserialized) == serialized + + +def test_code_executor_is_abstract() -> None: + with pytest.raises(TypeError, match="meant to be abstract"): + CodeExecutor(name="executor") + + +@pytest.mark.parametrize( + "executor_class", + [ + CodeExecutor, + SubProcessCodeExecutor, + LocalContainerCodeExecutor, + EndpointCodeExecutor, + ], +) +def test_code_executors_are_builtin_components(executor_class: type[CodeExecutor]) -> None: + assert BUILTIN_CLASS_MAP[executor_class.__name__] is executor_class + + +@pytest.mark.parametrize( + ("executor", "serializer", "deserializer"), + [ + ( + SubProcessCodeExecutor(name="subprocess"), + AgentSpecSerializer().to_json, + AgentSpecDeserializer().from_json, + ), + ( + LocalContainerCodeExecutor(name="container", image="python:3.12"), + AgentSpecSerializer().to_yaml, + AgentSpecDeserializer().from_yaml, + ), + ( + EndpointCodeExecutor( + name="endpoint", + url="https://executor.example.invalid/run", + headers={"X-Request-Id": "request-id"}, + retry_policy=RetryPolicy(max_attempts=3), + ), + AgentSpecSerializer().to_json, + AgentSpecDeserializer().from_json, + ), + ], + ids=["subprocess-json", "container-yaml", "endpoint-json"], +) +def test_code_executor_json_and_yaml_roundtrips( + executor: CodeExecutor, + serializer: Callable[[CodeExecutor], str], + deserializer: Callable[[str], CodeExecutor], +) -> None: + serialized = serializer(executor) + deserialized = deserializer(serialized) + + assert deserialized == executor + if serialized.lstrip().startswith("{"): + assert json.loads(serialized)["component_type"] == executor.component_type + else: + assert "component_type: " + executor.component_type in serialized + + +def test_code_executor_rejects_serialization_before_v26_3_0() -> None: + executor = SubProcessCodeExecutor(name="subprocess") + + with pytest.raises(ValueError, match="Invalid agentspec_version"): + AgentSpecSerializer().to_dict( + executor, agentspec_version=AgentSpecVersionEnum.v26_2_0 + ) + + +def test_code_executor_rejects_deserialization_before_v26_3_0() -> None: + executor = SubProcessCodeExecutor(name="subprocess") + serialized = AgentSpecSerializer().to_dict(executor) + serialized["agentspec_version"] = AgentSpecVersionEnum.v26_2_0.value + + with pytest.raises(ValueError, match="Invalid agentspec_version"): + AgentSpecDeserializer().from_dict(serialized) diff --git a/pyagentspec/tests/test_versioning.py b/pyagentspec/tests/test_versioning.py index 45a3aa9a..d5eece4a 100644 --- a/pyagentspec/tests/test_versioning.py +++ b/pyagentspec/tests/test_versioning.py @@ -30,10 +30,10 @@ from .serialization.conftest import simplest_flow # noqa: F401 -def test_current_version_is_26_2_0() -> None: - assert AgentSpecVersionEnum.current_version == AgentSpecVersionEnum.v26_2_0 - assert AgentSpecVersionEnum.latest_supported_version == AgentSpecVersionEnum.v26_2_0 - assert AgentSpecVersionEnum("26.2.0") == AgentSpecVersionEnum.v26_2_0 +def test_current_version_is_26_3_0() -> None: + assert AgentSpecVersionEnum.current_version == AgentSpecVersionEnum.v26_3_0 + assert AgentSpecVersionEnum.latest_supported_version == AgentSpecVersionEnum.v26_3_0 + assert AgentSpecVersionEnum("26.3.0") == AgentSpecVersionEnum.v26_3_0 def test_flow_exports_with_agentspec_version(simplest_flow: Flow) -> None: From feb00c4cba8db49894dd3044fad7af24ee9d4e5d Mon Sep 17 00:00:00 2001 From: Paul Cayet Date: Thu, 30 Jul 2026 12:24:13 +0000 Subject: [PATCH 2/2] revert to 26.2.0 sufficient --- VERSION | 2 +- .../json_spec/agentspec_json_spec_26_2_0.json | 375 + .../json_spec/agentspec_json_spec_26_3_0.json | 9619 ----------------- .../agentspec/language_spec_nightly.rst | 2 +- .../src/pyagentspec/tools/codeexecutors.py | 2 +- pyagentspec/src/pyagentspec/versioning.py | 5 +- pyagentspec/tests/test_codeexecutors.py | 16 +- pyagentspec/tests/test_versioning.py | 8 +- 8 files changed, 390 insertions(+), 9639 deletions(-) delete mode 100644 docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json diff --git a/VERSION b/VERSION index ffd7385f..6271efa3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -26.2.0.dev7 +26.2.0.dev8 diff --git a/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_2_0.json b/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_2_0.json index 1b3518fd..353174ca 100644 --- a/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_2_0.json +++ b/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_2_0.json @@ -164,6 +164,16 @@ } ] }, + "CodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, "ComponentWithIO": { "anyOf": [ { @@ -224,6 +234,16 @@ } ] }, + "EndpointCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseEndpointCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, "Flow": { "anyOf": [ { @@ -378,6 +398,16 @@ } ] }, + "LocalContainerCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, "MCPTool": { "anyOf": [ { @@ -1000,6 +1030,16 @@ } ] }, + "SubProcessCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSubProcessCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ] + }, "Swarm": { "anyOf": [ { @@ -2241,6 +2281,20 @@ ], "x-abstract-component": true }, + "BaseCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/EndpointCodeExecutor" + }, + { + "$ref": "#/$defs/LocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/SubProcessCodeExecutor" + } + ], + "x-abstract-component": true + }, "BaseComponentWithIO": { "anyOf": [ { @@ -2730,6 +2784,114 @@ "type": "object", "x-abstract-component": false }, + "BaseEndpointCodeExecutor": { + "additionalProperties": false, + "description": "Code executor that sends execution requests to an endpoint.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout_seconds": { + "default": 30.0, + "exclusiveMinimum": 0, + "title": "Timeout Seconds", + "type": "number" + }, + "max_code_chars": { + "default": 50000, + "exclusiveMinimum": 0, + "title": "Max Code Chars", + "type": "integer" + }, + "url": { + "title": "Url", + "type": "string" + }, + "headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Headers" + }, + "sensitive_headers": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Sensitive Headers" + }, + "retry_policy": { + "anyOf": [ + { + "type": "null" + }, + { + "$ref": "#/$defs/RetryPolicy" + } + ], + "default": null + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "EndpointCodeExecutor" + } + }, + "required": [ + "name", + "url" + ], + "title": "EndpointCodeExecutor", + "type": "object", + "x-abstract-component": false + }, "BaseFlow": { "additionalProperties": false, "description": "A flow is a component to model sequences of operations to do in a precised order.\n\nThe operations and sequence is defined by the nodes and transitions associated to the flow.\nSteps can be deterministic, or for some use LLMs.\n\nExample\n-------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import LlmNode, StartNode, EndNode\n>>> prompt_property = Property(\n... json_schema={\"title\": \"prompt\", \"type\": \"string\"}\n... )\n>>> llm_output_property = Property(\n... json_schema={\"title\": \"llm_output\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[prompt_property])\n>>> end_node = EndNode(name=\"end\", outputs=[llm_output_property])\n>>> llm_node = LlmNode(\n... name=\"simple llm node\",\n... llm_config=llm_config,\n... prompt_template=\"{{prompt}}\",\n... inputs=[prompt_property],\n... outputs=[llm_output_property],\n... )\n>>> flow = Flow(\n... name=\"Simple prompting flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"prompt_edge\",\n... source_node=start_node,\n... source_output=\"prompt\",\n... destination_node=llm_node,\n... destination_input=\"prompt\",\n... ),\n... DataFlowEdge(\n... name=\"llm_output_edge\",\n... source_node=llm_node,\n... source_output=\"llm_output\",\n... destination_node=end_node,\n... destination_input=\"llm_output\"\n... ),\n... ],\n... )", @@ -3639,6 +3801,73 @@ "type": "object", "x-abstract-component": false }, + "BaseLocalContainerCodeExecutor": { + "additionalProperties": false, + "description": "Code executor that declares local container execution.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout_seconds": { + "default": 30.0, + "exclusiveMinimum": 0, + "title": "Timeout Seconds", + "type": "number" + }, + "max_code_chars": { + "default": 50000, + "exclusiveMinimum": 0, + "title": "Max Code Chars", + "type": "integer" + }, + "image": { + "title": "Image", + "type": "string" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "LocalContainerCodeExecutor" + } + }, + "required": [ + "image", + "name" + ], + "title": "LocalContainerCodeExecutor", + "type": "object", + "x-abstract-component": false + }, "BaseMCPTool": { "additionalProperties": false, "description": "Class for tools exposed by MCP servers", @@ -7070,6 +7299,68 @@ "type": "object", "x-abstract-component": false }, + "BaseSubProcessCodeExecutor": { + "additionalProperties": false, + "description": "Code executor that declares local process execution.\n\nNote: The subprocess executor is intended for prototyping only and must\nnot be used in production deployments.", + "properties": { + "id": { + "title": "Id", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "metadata": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Metadata" + }, + "timeout_seconds": { + "default": 30.0, + "exclusiveMinimum": 0, + "title": "Timeout Seconds", + "type": "number" + }, + "max_code_chars": { + "default": 50000, + "exclusiveMinimum": 0, + "title": "Max Code Chars", + "type": "integer" + }, + "$referenced_components": { + "$ref": "#/$defs/ReferencedComponents" + }, + "component_type": { + "const": "SubProcessCodeExecutor" + } + }, + "required": [ + "name" + ], + "title": "SubProcessCodeExecutor", + "type": "object", + "x-abstract-component": false + }, "BaseSwarm": { "additionalProperties": false, "description": "Defines a ``Swarm`` conversational component.\n\nA ``Swarm`` is a multi-agent conversational component in which each agent determines\nthe next agent to be executed, based on a list of pre-defined relationships.\nAgents in Swarm can be any ``AgenticComponent``.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.swarm import Swarm\n>>> addition_agent = Agent(name=\"addition_agent\", description=\"Agent that can do additions\", llm_config=llm_config, system_prompt=\"You can do additions.\")\n>>> multiplication_agent = Agent(name=\"multiplication_agent\", description=\"Agent that can do multiplication\", llm_config=llm_config, system_prompt=\"You can do multiplication.\")\n>>> division_agent = Agent(name=\"division_agent\", description=\"Agent that can do division\", llm_config=llm_config, system_prompt=\"You can do division.\")\n>>>\n>>> swarm = Swarm(\n... name=\"swarm\",\n... first_agent=addition_agent,\n... relationships=[\n... (addition_agent, multiplication_agent),\n... (addition_agent, division_agent),\n... (multiplication_agent, division_agent),\n... ]\n... )", @@ -7717,6 +8008,9 @@ { "$ref": "#/$defs/BaseClientTransport" }, + { + "$ref": "#/$defs/BaseCodeExecutor" + }, { "$ref": "#/$defs/BaseComponentWithIO" }, @@ -7735,6 +8029,9 @@ { "$ref": "#/$defs/BaseEndNode" }, + { + "$ref": "#/$defs/BaseEndpointCodeExecutor" + }, { "$ref": "#/$defs/BaseFlow" }, @@ -7765,6 +8062,9 @@ { "$ref": "#/$defs/BaseLlmNode" }, + { + "$ref": "#/$defs/BaseLocalContainerCodeExecutor" + }, { "$ref": "#/$defs/BaseMCPTool" }, @@ -7882,6 +8182,9 @@ { "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" }, + { + "$ref": "#/$defs/BaseSubProcessCodeExecutor" + }, { "$ref": "#/$defs/BaseSwarm" }, @@ -8117,6 +8420,21 @@ } } }, + "VersionedCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, "VersionedComponentWithIO": { "anyOf": [ { @@ -8207,6 +8525,21 @@ } } }, + "VersionedEndpointCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseEndpointCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, "VersionedFlow": { "anyOf": [ { @@ -8357,6 +8690,21 @@ } } }, + "VersionedLocalContainerCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseLocalContainerCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, "VersionedMCPTool": { "anyOf": [ { @@ -8897,6 +9245,21 @@ } } }, + "VersionedSubProcessCodeExecutor": { + "anyOf": [ + { + "$ref": "#/$defs/BaseSubProcessCodeExecutor" + }, + { + "$ref": "#/$defs/ComponentReference" + } + ], + "properties": { + "agentspec_version": { + "$ref": "#/$defs/AgentSpecVersionEnum" + } + } + }, "VersionedSwarm": { "anyOf": [ { @@ -9059,6 +9422,9 @@ { "$ref": "#/$defs/VersionedClientTransport" }, + { + "$ref": "#/$defs/VersionedCodeExecutor" + }, { "$ref": "#/$defs/VersionedComponentReferenceWithNestedReferences" }, @@ -9080,6 +9446,9 @@ { "$ref": "#/$defs/VersionedEndNode" }, + { + "$ref": "#/$defs/VersionedEndpointCodeExecutor" + }, { "$ref": "#/$defs/VersionedFlow" }, @@ -9110,6 +9479,9 @@ { "$ref": "#/$defs/VersionedLlmNode" }, + { + "$ref": "#/$defs/VersionedLocalContainerCodeExecutor" + }, { "$ref": "#/$defs/VersionedMCPTool" }, @@ -9218,6 +9590,9 @@ { "$ref": "#/$defs/VersionedStreamableHTTPmTLSTransport" }, + { + "$ref": "#/$defs/VersionedSubProcessCodeExecutor" + }, { "$ref": "#/$defs/VersionedSwarm" }, diff --git a/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json b/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json deleted file mode 100644 index a4b5db70..00000000 --- a/docs/pyagentspec/source/agentspec/json_spec/agentspec_json_spec_26_3_0.json +++ /dev/null @@ -1,9619 +0,0 @@ -{ - "$defs": { - "A2AAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseA2AAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "A2AConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseA2AConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "A2ASessionParameters": { - "description": "Class to specify parameters of the A2A session.", - "properties": { - "timeout": { - "default": 60.0, - "title": "Timeout", - "type": "number" - }, - "poll_interval": { - "default": 2.0, - "title": "Poll Interval", - "type": "number" - }, - "max_retries": { - "default": 5, - "title": "Max Retries", - "type": "integer" - } - }, - "title": "A2ASessionParameters", - "type": "object" - }, - "Agent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "AgentNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgentNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "AgentSpecVersionEnum": { - "description": "An Enumeration for different versions of Agent Spec.", - "enum": [ - "25.4.1", - "25.4.2", - "26.1.0", - "26.1.2", - "26.2.0", - "26.3.0" - ], - "title": "AgentSpecVersionEnum", - "type": "string" - }, - "AgentSpecializationParameters": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgentSpecializationParameters" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "AgenticComponent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgenticComponent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ApiNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseApiNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "AuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "BranchingNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseBranchingNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "BuiltinTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseBuiltinTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "CatchExceptionNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseCatchExceptionNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ClientTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseClientTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ClientTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseClientTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "CodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ComponentWithIO": { - "anyOf": [ - { - "$ref": "#/$defs/BaseComponentWithIO" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ControlFlowEdge": { - "anyOf": [ - { - "$ref": "#/$defs/BaseControlFlowEdge" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ConversationSummarizationTransform": { - "anyOf": [ - { - "$ref": "#/$defs/BaseConversationSummarizationTransform" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "DataFlowEdge": { - "anyOf": [ - { - "$ref": "#/$defs/BaseDataFlowEdge" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "Datastore": { - "anyOf": [ - { - "$ref": "#/$defs/BaseDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "EndNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseEndNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "EndpointCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseEndpointCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "Flow": { - "anyOf": [ - { - "$ref": "#/$defs/BaseFlow" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "FlowNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseFlowNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "GeminiAIStudioAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiAIStudioAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "GeminiAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "GeminiConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "GeminiVertexAIAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiVertexAIAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "HandoffMode": { - "description": "Controls how agents in a Swarm may delegate work to one another.\n\nThis setting determines whether an agent is equipped with:\n\n * *send_message* \u2014 a tool for asking another agent to perform a sub-task and reply back.\n\n * *handoff_conversation* \u2014 a tool for transferring the full user\u2013agent conversation to another agent.\n\nDepending on the selected mode, agents have different capabilities for delegation and collaboration.", - "enum": [ - "always", - "never", - "optional" - ], - "title": "HandoffMode", - "type": "string" - }, - "InMemoryCollectionDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BaseInMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "InputMessageNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseInputMessageNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "LlmConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseLlmConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "LlmGenerationConfig": { - "additionalProperties": true, - "description": "A configuration object defining LLM generation parameters.\n\nParameters include number of tokens, sampling parameters, etc.", - "properties": { - "max_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Max Tokens" - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Temperature" - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Top P" - } - }, - "title": "LlmGenerationConfig", - "type": "object" - }, - "LlmNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseLlmNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "LocalContainerCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseLocalContainerCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MCPTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMCPTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MCPToolBox": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMCPToolBox" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MCPToolSpec": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMCPToolSpec" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MTlsOracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ManagerWorkers": { - "anyOf": [ - { - "$ref": "#/$defs/BaseManagerWorkers" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MapNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMapNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MessageSummarizationTransform": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMessageSummarizationTransform" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "MessageTransform": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMessageTransform" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ModelProvider": { - "description": "Provider of the model. It is used to ensure the requests to this model respect\nthe format expected by the provider.", - "enum": [ - "COHERE", - "GROK", - "META", - "OTHER", - "XAI" - ], - "title": "ModelProvider", - "type": "string" - }, - "Node": { - "anyOf": [ - { - "$ref": "#/$defs/BaseNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OAuthClientConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOAuthClientConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OAuthEndpoints": { - "description": "Explicit OAuth endpoint configuration.\n\nUse this component when endpoint discovery is not available or not desired.\nThis groups the relevant endpoints required to execute OAuth authorization\ncode flows and token refresh.", - "properties": { - "authorization_endpoint": { - "title": "Authorization Endpoint", - "type": "string" - }, - "token_endpoint": { - "title": "Token Endpoint", - "type": "string" - }, - "refresh_endpoint": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Refresh Endpoint" - }, - "revocation_endpoint": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Revocation Endpoint" - }, - "userinfo_endpoint": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Userinfo Endpoint" - } - }, - "required": [ - "authorization_endpoint", - "token_endpoint" - ], - "title": "OAuthEndpoints", - "type": "object" - }, - "OciAPIType": { - "description": "Enumeration of API Types.", - "enum": [ - "oci", - "openai_chat_completions", - "openai_responses" - ], - "title": "OciAPIType", - "type": "string" - }, - "OciAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OciClientConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OciClientConfigWithApiKey": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithApiKey" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OciClientConfigWithInstancePrincipal": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithInstancePrincipal" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OciClientConfigWithResourcePrincipal": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithResourcePrincipal" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OciClientConfigWithSecurityToken": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithSecurityToken" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OciGenAiConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciGenAiConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OllamaConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOllamaConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OpenAIAPIType": { - "description": "Enumeration of OpenAI API Types.\n\nchat completions: Chat Completions API\nresponses: Responses API", - "enum": [ - "chat_completions", - "responses" - ], - "title": "OpenAIAPIType", - "type": "string" - }, - "OpenAiCompatibleConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOpenAiCompatibleConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OpenAiConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOpenAiConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OracleDatabaseDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "OutputMessageNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOutputMessageNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "PKCEMethod": { - "enum": [ - "S256", - "plain" - ], - "title": "PKCEMethod", - "type": "string" - }, - "PKCEPolicy": { - "description": "Policy configuration for Proof Key for Code Exchange (PKCE).\n\nPKCE mitigates authorization code interception and injection attacks in\nauthorization code flows. Some protocols (such as MCP OAuth) require PKCE.", - "properties": { - "required": { - "default": true, - "title": "Required", - "type": "boolean" - }, - "method": { - "$ref": "#/$defs/PKCEMethod", - "default": "S256" - } - }, - "title": "PKCEPolicy", - "type": "object" - }, - "ParallelFlowNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseParallelFlowNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ParallelMapNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseParallelMapNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "PostgresDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BasePostgresDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "PostgresDatabaseDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BasePostgresDatabaseDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "Property": { - "description": "This object must be a valid JSON Schema", - "type": "object" - }, - "ReductionMethod": { - "description": "Enumerator for the types of reduction available in the MapNode.", - "enum": [ - "append", - "average", - "max", - "min", - "sum" - ], - "title": "ReductionMethod", - "type": "string" - }, - "RemoteAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseRemoteAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "RemoteTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseRemoteTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "RemoteTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseRemoteTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "RetryPolicy": { - "additionalProperties": false, - "properties": { - "max_attempts": { - "default": 2, - "minimum": 0, - "title": "Max Attempts", - "type": "integer" - }, - "request_timeout": { - "anyOf": [ - { - "exclusiveMinimum": 0, - "type": "number" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Request Timeout" - }, - "initial_retry_delay": { - "default": 1.0, - "minimum": 0, - "title": "Initial Retry Delay", - "type": "number" - }, - "max_retry_delay": { - "default": 8.0, - "minimum": 0, - "title": "Max Retry Delay", - "type": "number" - }, - "backoff_factor": { - "default": 2.0, - "exclusiveMinimum": 0, - "title": "Backoff Factor", - "type": "number" - }, - "jitter": { - "anyOf": [ - { - "enum": [ - "decorrelated", - "equal", - "full", - "full_and_equal_for_throttle" - ], - "type": "string" - }, - { - "type": "null" - } - ], - "default": "full_and_equal_for_throttle", - "title": "Jitter" - }, - "service_error_retry_on_any_5xx": { - "default": true, - "title": "Service Error Retry On Any 5Xx", - "type": "boolean" - }, - "recoverable_statuses": { - "additionalProperties": { - "items": { - "type": "string" - }, - "type": "array" - }, - "title": "Recoverable Statuses", - "type": "object" - } - }, - "title": "RetryPolicy", - "type": "object" - }, - "SSETransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSSETransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "SSEmTLSTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSSEmTLSTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ScopePolicy": { - "enum": [ - "fixed", - "use_challenge_or_supported" - ], - "title": "ScopePolicy", - "type": "string" - }, - "ServerTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseServerTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ServingMode": { - "description": "Serving mode to use for the GenAI service", - "enum": [ - "DEDICATED", - "ON_DEMAND" - ], - "title": "ServingMode", - "type": "string" - }, - "SessionParameters": { - "description": "Class to specify parameters of the MCP client session.", - "properties": { - "read_timeout_seconds": { - "default": 60.0, - "title": "Read Timeout Seconds", - "type": "number" - } - }, - "title": "SessionParameters", - "type": "object" - }, - "SpecializedAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSpecializedAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "StartNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStartNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "StdioTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStdioTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "StreamableHTTPTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStreamableHTTPTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "StreamableHTTPmTLSTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "SubProcessCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSubProcessCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "Swarm": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSwarm" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "TlsOracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "TlsPostgresDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseTlsPostgresDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "Tool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ToolBox": { - "anyOf": [ - { - "$ref": "#/$defs/BaseToolBox" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "ToolNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseToolNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "VllmConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseVllmConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ] - }, - "BaseA2AAgent": { - "additionalProperties": false, - "description": "Component which communicates with a remote server agent using the A2A Protocol.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "agent_url": { - "title": "Agent Url", - "type": "string" - }, - "connection_config": { - "$ref": "#/$defs/A2AConnectionConfig" - }, - "session_parameters": { - "$ref": "#/$defs/A2ASessionParameters", - "default": { - "timeout": 60.0, - "poll_interval": 2.0, - "max_retries": 5 - } - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "A2AAgent" - } - }, - "required": [ - "agent_url", - "connection_config", - "name" - ], - "title": "A2AAgent", - "type": "object", - "x-abstract-component": false - }, - "BaseA2AConnectionConfig": { - "additionalProperties": false, - "description": "Class to specify configuration settings for establishing a connection in A2A communication.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "timeout": { - "default": 600.0, - "title": "Timeout", - "type": "number" - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Headers" - }, - "verify": { - "default": true, - "title": "Verify", - "type": "boolean" - }, - "key_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Key File" - }, - "cert_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cert File" - }, - "ssl_ca_cert": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Ssl Ca Cert" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "A2AConnectionConfig" - } - }, - "required": [ - "name" - ], - "title": "A2AConnectionConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseAgent": { - "additionalProperties": false, - "description": "An agent is a component that can do several rounds of conversation to solve a task.\n\nIt can be executed by itself, or be executed in a flow using an AgentNode.\n\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.property import Property\n>>> expertise_property=Property(\n... json_schema={\"title\": \"domain_of_expertise\", \"type\": \"string\"}\n... )\n>>> system_prompt = '''You are an expert in {{domain_of_expertise}}.\n... Please help the users with their requests.'''\n>>> agent = Agent(\n... name=\"Adaptive expert agent\",\n... system_prompt=system_prompt,\n... llm_config=llm_config,\n... inputs=[expertise_property],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "llm_config": { - "$ref": "#/$defs/LlmConfig" - }, - "system_prompt": { - "title": "System Prompt", - "type": "string" - }, - "tools": { - "items": { - "$ref": "#/$defs/Tool" - }, - "title": "Tools", - "type": "array" - }, - "toolboxes": { - "items": { - "$ref": "#/$defs/ToolBox" - }, - "title": "Toolboxes", - "type": "array" - }, - "human_in_the_loop": { - "default": true, - "title": "Human In The Loop", - "type": "boolean" - }, - "transforms": { - "items": { - "$ref": "#/$defs/MessageTransform" - }, - "title": "Transforms", - "type": "array" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "Agent" - } - }, - "required": [ - "llm_config", - "name", - "system_prompt" - ], - "title": "Agent", - "type": "object", - "x-abstract-component": false - }, - "BaseAgentNode": { - "additionalProperties": false, - "description": "The agent execution node is a node that will execute an agent as part of a flow.\n\nIf branches are configured, the agent will be prompted to select a branch before the agent node\ncompletes to transition to another node of the Flow.\n\n- **Inputs**\n Inferred from the definition of the agent to execute.\n- **Outputs**\n Inferred from the definition of the agent to execute.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.nodes import AgentNode, StartNode, EndNode\n>>> from pyagentspec.tools import ServerTool\n>>> query_property = Property(json_schema={\"title\": \"query\", \"type\": \"string\"})\n>>> search_results_property = Property(\n... json_schema={\"title\": \"search_results\", \"type\": \"array\", \"items\": {\"type\": \"string\"}}\n... )\n>>> search_tool = ServerTool(\n... name=\"search_tool\",\n... description=(\n... \"This tool runs a web search with the given query \"\n... \"and returns the most relevant results\"\n... ),\n... inputs=[query_property],\n... outputs=[search_results_property],\n... )\n>>> agent = Agent(\n... name=\"Search agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to gather the required information for the user: {{query}}\"\n... ),\n... tools=[search_tool],\n... outputs=[search_results_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[query_property])\n>>> end_node = EndNode(name=\"end\", outputs=[search_results_property])\n>>> agent_node = AgentNode(\n... name=\"Search agent node\",\n... agent=agent,\n... )\n>>> flow = Flow(\n... name=\"Search agent flow\",\n... start_node=start_node,\n... nodes=[start_node, agent_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_agent\", from_node=start_node, to_node=agent_node),\n... ControlFlowEdge(name=\"agent_to_end\", from_node=agent_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"query\",\n... destination_node=agent_node,\n... destination_input=\"query\",\n... ),\n... DataFlowEdge(\n... name=\"search_results_edge\",\n... source_node=agent_node,\n... source_output=\"search_results\",\n... destination_node=end_node,\n... destination_input=\"search_results\"\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "agent": { - "$ref": "#/$defs/AgenticComponent" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "AgentNode" - } - }, - "required": [ - "agent", - "name" - ], - "title": "AgentNode", - "type": "object", - "x-abstract-component": false - }, - "BaseAgentSpecializationParameters": { - "additionalProperties": false, - "description": "Parameters used to specialize an agent for a certain goal or task.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "additional_instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Additional Instructions" - }, - "additional_tools": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Tool" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Additional Tools" - }, - "human_in_the_loop": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Human In The Loop" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "AgentSpecializationParameters" - } - }, - "required": [ - "name" - ], - "title": "AgentSpecializationParameters", - "type": "object", - "x-abstract-component": false - }, - "BaseAgenticComponent": { - "anyOf": [ - { - "$ref": "#/$defs/A2AAgent" - }, - { - "$ref": "#/$defs/Agent" - }, - { - "$ref": "#/$defs/Flow" - }, - { - "$ref": "#/$defs/ManagerWorkers" - }, - { - "$ref": "#/$defs/OciAgent" - }, - { - "$ref": "#/$defs/RemoteAgent" - }, - { - "$ref": "#/$defs/SpecializedAgent" - }, - { - "$ref": "#/$defs/Swarm" - } - ], - "x-abstract-component": true - }, - "BaseApiNode": { - "additionalProperties": false, - "description": "Make an API call.\n\nThis node is intended to be a part of a Flow.\n\n- **Inputs**\n Inferred from the json spec retrieved from API Spec URI, if available and reachable.\n Otherwise, users have to manually specify them.\n- **Outputs**\n Inferred from the json spec retrieved from API Spec URI, if available and reachable.\n Otherwise, users should manually specify them.\n\n If None is given, ``pyagentspec`` infers a generic property of any type named ``response``.\n- **Branches**\n One, the default next.\n\n\nExamples\n--------\n>>> from pyagentspec.flows.nodes import ApiNode\n>>> from pyagentspec.property import Property\n>>> weather_result_property = Property(\n... json_schema={\n... \"title\": \"zurich_weather\",\n... \"type\": \"object\",\n... \"properties\": {\n... \"temperature\": {\n... \"type\": \"number\",\n... \"description\": \"Temperature in celsius degrees\",\n... },\n... \"weather\": {\"type\": \"string\"}\n... },\n... }\n... )\n>>> call_current_weather_step = ApiNode(\n... name=\"Weather API call node\",\n... url=\"https://example.com/weather\",\n... http_method = \"GET\",\n... query_params={\n... \"location\": \"zurich\",\n... },\n... outputs=[weather_result_property]\n... )\n>>>\n>>> item_id_property = Property(\n... json_schema={\"title\": \"item_id\", \"type\": \"string\"}\n... )\n>>> order_id_property = Property(\n... json_schema={\"title\": \"order_id\", \"type\": \"string\"}\n... )\n>>> store_id_property = Property(\n... json_schema={\"title\": \"store_id\", \"type\": \"string\"}\n... )\n>>> session_id_property = Property(\n... json_schema={\"title\": \"session_id\", \"type\": \"string\"}\n... )\n>>> create_order_step = ApiNode(\n... name=\"Orders api call node\",\n... url=\"https://example.com/orders/{{ order_id }}\",\n... http_method=\"POST\",\n... # sending an object which will automatically be transformed into JSON\n... data={\n... # define a static body parameter\n... \"topic_id\": 12345,\n... # define a templated body parameter.\n... # The value for {{ item_id }} will be taken from the IO system at runtime\n... \"item_id\": \"{{ item_id }}\",\n... },\n... query_params={\n... # provide one templated query parameter called \"store_id\"\n... # which will take its value from the IO system from key \"store_id\"\n... \"store_id\": \"{{ store_id }}\",\n... },\n... headers={\n... # set header session_id. the value is coming from the IO system\n... \"session_id\": \"{{ session_id }}\",\n... },\n... inputs=[item_id_property, order_id_property, store_id_property, session_id_property],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "url": { - "title": "Url", - "type": "string" - }, - "http_method": { - "title": "Http Method", - "type": "string" - }, - "api_spec_uri": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Spec Uri" - }, - "data": { - "anyOf": [ - { - "type": "string" - }, - { - "format": "binary", - "type": "string" - }, - {} - ], - "title": "Data" - }, - "query_params": { - "additionalProperties": true, - "title": "Query Params", - "type": "object" - }, - "headers": { - "additionalProperties": true, - "title": "Headers", - "type": "object" - }, - "sensitive_headers": { - "additionalProperties": true, - "title": "Sensitive Headers", - "type": "object" - }, - "url_allow_list": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url Allow List" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ApiNode" - } - }, - "required": [ - "http_method", - "name", - "url" - ], - "title": "ApiNode", - "type": "object", - "x-abstract-component": false - }, - "BaseAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/OAuthConfig" - } - ], - "x-abstract-component": true - }, - "BaseBranchingNode": { - "additionalProperties": false, - "description": "Select the next node to transition to based on a mapping.\n\nThe input is used as key for the mapping. If the input does not correspond to any of the keys\nof the mapping the branch 'default' will be selected. This node is intended to be a part of a\nFlow.\n\n- **Inputs**\n The input value that should be used as key for the mapping.\n\n If None is given, ``pyagentspec`` infers a string property named ``branching_mapping_key``.\n- **Outputs**\n None.\n- **Branches**\n One for each value in the mapping, plus a branch called ``default``,\n which is the branch taken by the flow when mapping fails\n (i.e., the input does not match any key in the mapping).\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import AgentNode, BranchingNode, StartNode, EndNode\n>>> from pyagentspec.property import Property\n>>> CORRECT_PASSWORD_BRANCH = \"PASSWORD_OK\"\n>>> password_property = Property(\n... json_schema={\"title\": \"password\", \"type\": \"string\"}\n... )\n>>> agent = Agent(\n... name=\"User input agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to ask the password to the user. \"\n... \"Once you get it, submit it and end.\"\n... ),\n... outputs=[password_property],\n... )\n>>> start_node = StartNode(name=\"start\")\n>>> access_granted_end_node = EndNode(\n... name=\"access granted end\", branch_name=\"ACCESS_GRANTED\"\n... )\n>>> access_denied_end_node = EndNode(\n... name=\"access denied end\", branch_name=\"ACCESS_DENIED\"\n... )\n>>> branching_node = BranchingNode(\n... name=\"password check\",\n... mapping={\"123456\": CORRECT_PASSWORD_BRANCH},\n... inputs=[password_property]\n... )\n>>> agent_node = AgentNode(\n... name=\"User input agent node\",\n... agent=agent,\n... )\n>>> assistant = Flow(\n... name=\"Check access flow\",\n... start_node=start_node,\n... nodes=[\n... start_node,\n... agent_node,\n... branching_node,\n... access_granted_end_node,\n... access_denied_end_node\n... ],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_agent\",\n... from_node=start_node,\n... to_node=agent_node\n... ),\n... ControlFlowEdge(\n... name=\"agent_to_branching\",\n... from_node=agent_node,\n... to_node=branching_node\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_access_granted\",\n... from_node=branching_node,\n... from_branch=CORRECT_PASSWORD_BRANCH,\n... to_node=access_granted_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_access_denied\",\n... from_node=branching_node,\n... from_branch=BranchingNode.DEFAULT_BRANCH,\n... to_node=access_denied_end_node,\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"password_edge\",\n... source_node=agent_node,\n... source_output=\"password\",\n... destination_node=branching_node,\n... destination_input=\"password\",\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "mapping": { - "additionalProperties": { - "type": "string" - }, - "title": "Mapping", - "type": "object" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "BranchingNode" - } - }, - "required": [ - "mapping", - "name" - ], - "title": "BranchingNode", - "type": "object", - "x-abstract-component": false - }, - "BaseBuiltinTool": { - "additionalProperties": false, - "description": "A tool that is built into and executed by the orchestrator", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "tool_type": { - "title": "Tool Type", - "type": "string" - }, - "configuration": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Configuration" - }, - "executor_name": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Executor Name" - }, - "tool_version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tool Version" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "BuiltinTool" - } - }, - "required": [ - "name", - "tool_type" - ], - "title": "BuiltinTool", - "type": "object", - "x-abstract-component": false - }, - "BaseCatchExceptionNode": { - "additionalProperties": false, - "description": "Node to execute a Flow and catch exceptions.\n\n- If no exception is caught, the node will transition to the branches of its subflow.\n- If an exception is caught, it will transition to an exception branch.\n\nInputs\n------\nSame as the inputs from the ``subflow``.\n\nOutputs\n-------\n\n- The outputs of the ``subflow``.\n If an exception is raised, the default values of each output property are used.\n- An additional output named ``caught_exception_info`` with type ``string | null``\n and default value ``null``. Executors may populate it with a non-sensitive\n error description when an exception is caught.\n\nBranches\n--------\n\n- The branches of the ``subflow``\n- One additional branch named ``caught_exception_branch``\n\nSecurity Considerations\n-----------------------\n\nSee security considerations regarding exception catching in\nthe :ref:`Security Considerations `", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "subflow": { - "$ref": "#/$defs/Flow" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "CatchExceptionNode" - } - }, - "required": [ - "name", - "subflow" - ], - "title": "CatchExceptionNode", - "type": "object", - "x-abstract-component": false - }, - "BaseClientTool": { - "additionalProperties": false, - "description": "A tool that needs to be run by the client application.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ClientTool" - } - }, - "required": [ - "name" - ], - "title": "ClientTool", - "type": "object", - "x-abstract-component": false - }, - "BaseClientTransport": { - "anyOf": [ - { - "$ref": "#/$defs/RemoteTransport" - }, - { - "$ref": "#/$defs/SSETransport" - }, - { - "$ref": "#/$defs/SSEmTLSTransport" - }, - { - "$ref": "#/$defs/StdioTransport" - }, - { - "$ref": "#/$defs/StreamableHTTPTransport" - }, - { - "$ref": "#/$defs/StreamableHTTPmTLSTransport" - } - ], - "x-abstract-component": true - }, - "BaseCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/EndpointCodeExecutor" - }, - { - "$ref": "#/$defs/LocalContainerCodeExecutor" - }, - { - "$ref": "#/$defs/SubProcessCodeExecutor" - } - ], - "x-abstract-component": true - }, - "BaseComponentWithIO": { - "anyOf": [ - { - "$ref": "#/$defs/A2AAgent" - }, - { - "$ref": "#/$defs/Agent" - }, - { - "$ref": "#/$defs/AgentNode" - }, - { - "$ref": "#/$defs/AgentSpecializationParameters" - }, - { - "$ref": "#/$defs/AgenticComponent" - }, - { - "$ref": "#/$defs/ApiNode" - }, - { - "$ref": "#/$defs/BranchingNode" - }, - { - "$ref": "#/$defs/BuiltinTool" - }, - { - "$ref": "#/$defs/CatchExceptionNode" - }, - { - "$ref": "#/$defs/ClientTool" - }, - { - "$ref": "#/$defs/EndNode" - }, - { - "$ref": "#/$defs/Flow" - }, - { - "$ref": "#/$defs/FlowNode" - }, - { - "$ref": "#/$defs/InputMessageNode" - }, - { - "$ref": "#/$defs/LlmNode" - }, - { - "$ref": "#/$defs/MCPTool" - }, - { - "$ref": "#/$defs/MCPToolSpec" - }, - { - "$ref": "#/$defs/ManagerWorkers" - }, - { - "$ref": "#/$defs/MapNode" - }, - { - "$ref": "#/$defs/Node" - }, - { - "$ref": "#/$defs/OciAgent" - }, - { - "$ref": "#/$defs/OutputMessageNode" - }, - { - "$ref": "#/$defs/ParallelFlowNode" - }, - { - "$ref": "#/$defs/ParallelMapNode" - }, - { - "$ref": "#/$defs/RemoteAgent" - }, - { - "$ref": "#/$defs/RemoteTool" - }, - { - "$ref": "#/$defs/ServerTool" - }, - { - "$ref": "#/$defs/SpecializedAgent" - }, - { - "$ref": "#/$defs/StartNode" - }, - { - "$ref": "#/$defs/Swarm" - }, - { - "$ref": "#/$defs/Tool" - }, - { - "$ref": "#/$defs/ToolNode" - } - ], - "x-abstract-component": true - }, - "BaseControlFlowEdge": { - "additionalProperties": false, - "description": "A control flow edge specifies a possible transition from a node to another in a flow.\n\nA single node can have several potential next nodes, in which case several control flow edges\nshould be present in the control flow connections of that flow.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "from_node": { - "$ref": "#/$defs/Node" - }, - "from_branch": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "From Branch" - }, - "to_node": { - "$ref": "#/$defs/Node" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ControlFlowEdge" - } - }, - "required": [ - "from_node", - "name", - "to_node" - ], - "title": "ControlFlowEdge", - "type": "object", - "x-abstract-component": false - }, - "BaseConversationSummarizationTransform": { - "additionalProperties": false, - "description": "Summarizes conversations exceeding a configured size threshold using an LLM and caches\nconversation summaries in a ``Datastore``.\n\nThis is useful to reduce long conversation history into a concise context for downstream LLM calls.\n\nExamples\n--------\n>>> from pyagentspec.transforms import ConversationSummarizationTransform\n>>> summarization_transform = ConversationSummarizationTransform(\n... name=\"conversation-summarizer\",\n... llm=llm_config,\n... max_num_messages=30,\n... min_num_messages=10\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "llm": { - "$ref": "#/$defs/LlmConfig" - }, - "max_num_messages": { - "anyOf": [ - { - "exclusiveMinimum": 0, - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 50, - "title": "Max Num Messages" - }, - "max_num_characters": { - "anyOf": [ - { - "exclusiveMinimum": 0, - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Max Num Characters" - }, - "min_num_messages": { - "default": 10, - "exclusiveMinimum": 0, - "title": "Min Num Messages", - "type": "integer" - }, - "summarization_instructions": { - "default": "Please make a summary of this conversation. Include relevant information and keep it short. Your response will replace the messages, so just output the summary directly, no introduction needed.", - "title": "Summarization Instructions", - "type": "string" - }, - "summarized_conversation_template": { - "default": "Summarized conversation: {{summary}}", - "title": "Summarized Conversation Template", - "type": "string" - }, - "max_cache_size": { - "anyOf": [ - { - "exclusiveMinimum": 0, - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 10000, - "title": "Max Cache Size" - }, - "max_cache_lifetime": { - "anyOf": [ - { - "exclusiveMinimum": 0, - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 14400, - "title": "Max Cache Lifetime" - }, - "cache_collection_name": { - "default": "summarized_conversations_cache", - "title": "Cache Collection Name", - "type": "string" - }, - "datastore": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/InMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/OracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/PostgresDatabaseDatastore" - } - ], - "title": "Datastore" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ConversationSummarizationTransform" - } - }, - "required": [ - "llm", - "name" - ], - "title": "ConversationSummarizationTransform", - "type": "object", - "x-abstract-component": false - }, - "BaseDataFlowEdge": { - "additionalProperties": false, - "description": "A data flow edge specifies how the output of a node propagates as input of another node.\n\nAn outputs can be propagated as input of several nodes.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "source_node": { - "$ref": "#/$defs/Node" - }, - "source_output": { - "title": "Source Output", - "type": "string" - }, - "destination_node": { - "$ref": "#/$defs/Node" - }, - "destination_input": { - "title": "Destination Input", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "DataFlowEdge" - } - }, - "required": [ - "destination_input", - "destination_node", - "name", - "source_node", - "source_output" - ], - "title": "DataFlowEdge", - "type": "object", - "x-abstract-component": false - }, - "BaseDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/InMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/OracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/PostgresDatabaseDatastore" - } - ], - "x-abstract-component": true - }, - "BaseEndNode": { - "additionalProperties": false, - "description": "End nodes denote the end of the execution of a flow.\n\nThere might be several end nodes in a flow, in which case the executor of the flow\nshould be able to track which one was reached and pass that back to the caller.\n\n- **Inputs**\n The list of inputs of the step. If both input and output properties are specified they\n must be an exact match\n\n If None is given, ``pyagentspec`` copies the outputs provided, if any. Otherwise, no input is exposed.\n- **Outputs**\n The list of outputs that should be exposed by the flow. If both input and output properties\n are specified they must be an exact match\n\n If None is given, ``pyagentspec`` copies the inputs provided, if any. Otherwise, no output is exposed.\n- **Branches**\n None.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import AgentNode, BranchingNode, StartNode, EndNode\n>>> from pyagentspec.property import Property\n>>> languages_to_branch_name = {\n... \"english\": \"ENGLISH\",\n... \"spanish\": \"SPANISH\",\n... \"italian\": \"ITALIAN\",\n... }\n>>> language_property = Property(\n... json_schema={\"title\": \"language\", \"type\": \"string\"}\n... )\n>>> agent = Agent(\n... name=\"Language detector agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to understand the language spoken by the user.\"\n... \"Please output only the language in lowercase and submit.\"\n... ),\n... outputs=[language_property],\n... )\n>>> start_node = StartNode(name=\"start\")\n>>> english_end_node = EndNode(\n... name=\"english end\", branch_name=languages_to_branch_name[\"english\"]\n... )\n>>> spanish_end_node = EndNode(\n... name=\"spanish end\", branch_name=languages_to_branch_name[\"spanish\"]\n... )\n>>> italian_end_node = EndNode(\n... name=\"italian end\", branch_name=languages_to_branch_name[\"italian\"]\n... )\n>>> unknown_end_node = EndNode(name=\"unknown language end\", branch_name=\"unknown\")\n>>> branching_node = BranchingNode(\n... name=\"language check\",\n... mapping=languages_to_branch_name,\n... inputs=[language_property]\n... )\n>>> agent_node = AgentNode(\n... name=\"User input agent node\",\n... agent=agent,\n... )\n>>> assistant = Flow(\n... name=\"Check access flow\",\n... start_node=start_node,\n... nodes=[\n... start_node,\n... agent_node,\n... branching_node,\n... english_end_node,\n... spanish_end_node,\n... italian_end_node,\n... unknown_end_node,\n... ],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_agent\", from_node=start_node, to_node=agent_node\n... ),\n... ControlFlowEdge(\n... name=\"agent_to_branching\", from_node=agent_node, to_node=branching_node\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_english_end\",\n... from_node=branching_node,\n... from_branch=languages_to_branch_name[\"english\"],\n... to_node=english_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_spanish_end\",\n... from_node=branching_node,\n... from_branch=languages_to_branch_name[\"spanish\"],\n... to_node=spanish_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_italian_end\",\n... from_node=branching_node,\n... from_branch=languages_to_branch_name[\"italian\"],\n... to_node=italian_end_node,\n... ),\n... ControlFlowEdge(\n... name=\"branching_to_unknown_end\",\n... from_node=branching_node,\n... from_branch=BranchingNode.DEFAULT_BRANCH,\n... to_node=unknown_end_node,\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"language_edge\",\n... source_node=agent_node,\n... source_output=\"language\",\n... destination_node=branching_node,\n... destination_input=\"language\",\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "branch_name": { - "default": "next", - "title": "Branch Name", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "EndNode" - } - }, - "required": [ - "name" - ], - "title": "EndNode", - "type": "object", - "x-abstract-component": false - }, - "BaseEndpointCodeExecutor": { - "additionalProperties": false, - "description": "Code executor that sends execution requests to an endpoint.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "timeout_seconds": { - "default": 30.0, - "exclusiveMinimum": 0, - "title": "Timeout Seconds", - "type": "number" - }, - "max_code_chars": { - "default": 50000, - "exclusiveMinimum": 0, - "title": "Max Code Chars", - "type": "integer" - }, - "url": { - "title": "Url", - "type": "string" - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Headers" - }, - "sensitive_headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sensitive Headers" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "EndpointCodeExecutor" - } - }, - "required": [ - "name", - "url" - ], - "title": "EndpointCodeExecutor", - "type": "object", - "x-abstract-component": false - }, - "BaseFlow": { - "additionalProperties": false, - "description": "A flow is a component to model sequences of operations to do in a precised order.\n\nThe operations and sequence is defined by the nodes and transitions associated to the flow.\nSteps can be deterministic, or for some use LLMs.\n\nExample\n-------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import LlmNode, StartNode, EndNode\n>>> prompt_property = Property(\n... json_schema={\"title\": \"prompt\", \"type\": \"string\"}\n... )\n>>> llm_output_property = Property(\n... json_schema={\"title\": \"llm_output\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[prompt_property])\n>>> end_node = EndNode(name=\"end\", outputs=[llm_output_property])\n>>> llm_node = LlmNode(\n... name=\"simple llm node\",\n... llm_config=llm_config,\n... prompt_template=\"{{prompt}}\",\n... inputs=[prompt_property],\n... outputs=[llm_output_property],\n... )\n>>> flow = Flow(\n... name=\"Simple prompting flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"prompt_edge\",\n... source_node=start_node,\n... source_output=\"prompt\",\n... destination_node=llm_node,\n... destination_input=\"prompt\",\n... ),\n... DataFlowEdge(\n... name=\"llm_output_edge\",\n... source_node=llm_node,\n... source_output=\"llm_output\",\n... destination_node=end_node,\n... destination_input=\"llm_output\"\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "start_node": { - "$ref": "#/$defs/Node" - }, - "nodes": { - "items": { - "$ref": "#/$defs/Node" - }, - "title": "Nodes", - "type": "array" - }, - "control_flow_connections": { - "items": { - "$ref": "#/$defs/ControlFlowEdge" - }, - "title": "Control Flow Connections", - "type": "array" - }, - "data_flow_connections": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/DataFlowEdge" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Data Flow Connections" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "Flow" - } - }, - "required": [ - "control_flow_connections", - "name", - "nodes", - "start_node" - ], - "title": "Flow", - "type": "object", - "x-abstract-component": false - }, - "BaseFlowNode": { - "additionalProperties": false, - "description": "The flow node executes a subflow as part of a flow.\n\n- **Inputs**\n Inferred from the inner structure. It's the sets of inputs\n required by the StartNode of the inner flow.\n- **Outputs**\n Inferred from the inner structure. It's the union of the\n sets of outputs exposed by the EndNodes of the inner flow.\n- **Branches**\n Inferred from the inner flow, one per each different value of the attribute\n ``branch_name`` of the nodes of type EndNode in the inner flow.\n\nExample\n-------\nThe ``FlowNode`` is particularly suitable when subflows can be reused inside a project.\nLet's see an example with a flow that estimates numerical value\nusing the \"wisdowm of the crowd\" effect:\n\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import MapNode, LlmNode, ToolNode, StartNode, EndNode\n>>> from pyagentspec.tools import ServerTool\n>>> duplication_tool = ServerTool(\n... name=\"duplication_tool\",\n... description=\"\",\n... inputs=[\n... Property(\n... json_schema={\"title\": \"element\", \"description\": \"\", \"type\": \"string\"}\n... ),\n... Property(\n... json_schema={\"title\": \"n\", \"description\": \"\", \"type\": \"integer\"}\n... ),\n... ],\n... outputs=[\n... Property(\n... json_schema={\n... \"title\": \"flow_iterable_queries\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"string\"}\n... },\n... )\n... ],\n... )\n>>> reduce_tool = ServerTool(\n... name=\"reduce_tool\",\n... description=\"\",\n... inputs=[\n... Property(\n... json_schema={\"title\": \"elements\", \"type\": \"array\", \"items\": {\"type\": \"string\"}}\n... ),\n... ],\n... outputs=[Property(json_schema={\"title\": \"flow_processed_query\", \"type\": \"string\"})],\n... )\n>>> # Defining a simple prompt\n>>> REASONING_PROMPT_TEMPLATE = '''Provide your best numerical estimate for: {{user_input}}\n... Your answer should be a single number.\n... Do not include any units, reasoning, or extra text.'''\n>>> # Defining the subflow for the map step\n>>> user_input_property = Property(\n... json_schema={\"title\": \"user_input\", \"type\": \"string\"}\n... )\n>>> flow_processed_query_property = Property(\n... json_schema={\"title\": \"flow_processed_query\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[user_input_property])\n>>> end_node = EndNode(name=\"end\", outputs=[flow_processed_query_property])\n>>> llm_node = LlmNode(\n... name=\"reasoning llm node\",\n... llm_config=llm_config,\n... prompt_template=REASONING_PROMPT_TEMPLATE,\n... inputs=[user_input_property],\n... outputs=[flow_processed_query_property],\n... )\n>>> inner_map_flow = Flow(\n... name=\"Map flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"user_input\",\n... destination_node=llm_node,\n... destination_input=\"user_input\",\n... ),\n... DataFlowEdge(\n... name=\"search_results_edge\",\n... source_node=llm_node,\n... source_output=\"flow_processed_query\",\n... destination_node=end_node,\n... destination_input=\"flow_processed_query\"\n... ),\n... ],\n... )\n>>> user_query_property = Property(\n... json_schema={\"title\": \"user_query\", \"type\": \"string\"}\n... )\n>>> n_repeat_property = Property(\n... json_schema={\"title\": \"n_repeat\", \"type\": \"integer\"}\n... )\n>>> flow_iterable_queries_property = Property(\n... json_schema={\n... \"title\": \"iterated_user_input\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"string\"},\n... }\n... )\n>>> flow_processed_queries_property = Property(\n... json_schema={\n... \"title\": \"collected_flow_processed_query\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"string\"},\n... }\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[user_query_property, n_repeat_property])\n>>> end_node = EndNode(name=\"end\", outputs=[flow_processed_query_property])\n>>> duplication_node = ToolNode(\n... name=\"duplication_tool node\",\n... tool=duplication_tool,\n... )\n>>> reduce_node = ToolNode(\n... name=\"reduce_tool node\",\n... tool=reduce_tool,\n... )\n>>> map_node = MapNode(\n... name=\"map node\",\n... subflow=inner_map_flow,\n... inputs=[flow_iterable_queries_property],\n... outputs=[flow_processed_queries_property],\n... )\n>>> mapreduce_flow = Flow(\n... name=\"Map-reduce flow\",\n... start_node=start_node,\n... nodes=[start_node, duplication_node, map_node, reduce_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_duplication\", from_node=start_node, to_node=duplication_node\n... ),\n... ControlFlowEdge(\n... name=\"duplication_to_map\", from_node=duplication_node, to_node=map_node\n... ),\n... ControlFlowEdge(name=\"map_to_reduce\", from_node=map_node, to_node=reduce_node),\n... ControlFlowEdge(name=\"reduce_to_end\", from_node=reduce_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"user_query\",\n... destination_node=duplication_node,\n... destination_input=\"element\",\n... ),\n... DataFlowEdge(\n... name=\"n_repeat_edge\",\n... source_node=start_node,\n... source_output=\"n_repeat\",\n... destination_node=duplication_node,\n... destination_input=\"n\",\n... ),\n... DataFlowEdge(\n... name=\"flow_iterables_edge\",\n... source_node=duplication_node,\n... source_output=\"flow_iterable_queries\",\n... destination_node=map_node,\n... destination_input=\"iterated_user_input\",\n... ),\n... DataFlowEdge(\n... name=\"flow_processed_queries_edge\",\n... source_node=map_node,\n... source_output=\"collected_flow_processed_query\",\n... destination_node=reduce_node,\n... destination_input=\"elements\",\n... ),\n... DataFlowEdge(\n... name=\"flow_processed_query_edge\",\n... source_node=reduce_node,\n... source_output=\"flow_processed_query\",\n... destination_node=end_node,\n... destination_input=\"flow_processed_query\",\n... ),\n... ],\n... )\n\nOnce the subflow is created we can simply integrate it with the ``FlowNode``:\n\n>>> from pyagentspec.flows.nodes import FlowNode, AgentNode\n>>> from pyagentspec.agent import Agent\n>>> start_node = StartNode(name=\"start\")\n>>> end_node = EndNode(name=\"end\", outputs=[flow_processed_query_property])\n>>> flow_node = FlowNode(name=\"flow node\", subflow=mapreduce_flow)\n>>> agent = Agent(\n... name=\"User interaction agent\",\n... llm_config=llm_config,\n... system_prompt=(\n... \"Your task is to gather from the user the query and the number of times \"\n... \"it should be asked to an LLM. Once you have this information, submit and exit.\"\n... ),\n... outputs=[user_query_property, n_repeat_property],\n... )\n>>> agent_node = AgentNode(name=\"flow node\", agent=agent)\n>>> flow = Flow(\n... name=\"Map flow\",\n... start_node=start_node,\n... nodes=[start_node, agent_node, flow_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_agent\", from_node=start_node, to_node=agent_node),\n... ControlFlowEdge(name=\"agent_to_flow\", from_node=agent_node, to_node=flow_node),\n... ControlFlowEdge(name=\"flow_to_end\", from_node=flow_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=agent_node,\n... source_output=\"user_query\",\n... destination_node=flow_node,\n... destination_input=\"user_query\",\n... ),\n... DataFlowEdge(\n... name=\"n_rep_edge\",\n... source_node=agent_node,\n... source_output=\"n_repeat\",\n... destination_node=flow_node,\n... destination_input=\"n_repeat\"\n... ),\n... DataFlowEdge(\n... name=\"n_rep_edge\",\n... source_node=flow_node,\n... source_output=\"flow_processed_query\",\n... destination_node=end_node,\n... destination_input=\"flow_processed_query\"\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "subflow": { - "$ref": "#/$defs/Flow" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "FlowNode" - } - }, - "required": [ - "name", - "subflow" - ], - "title": "FlowNode", - "type": "object", - "x-abstract-component": false - }, - "BaseGeminiAIStudioAuthConfig": { - "additionalProperties": false, - "description": "Authentication settings for Gemini via Google AI Studio.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "GeminiAIStudioAuthConfig" - } - }, - "required": [ - "name" - ], - "title": "GeminiAIStudioAuthConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseGeminiAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/GeminiAIStudioAuthConfig" - }, - { - "$ref": "#/$defs/GeminiVertexAIAuthConfig" - } - ], - "x-abstract-component": true - }, - "BaseGeminiConfig": { - "additionalProperties": false, - "description": "Configure a connection to a Gemini LLM (AI Studio or Vertex AI).", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "const": "google", - "default": "google", - "title": "Provider", - "type": "string" - }, - "api_provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Provider" - }, - "api_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Type" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "auth": { - "$ref": "#/$defs/GeminiAuthConfig" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "GeminiConfig" - } - }, - "required": [ - "auth", - "model_id", - "name" - ], - "title": "GeminiConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseGeminiVertexAIAuthConfig": { - "additionalProperties": false, - "description": "Authentication settings for Gemini via Google Vertex AI.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "project_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Project Id" - }, - "location": { - "default": "global", - "title": "Location", - "type": "string" - }, - "credentials": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Credentials" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "GeminiVertexAIAuthConfig" - } - }, - "required": [ - "name" - ], - "title": "GeminiVertexAIAuthConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseInMemoryCollectionDatastore": { - "additionalProperties": false, - "description": "In-memory datastore for testing and development purposes.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "datastore_schema": { - "additionalProperties": { - "$ref": "#/$defs/Property" - }, - "title": "Datastore Schema", - "type": "object" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "InMemoryCollectionDatastore" - } - }, - "required": [ - "datastore_schema", - "name" - ], - "title": "InMemoryCollectionDatastore", - "type": "object", - "x-abstract-component": false - }, - "BaseInputMessageNode": { - "additionalProperties": false, - "description": "This node interrupts the execution of the flow in order to wait for a user input, and restarts after receiving it.\nAn agent message, if given, is appended to the conversation before waiting for input.\nUser input is appended to the conversation as a user message, and it is returned as a string property from the node.\n\n- **Inputs**\n One per variable in the message\n- **Outputs**\n One string property that represents the content of the input user message.\n\n If None is given, ``pyagentspec`` infers a string property named ``user_input``.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import StartNode, EndNode, InputMessageNode, OutputMessageNode, LlmNode\n>>> from pyagentspec.property import StringProperty\n>>> start_node = StartNode(name=\"start\")\n>>> prompt_node = OutputMessageNode(name=\"ask_input\", message=\"What is the paragraph you want to rephrase?\")\n>>> input_node = InputMessageNode(name=\"user_input\", outputs=[StringProperty(title=\"user_input\")])\n>>> llm_node = LlmNode(\n... name=\"rephrase\",\n... llm_config=llm_config,\n... prompt_template=\"Rephrase {{user_input}}\",\n... outputs=[StringProperty(title=\"rephrased_user_input\")],\n... )\n>>> output_node = OutputMessageNode(name=\"ask_input\", message=\"{{rephrased_user_input}}\")\n>>> end_node = EndNode(name=\"end\")\n>>> flow = Flow(\n... name=\"rephrase_paragraph_flow\",\n... start_node=start_node,\n... nodes=[start_node, prompt_node, input_node, llm_node, output_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"ce1\", from_node=start_node, to_node=prompt_node),\n... ControlFlowEdge(name=\"ce2\", from_node=prompt_node, to_node=input_node),\n... ControlFlowEdge(name=\"ce3\", from_node=input_node, to_node=llm_node),\n... ControlFlowEdge(name=\"ce4\", from_node=llm_node, to_node=output_node),\n... ControlFlowEdge(name=\"ce5\", from_node=output_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"de1\",\n... source_node=input_node,\n... source_output=\"user_input\",\n... destination_node=llm_node,\n... destination_input=\"user_input\",\n... ),\n... DataFlowEdge(\n... name=\"de2\",\n... source_node=llm_node,\n... source_output=\"rephrased_user_input\",\n... destination_node=output_node,\n... destination_input=\"rephrased_user_input\",\n... ),\n... ]\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Message" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "InputMessageNode" - } - }, - "required": [ - "name" - ], - "title": "InputMessageNode", - "type": "object", - "x-abstract-component": false - }, - "BaseLlmConfig": { - "anyOf": [ - { - "$ref": "#/$defs/GeminiConfig" - }, - { - "$ref": "#/$defs/OciGenAiConfig" - }, - { - "$ref": "#/$defs/OllamaConfig" - }, - { - "$ref": "#/$defs/OpenAiCompatibleConfig" - }, - { - "$ref": "#/$defs/OpenAiConfig" - }, - { - "$ref": "#/$defs/VllmConfig" - }, - { - "additionalProperties": false, - "description": "A LLM configuration defines how to connect to a LLM to do generation requests.\n\nThis class can be used directly with the ``provider``, ``api_provider``, and ``api_type``\nfields to describe any LLM without a dedicated subclass. Concrete subclasses provide\nadditional configuration for specific LLM providers.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Provider" - }, - "api_provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Provider" - }, - "api_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Type" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "LlmConfig" - } - }, - "required": [ - "model_id", - "name" - ], - "title": "LlmConfig", - "type": "object" - } - ], - "x-abstract-component": false - }, - "BaseLlmNode": { - "additionalProperties": false, - "description": "Execute a prompt template with a given LLM.\n\nThis node is intended to be a part of a Flow.\n\n- **Inputs**\n One per placeholder in the prompt template.\n- **Outputs**\n The output text generated by the LLM.\n\n If None is given, ``pyagentspec`` infers a string property named ``generated_text``.\n- **Branches**\n One, the default next.\n\nExample\n-------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.nodes import LlmNode, StartNode, EndNode\n>>> country_property = Property(\n... json_schema={\"title\": \"country\", \"type\": \"string\"}\n... )\n>>> capital_property = Property(\n... json_schema={\"title\": \"capital\", \"type\": \"string\"}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[country_property])\n>>> end_node = EndNode(name=\"end\", outputs=[capital_property])\n>>> llm_node = LlmNode(\n... name=\"simple llm node\",\n... llm_config=llm_config,\n... prompt_template=\"What is the capital of {{ country }}?\",\n... inputs=[country_property],\n... outputs=[capital_property],\n... )\n>>> flow = Flow(\n... name=\"Get the country's capital flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"country_edge\",\n... source_node=start_node,\n... source_output=\"country\",\n... destination_node=llm_node,\n... destination_input=\"country\",\n... ),\n... DataFlowEdge(\n... name=\"capital_edge\",\n... source_node=llm_node,\n... source_output=\"capital\",\n... destination_node=end_node,\n... destination_input=\"capital\"\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "llm_config": { - "$ref": "#/$defs/LlmConfig" - }, - "prompt_template": { - "title": "Prompt Template", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "LlmNode" - } - }, - "required": [ - "llm_config", - "name", - "prompt_template" - ], - "title": "LlmNode", - "type": "object", - "x-abstract-component": false - }, - "BaseLocalContainerCodeExecutor": { - "additionalProperties": false, - "description": "Code executor that declares local container execution.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "timeout_seconds": { - "default": 30.0, - "exclusiveMinimum": 0, - "title": "Timeout Seconds", - "type": "number" - }, - "max_code_chars": { - "default": 50000, - "exclusiveMinimum": 0, - "title": "Max Code Chars", - "type": "integer" - }, - "image": { - "title": "Image", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "LocalContainerCodeExecutor" - } - }, - "required": [ - "image", - "name" - ], - "title": "LocalContainerCodeExecutor", - "type": "object", - "x-abstract-component": false - }, - "BaseMCPTool": { - "additionalProperties": false, - "description": "Class for tools exposed by MCP servers", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "client_transport": { - "$ref": "#/$defs/ClientTransport" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "MCPTool" - } - }, - "required": [ - "client_transport", - "name" - ], - "title": "MCPTool", - "type": "object", - "x-abstract-component": false - }, - "BaseMCPToolBox": { - "additionalProperties": false, - "description": "Class to dynamically expose a list of tools from a MCP Server.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "client_transport": { - "$ref": "#/$defs/ClientTransport" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "tool_filter": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/$defs/MCPToolSpec" - } - ] - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Tool Filter" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "MCPToolBox" - } - }, - "required": [ - "client_transport", - "name" - ], - "title": "MCPToolBox", - "type": "object", - "x-abstract-component": false - }, - "BaseMCPToolSpec": { - "additionalProperties": false, - "description": "Specification of MCP tool", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "MCPToolSpec" - } - }, - "required": [ - "name" - ], - "title": "MCPToolSpec", - "type": "object", - "x-abstract-component": false - }, - "BaseMTlsOracleDatabaseConnectionConfig": { - "additionalProperties": false, - "description": "Mutual-TLS Connection Configuration to Oracle Database.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "user": { - "title": "User", - "type": "string" - }, - "password": { - "title": "Password", - "type": "string" - }, - "dsn": { - "title": "Dsn", - "type": "string" - }, - "config_dir": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Config Dir" - }, - "protocol": { - "default": "tcps", - "enum": [ - "tcp", - "tcps" - ], - "title": "Protocol", - "type": "string" - }, - "wallet_location": { - "title": "Wallet Location", - "type": "string" - }, - "wallet_password": { - "title": "Wallet Password", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "MTlsOracleDatabaseConnectionConfig" - } - }, - "required": [ - "dsn", - "name", - "password", - "user", - "wallet_location", - "wallet_password" - ], - "title": "MTlsOracleDatabaseConnectionConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseManagerWorkers": { - "additionalProperties": false, - "description": "Defines a ``ManagerWorkers`` conversational component.\n\nA ``ManagerWorkers`` is a multi-agent conversational component in which a group manager\nassigns tasks to the workers. The group manager and workers can be instantiated from\nany ``AgenticComponent`` type.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.managerworkers import ManagerWorkers\n>>> manager_agent = Agent(\n... name=\"manager_agent\",\n... description=\"Agent that manages a group of math agents\",\n... llm_config=llm_config,\n... system_prompt=\"You are the manager of a group of math agents\"\n... )\n>>> multiplication_agent = Agent(\n... name=\"multiplication_agent\",\n... description=\"Agent that can do multiplication\",\n... llm_config=llm_config,\n... system_prompt=\"You can do multiplication.\"\n... )\n>>> division_agent = Agent(\n... name=\"division_agent\",\n... description=\"Agent that can do division\",\n... llm_config=llm_config,\n... system_prompt=\"You can do division.\"\n... )\n>>> group = ManagerWorkers(\n... name=\"managerworkers\",\n... group_manager=manager_agent,\n... workers=[multiplication_agent, division_agent],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "group_manager": { - "$ref": "#/$defs/AgenticComponent" - }, - "workers": { - "items": { - "$ref": "#/$defs/AgenticComponent" - }, - "title": "Workers", - "type": "array" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ManagerWorkers" - } - }, - "required": [ - "group_manager", - "name", - "workers" - ], - "title": "ManagerWorkers", - "type": "object", - "x-abstract-component": false - }, - "BaseMapNode": { - "additionalProperties": false, - "description": "The map node executes a subflow on each element of a given input as part of a flow.\n\n- **Inputs**\n Inferred from the inner structure. It's the sets of inputs\n required by the StartNode of the inner flow.\n The names of the inputs will be the ones of the inner flow,\n complemented with the ``iterated_`` prefix. Their type is\n ``Union[inner_type, List[inner_type]]``, where ``inner_type``\n is the type of the respective input in the inner flow.\n\n If None is given, ``pyagentspec`` infers input properties directly from the inner flow,\n specifying title and type according to the rules defined above.\n\n- **Outputs**\n Inferred from the inner structure. It's the union of the\n sets of outputs exposed by the EndNodes of the inner flow,\n combined with the reducer method of each output.\n The names of the outputs will be the ones of the inner flow,\n complemented with the ``collected_`` prefix. Their type depends\n on the ``reduce`` method specified for that output:\n\n - ``List`` of the respective output type in case of ``append``\n - same type of the respective output type in case of ``sum``, ``avg``\n\n If None is given, ``pyagentspec`` infers outputs by exposing\n an output property for each entry in the ``reducers`` dictionary, specifying title\n and type according to the rules defined above.\n\n- **Branches**\n One, the default next.\n\nExamples\n--------\nIn this example we will create a flow that returns\nan L2-normalized version of a given list of numbers.\n\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import EndNode, StartNode, MapNode, ToolNode\n>>> from pyagentspec.tools import ServerTool\n\nFirst, we define a MapNode that returns the square of all the elements in a list.\nIt will be used to compute the L2-norm.\n\n>>> x_property = Property(json_schema={\"title\": \"x\", \"type\": \"number\"})\n>>> x_square_property = Property(\n... json_schema={\"title\": \"x_square\", \"type\": \"number\"}\n... )\n>>> square_tool = ServerTool(\n... name=\"compute_square_tool\",\n... description=\"Computes the square of a number\",\n... inputs=[x_property],\n... outputs=[x_square_property],\n... )\n>>> list_of_x_property = Property(\n... json_schema={\"title\": \"x_list\", \"type\": \"array\", \"items\": {\"type\": \"number\"}}\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[x_property])\n>>> end_node = EndNode(name=\"end\", outputs=[x_square_property])\n>>> square_tool_node = ToolNode(name=\"square tool node\", tool=square_tool)\n>>> square_number_flow = Flow(\n... name=\"Square number flow\",\n... start_node=start_node,\n... nodes=[start_node, square_tool_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_tool\", from_node=start_node, to_node=square_tool_node\n... ),\n... ControlFlowEdge(\n... name=\"tool_to_end\", from_node=square_tool_node, to_node=end_node\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"x_edge\",\n... source_node=start_node,\n... source_output=\"x\",\n... destination_node=square_tool_node,\n... destination_input=\"x\",\n... ),\n... DataFlowEdge(\n... name=\"x_square_edge\",\n... source_node=square_tool_node,\n... source_output=\"x_square\",\n... destination_node=end_node,\n... destination_input=\"x_square\",\n... ),\n... ],\n... )\n>>> list_of_x_square_property = Property(\n... json_schema={\"title\": \"x_square_list\", \"type\": \"array\", \"items\": {\"type\": \"number\"}}\n... )\n>>> square_numbers_map_node = MapNode(\n... name=\"square number map node\",\n... subflow=square_number_flow,\n... )\n\nNow we define the MapNode responsible for normalizing the given list of input numbers.\nThe denominator is the same for all of the numbers,\nwe are going to map only the numerators (i.e., the input numbers).\n\n>>> numerator_property = Property(\n... json_schema={\"title\": \"numerator\", \"type\": \"number\"}\n... )\n>>> denominator_property = Property(\n... json_schema={\"title\": \"denominator\", \"type\": \"number\"}\n... )\n>>> result_property = Property(\n... json_schema={\"title\": \"result\", \"type\": \"number\"}\n... )\n>>> division_tool = ServerTool(\n... name=\"division_tool\",\n... description=\"Computes the ratio between two numbers\",\n... inputs=[numerator_property, denominator_property],\n... outputs=[result_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[numerator_property, denominator_property])\n>>> end_node = EndNode(name=\"end\", outputs=[result_property])\n>>> divide_node = ToolNode(name=\"divide node\", tool=division_tool)\n>>> normalize_flow = Flow(\n... name=\"Normalize flow\",\n... start_node=start_node,\n... nodes=[start_node, divide_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_tool\", from_node=start_node, to_node=divide_node),\n... ControlFlowEdge(name=\"tool_to_end\", from_node=divide_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"numerator_edge\",\n... source_node=start_node,\n... source_output=\"numerator\",\n... destination_node=divide_node,\n... destination_input=\"numerator\",\n... ),\n... DataFlowEdge(\n... name=\"denominator_edge\",\n... source_node=start_node,\n... source_output=\"denominator\",\n... destination_node=divide_node,\n... destination_input=\"denominator\",\n... ),\n... DataFlowEdge(\n... name=\"result_edge\",\n... source_node=divide_node,\n... source_output=\"result\",\n... destination_node=end_node,\n... destination_input=\"result\",\n... ),\n... ],\n... )\n\nFinally, we define the overall flow:\n\n- The list of inputs is squared\n- The squared list is summed and root squared\n- The list of inputs is normalized based on the outcomes of the previous 2 steps\n\n>>> squared_sum_property = Property(\n... json_schema={\"title\": \"squared_sum\", \"type\": \"number\"}\n... )\n>>> normalized_list_of_x_property = Property(\n... json_schema={\n... \"title\": \"x_list_normalized\",\n... \"type\": \"array\",\n... \"items\": {\"type\": \"number\"},\n... }\n... )\n>>> normalize_map_node = MapNode(\n... name=\"normalize map node\",\n... subflow=normalize_flow,\n... )\n>>> squared_sum_tool = ServerTool(\n... name=\"squared_sum_tool\",\n... description=\"Computes the squared sum of a list of numbers\",\n... inputs=[list_of_x_property],\n... outputs=[squared_sum_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[list_of_x_property])\n>>> end_node = EndNode(name=\"end\", outputs=[normalized_list_of_x_property])\n>>> squared_sum_tool_node = ToolNode(name=\"squared sum tool node\", tool=squared_sum_tool)\n>>> flow = Flow(\n... name=\"L2 normalize flow\",\n... start_node=start_node,\n... nodes=[\n... start_node,\n... square_numbers_map_node,\n... squared_sum_tool_node,\n... normalize_map_node,\n... end_node,\n... ],\n... control_flow_connections=[\n... ControlFlowEdge(\n... name=\"start_to_square_numbers\",\n... from_node=start_node,\n... to_node=square_numbers_map_node\n... ),\n... ControlFlowEdge(\n... name=\"square_numbers_to_squared_sum_tool\",\n... from_node=square_numbers_map_node,\n... to_node=squared_sum_tool_node\n... ),\n... ControlFlowEdge(\n... name=\"squared_sum_tool_to_normalize\",\n... from_node=squared_sum_tool_node,\n... to_node=normalize_map_node\n... ),\n... ControlFlowEdge(\n... name=\"normalize_to_end\",\n... from_node=normalize_map_node,\n... to_node=end_node\n... ),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"list_of_x_edge\",\n... source_node=start_node,\n... source_output=\"x_list\",\n... destination_node=square_numbers_map_node,\n... destination_input=\"iterated_x\",\n... ),\n... DataFlowEdge(\n... name=\"x_square_list_edge\",\n... source_node=square_numbers_map_node,\n... source_output=\"collected_x_square\",\n... destination_node=squared_sum_tool_node,\n... destination_input=\"x_list\",\n... ),\n... DataFlowEdge(\n... name=\"numerator_edge\",\n... source_node=start_node,\n... source_output=\"x_list\",\n... destination_node=normalize_map_node,\n... destination_input=\"iterated_numerator\",\n... ),\n... DataFlowEdge(\n... name=\"denominator_edge\",\n... source_node=squared_sum_tool_node,\n... source_output=\"squared_sum\",\n... destination_node=normalize_map_node,\n... destination_input=\"iterated_denominator\",\n... ),\n... DataFlowEdge(\n... name=\"x_list_normalized_edge\",\n... source_node=normalize_map_node,\n... source_output=\"collected_result\",\n... destination_node=end_node,\n... destination_input=\"x_list_normalized\",\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "subflow": { - "$ref": "#/$defs/Flow" - }, - "reducers": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/$defs/ReductionMethod" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Reducers" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "MapNode" - } - }, - "required": [ - "name", - "subflow" - ], - "title": "MapNode", - "type": "object", - "x-abstract-component": false - }, - "BaseMessageSummarizationTransform": { - "additionalProperties": false, - "description": "Summarizes oversized messages using an LLM and optionally caches summaries.\n\nThis is useful for long conversations where the context can become too large for the LLM to handle.\n\nExamples\n--------\n>>> from pyagentspec.transforms import MessageSummarizationTransform\n>>> summarization_transform = MessageSummarizationTransform(\n... name=\"message-summarizer\",\n... llm=llm_config,\n... max_message_size=30_000\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "llm": { - "$ref": "#/$defs/LlmConfig" - }, - "max_message_size": { - "default": 20000, - "title": "Max Message Size", - "type": "integer" - }, - "summarization_instructions": { - "default": "Please make a summary of this message. Include relevant information and keep it short. Your response will replace the message, so just output the summary directly, no introduction needed.", - "title": "Summarization Instructions", - "type": "string" - }, - "summarized_message_template": { - "default": "Summarized message: {{summary}}", - "title": "Summarized Message Template", - "type": "string" - }, - "max_cache_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 10000, - "title": "Max Cache Size" - }, - "max_cache_lifetime": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 14400, - "title": "Max Cache Lifetime" - }, - "cache_collection_name": { - "default": "summarized_messages_cache", - "title": "Cache Collection Name", - "type": "string" - }, - "datastore": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/InMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/OracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/PostgresDatabaseDatastore" - } - ], - "title": "Datastore" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "MessageSummarizationTransform" - } - }, - "required": [ - "llm", - "name" - ], - "title": "MessageSummarizationTransform", - "type": "object", - "x-abstract-component": false - }, - "BaseMessageTransform": { - "anyOf": [ - { - "$ref": "#/$defs/ConversationSummarizationTransform" - }, - { - "$ref": "#/$defs/MessageSummarizationTransform" - } - ], - "x-abstract-component": true - }, - "BaseNode": { - "anyOf": [ - { - "$ref": "#/$defs/AgentNode" - }, - { - "$ref": "#/$defs/ApiNode" - }, - { - "$ref": "#/$defs/BranchingNode" - }, - { - "$ref": "#/$defs/CatchExceptionNode" - }, - { - "$ref": "#/$defs/EndNode" - }, - { - "$ref": "#/$defs/FlowNode" - }, - { - "$ref": "#/$defs/InputMessageNode" - }, - { - "$ref": "#/$defs/LlmNode" - }, - { - "$ref": "#/$defs/MapNode" - }, - { - "$ref": "#/$defs/OutputMessageNode" - }, - { - "$ref": "#/$defs/ParallelFlowNode" - }, - { - "$ref": "#/$defs/ParallelMapNode" - }, - { - "$ref": "#/$defs/StartNode" - }, - { - "$ref": "#/$defs/ToolNode" - } - ], - "x-abstract-component": true - }, - "BaseOAuthClientConfig": { - "additionalProperties": false, - "description": "OAuth client identity / registration configuration.\n\nThis configuration describes how the runtime establishes the OAuth client\nidentity to use with the authorization server. It supports:\n- Pre-registered clients (static client_id/client_secret)\n- Client ID Metadata Documents (URL-formatted client_id)\n- Dynamic client registration (RFC 7591)", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "min_agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum", - "default": "26.1.2" - }, - "type": { - "enum": [ - "client_id_metadata_document", - "dynamic_registration", - "pre_registered" - ], - "title": "Type", - "type": "string" - }, - "client_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Client Id" - }, - "client_secret": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Client Secret" - }, - "token_endpoint_auth_method": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Token Endpoint Auth Method" - }, - "client_id_metadata_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Client Id Metadata Url" - }, - "registration_endpoint": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Registration Endpoint" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OAuthClientConfig" - } - }, - "required": [ - "name", - "type" - ], - "title": "OAuthClientConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseOAuthConfig": { - "additionalProperties": false, - "description": "Configure OAuth-based authentication for a tool or transport.\n\nOAuthConfig is a generic configuration that can be used for both MCP servers\nand non-MCP remote API tools. It supports discovery-based configuration (via\n``issuer``) and explicit endpoints (via ``endpoints``).", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "min_agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum", - "default": "26.1.2" - }, - "issuer": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Issuer" - }, - "endpoints": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/OAuthEndpoints" - } - ], - "default": null - }, - "client": { - "$ref": "#/$defs/OAuthClientConfig" - }, - "redirect_uri": { - "title": "Redirect Uri", - "type": "string" - }, - "scopes": { - "anyOf": [ - { - "type": "string" - }, - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Scopes" - }, - "scope_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/ScopePolicy" - } - ], - "default": null - }, - "pkce": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/PKCEPolicy" - } - ], - "default": null - }, - "resource": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Resource" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OAuthConfig" - } - }, - "required": [ - "client", - "name", - "redirect_uri" - ], - "title": "OAuthConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseOciAgent": { - "additionalProperties": false, - "description": "An agent is a component that can do several rounds of conversation to solve a task.\n\nThe agent is defined on the OCI console and this is only a wrapper to connect to it.\nIt can be executed by itself, or be executed in a flow using an AgentNode.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "agent_endpoint_id": { - "title": "Agent Endpoint Id", - "type": "string" - }, - "client_config": { - "$ref": "#/$defs/OciClientConfig" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OciAgent" - } - }, - "required": [ - "agent_endpoint_id", - "client_config", - "name" - ], - "title": "OciAgent", - "type": "object", - "x-abstract-component": false - }, - "BaseOciClientConfig": { - "anyOf": [ - { - "$ref": "#/$defs/OciClientConfigWithApiKey" - }, - { - "$ref": "#/$defs/OciClientConfigWithInstancePrincipal" - }, - { - "$ref": "#/$defs/OciClientConfigWithResourcePrincipal" - }, - { - "$ref": "#/$defs/OciClientConfigWithSecurityToken" - } - ], - "x-abstract-component": true - }, - "BaseOciClientConfigWithApiKey": { - "additionalProperties": false, - "description": "OCI client config class for authentication using API_KEY and a config file.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "service_endpoint": { - "title": "Service Endpoint", - "type": "string" - }, - "auth_type": { - "const": "API_KEY", - "default": "API_KEY", - "title": "Auth Type", - "type": "string" - }, - "auth_profile": { - "title": "Auth Profile", - "type": "string" - }, - "auth_file_location": { - "title": "Auth File Location", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OciClientConfigWithApiKey" - } - }, - "required": [ - "auth_file_location", - "auth_profile", - "name", - "service_endpoint" - ], - "title": "OciClientConfigWithApiKey", - "type": "object", - "x-abstract-component": false - }, - "BaseOciClientConfigWithInstancePrincipal": { - "additionalProperties": false, - "description": "OCI client config class for authentication using INSTANCE_PRINCIPAL.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "service_endpoint": { - "title": "Service Endpoint", - "type": "string" - }, - "auth_type": { - "const": "INSTANCE_PRINCIPAL", - "default": "INSTANCE_PRINCIPAL", - "title": "Auth Type", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OciClientConfigWithInstancePrincipal" - } - }, - "required": [ - "name", - "service_endpoint" - ], - "title": "OciClientConfigWithInstancePrincipal", - "type": "object", - "x-abstract-component": false - }, - "BaseOciClientConfigWithResourcePrincipal": { - "additionalProperties": false, - "description": "OCI client config class for authentication using RESOURCE_PRINCIPAL.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "service_endpoint": { - "title": "Service Endpoint", - "type": "string" - }, - "auth_type": { - "const": "RESOURCE_PRINCIPAL", - "default": "RESOURCE_PRINCIPAL", - "title": "Auth Type", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OciClientConfigWithResourcePrincipal" - } - }, - "required": [ - "name", - "service_endpoint" - ], - "title": "OciClientConfigWithResourcePrincipal", - "type": "object", - "x-abstract-component": false - }, - "BaseOciClientConfigWithSecurityToken": { - "additionalProperties": false, - "description": "OCI client config class for authentication using SECURITY_TOKEN.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "service_endpoint": { - "title": "Service Endpoint", - "type": "string" - }, - "auth_type": { - "const": "SECURITY_TOKEN", - "default": "SECURITY_TOKEN", - "title": "Auth Type", - "type": "string" - }, - "auth_profile": { - "title": "Auth Profile", - "type": "string" - }, - "auth_file_location": { - "title": "Auth File Location", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OciClientConfigWithSecurityToken" - } - }, - "required": [ - "auth_file_location", - "auth_profile", - "name", - "service_endpoint" - ], - "title": "OciClientConfigWithSecurityToken", - "type": "object", - "x-abstract-component": false - }, - "BaseOciGenAiConfig": { - "additionalProperties": false, - "description": "Class to configure a connection to a OCI GenAI hosted model.\n\nRequires to specify the model id and the client configuration to the OCI GenAI service.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/ModelProvider" - } - ], - "default": null - }, - "api_provider": { - "const": "oci", - "default": "oci", - "title": "Api Provider", - "type": "string" - }, - "api_type": { - "$ref": "#/$defs/OciAPIType", - "default": "oci" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "compartment_id": { - "title": "Compartment Id", - "type": "string" - }, - "serving_mode": { - "$ref": "#/$defs/ServingMode", - "default": "ON_DEMAND" - }, - "client_config": { - "$ref": "#/$defs/OciClientConfig" - }, - "conversation_store_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Conversation Store Id" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OciGenAiConfig" - } - }, - "required": [ - "client_config", - "compartment_id", - "model_id", - "name" - ], - "title": "OciGenAiConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseOllamaConfig": { - "additionalProperties": false, - "description": "Class to configure a connection to a local model ran with Ollama.\n\nRequires to specify the url and port at which the model is running.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Provider" - }, - "api_provider": { - "const": "ollama", - "default": "ollama", - "title": "Api Provider", - "type": "string" - }, - "api_type": { - "$ref": "#/$defs/OpenAIAPIType", - "default": "chat_completions" - }, - "url": { - "title": "Url", - "type": "string" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "key_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Key File" - }, - "cert_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cert File" - }, - "ca_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Ca File" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OllamaConfig" - } - }, - "required": [ - "model_id", - "name", - "url" - ], - "title": "OllamaConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseOpenAiCompatibleConfig": { - "anyOf": [ - { - "$ref": "#/$defs/OllamaConfig" - }, - { - "$ref": "#/$defs/VllmConfig" - }, - { - "additionalProperties": false, - "description": "Class to configure a connection to an LLM that is compatible with OpenAI completions APIs.\n\nRequires to specify the url of the APIs to contact.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Provider" - }, - "api_provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Provider" - }, - "api_type": { - "$ref": "#/$defs/OpenAIAPIType", - "default": "chat_completions" - }, - "url": { - "title": "Url", - "type": "string" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "key_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Key File" - }, - "cert_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cert File" - }, - "ca_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Ca File" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OpenAiCompatibleConfig" - } - }, - "required": [ - "model_id", - "name", - "url" - ], - "title": "OpenAiCompatibleConfig", - "type": "object" - } - ], - "x-abstract-component": false - }, - "BaseOpenAiConfig": { - "additionalProperties": false, - "description": "Class to configure a connection to a OpenAI LLM.\n\nRequires to specify the identity of the model to use.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "const": "openai", - "default": "openai", - "title": "Provider", - "type": "string" - }, - "api_provider": { - "const": "openai", - "default": "openai", - "title": "Api Provider", - "type": "string" - }, - "api_type": { - "$ref": "#/$defs/OpenAIAPIType", - "default": "chat_completions" - }, - "url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OpenAiConfig" - } - }, - "required": [ - "model_id", - "name" - ], - "title": "OpenAiConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseOracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/MTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/TlsOracleDatabaseConnectionConfig" - } - ], - "x-abstract-component": true - }, - "BaseOracleDatabaseDatastore": { - "additionalProperties": false, - "description": "Datastore that uses Oracle Database as the storage mechanism.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "datastore_schema": { - "additionalProperties": { - "$ref": "#/$defs/Property" - }, - "title": "Datastore Schema", - "type": "object" - }, - "connection_config": { - "$ref": "#/$defs/OracleDatabaseConnectionConfig" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OracleDatabaseDatastore" - } - }, - "required": [ - "connection_config", - "datastore_schema", - "name" - ], - "title": "OracleDatabaseDatastore", - "type": "object", - "x-abstract-component": false - }, - "BaseOutputMessageNode": { - "additionalProperties": false, - "description": "This node appends an agent message to the ongoing flow conversation.\n\n- **Inputs**\n One per variable in the message.\n- **Outputs**\n No outputs.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import StartNode, EndNode, InputMessageNode, OutputMessageNode, LlmNode\n>>> from pyagentspec.property import StringProperty\n>>> start_node = StartNode(name=\"start\")\n>>> prompt_node = OutputMessageNode(name=\"ask_input\", message=\"What is the paragraph you want to rephrase?\")\n>>> input_node = InputMessageNode(name=\"user_input\", outputs=[StringProperty(title=\"user_input\")])\n>>> llm_node = LlmNode(\n... name=\"rephrase\",\n... llm_config=llm_config,\n... prompt_template=\"Rephrase {{user_input}}\",\n... outputs=[StringProperty(title=\"rephrased_user_input\")],\n... )\n>>> output_node = OutputMessageNode(name=\"ask_input\", message=\"{{rephrased_user_input}}\")\n>>> end_node = EndNode(name=\"end\")\n>>> flow = Flow(\n... name=\"rephrase_paragraph_flow\",\n... start_node=start_node,\n... nodes=[start_node, prompt_node, input_node, llm_node, output_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"ce1\", from_node=start_node, to_node=prompt_node),\n... ControlFlowEdge(name=\"ce2\", from_node=prompt_node, to_node=input_node),\n... ControlFlowEdge(name=\"ce3\", from_node=input_node, to_node=llm_node),\n... ControlFlowEdge(name=\"ce4\", from_node=llm_node, to_node=output_node),\n... ControlFlowEdge(name=\"ce5\", from_node=output_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"de1\",\n... source_node=input_node,\n... source_output=\"user_input\",\n... destination_node=llm_node,\n... destination_input=\"user_input\",\n... ),\n... DataFlowEdge(\n... name=\"de2\",\n... source_node=llm_node,\n... source_output=\"rephrased_user_input\",\n... destination_node=output_node,\n... destination_input=\"rephrased_user_input\",\n... ),\n... ]\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "message": { - "title": "Message", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "OutputMessageNode" - } - }, - "required": [ - "message", - "name" - ], - "title": "OutputMessageNode", - "type": "object", - "x-abstract-component": false - }, - "BaseParallelFlowNode": { - "additionalProperties": false, - "description": "The parallel flow node executes multiple subflows in parallel.\n\n- **Inputs**\n Inferred from the inner structure. It's the union of the sets of inputs of the inner flows.\n Inputs of different inner flows that have the same name are merged if they have the same type.\n\n- **Outputs**\n Inferred from the inner structure. It's the union of the outputs of the inner flows.\n Outputs of different inner flows that have the same name are not allowed.\n\n- **Branches**\n One, the default next.\n\nExamples\n--------", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "subflows": { - "items": { - "$ref": "#/$defs/Flow" - }, - "title": "Subflows", - "type": "array" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ParallelFlowNode" - } - }, - "required": [ - "name" - ], - "title": "ParallelFlowNode", - "type": "object", - "x-abstract-component": false - }, - "BaseParallelMapNode": { - "additionalProperties": false, - "description": "The parallel map node executes a subflow on each element of a given input in a parallel manner.\n\n- **Inputs**\n Inferred from the inner structure. It's the sets of inputs\n required by the StartNode of the inner flow.\n The names of the inputs will be the ones of the inner flow,\n complemented with the ``iterated_`` prefix. Their type is\n ``Union[inner_type, List[inner_type]]``, where ``inner_type``\n is the type of the respective input in the inner flow.\n\n If None is given, ``pyagentspec`` infers input properties directly from the inner flow,\n specifying title and type according to the rules defined above.\n\n- **Outputs**\n Inferred from the inner structure. It's the union of the\n sets of outputs exposed by the EndNodes of the inner flow,\n combined with the reducer method of each output.\n The names of the outputs will be the ones of the inner flow,\n complemented with the ``collected_`` prefix. Their type depends\n on the ``reduce`` method specified for that output:\n\n - ``List`` of the respective output type in case of ``append``\n - same type of the respective output type in case of ``sum``, ``avg``\n\n If None is given, ``pyagentspec`` infers outputs by exposing\n an output property for each entry in the ``reducers`` dictionary, specifying title\n and type according to the rules defined above.\n\n- **Branches**\n One, the default next.\n\nExamples\n--------\nIn this example we create a flow that generates a summary of the given articles that talk about LLMs.\n\n>>> from pyagentspec.property import BooleanProperty, StringProperty, ListProperty\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import EndNode, StartNode, ParallelMapNode, LlmNode, BranchingNode\n>>> from pyagentspec.flows.node import Node\n\nFirst we define the flow that determines if an article talks about LLMs or not:\n\n- if it does, we return it, so that we will use it for our summary\n- if it does not, we don't return its text\n\n>>> def create_data_flow_edge(source_node: Node, destination_node: Node, property_name: str) -> DataFlowEdge:\n... return DataFlowEdge(\n... name=f\"{source_node.name}_{destination_node.name}_{property_name}_edge\",\n... source_node=source_node,\n... source_output=property_name,\n... destination_node=destination_node,\n... destination_input=property_name,\n... )\n>>>\n>>> article_property = StringProperty(title=\"article\")\n>>> is_llm_article_property = StringProperty(title=\"is_article\")\n>>> llm_node = LlmNode(\n... name=\"check_if_article_talks_about_llms_node\",\n... prompt_template=\"Look at this article: {{article}}. Does it talk about LLMs? Answer `yes` or `no`.\",\n... llm_config=llm_config,\n... inputs=[article_property],\n... outputs=[is_llm_article_property],\n... )\n>>>\n>>> branching_node = BranchingNode(\n... name=\"decide_if_we_should_return_the_article\",\n... mapping={\"yes\": \"yes\"},\n... inputs=[is_llm_article_property],\n... )\n>>>\n>>> start_node = StartNode(name=\"start\", inputs=[article_property])\n>>> end_node_with_output = EndNode(name=\"end_with_output\", outputs=[article_property])\n>>> end_node_without_output = EndNode(name=\"end_without_output\", outputs=[])\n>>>\n>>> check_if_article_is_about_llm_flow = Flow(\n... name=\"is_article_about_llm_flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node_with_output, end_node_without_output, branching_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_branching\", from_node=llm_node, to_node=branching_node),\n... ControlFlowEdge(name=\"branching_to_end_with\", from_node=branching_node, to_node=end_node_with_output),\n... ControlFlowEdge(name=\"branching_to_end_without\", from_node=branching_node, to_node=end_node_without_output),\n... ],\n... data_flow_connections=[\n... create_data_flow_edge(start_node, llm_node, article_property.title),\n... create_data_flow_edge(llm_node, branching_node, is_llm_article_property.title),\n... create_data_flow_edge(start_node, end_node_with_output, article_property.title),\n... ],\n... outputs=[StringProperty(title=article_property.title, default=\"\")],\n... )\n\nWe put this flow into a ``ParallelMapNode``, so that we can perform the check\nin parallel on multiple articles at the same time.\n\n>>> list_of_articles_property = ListProperty(title=\"iterated_article\", item_type=article_property)\n>>> list_of_articles_about_llm_property = ListProperty(title=\"collected_article\", item_type=article_property)\n>>> parallel_article_check_node = ParallelMapNode(\n... name=\"parallel_check_if_articles_talk_about_llms_node\",\n... subflow=check_if_article_is_about_llm_flow,\n... inputs=[list_of_articles_property],\n... outputs=[list_of_articles_about_llm_property],\n... )\n\nFinally, we create the flow that takes the list of articles as input, filters them through the\n``ParallelMapNode`` we have just created, and we generate the summary with the remaining articles.\n\n>>> summary_property = StringProperty(title=\"summary\")\n>>> summary_llm_node = LlmNode(\n... name=\"generate_summary_of_llm_articles_node\",\n... prompt_template=\"Summarize the following articles that talk about LLMs: {{collected_article}}\",\n... llm_config=llm_config,\n... inputs=[list_of_articles_about_llm_property],\n... outputs=[summary_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[list_of_articles_property])\n>>> end_node = EndNode(name=\"end\", outputs=[summary_property])\n>>> generate_summary_of_llm_articles_flow = Flow(\n... name=\"Generate summary of articles about LLMs flow\",\n... start_node=start_node,\n... nodes=[start_node, parallel_article_check_node, summary_llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_parallelmap\", from_node=start_node, to_node=parallel_article_check_node),\n... ControlFlowEdge(name=\"parallelmap_to_llm\", from_node=parallel_article_check_node, to_node=summary_llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=summary_llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... create_data_flow_edge(start_node, parallel_article_check_node, list_of_articles_property.title),\n... create_data_flow_edge(parallel_article_check_node, summary_llm_node, list_of_articles_about_llm_property.title),\n... create_data_flow_edge(summary_llm_node, end_node, summary_property.title),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "subflow": { - "$ref": "#/$defs/Flow" - }, - "reducers": { - "anyOf": [ - { - "additionalProperties": { - "$ref": "#/$defs/ReductionMethod" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Reducers" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ParallelMapNode" - } - }, - "required": [ - "name", - "subflow" - ], - "title": "ParallelMapNode", - "type": "object", - "x-abstract-component": false - }, - "BasePostgresDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/TlsPostgresDatabaseConnectionConfig" - } - ], - "x-abstract-component": true - }, - "BasePostgresDatabaseDatastore": { - "additionalProperties": false, - "description": "Datastore that uses PostgreSQL Database as the storage mechanism.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "datastore_schema": { - "additionalProperties": { - "$ref": "#/$defs/Property" - }, - "title": "Datastore Schema", - "type": "object" - }, - "connection_config": { - "$ref": "#/$defs/PostgresDatabaseConnectionConfig" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "PostgresDatabaseDatastore" - } - }, - "required": [ - "connection_config", - "datastore_schema", - "name" - ], - "title": "PostgresDatabaseDatastore", - "type": "object", - "x-abstract-component": false - }, - "BaseRemoteAgent": { - "anyOf": [ - { - "$ref": "#/$defs/A2AAgent" - }, - { - "$ref": "#/$defs/OciAgent" - } - ], - "x-abstract-component": true - }, - "BaseRemoteTool": { - "additionalProperties": false, - "description": "A tool that is run remotely and called through REST.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "url": { - "title": "Url", - "type": "string" - }, - "http_method": { - "title": "Http Method", - "type": "string" - }, - "api_spec_uri": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Spec Uri" - }, - "data": { - "anyOf": [ - { - "type": "string" - }, - { - "format": "binary", - "type": "string" - }, - {} - ], - "title": "Data" - }, - "query_params": { - "additionalProperties": true, - "title": "Query Params", - "type": "object" - }, - "headers": { - "additionalProperties": true, - "title": "Headers", - "type": "object" - }, - "sensitive_headers": { - "additionalProperties": true, - "title": "Sensitive Headers", - "type": "object" - }, - "url_allow_list": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Url Allow List" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "RemoteTool" - } - }, - "required": [ - "http_method", - "name", - "url" - ], - "title": "RemoteTool", - "type": "object", - "x-abstract-component": false - }, - "BaseRemoteTransport": { - "anyOf": [ - { - "$ref": "#/$defs/SSETransport" - }, - { - "$ref": "#/$defs/SSEmTLSTransport" - }, - { - "$ref": "#/$defs/StreamableHTTPTransport" - }, - { - "$ref": "#/$defs/StreamableHTTPmTLSTransport" - } - ], - "x-abstract-component": true - }, - "BaseSSETransport": { - "anyOf": [ - { - "$ref": "#/$defs/SSEmTLSTransport" - }, - { - "additionalProperties": false, - "description": "Transport implementation that connects to an MCP server via Server-Sent Events.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "session_parameters": { - "$ref": "#/$defs/SessionParameters" - }, - "url": { - "title": "Url", - "type": "string" - }, - "auth": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/AuthConfig" - } - ], - "default": null - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Headers" - }, - "sensitive_headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sensitive Headers" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "SSETransport" - } - }, - "required": [ - "name", - "url" - ], - "title": "SSETransport", - "type": "object" - } - ], - "x-abstract-component": false - }, - "BaseSSEmTLSTransport": { - "additionalProperties": false, - "description": "Transport layer for SSE with mTLS (mutual Transport Layer Security).\n\nThis transport establishes a secure, mutually authenticated TLS connection to the MCP server using client\ncertificates. Production deployments MUST use this transport to ensure both client and server identities\nare verified.\n\nNotes\n-----\n- Users MUST provide a valid client certificate (PEM format) and private key.\n- Users MUST provide (or trust) the correct certificate authority (CA) for the server they're connecting to.\n- The client certificate/key and CA certificate paths can be managed via secrets, config files, or secure\n environment variables in any production system.\n- Executors should ensure that these files are rotated and managed securely.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "session_parameters": { - "$ref": "#/$defs/SessionParameters" - }, - "url": { - "title": "Url", - "type": "string" - }, - "auth": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/AuthConfig" - } - ], - "default": null - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Headers" - }, - "sensitive_headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sensitive Headers" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "key_file": { - "title": "Key File", - "type": "string" - }, - "cert_file": { - "title": "Cert File", - "type": "string" - }, - "ca_file": { - "title": "Ca File", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "SSEmTLSTransport" - } - }, - "required": [ - "ca_file", - "cert_file", - "key_file", - "name", - "url" - ], - "title": "SSEmTLSTransport", - "type": "object", - "x-abstract-component": false - }, - "BaseServerTool": { - "additionalProperties": false, - "description": "A tool that is registered to and executed by the orchestrator.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "requires_confirmation": { - "default": false, - "title": "Requires Confirmation", - "type": "boolean" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ServerTool" - } - }, - "required": [ - "name" - ], - "title": "ServerTool", - "type": "object", - "x-abstract-component": false - }, - "BaseSpecializedAgent": { - "additionalProperties": false, - "description": "A specialized agent is an agent that uses an existing generic agent and\nspecializes it to solve a given task.\n\nIt can be executed anywhere an Agent can be executed.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.property import StringProperty\n>>> from pyagentspec.specialized_agent import AgentSpecializationParameters, SpecializedAgent\n>>> from pyagentspec.tools import ServerTool\n>>> expertise_property = StringProperty(title=\"domain_of_expertise\")\n>>> system_prompt = '''You are an expert in {{domain_of_expertise}}.\n... Please help the users with their requests.'''\n>>> agent = Agent(\n... name=\"Adaptive expert agent\",\n... system_prompt=system_prompt,\n... llm_config=llm_config,\n... inputs=[expertise_property],\n... )\n>>> websearch_tool = ServerTool(\n... name=\"websearch_tool\",\n... description=\"Search the web for information\",\n... inputs=[StringProperty(title=\"query\")],\n... outputs=[StringProperty(title=\"search_result\")],\n... )\n>>> agent_specialization_parameters = AgentSpecializationParameters(\n... name=\"essay_agent\",\n... additional_instructions=\"Your goal is to help the user write an essay around the domain of expertise.\",\n... additional_tools=[websearch_tool]\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "agent": { - "$ref": "#/$defs/Agent" - }, - "agent_specialization_parameters": { - "$ref": "#/$defs/AgentSpecializationParameters" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "SpecializedAgent" - } - }, - "required": [ - "agent", - "agent_specialization_parameters", - "name" - ], - "title": "SpecializedAgent", - "type": "object", - "x-abstract-component": false - }, - "BaseStartNode": { - "additionalProperties": false, - "description": "Start nodes denote the start of the execution of a flow.\n\n- **Inputs**\n The list of inputs that should be the inputs of the flow. If both input and output\n properties are specified they must be an exact match\n\n If None is given, ``pyagentspec`` copies the outputs provided, if any. Otherwise, no input is exposed.\n- **Outputs**\n The list of outputs of the step. If both input and output properties are specified they\n must be an exact match\n\n If None is given, ``pyagentspec`` copies the inputs provided, if any. Otherwise, no output is exposed.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.property import Property\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import EndNode, LlmNode, StartNode\n>>> user_question_property = Property(\n... json_schema=dict(\n... title=\"user_question\",\n... description=\"The user question.\",\n... type=\"string\",\n... )\n... )\n>>> answer_property = Property(json_schema=dict(title=\"answer\", type=\"string\"))\n>>> start_node = StartNode(name=\"start\", inputs=[user_question_property])\n>>> end_node = EndNode(name=\"end\", outputs=[answer_property])\n>>> llm_node = LlmNode(\n... name=\"llm node\",\n... prompt_template=\"Answer the user question: {{user_question}}\",\n... llm_config=llm_config,\n... )\n>>> flow = Flow(\n... name=\"flow\",\n... start_node=start_node,\n... nodes=[start_node, llm_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_llm\", from_node=start_node, to_node=llm_node),\n... ControlFlowEdge(name=\"llm_to_end\", from_node=llm_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"query_edge\",\n... source_node=start_node,\n... source_output=\"user_question\",\n... destination_node=llm_node,\n... destination_input=\"user_question\",\n... ),\n... DataFlowEdge(\n... name=\"answer_edge\",\n... source_node=llm_node,\n... source_output=\"generated_text\",\n... destination_node=end_node,\n... destination_input=\"answer\"\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "StartNode" - } - }, - "required": [ - "name" - ], - "title": "StartNode", - "type": "object", - "x-abstract-component": false - }, - "BaseStdioTransport": { - "additionalProperties": false, - "description": "Base transport for connecting to an MCP server via subprocess with stdio.\n\nThis is a base class that can be subclassed for specific command-based\ntransports like Python, Node, Uvx, etc.\n\n.. warning::\n Stdio should be used for local prototyping only.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "session_parameters": { - "$ref": "#/$defs/SessionParameters" - }, - "command": { - "title": "Command", - "type": "string" - }, - "args": { - "items": { - "type": "string" - }, - "title": "Args", - "type": "array" - }, - "env": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Env" - }, - "cwd": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cwd" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "StdioTransport" - } - }, - "required": [ - "command", - "name" - ], - "title": "StdioTransport", - "type": "object", - "x-abstract-component": false - }, - "BaseStreamableHTTPTransport": { - "anyOf": [ - { - "$ref": "#/$defs/StreamableHTTPmTLSTransport" - }, - { - "additionalProperties": false, - "description": "Transport implementation that connects to an MCP server via Streamable HTTP.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "session_parameters": { - "$ref": "#/$defs/SessionParameters" - }, - "url": { - "title": "Url", - "type": "string" - }, - "auth": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/AuthConfig" - } - ], - "default": null - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Headers" - }, - "sensitive_headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sensitive Headers" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "StreamableHTTPTransport" - } - }, - "required": [ - "name", - "url" - ], - "title": "StreamableHTTPTransport", - "type": "object" - } - ], - "x-abstract-component": false - }, - "BaseStreamableHTTPmTLSTransport": { - "additionalProperties": false, - "description": "Transport layer for streamable HTTP with mTLS (mutual Transport Layer Security).\n\nThis transport establishes a secure, mutually authenticated TLS connection to the MCP server using client\ncertificates. Production deployments MUST use this transport to ensure both client and server identities\nare verified.\n\nNotes\n-----\n- Users MUST provide a valid client certificate (PEM format) and private key.\n- Users MUST provide (or trust) the correct certificate authority (CA) for the server they're connecting to.\n- The client certificate/key and CA certificate paths can be managed via secrets, config files, or secure\n environment variables in any production system.\n- Executors should ensure that these files are rotated and managed securely.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "session_parameters": { - "$ref": "#/$defs/SessionParameters" - }, - "url": { - "title": "Url", - "type": "string" - }, - "auth": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/AuthConfig" - } - ], - "default": null - }, - "headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Headers" - }, - "sensitive_headers": { - "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sensitive Headers" - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "key_file": { - "title": "Key File", - "type": "string" - }, - "cert_file": { - "title": "Cert File", - "type": "string" - }, - "ca_file": { - "title": "Ca File", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "StreamableHTTPmTLSTransport" - } - }, - "required": [ - "ca_file", - "cert_file", - "key_file", - "name", - "url" - ], - "title": "StreamableHTTPmTLSTransport", - "type": "object", - "x-abstract-component": false - }, - "BaseSubProcessCodeExecutor": { - "additionalProperties": false, - "description": "Code executor that declares local process execution.\n\nNote: The subprocess executor is intended for prototyping only and must\nnot be used in production deployments.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "timeout_seconds": { - "default": 30.0, - "exclusiveMinimum": 0, - "title": "Timeout Seconds", - "type": "number" - }, - "max_code_chars": { - "default": 50000, - "exclusiveMinimum": 0, - "title": "Max Code Chars", - "type": "integer" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "SubProcessCodeExecutor" - } - }, - "required": [ - "name" - ], - "title": "SubProcessCodeExecutor", - "type": "object", - "x-abstract-component": false - }, - "BaseSwarm": { - "additionalProperties": false, - "description": "Defines a ``Swarm`` conversational component.\n\nA ``Swarm`` is a multi-agent conversational component in which each agent determines\nthe next agent to be executed, based on a list of pre-defined relationships.\nAgents in Swarm can be any ``AgenticComponent``.\n\nExamples\n--------\n>>> from pyagentspec.agent import Agent\n>>> from pyagentspec.swarm import Swarm\n>>> addition_agent = Agent(name=\"addition_agent\", description=\"Agent that can do additions\", llm_config=llm_config, system_prompt=\"You can do additions.\")\n>>> multiplication_agent = Agent(name=\"multiplication_agent\", description=\"Agent that can do multiplication\", llm_config=llm_config, system_prompt=\"You can do multiplication.\")\n>>> division_agent = Agent(name=\"division_agent\", description=\"Agent that can do division\", llm_config=llm_config, system_prompt=\"You can do division.\")\n>>>\n>>> swarm = Swarm(\n... name=\"swarm\",\n... first_agent=addition_agent,\n... relationships=[\n... (addition_agent, multiplication_agent),\n... (addition_agent, division_agent),\n... (multiplication_agent, division_agent),\n... ]\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "first_agent": { - "$ref": "#/$defs/AgenticComponent" - }, - "relationships": { - "items": { - "maxItems": 2, - "minItems": 2, - "prefixItems": [ - { - "$ref": "#/$defs/AgenticComponent" - }, - { - "$ref": "#/$defs/AgenticComponent" - } - ], - "type": "array" - }, - "title": "Relationships", - "type": "array" - }, - "handoff": { - "anyOf": [ - { - "type": "boolean" - }, - { - "$ref": "#/$defs/HandoffMode" - } - ], - "default": "optional", - "title": "Handoff" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "Swarm" - } - }, - "required": [ - "first_agent", - "name", - "relationships" - ], - "title": "Swarm", - "type": "object", - "x-abstract-component": false - }, - "BaseTlsOracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/MTlsOracleDatabaseConnectionConfig" - }, - { - "additionalProperties": false, - "description": "TLS Connection Configuration to Oracle Database.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "user": { - "title": "User", - "type": "string" - }, - "password": { - "title": "Password", - "type": "string" - }, - "dsn": { - "title": "Dsn", - "type": "string" - }, - "config_dir": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Config Dir" - }, - "protocol": { - "default": "tcps", - "enum": [ - "tcp", - "tcps" - ], - "title": "Protocol", - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "TlsOracleDatabaseConnectionConfig" - } - }, - "required": [ - "dsn", - "name", - "password", - "user" - ], - "title": "TlsOracleDatabaseConnectionConfig", - "type": "object" - } - ], - "x-abstract-component": false - }, - "BaseTlsPostgresDatabaseConnectionConfig": { - "additionalProperties": false, - "description": "Configuration for a PostgreSQL connection with TLS/SSL support.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "user": { - "title": "User", - "type": "string" - }, - "password": { - "title": "Password", - "type": "string" - }, - "url": { - "title": "Url", - "type": "string" - }, - "sslmode": { - "default": "require", - "enum": [ - "allow", - "disable", - "prefer", - "require", - "verify-ca", - "verify-full" - ], - "title": "Sslmode", - "type": "string" - }, - "sslcert": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sslcert" - }, - "sslkey": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sslkey" - }, - "sslrootcert": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sslrootcert" - }, - "sslcrl": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Sslcrl" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "TlsPostgresDatabaseConnectionConfig" - } - }, - "required": [ - "name", - "password", - "url", - "user" - ], - "title": "TlsPostgresDatabaseConnectionConfig", - "type": "object", - "x-abstract-component": false - }, - "BaseTool": { - "anyOf": [ - { - "$ref": "#/$defs/BuiltinTool" - }, - { - "$ref": "#/$defs/ClientTool" - }, - { - "$ref": "#/$defs/MCPTool" - }, - { - "$ref": "#/$defs/RemoteTool" - }, - { - "$ref": "#/$defs/ServerTool" - } - ], - "x-abstract-component": true - }, - "BaseToolBox": { - "anyOf": [ - { - "$ref": "#/$defs/MCPToolBox" - } - ], - "x-abstract-component": true - }, - "BaseToolNode": { - "additionalProperties": false, - "description": "The tool execution node is a node that will execute a tool as part of a flow.\n\n- **Inputs**\n Inferred from the definition of the tool to execute.\n- **Outputs**\n Inferred from the definition of the tool to execute.\n- **Branches**\n One, the default next.\n\nExamples\n--------\n>>> from pyagentspec.flows.edges import ControlFlowEdge, DataFlowEdge\n>>> from pyagentspec.flows.flow import Flow\n>>> from pyagentspec.flows.nodes import ToolNode, StartNode, EndNode\n>>> from pyagentspec.tools import ServerTool\n>>> from pyagentspec.property import Property\n>>>\n>>> x_property = Property(json_schema={\"title\": \"x\", \"type\": \"number\"})\n>>> x_square_root_property = Property(\n... json_schema={\"title\": \"x_square_root\", \"type\": \"number\"}\n... )\n>>> square_root_tool = ServerTool(\n... name=\"compute_square_root\",\n... description=\"Computes the square root of a number\",\n... inputs=[x_property],\n... outputs=[x_square_root_property],\n... )\n>>> start_node = StartNode(name=\"start\", inputs=[x_property])\n>>> end_node = EndNode(name=\"end\", outputs=[x_square_root_property])\n>>> tool_node = ToolNode(name=\"\", tool=square_root_tool)\n>>> flow = Flow(\n... name=\"Compute square root flow\",\n... start_node=start_node,\n... nodes=[start_node, tool_node, end_node],\n... control_flow_connections=[\n... ControlFlowEdge(name=\"start_to_tool\", from_node=start_node, to_node=tool_node),\n... ControlFlowEdge(name=\"tool_to_end\", from_node=tool_node, to_node=end_node),\n... ],\n... data_flow_connections=[\n... DataFlowEdge(\n... name=\"x_edge\",\n... source_node=start_node,\n... source_output=\"x\",\n... destination_node=tool_node,\n... destination_input=\"x\",\n... ),\n... DataFlowEdge(\n... name=\"x_square_root_edge\",\n... source_node=tool_node,\n... source_output=\"x_square_root\",\n... destination_node=end_node,\n... destination_input=\"x_square_root\"\n... ),\n... ],\n... )", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "inputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Inputs" - }, - "outputs": { - "anyOf": [ - { - "items": { - "$ref": "#/$defs/Property" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Outputs" - }, - "branches": { - "items": { - "type": "string" - }, - "title": "Branches", - "type": "array" - }, - "tool": { - "$ref": "#/$defs/Tool" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "ToolNode" - } - }, - "required": [ - "name", - "tool" - ], - "title": "ToolNode", - "type": "object", - "x-abstract-component": false - }, - "BaseVllmConfig": { - "additionalProperties": false, - "description": "Class to configure a connection to a vLLM-hosted LLM.\n\nRequires to specify the url at which the instance is running.", - "properties": { - "id": { - "title": "Id", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "metadata": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Metadata" - }, - "model_id": { - "title": "Model Id", - "type": "string" - }, - "provider": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Provider" - }, - "api_provider": { - "const": "vllm", - "default": "vllm", - "title": "Api Provider", - "type": "string" - }, - "api_type": { - "$ref": "#/$defs/OpenAIAPIType", - "default": "chat_completions" - }, - "url": { - "title": "Url", - "type": "string" - }, - "api_key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Api Key" - }, - "default_generation_parameters": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/LlmGenerationConfig" - } - ], - "default": null - }, - "retry_policy": { - "anyOf": [ - { - "type": "null" - }, - { - "$ref": "#/$defs/RetryPolicy" - } - ], - "default": null - }, - "key_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Key File" - }, - "cert_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Cert File" - }, - "ca_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Ca File" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "component_type": { - "const": "VllmConfig" - } - }, - "required": [ - "model_id", - "name", - "url" - ], - "title": "VllmConfig", - "type": "object", - "x-abstract-component": false - }, - "ReferencedComponents": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "$ref": "#/$defs/BaseA2AAgent" - }, - { - "$ref": "#/$defs/BaseA2AConnectionConfig" - }, - { - "$ref": "#/$defs/BaseAgent" - }, - { - "$ref": "#/$defs/BaseAgentNode" - }, - { - "$ref": "#/$defs/BaseAgentSpecializationParameters" - }, - { - "$ref": "#/$defs/BaseAgenticComponent" - }, - { - "$ref": "#/$defs/BaseApiNode" - }, - { - "$ref": "#/$defs/BaseAuthConfig" - }, - { - "$ref": "#/$defs/BaseBranchingNode" - }, - { - "$ref": "#/$defs/BaseBuiltinTool" - }, - { - "$ref": "#/$defs/BaseCatchExceptionNode" - }, - { - "$ref": "#/$defs/BaseClientTool" - }, - { - "$ref": "#/$defs/BaseClientTransport" - }, - { - "$ref": "#/$defs/BaseCodeExecutor" - }, - { - "$ref": "#/$defs/BaseComponentWithIO" - }, - { - "$ref": "#/$defs/BaseControlFlowEdge" - }, - { - "$ref": "#/$defs/BaseConversationSummarizationTransform" - }, - { - "$ref": "#/$defs/BaseDataFlowEdge" - }, - { - "$ref": "#/$defs/BaseDatastore" - }, - { - "$ref": "#/$defs/BaseEndNode" - }, - { - "$ref": "#/$defs/BaseEndpointCodeExecutor" - }, - { - "$ref": "#/$defs/BaseFlow" - }, - { - "$ref": "#/$defs/BaseFlowNode" - }, - { - "$ref": "#/$defs/BaseGeminiAIStudioAuthConfig" - }, - { - "$ref": "#/$defs/BaseGeminiAuthConfig" - }, - { - "$ref": "#/$defs/BaseGeminiConfig" - }, - { - "$ref": "#/$defs/BaseGeminiVertexAIAuthConfig" - }, - { - "$ref": "#/$defs/BaseInMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/BaseInputMessageNode" - }, - { - "$ref": "#/$defs/BaseLlmConfig" - }, - { - "$ref": "#/$defs/BaseLlmNode" - }, - { - "$ref": "#/$defs/BaseLocalContainerCodeExecutor" - }, - { - "$ref": "#/$defs/BaseMCPTool" - }, - { - "$ref": "#/$defs/BaseMCPToolBox" - }, - { - "$ref": "#/$defs/BaseMCPToolSpec" - }, - { - "$ref": "#/$defs/BaseMTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/BaseManagerWorkers" - }, - { - "$ref": "#/$defs/BaseMapNode" - }, - { - "$ref": "#/$defs/BaseMessageSummarizationTransform" - }, - { - "$ref": "#/$defs/BaseMessageTransform" - }, - { - "$ref": "#/$defs/BaseNode" - }, - { - "$ref": "#/$defs/BaseOAuthClientConfig" - }, - { - "$ref": "#/$defs/BaseOAuthConfig" - }, - { - "$ref": "#/$defs/BaseOciAgent" - }, - { - "$ref": "#/$defs/BaseOciClientConfig" - }, - { - "$ref": "#/$defs/BaseOciClientConfigWithApiKey" - }, - { - "$ref": "#/$defs/BaseOciClientConfigWithInstancePrincipal" - }, - { - "$ref": "#/$defs/BaseOciClientConfigWithResourcePrincipal" - }, - { - "$ref": "#/$defs/BaseOciClientConfigWithSecurityToken" - }, - { - "$ref": "#/$defs/BaseOciGenAiConfig" - }, - { - "$ref": "#/$defs/BaseOllamaConfig" - }, - { - "$ref": "#/$defs/BaseOpenAiCompatibleConfig" - }, - { - "$ref": "#/$defs/BaseOpenAiConfig" - }, - { - "$ref": "#/$defs/BaseOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/BaseOracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/BaseOutputMessageNode" - }, - { - "$ref": "#/$defs/BaseParallelFlowNode" - }, - { - "$ref": "#/$defs/BaseParallelMapNode" - }, - { - "$ref": "#/$defs/BasePostgresDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/BasePostgresDatabaseDatastore" - }, - { - "$ref": "#/$defs/BaseRemoteAgent" - }, - { - "$ref": "#/$defs/BaseRemoteTool" - }, - { - "$ref": "#/$defs/BaseRemoteTransport" - }, - { - "$ref": "#/$defs/BaseSSETransport" - }, - { - "$ref": "#/$defs/BaseSSEmTLSTransport" - }, - { - "$ref": "#/$defs/BaseServerTool" - }, - { - "$ref": "#/$defs/BaseSpecializedAgent" - }, - { - "$ref": "#/$defs/BaseStartNode" - }, - { - "$ref": "#/$defs/BaseStdioTransport" - }, - { - "$ref": "#/$defs/BaseStreamableHTTPTransport" - }, - { - "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" - }, - { - "$ref": "#/$defs/BaseSubProcessCodeExecutor" - }, - { - "$ref": "#/$defs/BaseSwarm" - }, - { - "$ref": "#/$defs/BaseTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/BaseTlsPostgresDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/BaseTool" - }, - { - "$ref": "#/$defs/BaseToolBox" - }, - { - "$ref": "#/$defs/BaseToolNode" - }, - { - "$ref": "#/$defs/BaseVllmConfig" - }, - { - "$ref": "#/$defs/ComponentReferenceWithNestedReferences" - } - ] - } - }, - "ComponentReference": { - "type": "object", - "properties": { - "$component_ref": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "$component_ref" - ] - }, - "ComponentReferenceWithNestedReferences": { - "type": "object", - "properties": { - "$component_ref": { - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - } - }, - "additionalProperties": false, - "required": [ - "$component_ref", - "$referenced_components" - ] - }, - "VersionedA2AAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseA2AAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedA2AConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseA2AConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedAgentNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgentNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedAgentSpecializationParameters": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgentSpecializationParameters" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedAgenticComponent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseAgenticComponent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedApiNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseApiNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedBranchingNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseBranchingNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedBuiltinTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseBuiltinTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedCatchExceptionNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseCatchExceptionNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedClientTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseClientTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedClientTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseClientTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedComponentWithIO": { - "anyOf": [ - { - "$ref": "#/$defs/BaseComponentWithIO" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedControlFlowEdge": { - "anyOf": [ - { - "$ref": "#/$defs/BaseControlFlowEdge" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedConversationSummarizationTransform": { - "anyOf": [ - { - "$ref": "#/$defs/BaseConversationSummarizationTransform" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedDataFlowEdge": { - "anyOf": [ - { - "$ref": "#/$defs/BaseDataFlowEdge" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BaseDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedEndNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseEndNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedEndpointCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseEndpointCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedFlow": { - "anyOf": [ - { - "$ref": "#/$defs/BaseFlow" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedFlowNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseFlowNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedGeminiAIStudioAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiAIStudioAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedGeminiAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedGeminiConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedGeminiVertexAIAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseGeminiVertexAIAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedInMemoryCollectionDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BaseInMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedInputMessageNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseInputMessageNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedLlmConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseLlmConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedLlmNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseLlmNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedLocalContainerCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseLocalContainerCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedMCPTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMCPTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedMCPToolBox": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMCPToolBox" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedMCPToolSpec": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMCPToolSpec" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedMTlsOracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedManagerWorkers": { - "anyOf": [ - { - "$ref": "#/$defs/BaseManagerWorkers" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedMapNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMapNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedMessageSummarizationTransform": { - "anyOf": [ - { - "$ref": "#/$defs/BaseMessageSummarizationTransform" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOAuthClientConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOAuthClientConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOAuthConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOAuthConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciClientConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciClientConfigWithApiKey": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithApiKey" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciClientConfigWithInstancePrincipal": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithInstancePrincipal" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciClientConfigWithResourcePrincipal": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithResourcePrincipal" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciClientConfigWithSecurityToken": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciClientConfigWithSecurityToken" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOciGenAiConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOciGenAiConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOllamaConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOllamaConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOpenAiCompatibleConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOpenAiCompatibleConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOpenAiConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOpenAiConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOracleDatabaseDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedOutputMessageNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseOutputMessageNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedParallelFlowNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseParallelFlowNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedParallelMapNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseParallelMapNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedPostgresDatabaseDatastore": { - "anyOf": [ - { - "$ref": "#/$defs/BasePostgresDatabaseDatastore" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedRemoteAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseRemoteAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedRemoteTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseRemoteTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedRemoteTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseRemoteTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedSSETransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSSETransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedSSEmTLSTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSSEmTLSTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedServerTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseServerTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedSpecializedAgent": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSpecializedAgent" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedStartNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStartNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedStdioTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStdioTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedStreamableHTTPTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStreamableHTTPTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedStreamableHTTPmTLSTransport": { - "anyOf": [ - { - "$ref": "#/$defs/BaseStreamableHTTPmTLSTransport" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedSubProcessCodeExecutor": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSubProcessCodeExecutor" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedSwarm": { - "anyOf": [ - { - "$ref": "#/$defs/BaseSwarm" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedTlsOracleDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedTlsPostgresDatabaseConnectionConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseTlsPostgresDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedTool": { - "anyOf": [ - { - "$ref": "#/$defs/BaseTool" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedToolBox": { - "anyOf": [ - { - "$ref": "#/$defs/BaseToolBox" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedToolNode": { - "anyOf": [ - { - "$ref": "#/$defs/BaseToolNode" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedVllmConfig": { - "anyOf": [ - { - "$ref": "#/$defs/BaseVllmConfig" - }, - { - "$ref": "#/$defs/ComponentReference" - } - ], - "properties": { - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - } - }, - "VersionedComponentReferenceWithNestedReferences": { - "type": "object", - "properties": { - "$component_ref": { - "type": "string" - }, - "$referenced_components": { - "$ref": "#/$defs/ReferencedComponents" - }, - "agentspec_version": { - "$ref": "#/$defs/AgentSpecVersionEnum" - } - }, - "additionalProperties": false, - "required": [ - "$component_ref", - "$referenced_components" - ] - } - }, - "anyOf": [ - { - "$ref": "#/$defs/VersionedA2AAgent" - }, - { - "$ref": "#/$defs/VersionedA2AConnectionConfig" - }, - { - "$ref": "#/$defs/VersionedAgent" - }, - { - "$ref": "#/$defs/VersionedAgentNode" - }, - { - "$ref": "#/$defs/VersionedAgentSpecializationParameters" - }, - { - "$ref": "#/$defs/VersionedAgenticComponent" - }, - { - "$ref": "#/$defs/VersionedApiNode" - }, - { - "$ref": "#/$defs/VersionedBranchingNode" - }, - { - "$ref": "#/$defs/VersionedBuiltinTool" - }, - { - "$ref": "#/$defs/VersionedCatchExceptionNode" - }, - { - "$ref": "#/$defs/VersionedClientTool" - }, - { - "$ref": "#/$defs/VersionedClientTransport" - }, - { - "$ref": "#/$defs/VersionedCodeExecutor" - }, - { - "$ref": "#/$defs/VersionedComponentReferenceWithNestedReferences" - }, - { - "$ref": "#/$defs/VersionedComponentWithIO" - }, - { - "$ref": "#/$defs/VersionedControlFlowEdge" - }, - { - "$ref": "#/$defs/VersionedConversationSummarizationTransform" - }, - { - "$ref": "#/$defs/VersionedDataFlowEdge" - }, - { - "$ref": "#/$defs/VersionedDatastore" - }, - { - "$ref": "#/$defs/VersionedEndNode" - }, - { - "$ref": "#/$defs/VersionedEndpointCodeExecutor" - }, - { - "$ref": "#/$defs/VersionedFlow" - }, - { - "$ref": "#/$defs/VersionedFlowNode" - }, - { - "$ref": "#/$defs/VersionedGeminiAIStudioAuthConfig" - }, - { - "$ref": "#/$defs/VersionedGeminiAuthConfig" - }, - { - "$ref": "#/$defs/VersionedGeminiConfig" - }, - { - "$ref": "#/$defs/VersionedGeminiVertexAIAuthConfig" - }, - { - "$ref": "#/$defs/VersionedInMemoryCollectionDatastore" - }, - { - "$ref": "#/$defs/VersionedInputMessageNode" - }, - { - "$ref": "#/$defs/VersionedLlmConfig" - }, - { - "$ref": "#/$defs/VersionedLlmNode" - }, - { - "$ref": "#/$defs/VersionedLocalContainerCodeExecutor" - }, - { - "$ref": "#/$defs/VersionedMCPTool" - }, - { - "$ref": "#/$defs/VersionedMCPToolBox" - }, - { - "$ref": "#/$defs/VersionedMCPToolSpec" - }, - { - "$ref": "#/$defs/VersionedMTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/VersionedManagerWorkers" - }, - { - "$ref": "#/$defs/VersionedMapNode" - }, - { - "$ref": "#/$defs/VersionedMessageSummarizationTransform" - }, - { - "$ref": "#/$defs/VersionedNode" - }, - { - "$ref": "#/$defs/VersionedOAuthClientConfig" - }, - { - "$ref": "#/$defs/VersionedOAuthConfig" - }, - { - "$ref": "#/$defs/VersionedOciAgent" - }, - { - "$ref": "#/$defs/VersionedOciClientConfig" - }, - { - "$ref": "#/$defs/VersionedOciClientConfigWithApiKey" - }, - { - "$ref": "#/$defs/VersionedOciClientConfigWithInstancePrincipal" - }, - { - "$ref": "#/$defs/VersionedOciClientConfigWithResourcePrincipal" - }, - { - "$ref": "#/$defs/VersionedOciClientConfigWithSecurityToken" - }, - { - "$ref": "#/$defs/VersionedOciGenAiConfig" - }, - { - "$ref": "#/$defs/VersionedOllamaConfig" - }, - { - "$ref": "#/$defs/VersionedOpenAiCompatibleConfig" - }, - { - "$ref": "#/$defs/VersionedOpenAiConfig" - }, - { - "$ref": "#/$defs/VersionedOracleDatabaseDatastore" - }, - { - "$ref": "#/$defs/VersionedOutputMessageNode" - }, - { - "$ref": "#/$defs/VersionedParallelFlowNode" - }, - { - "$ref": "#/$defs/VersionedParallelMapNode" - }, - { - "$ref": "#/$defs/VersionedPostgresDatabaseDatastore" - }, - { - "$ref": "#/$defs/VersionedRemoteAgent" - }, - { - "$ref": "#/$defs/VersionedRemoteTool" - }, - { - "$ref": "#/$defs/VersionedRemoteTransport" - }, - { - "$ref": "#/$defs/VersionedSSETransport" - }, - { - "$ref": "#/$defs/VersionedSSEmTLSTransport" - }, - { - "$ref": "#/$defs/VersionedServerTool" - }, - { - "$ref": "#/$defs/VersionedSpecializedAgent" - }, - { - "$ref": "#/$defs/VersionedStartNode" - }, - { - "$ref": "#/$defs/VersionedStdioTransport" - }, - { - "$ref": "#/$defs/VersionedStreamableHTTPTransport" - }, - { - "$ref": "#/$defs/VersionedStreamableHTTPmTLSTransport" - }, - { - "$ref": "#/$defs/VersionedSubProcessCodeExecutor" - }, - { - "$ref": "#/$defs/VersionedSwarm" - }, - { - "$ref": "#/$defs/VersionedTlsOracleDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/VersionedTlsPostgresDatabaseConnectionConfig" - }, - { - "$ref": "#/$defs/VersionedTool" - }, - { - "$ref": "#/$defs/VersionedToolBox" - }, - { - "$ref": "#/$defs/VersionedToolNode" - }, - { - "$ref": "#/$defs/VersionedVllmConfig" - } - ] -} \ No newline at end of file diff --git a/docs/pyagentspec/source/agentspec/language_spec_nightly.rst b/docs/pyagentspec/source/agentspec/language_spec_nightly.rst index b6e087a7..37d33ee7 100644 --- a/docs/pyagentspec/source/agentspec/language_spec_nightly.rst +++ b/docs/pyagentspec/source/agentspec/language_spec_nightly.rst @@ -3290,7 +3290,7 @@ We put here the current JSON spec of the Agent Spec language. .. collapse:: JSON Schema - .. literalinclude:: json_spec/agentspec_json_spec_26_3_0.json + .. literalinclude:: json_spec/agentspec_json_spec_26_2_0.json :language: json Note about serialization of components diff --git a/pyagentspec/src/pyagentspec/tools/codeexecutors.py b/pyagentspec/src/pyagentspec/tools/codeexecutors.py index 591369d0..a685e34c 100644 --- a/pyagentspec/src/pyagentspec/tools/codeexecutors.py +++ b/pyagentspec/src/pyagentspec/tools/codeexecutors.py @@ -34,7 +34,7 @@ class CodeExecutor(Component, abstract=True): """Maximum accepted source length in characters.""" min_agentspec_version: SkipJsonSchema[AgentSpecVersionEnum] = Field( - default=AgentSpecVersionEnum.v26_3_0, + default=AgentSpecVersionEnum.v26_2_0, init=False, exclude=True, ) diff --git a/pyagentspec/src/pyagentspec/versioning.py b/pyagentspec/src/pyagentspec/versioning.py index 809d5471..d0dacda5 100644 --- a/pyagentspec/src/pyagentspec/versioning.py +++ b/pyagentspec/src/pyagentspec/versioning.py @@ -38,9 +38,8 @@ class AgentSpecVersionEnum(Enum): v26_1_0 = "26.1.0" v26_1_2 = "26.1.2" v26_2_0 = "26.2.0" - v26_3_0 = "26.3.0" - current_version = "26.3.0" - latest_supported_version = "26.3.0" + current_version = "26.2.0" + latest_supported_version = "26.2.0" def __lt__(self, other: "AgentSpecVersionEnum") -> bool: return _version_lt(self.value, other.value) diff --git a/pyagentspec/tests/test_codeexecutors.py b/pyagentspec/tests/test_codeexecutors.py index cfeae740..738d0f43 100644 --- a/pyagentspec/tests/test_codeexecutors.py +++ b/pyagentspec/tests/test_codeexecutors.py @@ -29,7 +29,7 @@ def test_code_executor_defaults() -> None: assert executor.timeout_seconds == 30.0 assert executor.max_code_chars == 50_000 assert executor.component_type == "SubProcessCodeExecutor" - assert executor.min_agentspec_version == AgentSpecVersionEnum.v26_3_0 + assert executor.min_agentspec_version == AgentSpecVersionEnum.v26_2_0 @pytest.mark.parametrize( @@ -81,9 +81,7 @@ def test_endpoint_sensitive_headers_are_excluded_by_default_and_exported_on_opt_ serialized = AgentSpecSerializer().to_dict(endpoint) assert serialized["headers"] == {"X-Request-Id": "request-id"} # Default serialization replaces non-empty sensitive values with references. - assert serialized["sensitive_headers"] == { - "$component_ref": f"{endpoint.id}.sensitive_headers" - } + assert serialized["sensitive_headers"] == {"$component_ref": f"{endpoint.id}.sensitive_headers"} # Sensitive values require an explicit opt-in before they are serialized. with pytest.warns(UserWarning): @@ -169,19 +167,17 @@ def test_code_executor_json_and_yaml_roundtrips( assert "component_type: " + executor.component_type in serialized -def test_code_executor_rejects_serialization_before_v26_3_0() -> None: +def test_code_executor_rejects_serialization_before_v26_2_0() -> None: executor = SubProcessCodeExecutor(name="subprocess") with pytest.raises(ValueError, match="Invalid agentspec_version"): - AgentSpecSerializer().to_dict( - executor, agentspec_version=AgentSpecVersionEnum.v26_2_0 - ) + AgentSpecSerializer().to_dict(executor, agentspec_version=AgentSpecVersionEnum.v26_1_2) -def test_code_executor_rejects_deserialization_before_v26_3_0() -> None: +def test_code_executor_rejects_deserialization_before_v26_2_0() -> None: executor = SubProcessCodeExecutor(name="subprocess") serialized = AgentSpecSerializer().to_dict(executor) - serialized["agentspec_version"] = AgentSpecVersionEnum.v26_2_0.value + serialized["agentspec_version"] = AgentSpecVersionEnum.v26_1_2.value with pytest.raises(ValueError, match="Invalid agentspec_version"): AgentSpecDeserializer().from_dict(serialized) diff --git a/pyagentspec/tests/test_versioning.py b/pyagentspec/tests/test_versioning.py index d5eece4a..45a3aa9a 100644 --- a/pyagentspec/tests/test_versioning.py +++ b/pyagentspec/tests/test_versioning.py @@ -30,10 +30,10 @@ from .serialization.conftest import simplest_flow # noqa: F401 -def test_current_version_is_26_3_0() -> None: - assert AgentSpecVersionEnum.current_version == AgentSpecVersionEnum.v26_3_0 - assert AgentSpecVersionEnum.latest_supported_version == AgentSpecVersionEnum.v26_3_0 - assert AgentSpecVersionEnum("26.3.0") == AgentSpecVersionEnum.v26_3_0 +def test_current_version_is_26_2_0() -> None: + assert AgentSpecVersionEnum.current_version == AgentSpecVersionEnum.v26_2_0 + assert AgentSpecVersionEnum.latest_supported_version == AgentSpecVersionEnum.v26_2_0 + assert AgentSpecVersionEnum("26.2.0") == AgentSpecVersionEnum.v26_2_0 def test_flow_exports_with_agentspec_version(simplest_flow: Flow) -> None: