Skip to main content

Module context

Module context 

Source
Expand description

Execution context system for Anda agents and tools.

Contexts carry the runtime capabilities exposed to anda_core agents and tools: caller identity, request metadata, cancellation, scoped cache, object storage, HTTP calls, Web3 signing, remote engine access, and per-session state. Contexts are hierarchical so each agent or tool receives a scoped namespace while sharing the same underlying runtime resources.

Structs§

AgentCtx
Context for agent operations, providing access to models, tools, and other agents.
AgentInfo
Contains descriptive and operational information about an AI agent.
BaseCtx
Runtime context shared by engine tools and nested agent calls.
CompletionRunner
A iteration style executor for completion.
CompletionStream
Stream wrapper for CompletionRunner.
EngineCard
Information about the engine, including agent and tool definitions.
RemoteAgent
Wraps a remote agent as a local agent.
RemoteEngineArgs
Arguments for registering a remote engine.
RemoteEngines
Collection of remote engines.
RemoteTool
Wraps a remote tool as a local tool.
ToolGroupSummary
One entry in the capability group directory returned by ToolsGroups.
ToolGroupsOutput
Output returned by ToolsGroups.
ToolsGroups
Lists the capability groups available to the model as a compact directory.
ToolsGroupsArgs
Arguments for ToolsGroups.
ToolsOutput
Output returned by callable discovery tools.
ToolsSearch
Searches the callable surface currently available to the model. The “tools_search” tool has been registered as a built-in agent with label “flash”.
ToolsSearchArgs
Arguments for ToolsSearch.
ToolsSelect
Returns a subset of callable definitions for direct use in the next reasoning turn. The “tools_select” tool has been registered as a built-in agent with label “flash”.
ToolsSelectArgs
Arguments for ToolsSelect.
Web3SDK
Backend-agnostic Web3 capability handle used by engine contexts.

Constants§

TOOLS_GROUPS_NAME
Built-in name for listing capability groups (the group directory).
TOOLS_SEARCH_NAME
Built-in name for keyword search across available callables.
TOOLS_SELECT_NAME
Built-in name for selecting callables by exact name.

Statics§

COMPACTION_PROMPT
DYNAMIC_REMOTE_ENGINES
Reserved dynamic-configuration key for remote engine registrations.
REMOTE_AGENT_PREFIX
Prefix used for routed remote-agent calls in model-facing tool names.
REMOTE_TOOL_PREFIX
Prefix used for routed remote-tool calls in model-facing tool names.
SUB_AGENT_PREFIX
Prefix used for routed subagent calls in model-facing tool names.

Traits§

Web3ClientFeatures
Object-safe Web3 capability surface required by Web3SDK.

Functions§

json_candidates
Extracts JSON candidates from the input string by applying various heuristics, such as stripping markdown code blocks and extracting JSON-like substrings. This increases the chances of successfully parsing the model output even when it is not perfectly formatted.