File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
pydantic_ai_slim/pydantic_ai/models Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 58
58
class OpenAIModelSettings (ModelSettings ):
59
59
"""Settings used for an OpenAI model request."""
60
60
61
- # This class is a placeholder for any future openai-specific settings
61
+ openai_reasoning_effort : chat .ChatCompletionReasoningEffort
62
+ """
63
+ Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning).
64
+ Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
65
+ result in faster responses and fewer tokens used on reasoning in a response.
66
+ """
62
67
63
68
64
69
@dataclass (init = False )
@@ -202,6 +207,7 @@ async def _completions_create(
202
207
presence_penalty = model_settings .get ('presence_penalty' , NOT_GIVEN ),
203
208
frequency_penalty = model_settings .get ('frequency_penalty' , NOT_GIVEN ),
204
209
logit_bias = model_settings .get ('logit_bias' , NOT_GIVEN ),
210
+ reasoning_effort = model_settings .get ('openai_reasoning_effort' , NOT_GIVEN ),
205
211
)
206
212
207
213
def _process_response (self , response : chat .ChatCompletion ) -> ModelResponse :
You can’t perform that action at this time.
0 commit comments