openai / openai-node

Official JavaScript / TypeScript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
8k stars 872 forks source link

500 Error on completions call using gpt-4o-audio-preview-* model #1158

Open Tsun4mii opened 3 weeks ago

Tsun4mii commented 3 weeks ago

Confirm this is a Node library issue and not an underlying OpenAI API issue

Describe the bug

When creating response in chat completions using gpt-4o-audio-preview-2024-10-01 with funtion getting 500 error

To Reproduce

  1. Install openai package in version 4.69.0
  2. Use openai functions

Code snippets

const payloadMessages: ChatCompletionMessageParam[] = [{ role: 'system', content: prompt.toString() }, ...messages];

    const result = await this.client.chat.completions.create({
      model: 'gpt-4o-audio-preview-2024-10-01',
      modalities: ['text', 'audio'],
      audio: { voice: 'alloy', format: 'wav' },
      tools: [
        {
          type: 'function',
          function: {
            name: 'redirect_to_operator',
            description: 'testing',
          },
        },
      ],
      messages: payloadMessages,
    });

OS

Ubuntu 22.04.5 LTS

Node version

Node v22.0.0

Library version

4.69.0