@@ -290,7 +290,7 @@ def create_message(
290290 thinking : ThinkingConfigParam | None = None , # noqa: ARG002
291291 tool_choice : ToolChoiceParam | None = None , # noqa: ARG002
292292 temperature : float | None = None ,
293- provider_options : dict [str , Any ] | None = None , # noqa: ARG002
293+ provider_options : dict [str , Any ] | None = None ,
294294 ) -> MessageParam :
295295 """Create a message via an OpenAI-compatible chat completions endpoint.
296296
@@ -303,7 +303,9 @@ def create_message(
303303 thinking: Ignored (not supported by the OpenAI chat API).
304304 tool_choice: Ignored.
305305 temperature: Sampling temperature.
306- provider_options: Ignored.
306+ provider_options: Additional keyword arguments forwarded directly
307+ to the OpenAI ``chat.completions.create`` call (e.g.
308+ ``{"top_p": 0.9, "response_format": {...}}``).
307309
308310 Returns:
309311 The model's response as a `MessageParam`.
@@ -328,5 +330,8 @@ def create_message(
328330 if openai_tools :
329331 kwargs ["tools" ] = openai_tools
330332
333+ if provider_options is not None :
334+ kwargs .update (provider_options )
335+
331336 response = self ._client .chat .completions .create (** kwargs )
332337 return _from_openai_response (response )
0 commit comments