Skip to content

Commit a2772d2

Browse files
committed
fix xrefs
1 parent 6256d9e commit a2772d2

File tree

10 files changed

+34
-22
lines changed

10 files changed

+34
-22
lines changed

docs/agent-spec.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ capabilities:
2626
2727
## Loading specs
2828
29-
[`Agent.from_file`][pydantic_ai.Agent.from_file] loads a spec from a YAML or JSON file and constructs an agent:
29+
[`Agent.from_file`][pydantic_ai.agent.Agent.from_file] loads a spec from a YAML or JSON file and constructs an agent:
3030

3131
```python {title="from_file_example.py" test="skip"}
3232
from pydantic_ai import Agent
3333
3434
agent = Agent.from_file('agent.yaml')
3535
```
3636

37-
[`Agent.from_spec`][pydantic_ai.Agent.from_spec] accepts a dict or [`AgentSpec`][pydantic_ai.agent.spec.AgentSpec] instance and supports additional keyword arguments that supplement or override the spec:
37+
[`Agent.from_spec`][pydantic_ai.agent.Agent.from_spec] accepts a dict or [`AgentSpec`](#agentspec-reference) instance and supports additional keyword arguments that supplement or override the spec:
3838

3939
```python {title="from_spec_example.py"}
4040
from dataclasses import dataclass
@@ -71,15 +71,15 @@ For more control over spec loading, use [`AgentSpec.from_file`][pydantic_ai.agen
7171

7272
## Template strings
7373

74-
[`TemplateStr`][pydantic_ai.TemplateStr] provides Handlebars-style templates (`{{variable}}`) that are rendered against the agent's [dependencies](dependencies.md) at runtime. In spec files, strings containing `{{` are automatically converted to template strings:
74+
[`TemplateStr`][pydantic_ai._template.TemplateStr] provides Handlebars-style templates (`{{variable}}`) that are rendered against the agent's [dependencies](dependencies.md) at runtime. In spec files, strings containing `{{` are automatically converted to template strings:
7575

7676
```yaml {test="skip"}
7777
instructions: "You are assisting {{name}}, who is a {{role}}."
7878
```
7979

8080
Template variables are resolved from the fields of the `deps` object. When a `deps_type` (or [`deps_schema`](#deps_schema)) is provided, template variable names are validated at construction time.
8181

82-
In Python code, [`TemplateStr`][pydantic_ai.TemplateStr] can be used explicitly, but a callable with [`RunContext`][pydantic_ai.tools.RunContext] is generally preferred for IDE autocomplete and type checking:
82+
In Python code, [`TemplateStr`][pydantic_ai._template.TemplateStr] can be used explicitly, but a callable with [`RunContext`][pydantic_ai.tools.RunContext] is generally preferred for IDE autocomplete and type checking:
8383

8484
```python {title="template_instructions.py"}
8585
from dataclasses import dataclass
@@ -117,7 +117,7 @@ See [Publishing capabilities](capabilities.md#publishing-capabilities) for how t
117117

118118
## `AgentSpec` reference
119119

120-
The [`AgentSpec`][pydantic_ai.agent.spec.AgentSpec] model represents the full spec structure:
120+
The [`AgentSpec`](#agentspec-reference) model represents the full spec structure:
121121

122122
| Field | Type | Description |
123123
|---|---|---|

docs/api/agent_spec.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `pydantic_ai.agent.spec`
2+
3+
::: pydantic_ai.agent.spec
4+
options:
5+
members:
6+
- AgentSpec
7+
8+
::: pydantic_ai._template
9+
options:
10+
members:
11+
- TemplateStr

docs/api/toolsets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
::: pydantic_ai.toolsets
44
options:
55
members:
6+
- AgentToolset
67
- AbstractToolset
78
- CombinedToolset
89
- ExternalToolset

docs/capabilities.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ The callable receives a [`RunContext`][pydantic_ai.tools.RunContext] where `ctx.
362362

363363
| Method | Return type | Purpose |
364364
|---|---|---|
365-
| [`get_toolset()`][pydantic_ai.capabilities.AbstractCapability.get_toolset] | [`AgentToolset`][pydantic_ai.toolsets.AgentToolset] `\| None` | A [toolset](toolsets.md) to register (or a callable for [dynamic toolsets](toolsets.md#dynamically-building-a-toolset)) |
365+
| [`get_toolset()`][pydantic_ai.capabilities.AbstractCapability.get_toolset] | [`AgentToolset`][pydantic_ai.toolsets.AgentToolset] \| `None` | A [toolset](toolsets.md) to register (or a callable for [dynamic toolsets](toolsets.md#dynamically-building-a-toolset)) |
366366
| [`get_builtin_tools()`][pydantic_ai.capabilities.AbstractCapability.get_builtin_tools] | `Sequence[`[`AgentBuiltinTool`][pydantic_ai.tools.AgentBuiltinTool]`]` | [Builtin tools](builtin-tools.md) to register (including callables) |
367-
| [`get_wrapper_toolset()`][pydantic_ai.capabilities.AbstractCapability.get_wrapper_toolset] | [`AbstractToolset`][pydantic_ai.toolsets.AbstractToolset] `\| None` | [Wrap the agent's assembled toolset](#toolset-wrapping) |
368-
| [`get_instructions()`][pydantic_ai.capabilities.AbstractCapability.get_instructions] | [`AgentInstructions`][pydantic_ai.agent.AgentInstructions] `\| None` | [Instructions](agent.md#instructions) (static strings, [template strings](agent-spec.md#template-strings), or callables) |
369-
| [`get_model_settings()`][pydantic_ai.capabilities.AbstractCapability.get_model_settings] | [`AgentModelSettings`][pydantic_ai.agent.AgentModelSettings] `\| None` | [Model settings](agent.md#model-run-settings) dict, or a callable for per-step settings |
367+
| [`get_wrapper_toolset()`][pydantic_ai.capabilities.AbstractCapability.get_wrapper_toolset] | [`AbstractToolset`][pydantic_ai.toolsets.AbstractToolset] \| `None` | [Wrap the agent's assembled toolset](#toolset-wrapping) |
368+
| [`get_instructions()`][pydantic_ai.capabilities.AbstractCapability.get_instructions] | [`AgentInstructions`][pydantic_ai.agent.AgentInstructions] \| `None` | [Instructions](agent.md#instructions) (static strings, [template strings](agent-spec.md#template-strings), or callables) |
369+
| [`get_model_settings()`][pydantic_ai.capabilities.AbstractCapability.get_model_settings] | [`AgentModelSettings`][pydantic_ai.agent.AgentModelSettings] \| `None` | [Model settings](agent.md#model-run-settings) dict, or a callable for per-step settings |
370370

371371
### Hooking into the lifecycle
372372

docs/extensibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To make a capability installable and usable in [agent specs](agent-spec.md):
2525

2626
3. **Package naming** — use the `pydantic-ai-` prefix (e.g. `pydantic-ai-guardrails`) so users can find your package.
2727

28-
4. **Registration** — users pass custom capability types via `custom_capability_types` on [`Agent.from_spec`][pydantic_ai.Agent.from_spec] or [`Agent.from_file`][pydantic_ai.Agent.from_file].
28+
4. **Registration** — users pass custom capability types via `custom_capability_types` on [`Agent.from_spec`][pydantic_ai.agent.Agent.from_spec] or [`Agent.from_file`][pydantic_ai.agent.Agent.from_file].
2929

3030
```python {test="skip" lint="skip"}
3131
from pydantic_ai import Agent

docs/thinking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ agent = Agent(model, model_settings=settings)
9191
To enable thinking, use the [`AnthropicModelSettings.anthropic_thinking`][pydantic_ai.models.anthropic.AnthropicModelSettings.anthropic_thinking] [model setting](agent.md#model-run-settings).
9292

9393
!!! note
94-
Extended thinking (`type: 'enabled'` with `budget_tokens`) is deprecated on `claude-opus-4-6`+. For those models, use [adaptive thinking](#adaptive-thinking--effort) instead.
94+
Extended thinking (`type: 'enabled'` with `budget_tokens`) is deprecated on `claude-opus-4-6`+. For those models, use [adaptive thinking](#adaptive-thinking-effort) instead.
9595

9696
```python {title="anthropic_thinking_part.py"}
9797
from pydantic_ai import Agent

pydantic_ai_slim/pydantic_ai/agent/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ def from_file(
800800
The file format is inferred from the extension (`.yaml`/`.yml` or `.json`)
801801
unless overridden with the `fmt` argument.
802802
803-
All other arguments are forwarded to [`from_spec`][pydantic_ai.Agent.from_spec].
803+
All other arguments are forwarded to [`from_spec`][pydantic_ai.agent.Agent.from_spec].
804804
"""
805805
spec = AgentSpec.from_file(path, fmt=fmt)
806806
return cls.from_spec(

pydantic_ai_slim/pydantic_ai/capabilities/abstract.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class AbstractCapability(ABC, Generic[AgentDepsT]):
7373
7474
[`get_serialization_name`][pydantic_ai.capabilities.AbstractCapability.get_serialization_name]
7575
and [`from_spec`][pydantic_ai.capabilities.AbstractCapability.from_spec] support
76-
YAML/JSON specs (via [`Agent.from_spec`][pydantic_ai.Agent.from_spec]); they have
76+
YAML/JSON specs (via [`Agent.from_spec`][pydantic_ai.agent.Agent.from_spec]); they have
7777
sensible defaults and typically don't need to be overridden.
7878
"""
7979

@@ -113,7 +113,7 @@ def get_instructions(self) -> AgentInstructions[AgentDepsT] | None:
113113
This method is called once at agent construction time. To get dynamic
114114
per-request behavior, return a callable that receives
115115
[`RunContext`][pydantic_ai.tools.RunContext] or a
116-
[`TemplateStr`][pydantic_ai.TemplateStr] — not a dynamic string.
116+
[`TemplateStr`][pydantic_ai._template.TemplateStr] — not a dynamic string.
117117
"""
118118
return None
119119

@@ -272,10 +272,10 @@ async def wrap_node_run(
272272
the returned next node, call `handler` multiple times (retry), or
273273
return a different node to redirect graph progression.
274274
275-
Note: this hook fires when using [`agent.run()`][pydantic_ai.Agent.run],
276-
[`agent.run_stream()`][pydantic_ai.Agent.run_stream], and when manually driving
277-
an [`agent.iter()`][pydantic_ai.Agent.iter] run with
278-
[`next()`][pydantic_ai.result.AgentRun.next], but it does **not** fire when
275+
Note: this hook fires when using [`agent.run()`][pydantic_ai.agent.AbstractAgent.run],
276+
[`agent.run_stream()`][pydantic_ai.agent.AbstractAgent.run_stream], and when manually driving
277+
an [`agent.iter()`][pydantic_ai.agent.Agent.iter] run with
278+
[`next()`][pydantic_ai.run.AgentRun.next], but it does **not** fire when
279279
iterating over the run with bare `async for` (which yields stream events, not
280280
node results).
281281
@@ -419,7 +419,7 @@ async def on_tool_validate_error(
419419
420420
This is the error counterpart to
421421
[`after_tool_validate`][pydantic_ai.capabilities.AbstractCapability.after_tool_validate].
422-
Fires for [`ValidationError`][pydantic.ValidationError] (schema mismatch) and
422+
Fires for `ValidationError` (schema mismatch) and
423423
[`ModelRetry`][pydantic_ai.exceptions.ModelRetry] (custom validator rejection).
424424
425425
**Raise** the original `error` (or a different exception) to propagate it.

pydantic_ai_slim/pydantic_ai/capabilities/builtin_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class BuiltinTool(AbstractCapability[AgentDepsT]):
2222
[`AbstractBuiltinTool`][pydantic_ai.builtin_tools.AbstractBuiltinTool] instance or a callable
2323
that dynamically produces one.
2424
25-
When `builtin_tools` is passed to [`Agent.__init__`][pydantic_ai.Agent.__init__], each item is
25+
When `builtin_tools` is passed to [`Agent.__init__`][pydantic_ai.agent.Agent.__init__], each item is
2626
automatically wrapped in a `BuiltinTool` capability.
2727
"""
2828

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class MCPServer(AbstractToolset[Any], ABC):
339339
340340
When enabled (default), tools are fetched once and cached until either:
341341
- The server sends a `notifications/tools/list_changed` notification
342-
- [`MCPServer.__aexit__`][pydantic_ai.mcp.MCPServer.__aexit__] is called (when the last context exits)
342+
- `MCPServer.__aexit__` is called (when the last context exits)
343343
344344
Set to `False` for servers that change tools dynamically without sending notifications.
345345
@@ -354,7 +354,7 @@ class MCPServer(AbstractToolset[Any], ABC):
354354
355355
When enabled (default), resources are fetched once and cached until either:
356356
- The server sends a `notifications/resources/list_changed` notification
357-
- [`MCPServer.__aexit__`][pydantic_ai.mcp.MCPServer.__aexit__] is called (when the last context exits)
357+
- `MCPServer.__aexit__` is called (when the last context exits)
358358
359359
Set to `False` for servers that change resources dynamically without sending notifications.
360360
"""

0 commit comments

Comments
 (0)