mirascope.core.base.structured_stream
Module structured_stream
This module defines the base class for structured streams.
Class BaseStructuredStream
A base class for streaming structured outputs from LLMs.
Bases:
Generic[_ResponseModelT]Attributes
| Name | Type | Description |
|---|---|---|
| stream | BaseStream | - |
| response_model | type[_ResponseModelT] | - |
| constructed_response_model | _ResponseModelT | - |
| fields_from_call_args | fields_from_call_args | - |
Function structured_stream_factory
Parameters
| Name | Type | Description |
|---|---|---|
| TCallResponse | type[_BaseCallResponseT] | - |
| TCallResponseChunk | type[_BaseCallResponseChunkT] | - |
| TStream | type[BaseStream] | - |
| TToolType | type[_BaseToolT] | - |
| setup_call | SameSyncAndAsyncClientSetupCall[_SameSyncAndAsyncClientT, _BaseDynamicConfigT, _AsyncBaseDynamicConfigT, _BaseCallParamsT, _ResponseT, _ResponseChunkT, _AsyncResponseT, _AsyncResponseChunkT, _BaseToolT] | SetupCall[_SyncBaseClientT, _AsyncBaseClientT, _BaseDynamicConfigT, _AsyncBaseDynamicConfigT, _BaseCallParamsT, _ResponseT, _ResponseChunkT, _AsyncResponseT, _AsyncResponseChunkT, _BaseToolT] | - |
| get_json_output | GetJsonOutput[_BaseCallResponseChunkT] | - |