@airbolt/sdk
    Preparing search index...

    Function chatSync

    • Send a chat message to Airbolt and receive a complete response (non-streaming)

      Note: For the default streaming behavior, use chat() instead.

      Parameters

      • messages: Message[]

        Array of messages in the conversation

      • Optionaloptions: ChatOptions

        Optional configuration

      Returns Promise<ChatResponse>

      The complete response including content and usage information

      const response = await chatSync([
      { role: 'user', content: 'Hello, how are you?' }
      ]);
      console.log(response.content); // "I'm doing well, thank you!"
      console.log(response.usage?.total_tokens); // 42
      // With options
      const response = await chatSync(
      [{ role: 'user', content: 'Tell me a joke' }],
      {
      baseURL: 'https://api.airbolt.dev',
      system: 'You are a helpful assistant who tells funny jokes'
      }
      );