diff --git a/docs/user-guide/concepts/model-providers/custom_model_provider.md b/docs/user-guide/concepts/model-providers/custom_model_provider.md index a65ab258..72d60129 100644 --- a/docs/user-guide/concepts/model-providers/custom_model_provider.md +++ b/docs/user-guide/concepts/model-providers/custom_model_provider.md @@ -332,13 +332,18 @@ T = TypeVar('T', bound=BaseModel) @override async def structured_output( - self, output_model: Type[T], prompt: Messages, **kwargs: Any + self, + output_model: Type[T], + prompt: Messages, + system_prompt: Optional[str] = None, + **kwargs: Any ) -> Generator[dict[str, Union[T, Any]], None, None]: """Get structured output using tool calling. Args: output_model: The output model to use for the agent. prompt: The prompt messages to use for the agent. + system_prompt: The system prompt to use for the agent. **kwargs: Additional keyword arguments for future extensibility. """ @@ -346,7 +351,7 @@ async def structured_output( tool_spec = convert_pydantic_to_tool_spec(output_model) # Use the stream method with tool specification - response = await self.stream(messages=prompt, tool_specs=[tool_spec], **kwargs) + response = await self.stream(messages=prompt, tool_specs=[tool_spec], system_prompt=system_prompt, **kwargs) # Process streaming response async for event in process_stream(response, prompt):