Skip to content

Commit b72bd77

Browse files
authored
Update docs to account for system_prompt in structured_output (#158)
Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
1 parent 966bc9e commit b72bd77

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/user-guide/concepts/model-providers/custom_model_provider.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,21 +332,26 @@ T = TypeVar('T', bound=BaseModel)
332332

333333
@override
334334
async def structured_output(
335-
self, output_model: Type[T], prompt: Messages, **kwargs: Any
335+
self,
336+
output_model: Type[T],
337+
prompt: Messages,
338+
system_prompt: Optional[str] = None,
339+
**kwargs: Any
336340
) -> Generator[dict[str, Union[T, Any]], None, None]:
337341
"""Get structured output using tool calling.
338342
339343
Args:
340344
output_model: The output model to use for the agent.
341345
prompt: The prompt messages to use for the agent.
346+
system_prompt: The system prompt to use for the agent.
342347
**kwargs: Additional keyword arguments for future extensibility.
343348
"""
344349

345350
# Convert Pydantic model to tool specification
346351
tool_spec = convert_pydantic_to_tool_spec(output_model)
347352

348353
# Use the stream method with tool specification
349-
response = await self.stream(messages=prompt, tool_specs=[tool_spec], **kwargs)
354+
response = await self.stream(messages=prompt, tool_specs=[tool_spec], system_prompt=system_prompt, **kwargs)
350355

351356
# Process streaming response
352357
async for event in process_stream(response, prompt):

0 commit comments

Comments
 (0)