You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/thinking.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,10 @@ See the sections below for how to enable thinking for each provider.
11
11
When using the [`OpenAIChatModel`][pydantic_ai.models.openai.OpenAIChatModel], text output inside `<think>` tags are converted to [`ThinkingPart`][pydantic_ai.messages.ThinkingPart] objects.
12
12
You can customize the tags using the [`thinking_tags`][pydantic_ai.profiles.ModelProfile.thinking_tags] field on the [model profile](models/openai.md#model-profile).
13
13
14
-
Some providers might also support native thinking parts that are not delimited by tags. Instead, they are sent and received as separatefields in the API. You can configure the fields with [`openai_chat_custom_reasoning_field`][pydantic_ai.profiles.openai.OpenAIModelProfile.openai_chat_custom_reasoning_field].
14
+
Some [OpenAI-compatible model providers](models/openai.md#openai-compatible-models) might also support native thinking parts that are not delimited by tags. Instead, they are sent and received as separate, custom fields in the API. Typically, if you are calling the model via the `<provider>:<model>` shorthand, Pydantic AI handles it for you. Nonetheless, you can still configure the fields with [`openai_chat_custom_reasoning_field`][pydantic_ai.profiles.openai.OpenAIModelProfile.openai_chat_custom_reasoning_field].
15
15
16
16
If your provider recommends to send back these custom fields not changed, for caching or interleaved thinking benefits, you can also achieve this with [`openai_chat_include_reasoning_in_request`][pydantic_ai.profiles.openai.OpenAIModelProfile.openai_chat_include_reasoning_in_request].
17
17
18
-
And finally, if your provider generates reasoning parts in a somewhat complex `reasoning_details` field, you might want to look into [`OpenRouterModel`][pydantic_ai.models.openrouter.OpenRouterModel] which has built-in support for parsing such fields.
19
-
20
18
### OpenAI Responses
21
19
22
20
The [`OpenAIResponsesModel`][pydantic_ai.models.openai.OpenAIResponsesModel] can generate native thinking parts.
0 commit comments