@avvyr/storefront-sdk - v0.19.0
    Preparing search index...

    Type Alias AssistantStreamEvent

    AssistantStreamEvent:
        | { content: string; type: "delta" }
        | { kind: AssistantActivityKind; type: "activity" }
        | { card: AssistantCard; type: "card" }
        | { cartAccessToken?: string; cartId: string; type: "cart" }
        | { proposal: AssistantProposal; type: "proposal" }
        | { replies: string[]; type: "replies" }
        | { mode: string; type: "handover" }
        | { status: AssistantConversationStatus; type: "queued" }
        | { status: AssistantConversationStatus; type: "done" }
        | { errorCode: string; message: string; type: "error" }

    Events streamed while the assistant answers a message.

    Type Declaration

    • { content: string; type: "delta" }

      A piece of the answer's text. Append in order.

    • { kind: AssistantActivityKind; type: "activity" }

      A tool started. A new block of text may follow it.

    • { card: AssistantCard; type: "card" }

      Something to show with the answer being streamed (products, an order, tracking).

    • { cartAccessToken?: string; cartId: string; type: "cart" }

      The assistant changed the shopper's cart: reload it. cartAccessToken is set only when the assistant had to create the cart; store it with cartId exactly as after cart.create().

    • { proposal: AssistantProposal; type: "proposal" }

      A card for the shopper to confirm or decline.

    • { replies: string[]; type: "replies" }

      Suggested replies for the answer just streamed (2–4 short texts). Sent at most once per turn, before done; replaces any shown earlier. Also on the message in conversation.messages.

    • { mode: string; type: "handover" }

      The conversation was handed over to a person (status is now waiting).

    • { status: AssistantConversationStatus; type: "queued" }

      A person answers this conversation: the message was saved, no assistant reply follows.

    • { status: AssistantConversationStatus; type: "done" }

      The turn is over.

    • { errorCode: string; message: string; type: "error" }

      The turn failed. The stream ends after this.