Config
any_agent.config.AgentConfig
Bases: BaseModel
Source code in src/any_agent/config.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
agent_args = None
class-attribute
instance-attribute
Pass arguments to the instance used by the underlying framework.
For example, you can pass output_type
when using the OpenAI Agents SDK:
agent_type = None
class-attribute
instance-attribute
Control the type of agent class that is used by the framework, and is unique to the framework used.
Check the individual Frameworks
pages for more info on the defaults.
callbacks = Field(default_factory=get_default_callbacks)
class-attribute
instance-attribute
List of callbacks to use during agent invocation.
See more info at Callbacks.
description = None
class-attribute
instance-attribute
Description of the agent.
instructions = None
class-attribute
instance-attribute
Specify the instructions for the agent (often also referred to as a system_prompt
).
model_args = None
class-attribute
instance-attribute
Pass arguments to the model instance like temperature
, top_k
, as well as any other provider-specific parameters.
Refer to LiteLLM Completion API Docs for more info.
model_id
instance-attribute
Select the underlying model used by the agent.
If you are using the default model_type (LiteLLM), you can refer to LiteLLM Provider Docs for the list of providers and how to access them.
model_type = None
class-attribute
instance-attribute
Control the type of model class that is used by the agent framework, and is unique to the agent framework being used.
For each framework, we leverage their support for LiteLLM and use it as default model_type, allowing you to use the same model_id syntax across these frameworks.
name = 'any_agent'
class-attribute
instance-attribute
The name of the agent.
Defaults to any_agent
.
output_type = None
class-attribute
instance-attribute
Control the output schema from calling run
. By default, the agent will return a type str.
Using this parameter you can define a Pydantic model that will be returned by the agent run methods.
tools = Field(default_factory=list)
class-attribute
instance-attribute
List of tools to be used by the agent.
See more info at Tools.
any_agent.config.MCPStdio
Bases: BaseModel
Source code in src/any_agent/config.py
args
instance-attribute
Command line args to pass to the command executable.
For example, ["run", "-i", "--rm", "mcp/fetch"]
.
client_session_timeout_seconds = 5
class-attribute
instance-attribute
the read timeout passed to the MCP ClientSession.
command
instance-attribute
The executable to run to start the server.
For example, docker
, uvx
, npx
.
env = None
class-attribute
instance-attribute
The environment variables to set for the server.
tools = None
class-attribute
instance-attribute
List of tool names to use from the MCP Server.
Use it to limit the tools accessible by the agent.
For example, if you use mcp/filesystem
,
you can pass tools=["read_file", "list_directory"]
to limit the agent to read-only operations.
If none is specified, the default behavior is that the agent will have access to all tools under that MCP server.
any_agent.config.MCPStreamableHttp
Bases: BaseModel
Source code in src/any_agent/config.py
client_session_timeout_seconds = 5
class-attribute
instance-attribute
the read timeout passed to the MCP ClientSession.
headers = None
class-attribute
instance-attribute
The headers to send to the server.
tools = None
class-attribute
instance-attribute
List of tool names to use from the MCP Server.
Use it to limit the tools accessible by the agent.
For example, if you use mcp/filesystem
,
you can pass tools=["read_file", "list_directory"]
to limit the agent to read-only operations.
url
instance-attribute
The URL of the server.
any_agent.config.MCPSse
Bases: BaseModel
Source code in src/any_agent/config.py
client_session_timeout_seconds = 5
class-attribute
instance-attribute
the read timeout passed to the MCP ClientSession.
headers = None
class-attribute
instance-attribute
The headers to send to the server.
tools = None
class-attribute
instance-attribute
List of tool names to use from the MCP Server.
Use it to limit the tools accessible by the agent.
For example, if you use mcp/filesystem
,
you can pass tools=["read_file", "list_directory"]
to limit the agent to read-only operations.
url
instance-attribute
The URL of the server.
any_agent.serving.A2AServingConfig
Bases: BaseModel
Configuration for serving an agent using the Agent2Agent Protocol (A2A).
Example
config = A2AServingConfig( port=8080, endpoint="/my-agent", skills=[ AgentSkill( id="search", name="web_search", description="Search the web for information" ) ], context_timeout_minutes=15 )
Source code in src/any_agent/serving/a2a/config_a2a.py
context_timeout_minutes = 10
class-attribute
instance-attribute
Context timeout in minutes. Contexts will be cleaned up after this period of inactivity.
endpoint = '/'
class-attribute
instance-attribute
Will be pass as argument to Starlette().add_route
history_formatter = default_history_formatter
class-attribute
instance-attribute
Function to format conversation history and current query into a single prompt. Takes (messages, current_query) and returns formatted string.
host = 'localhost'
class-attribute
instance-attribute
Will be passed as argument to uvicorn.run
.
log_level = 'warning'
class-attribute
instance-attribute
Will be passed as argument to the uvicorn
server.
port = 5000
class-attribute
instance-attribute
Will be passed as argument to uvicorn.run
.
push_notifier_sender_type = BasePushNotificationSender
class-attribute
instance-attribute
Push notifier sender to be used by the agent.
If not provided, a default async httpx-based push notifier sender will be used.
push_notifier_store_type = InMemoryPushNotificationConfigStore
class-attribute
instance-attribute
Push notifier config store to be used by the agent.
If not provided, a default in-memory push notifier config store will be used.
skills = None
class-attribute
instance-attribute
List of skills to be used by the agent.
If not provided, the skills will be inferred from the tools.
task_cleanup_interval_minutes = 5
class-attribute
instance-attribute
Interval in minutes between task cleanup runs.
task_store_type = InMemoryTaskStore
class-attribute
instance-attribute
Task store to be used by the agent.
If not provided, a default in-memory task store will be used.
any_agent.serving.MCPServingConfig
Bases: BaseModel
Configuration for serving an agent using the Model Context Protocol (MCP).
Example
config = MCPServingConfig( port=8080, endpoint="/my-agent", )
Source code in src/any_agent/serving/mcp/config_mcp.py
endpoint = '/'
class-attribute
instance-attribute
Will be pass as argument to Starlette().add_route
host = 'localhost'
class-attribute
instance-attribute
Will be passed as argument to uvicorn.run
.
log_level = 'warning'
class-attribute
instance-attribute
Will be passed as argument to the uvicorn
server.
port = 5000
class-attribute
instance-attribute
Will be passed as argument to uvicorn.run
.
any_agent.config.AgentFramework
Bases: StrEnum