File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change 20
20
21
21
T = TypeVar ('T' , bound = BaseModel )
22
22
23
- ReasoningModels : list [ChatModel | str ] = [
24
- 'o4-mini' ,
25
- 'o3' ,
26
- 'o3-mini' ,
27
- 'o1' ,
28
- 'o1-pro' ,
29
- 'o3-pro' ,
30
- 'gpt-5' ,
31
- 'gpt-5-mini' ,
32
- 'gpt-5-nano' ,
33
- ]
34
-
35
23
36
24
@dataclass
37
25
class ChatOpenAI (BaseChatModel ):
@@ -67,6 +55,17 @@ class ChatOpenAI(BaseChatModel):
67
55
http_client : httpx .AsyncClient | None = None
68
56
_strict_response_validation : bool = False
69
57
max_completion_tokens : int | None = 4096
58
+ reasoning_models : list [ChatModel | str ] | None = [
59
+ 'o4-mini' ,
60
+ 'o3' ,
61
+ 'o3-mini' ,
62
+ 'o1' ,
63
+ 'o1-pro' ,
64
+ 'o3-pro' ,
65
+ 'gpt-5' ,
66
+ 'gpt-5-mini' ,
67
+ 'gpt-5-nano' ,
68
+ ]
70
69
71
70
# Static
72
71
@property
@@ -180,7 +179,7 @@ async def ainvoke(
180
179
if self .service_tier is not None :
181
180
model_params ['service_tier' ] = self .service_tier
182
181
183
- if any (str (m ).lower () in str (self .model ).lower () for m in ReasoningModels ):
182
+ if any (str (m ).lower () in str (self .model ).lower () for m in self . reasoning_models ):
184
183
model_params ['reasoning_effort' ] = self .reasoning_effort
185
184
del model_params ['temperature' ]
186
185
del model_params ['frequency_penalty' ]
You can’t perform that action at this time.
0 commit comments