File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
src/praisonai/praisonai/inc Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -138,11 +138,15 @@ def get_model(self):
138138 "Please install with 'pip install langchain-anthropic'"
139139 )
140140 elif OPENAI_AVAILABLE :
141- return ChatOpenAI (
142- model = self .model_name ,
143- api_key = self .api_key ,
144- base_url = self .base_url ,
145- )
141+ chat_kwargs = {
142+ "model" : self .model_name ,
143+ "api_key" : self .api_key ,
144+ "base_url" : self .base_url ,
145+ }
146+ # Certain OpenAI models (e.g., gpt-5-* family) only allow temperature=1
147+ if isinstance (self .model_name , str ) and self .model_name .startswith ("gpt-5" ):
148+ chat_kwargs ["temperature" ] = 1
149+ return ChatOpenAI (** chat_kwargs )
146150 else :
147151 raise ImportError (
148152 "Required Langchain Integration 'langchain-openai' not found. "
You can’t perform that action at this time.
0 commit comments