1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use ;
use Value;
use crate;
/// The result of a structured-output request: `data` is JSON matching the shape
/// you asked for in [`StructuredRequest::schema`](super::StructuredRequest::schema),
/// ready to deserialize into your own type with `serde_json::from_value`.
///
/// Unlike [`TextResponse`](crate::text::TextResponse), there's no multi-step tool
/// -calling loop here and so no `steps` list -- a structured-output request is
/// always exactly one request/response round trip, regardless of which strategy
/// the provider uses underneath to get the model to comply with the schema (see
/// [`crate::structured`] for what that means).
/// One event in a streamed structured-output reply. See
/// [`PendingStructuredRequest::stream`](super::PendingStructuredRequest::stream).
///
/// Unlike [`StreamEvent`](crate::StreamEvent) (Text generation's streaming
/// counterpart), there's no multi-step loop here either -- a structured
/// request is always exactly one round trip, so the sequence is simply zero
/// or more [`PartialObject`](Self::PartialObject) events followed by exactly
/// one [`End`](Self::End).