openai / openai-node

The official Node.js / Typescript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.7k stars 825 forks source link

trascriptions.create return incomplete Interface Transcription #1099

Closed leorr closed 3 days ago

leorr commented 4 days ago

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

Describe the bug

Type of return from openai.audio.transcriptions.create does not seems to have any segments property.

const openai = new OpenAI({
    apiKey: ...
});

const transcription = await openai.audio.transcriptions.create({
      file: file,
      model: 'whisper-1',
      response_format: "verbose_json",
      timestamp_granularities: ["word"]
    });

    logger.info(transcription.segments)

To Reproduce

  1. Might be needed to use typescript, might be related to typescript type checking
  2. Create a new OpeanAI()
  3. Use openai.chat.transcriptions.create()
  4. Try to use the segments property from the previous step

Code snippets

No response

OS

Linux

Node version

Node v20.17.0

Library version

openai v4.63

RobertCraigie commented 3 days ago

Thanks for the report, this is a duplicate of #702. We're hoping to ship a fix tomorrow.