ailoy-node
    Preparing search index...

    Type Alias Part

    Part:
        | { text: string; type: "text" }
        | { function: PartFunction; id?: string; type: "function" }
        | { type: "value"; value: any }
        | { image: PartImage; type: "image" }

    Represents a semantically meaningful content unit exchanged between the model and the user.

    Conceptually, each Part encapsulates a piece of data that contributes to a chat message — such as text, a function invocation, or an image.

    For example, a single message consisting of a sequence like (text..., image, text...) is represented as a Message containing an array of three Part elements.

    Note that a Part does not carry "intent", such as "reasoning" or "tool call". These higher-level semantics are determined by the context of a [Message].

    Example

    let part = Part::text("Hello, world!");
    assert!(part.is_text());