Skip to main content

REFERENCE

SDK Demos

How to use @asgard-js/core and @asgard-js/react, with demos you can try on the page.

Thinking Block

When the model emits extended thinking (reasoning), the SDK automatically renders it as its own collapsible block, separate from the final answer. While streaming it shows an expanded "Thinking…"; once complete it auto-collapses. No setup is required.

  1. Message Shape​

    Thinking maps to ConversationThinkingMessage in the ConversationMessage union:

    type ConversationThinkingMessage = {
    type: "thinking";
    messageId: string;
    text: string;
    isThinking: boolean; // true = streaming (expanded); false = completed (collapsed)
    time: Date;
    traceId?: string;
    };

    In real usage these are assembled and written into the Conversation automatically from the backend asgard.message.thinking.start / .delta / .complete events — you never handle them by hand.

  2. See Also​

    • Tool Call — grouped tool calls before the answer
    • Headless — walk conversation.messages yourself to render thinking

Ready to get started?

Want to see how Asgard fits your team? Talk to us.

Contact us