openai-node
openai-node copied to clipboard
Official JavaScript / TypeScript library for the OpenAI API
### Describe the bug I'm using node.js with the official opean ai lib and when I tried to send a request, I got nothing, the choices array is empty. It's...
### Describe the bug I've been using openai-node **v3.1.0** and openai.**createImageEdit**() worked well. I updated to the **v3.2.1** to support the createChatCompletion() method, however my createImageEdit() is not working anymore....
### Describe the bug Cannot call `createTranscription` function like below: ``` ... const audio = await fs.readFile('path/to/audio.mp4'); // Compile Error at the first argument const response = await openai.createTranscription(audio, 'whisper-1');...
- Closes #77 Add `ReadStream` type from `fs` to every `file` argument. Since the `file` is just passed to `FormData.append()`, it can also be specified in the form of a...
### Describe the bug Streamed data still uses `CreateChatCompletionResponseChoicesInner` type which still contains `message` instead of `delta`. ### To Reproduce Reference the `CreateChatCompletionResponseChoicesInner` TS type ### Code snippets _No response_...
### Describe the bug The typing for `finish_reason` sets its type to `string | undefined` but its actual type used is `string | null`. ### To Reproduce Reference a `CreateChatCompletionResponse`...
The **conversation_id** and **parent_id** parameters can be used to keep track of the context of a conversation between a user and an AI. The **conversation_id** parameter is a unique identifier...
Not to detract from #45 but it is a little crowded with changes and it might be easier to review this way. This PR adds ESM interop for modules while...
- chore(upgrade): upgrade to TypeScript 4.9 - chore(upgrade): enable ESM support - chore(upgrade): add streamCompletion helper function (credits to @schnerd & @rauschma) - chore(upgrade): update README for fetch support
I'm a bit lost as to how to actually use `stream: true` in this library. Example incorrect syntax: ```javascript const res = await openai.createCompletion({ model: "text-davinci-002", prompt: "Say this is...