Skip to main content

rskit_llm_common/
types.rs

1#[derive(Debug, Clone, Default, PartialEq, Eq)]
2/// Incremental tool-call state extracted from a provider stream event.
3pub struct StreamToolCall {
4    /// Tool-call position in the provider response.
5    pub index: usize,
6    /// Provider-supplied tool-call identifier.
7    pub id: String,
8    /// Tool/function name.
9    pub name: String,
10    /// Incremental JSON arguments payload.
11    pub input_delta: String,
12}
13
14#[derive(Debug, Clone, Default, PartialEq, Eq)]
15/// Normalized content/tool delta extracted from a provider stream event.
16pub struct StreamChunk {
17    /// Text content emitted by the event.
18    pub content: String,
19    /// Tool-call deltas emitted by the event.
20    pub tool_calls: Vec<StreamToolCall>,
21    /// Whether the provider indicates the stream is finished.
22    pub done: bool,
23}