Package-level declarations
Types
A function an agent loop can call: the on-device loops (OpenAI, Anthropic, Gemini, Ollama), and server agents that accept client-side tools (AG-UI frontend tools, AI SDK client tools). parameters is a JSON Schema object, shared verbatim by every API.
Lets the model ask the user multiple-choice questions mid-run — Pydantic AI Harness AskUser, with the same tool (ask_user_question), schema, limits, instruction and result, so prompts and servers written for it work unchanged.
One question of an ask_user_question call.
Built-in tool: evaluates an arithmetic expression (+ - * / % ^ and parentheses) without eval.
A composable bundle of what an agent can do: instructions added to the system prompt and tools it may call — the Kotlin counterpart of a Pydantic AI capability. SubAgents, dev.ai.elements.core.skills.Skills and MCP servers (dev.ai.elements.core.mcp.McpToolset) are capabilities; so is any app feature that pairs tools with guidance.
Built-in tool: the current date and time in an IANA timezone.
A capability made of fixed tools and instructions.
One delegate of SubAgents: a named agent with its own instructions, model and tools, reached through backend. Any ChatBackend works — an on-device loop, an AG-UI or AI SDK server, or a remote A2A agent.
Lets the agent delegate self-contained tasks to named agents — the same contract as Pydantic AI Harness SubAgents, so on-device and server agents behave alike and UIs render both the same way:
The tool call an AgentTool.execute is running for. Agent loops install it in the coroutine context, so a tool reaches it with current without the AgentTool interface growing parameters:
What a tool call gives the model: its text result and the content it returned for the model (ToolCallContext.content; Pydantic AI ToolReturn.content), which a model loop sends in a user message after the tool results.
Functions
The ask_user_question result for the user's content (an InputResponse.Accept of askUserSchema).
The questions of an ask_user_question call's arguments, validated as Pydantic AI Harness does.
The InputRequest schema for questions: standard JSON Schema, one property per question.
All tools of capabilities; the first tool of a given name wins.
base, every capability's static instructions, then their per-turn Capability.context, separated by blank lines.
Execute one tool call of an agent loop, emitting the tool events. Tools with AgentTool.requiresApproval wait for approver first: a denial (with the user's reason) goes back to the model, edited arguments replace the proposed ones. While the tool runs, what it reports through ToolCallContext (interim output, a nested agent run) is streamed as ChatEvent.ToolOutput (preliminary) and ChatEvent.SubagentUpdate.
runTool, with the content the tool returned for the model.