@airbolt/sdk
    Preparing search index...

    Function chat

    • Stream a chat response from Airbolt (default behavior)

      This is the default chat() function - streaming provides better UX with real-time responses. For non-streaming behavior, use chatSync().

      Parameters

      • messages: Message[]

        Array of messages in the conversation

      • Optionaloptions: ChatOptions

        Optional configuration

      Returns AsyncGenerator<
          { content: string; type: "chunk"
          | "done"
          | "error"; usage?: UsageInfo },
      >

      Async generator yielding content chunks

      for await (const chunk of chat([
      { role: 'user', content: 'Tell me a story' }
      ])) {
      process.stdout.write(chunk.content);
      }