File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,17 @@ def select(
7070 if processor == Processors .OPENAI :
7171 log .info (f'Forwarding inference to OpenAI for customer { customer_id } ' )
7272
73+ model_name = options .get ('metadata' ).get ('model' )
74+
75+ # gpt-5 family does not support temperature other than 1 anymore
76+ model_temp = 1 if model_name .startswith ('gpt-5' ) else temperature
77+
7378 return ChatOpenAI (
7479 api_key = options .get ('secret' ),
7580 max_completion_tokens = max_completion_tokens ,
76- model_name = options . get ( 'metadata' ). get ( 'model' ) ,
81+ model_name = model_name ,
7782 streaming = stream ,
78- temperature = temperature ,
83+ temperature = model_temp ,
7984 )
8085 elif processor == Processors .AZURE :
8186 log .info (f'Forwarding inference to Azure-OpenAI for customer { customer_id } ' )
You can’t perform that action at this time.
0 commit comments