API Reference#

On this page, you will find the pyagentspec API reference, ordered by component.

Click on the components and section names to acccess the complete API documentation pages.

Components#

Classes

pyagentspec.component.Component

Base class for all components that can be used in Agent Spec.

pyagentspec.component.ComponentWithIO

Base class for all components that have input and output schemas.

Agents#

Classes

pyagentspec.agent.Agent

An agent is a component that can do several rounds of conversation to solve a task.

Remote Agents#

Classes

pyagentspec.remoteagent.RemoteAgent

Represents an agent that is defined and created remotely.

pyagentspec.ociagent.OciAgent

An agent is a component that can do several rounds of conversation to solve a task.

Flows & Nodes#

Classes

pyagentspec.flows.flow.Flow

A flow is a component to model sequences of operations to do in a precised order.

pyagentspec.flows.node.Node

Base class for all nodes that can be put inside a flow.

pyagentspec.flows.edges.DataFlowEdge

A data flow edge specifies how the output of a node propagates as input of another node.

pyagentspec.flows.edges.ControlFlowEdge

A control flow edge specifies a possible transition from a node to another in a flow.

pyagentspec.flows.nodes.AgentNode

The agent execution node is a node that will execute an agent as part of a flow.

pyagentspec.flows.nodes.ApiNode

Make an API call.

pyagentspec.flows.nodes.BranchingNode

Select the next node to transition to based on a mapping.

pyagentspec.flows.nodes.EndNode

End nodes denote the end of the execution of a flow.

pyagentspec.flows.nodes.FlowNode

The flow node executes a subflow as part of a flow.

pyagentspec.flows.nodes.InputMessageNode

This node interrupts the execution of the flow in order to wait for a user input, and restarts after receiving it.

pyagentspec.flows.nodes.LlmNode

Execute a prompt template with a given LLM.

pyagentspec.flows.nodes.MapNode

The map node executes a subflow on each element of a given input as part of a flow.

pyagentspec.flows.nodes.OutputMessageNode

This node appends an agent message to the ongoing flow conversation.

pyagentspec.flows.nodes.StartNode

Start nodes denote the start of the execution of a flow.

pyagentspec.flows.nodes.ToolNode

The tool execution node is a node that will execute a tool as part of a flow.

LLMs#

Classes

pyagentspec.llms.LlmConfig

A LLM configuration defines how to connect to a LLM to do generation requests.

pyagentspec.llms.LlmGenerationConfig

A configuration object defining LLM generation parameters.

pyagentspec.llms.VllmConfig

Class to configure a connection to a vLLM-hosted LLM.

pyagentspec.llms.OllamaConfig

Class to configure a connection to a local model ran with Ollama.

pyagentspec.llms.OciGenAiConfig

Class to configure a connection to a OCI GenAI hosted model.

pyagentspec.llms.OciClientConfig

Base abstract class for OCI client config.

pyagentspec.llms.OciClientConfigWithApiKey

OCI client config class for authentication using API_KEY and a config file.

pyagentspec.llms.OciClientConfigWithSecurityToken

OCI client config class for authentication using SECURITY_TOKEN.

pyagentspec.llms.OciClientConfigWithInstancePrincipal

OCI client config class for authentication using INSTANCE_PRINCIPAL.

pyagentspec.llms.OciClientConfigWithResourcePrincipal

OCI client config class for authentication using RESOURCE_PRINCIPAL.

pyagentspec.llms.OpenAiCompatibleConfig

Class to configure a connection to an LLM that is compatible with OpenAI completions APIs.

pyagentspec.llms.OpenAiConfig

Class to configure a connection to a OpenAI LLM.

Tools#

Classes

pyagentspec.tools.Tool

A tool specifies a function made available to an agent or a flow.

pyagentspec.tools.ClientTool

A tool that needs to be run by the client application.

pyagentspec.tools.RemoteTool

A tool that is run remotely and called through REST.

pyagentspec.tools.ServerTool

A tool that is registered to and executed by the orchestrator.

pyagentspec.mcp.MCPTool

Class for tools exposed by MCP servers

IO Properties#

Classes

pyagentspec.property.Property

Properties are the values that Components expose as inputs and outputs.

pyagentspec.property.StringProperty

Property object to represent a string property.

pyagentspec.property.BooleanProperty

Property object to represent a boolean property.

pyagentspec.property.IntegerProperty

Property object to represent an integer property.

pyagentspec.property.FloatProperty

Equivalent of a number property.

pyagentspec.property.NumberProperty

Property object to represent a number property.

pyagentspec.property.NullProperty

Property object to represent a null property.

pyagentspec.property.UnionProperty

Property object to represent a union property.

pyagentspec.property.ListProperty

Property object to represent a list property.

pyagentspec.property.DictProperty

Property object to represent a dict property.

pyagentspec.property.ObjectProperty

Property object to represent an object property.

MCP#

Classes

pyagentspec.mcp.SessionParameters

Class to specify parameters of the MCP client session.

pyagentspec.mcp.StdioTransport

Base transport for connecting to an MCP server via subprocess with stdio.

pyagentspec.mcp.SSETransport

Transport implementation that connects to an MCP server via Server-Sent Events.

pyagentspec.mcp.SSEmTLSTransport

Transport layer for SSE with mTLS (mutual Transport Layer Security).

pyagentspec.mcp.StreamableHTTPmTLSTransport

Transport layer for streamable HTTP with mTLS (mutual Transport Layer Security).

pyagentspec.mcp.StreamableHTTPTransport

Transport implementation that connects to an MCP server via Streamable HTTP.

pyagentspec.mcp.MCPTool

Class for tools exposed by MCP servers

Serialization / Deserialization#

Classes

pyagentspec.serialization.AgentSpecSerializer

Provides methods to serialize Agent Spec Components.

pyagentspec.serialization.AgentSpecDeserializer

Provides methods to deserialize Agent Spec Components.

pyagentspec.serialization.SerializationContext

Interface for the serialization of Components.

pyagentspec.serialization.ComponentSerializationPlugin

Base class for Component serialization plugins.

pyagentspec.serialization.PydanticComponentSerializationPlugin

Serialization plugin for Pydantic Components.

pyagentspec.serialization.DeserializationContext

Interface for the deserialization of Components.

pyagentspec.serialization.ComponentDeserializationPlugin

Base class for Component deserialization plugins.

pyagentspec.serialization.PydanticComponentDeserializationPlugin

Deserialization plugin for Pydantic Components.