@@ -123,6 +123,26 @@ def models(self) -> list[ProviderAIModel]:
123123 vision = True ,
124124 max_temperature = 2.0 ,
125125 ),
126+ ProviderAIModel (
127+ id = "gpt-4o-search-preview" ,
128+ name = "GPT-4o Search Preview" ,
129+ # Translators: This is a model description
130+ description = _ ("GPT model for web search in Chat Completions" ),
131+ context_window = 128000 ,
132+ max_output_tokens = 16384 ,
133+ vision = True ,
134+ max_temperature = 2.0 ,
135+ ),
136+ ProviderAIModel (
137+ id = "gpt-4o-mini-search-preview" ,
138+ name = "GPT-4o mini Search Preview" ,
139+ # Translators: This is a model description
140+ description = _ ("Fast, affordable small model for web search" ),
141+ context_window = 128000 ,
142+ max_output_tokens = 16384 ,
143+ vision = True ,
144+ max_temperature = 2.0 ,
145+ ),
126146 ProviderAIModel (
127147 id = "chatgpt-4o-latest" ,
128148 name = "ChatGPT 4o" ,
@@ -390,15 +410,21 @@ def completion(
390410 chat completion chunks.
391411 """
392412 super ().completion (new_block , conversation , system_message , ** kwargs )
413+ model_id = new_block .model .model_id
393414 params = {
394- "model" : new_block . model . model_id ,
415+ "model" : model_id ,
395416 "messages" : self .get_messages (
396417 new_block , conversation , system_message
397418 ),
398- "temperature" : new_block .temperature ,
399- "top_p" : new_block .top_p ,
400419 "stream" : new_block .stream ,
401420 }
421+ if model_id not in [
422+ "gpt-4o-search-preview" ,
423+ "gpt-4o-mini-search-preview" ,
424+ ]:
425+ params .update (
426+ {"temperature" : new_block .temperature , "top_p" : new_block .top_p }
427+ )
402428 if new_block .max_tokens :
403429 params ["max_tokens" ] = new_block .max_tokens
404430 params .update (kwargs )
0 commit comments