ailoy-node
    Preparing search index...

    Type Alias PartDelta

    PartDelta:
        | { text: string; type: "text" }
        | { function: PartDeltaFunction; id?: string; type: "function" }
        | { type: "value"; value: any }
        | { type: "null" }

    Represents a partial or incremental update (delta) of a [Part].

    This type enables composable, streaming updates to message parts. For example, text may be produced token-by-token, or a function call may be emitted gradually as its arguments stream in.

    Example

    let d1 = PartDelta::Text { text: "Hel".into() };
    let d2 = PartDelta::Text { text: "lo".into() };
    let merged = d1.accumulate(d2).unwrap();
    assert_eq!(merged.to_text().unwrap(), "Hello");

    Error Handling

    Accumulation or finalization may return an error if incompatible deltas (e.g. mismatched function IDs) are combined or invalid JSON arguments are given.