Questions tagged [openai-api]

OpenAI makes several AI products, including ChatGPT, Dall-E, Whisper. Use for questions about the OpenAI API, and not for general support.

Use for questions about using the OpenAI API. All question should be according to the scope of Stack Overflow and following the How to ask a good question and Expected Behavior guidelines.

Before asking a question, read the documentation.

If you will include non-original code, be sure to provide proper attribution.

Don't use for questions about using ChatGPT as an end-user. Don't use for questions about responses given by ChatGPT that aren't directly related to a programming issue using the OpenAI API.

Related tags:


OpenAI Community

https://community.openai.com/

1620 questions
4
votes
1 answer

whisper api from a recorded audio blob

I am creating a transcriber using openAI whisper API in nodejs and react. I want the user to be able to record an audio file in the browser and transcribe their recording. i am doing this by saving the buffer data of the audio blob they have…
4
votes
1 answer

LlamaIndex with ChatGPT taking too long to retrieve answers

I am currently working on a chatbot for our website that provides domain knowledge using LlamaIndex and chatGPT. Our chatbot uses around 50 documents, each around 1-2 pages long, containing tutorials and other information from our site. While the…
Aggamarcel
  • 41
  • 4
4
votes
5 answers

Langchain's AzureOpenAI error: Resource not found

I’m trying to use LangChain’s AzureOpenAI as below but getting this error. Do you know how can I fix this? openai.error.InvalidRequestError: Resource not found # Import Azure OpenAI from langchain.llms import AzureOpenAI import openai import…
user2467491
  • 73
  • 1
  • 7
4
votes
1 answer

OpenAI Embeddings API: How embeddings work?

There are quite a few tutorials on embeddings in OpenAI. I can't understand how they work. Referring to https://platform.openai.com/docs/guides/embeddings/what-are-embeddings , an embedding is a vector or list. A string is passed to an embedding…
Manu Chadha
  • 15,555
  • 19
  • 91
  • 184
4
votes
1 answer

tRPC stream API response from OpenAI to React client

I am currently working on a way to implement the openai-node package into my Next.js application. Because of the long generation times of OpenAI completions, I want to make use of streaming (which is normally not supported inside the package, see…
thim24
  • 624
  • 1
  • 5
  • 14
4
votes
0 answers

Getting error while generating image variations using openAI using NodeJS

I am working on a whatsapp bot with chatgpt like features like image generation, variation. For now when someone sends an image in the test group chat, the image is saved in the local folder. const saveToDir = async (bufferString) => { const…
SAK
  • 41
  • 1
4
votes
2 answers

OpenAI GPT-3 API error: "Invalid URL (POST /v1/chat/completions)"

Here is my code snippet: const { Configuration, OpenAI, OpenAIApi } = require ("openai"); const configuration = new Configuration({ apiKey: 'MY KEY' }) const openai = new OpenAIApi(configuration) async function start() { const response =…
Das CO
  • 53
  • 1
  • 4
4
votes
3 answers

Use of UnstructuredPDFLoader unstructured package not found, please install it with `pip install unstructured

I just have a newly created Environment in Anaconda (conda 22.9.0 and Python 3.10.10). Then I proceed to install langchain (pip install langchain if I try conda install langchain it does not work). According to the quickstart guide I have to install…
Edu
  • 159
  • 1
  • 14
4
votes
2 answers

Getting RateLimitError while implementing openai GPT with Python

I have started to implement openai gpt model in python. I have to send a single request in which I am getting RateLimitError. My code looks like this import openai key = '' openai.api_key = key model_engine = 'text-ada-001' prompt =…
Shubham Srivastava
  • 1,190
  • 14
  • 28
4
votes
1 answer

Why am I getting a 401 error even though I am getting a response when linking my Next.js site with ChatGPT?

I am trying to incorporate ChatGPT into my practice e-commerce site to use it as a chatbot. I have imported openAI and added a function which sends a message to ChatGPT and then console logs the response. Upon running the site using npm run dev I…
4
votes
0 answers

Can i train chatgpt with custom data from a database?

Let's say I'm a law firm and I have this tables(basic structure) users: name, email, telephone etc.. employees: kind, name, email, telephone etc.. cases: case name, casenumber, parties names, attorney assigned, entries, last update, status,…
John Balvin Arias
  • 2,632
  • 3
  • 26
  • 41
4
votes
3 answers

OpenAI ChatGPT (GPT-3.5) API error 400: "Bad Request" (migrating from GPT-3 API to GPT-3.5 API)

Trying to call the got-3.5-turbo API that was just released for ChatGPT, but I'm getting a bad request error? var body = new { model = "gpt-3.5-turbo", messages = data …
Robert Benedetto
  • 1,590
  • 2
  • 29
  • 52
4
votes
2 answers

OpenAI GPT-3 API: Why do I get only partial completion? Why is the completion cut off?

I tried the following code but got only partial results like [{"light_id": 0, "color I was expecting the full JSON as suggested on this page: https://medium.com/@richardhayes777/using-chatgpt-to-control-hue-lights-37729959d94f import json import…
shantanuo
  • 31,689
  • 78
  • 245
  • 403
4
votes
1 answer

OpenAI Unity - POST Request not working properly (400 status)

I'm connecting GPT3 OpenAI but I just cant manage to make a proper POST request to it (I'm following some guides but for them it works...). private IEnumerator Upload ( ) { WWWForm form = new WWWForm(); form.AddField ( "prompt", prompt ); …
Dolev Mitz
  • 103
  • 14
4
votes
1 answer

How to use an API from my mobile app without someone stealing the token

I'm building an app that makes use of the OpenAI API They provide me with an API token which I use to make the API calls from my android mobile app (react native) I know it is a bad practice to store this API token on the mobile client because…
YardenST
  • 5,119
  • 2
  • 33
  • 54