pub async fn collect_stream_object<T>(
stream: ChatStream,
schema: &JsonSchema,
) -> Result<PartialObject<T>, LlmError>where
T: DeserializeOwned,Expand description
Collects a ChatStream into a PartialObject<T>.
Accumulates text deltas, then validates and deserializes the result
when the stream completes. Use this with stream_object_async.
Unlike generate_object, this function does not retry on
validation failures — errors are returned immediately.