Skip to content

Commit 9f2d78f

Browse files
committed
undo whitespace changes
1 parent 013c39b commit 9f2d78f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/output.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If the output type schema is not of type `"object"` (e.g. it's `int` or `list[in
4343
Structured outputs (like tools) use Pydantic to build the JSON schema used for the tool, and to validate the data returned by the model.
4444

4545
!!! note "Type checking considerations"
46-
The Agent class is generic in its output type, and this type is carried through to `AgentRunResult.output` and `StreamedRunResult.output` so that your IDE or static type checker can warn you when your code doesn't properly take into account all the possible values those outputs could have.
46+
The Agent class is generic in its output type, and this type is carried through to `AgentRunResult.output` and `StreamedRunResult.output` so that your IDE or static type checker can warn you when your code doesn't properly take into account all the possible values those outputs could have.
4747

4848
Static type checkers like pyright and mypy will do their best to infer the agent's output type from the `output_type` you've specified, but they're not always able to do so correctly when you provide functions or multiple types in a union or list, even though Pydantic AI will behave correctly. When this happens, your type checker will complain even when you're confident you've passed a valid `output_type`, and you'll need to help the type checker by explicitly specifying the generic parameters on the `Agent` constructor. This is shown in the second example below and the output functions example further down.
4949

@@ -544,8 +544,8 @@ There two main challenges with streamed results:
544544
2. When receiving a response, we don't know if it's the final response without starting to stream it and peeking at the content. Pydantic AI streams just enough of the response to sniff out if it's a tool call or an output, then streams the whole thing and calls tools, or returns the stream as a [`StreamedRunResult`][pydantic_ai.result.StreamedRunResult].
545545

546546
!!! note
547-
As the `run_stream()` method will consider the first output matching the `output_type` to be the final output,
548-
it will stop running the agent graph and will not execute any tool calls made by the model after this "final" output.
547+
As the `run_stream()` method will consider the first output matching the `output_type` to be the final output,
548+
it will stop running the agent graph and will not execute any tool calls made by the model after this "final" output.
549549

550550
If you want to always run the agent graph to completion and stream all events from the model's streaming response and the agent's execution of tools,
551551
use [`agent.run_stream_events()`][pydantic_ai.agent.AbstractAgent.run_stream_events] ([docs](agents.md#streaming-all-events)) or [`agent.iter()`][pydantic_ai.agent.AbstractAgent.iter] ([docs](agents.md#streaming-all-events-and-output)) instead.
@@ -603,8 +603,8 @@ async def main():
603603
_(This example is complete, it can be run "as is" — you'll need to add `asyncio.run(main())` to run `main`)_
604604

605605
!!! warning "Output message not included in `messages`"
606-
The final output message will **NOT** be added to result messages if you use `.stream_text(delta=True)`,
607-
see [Messages and chat history](message-history.md) for more information.
606+
The final output message will **NOT** be added to result messages if you use `.stream_text(delta=True)`,
607+
see [Messages and chat history](message-history.md) for more information.
608608

609609
### Streaming Structured Output
610610

0 commit comments

Comments
 (0)