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
To enable thinking, use the [`OpenRouterModelSettings.openrouter_reasoning`][pydantic_ai.models.openrouter.OpenRouterModelSettings.openrouter_reasoning][model setting](agents.md#model-run-settings).
150
+
151
+
```python {title="openrouter_thinking_part.py"}
152
+
from pydantic_ai import Agent
153
+
from pydantic_ai.models.openrouter import OpenRouterModel, OpenRouterModelSettings
@@ -204,7 +204,7 @@ class OpenRouterModelSettings(ModelSettings, total=False):
204
204
These models will be tried, in order, if the main model returns an error. [See details](https://openrouter.ai/docs/features/model-routing#the-models-parameter)
205
205
"""
206
206
207
-
openrouter_provider: _OpenRouterProviderConfig
207
+
openrouter_provider: OpenRouterProviderConfig
208
208
"""OpenRouter routes requests to the best available providers for your model. By default, requests are load balanced across the top providers to maximize uptime.
209
209
210
210
You can customize how your requests are routed using the provider object. [See more](https://openrouter.ai/docs/features/provider-routing)"""
@@ -214,19 +214,19 @@ class OpenRouterModelSettings(ModelSettings, total=False):
214
214
215
215
Create and manage presets through the OpenRouter web application to control provider routing, model selection, system prompts, and other parameters, then reference them in OpenRouter API requests. [See more](https://openrouter.ai/docs/features/presets)"""
216
216
217
-
openrouter_transforms: list[_Transforms]
217
+
openrouter_transforms: list[OpenRouterTransforms]
218
218
"""To help with prompts that exceed the maximum context size of a model.
219
219
220
220
Transforms work by removing or truncating messages from the middle of the prompt, until the prompt fits within the model's context window. [See more](https://openrouter.ai/docs/features/message-transforms)
221
221
"""
222
222
223
-
openrouter_reasoning: _OpenRouterReasoning
223
+
openrouter_reasoning: OpenRouterReasoning
224
224
"""To control the reasoning tokens in the request.
225
225
226
226
The reasoning config object consolidates settings for controlling reasoning strength across different models. [See more](https://openrouter.ai/docs/use-cases/reasoning-tokens)
227
227
"""
228
228
229
-
openrouter_usage: _OpenRouterUsageConfig
229
+
openrouter_usage: OpenRouterUsageConfig
230
230
"""To control the usage of the model.
231
231
232
232
The usage config object consolidates settings for enabling detailed usage information. [See more](https://openrouter.ai/docs/use-cases/usage-accounting)
0 commit comments