Skip to main content

Module intel

Module intel 

Source
Expand description

Intelligence wire types — the provider-neutral representation the agentic loop reasons over.

The loop builds a Request and consumes a Response without knowing which provider answered. The intel/openai.rs and intel/anthropic.rs adapters translate to/from the on-the-wire JSON dialects; a model lacking native tool-calling falls back to the JSON-action shape parsed in agentloop/action.rs. Because the neutral model lives here rather than in one provider’s struct, supporting another provider costs one adapter and no change to the loop — that is what keeps the adapter count from growing into the rest of the runtime.

Structs§

Request
A request to the intelligence endpoint.
Response
A response from the intelligence endpoint, normalized across providers.
ToolCall
A model-requested tool invocation. arguments is already-parsed JSON.
ToolDef
A tool advertised to the model in the request tools field. Sourced from the scoped MCP tools/list plus agentd’s own self-tools.
Usage
Token accounting from one model call. The supervisor sums these into the run’s budget, and a child’s usage also counts against its parent’s.

Enums§

Message
One conversation message. Assistant may carry tool calls; ToolResult feeds a tool’s output back into the conversation as the next observation.
StopReason
Why the model stopped — drives the loop’s branch (tool-use vs final) and the exhausted_tokens terminal status.