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
3
votes
0 answers

Azure OpenAI latency spikes (3-20 minutes!)

We're prototyping a chatbot application using Azure OpenAI gpt-3.5-turbo model using the standard tier. We're facing random latency bursts, which sometimes go between 3-20 minutes. Below I have screenshots with the metrics provided by the portal. As…
3
votes
2 answers

Deploying (and hosting) a LangChain code on StreamLit throws PydanticUserError

I built a pdf document question-answering using LangChain, OpenAI (embeddings and LLM) and Chroma (for storing the vector embeddings) and UI with StreamLit. I am trying to deploy and host the webapp using StreamLit cloud services. And on installing…
3
votes
3 answers

Langchain pandas agent - Azure OpenAI account

I am trying to use Langchain for structured data using these steps from the official document. I changed it a bit as I am using Azure OpenAI account referring this. Below is the snippet of my code - from langchain.agents import…
Archit
  • 33
  • 6
3
votes
1 answer

Inserting data as vectors from SQL Database to Pinecone

I have a profiles table in SQL with around 50 columns, and only 244 rows. I have created a view with only 2 columns, ID and content and in content I concatenated all data from other columns in a format like this: FirstName: John. LastName: Smith.…
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
3
votes
0 answers

OpenAI check billing separated by Api-key

I deployed some simple chatbot apps using OpenAi gpt turbo api. For each app I'm using a different OpenAI api-key, (each api-key is created using the same OpenAI user). Is it possible to see historical usage by api-key? It would be useful to…
user17788510
  • 158
  • 1
  • 8
3
votes
1 answer

Langchain pyPDFLoader

I am currently trying to get started working with Langchain. I am working in Anaconda/Spyder IDE: # Imports import os from langchain.llms import OpenAI from langchain.document_loaders import TextLoader from langchain.document_loaders import…
NeilS
  • 65
  • 1
  • 7
3
votes
1 answer

Using GPT 4 or GPT 3.5 with SQL Database Agent throws OutputParserException: Could not parse LLM output:

I am using the SQL Database Agent to query a postgres database. I want to use gpt 4 or gpt 3.5 models in the OpenAI llm passed to the agent, but it says I must use ChatOpenAI. Using ChatOpenAI throws parsing errors. The reason for wanting to switch…
RamlahAziz
  • 47
  • 10
3
votes
1 answer

Unable to send OpenAI stream response via Flask API

For streaming OpenAI response in langchain I use this https://python.langchain.com/en/latest/modules/models/chat/examples/streaming.html It streams the response in my terminal. I want to send stream response back to the user using Flask API Anyone,…
3
votes
2 answers

How can I troubleshoot an empty AuthenticationError when using the OpenAI API in Python?

I am having a problem with this code import openai openai.api_key = "api_key" completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Give me 3 ideas for apps I could build with openai apis…
ShadowDevi
  • 31
  • 1
  • 2
3
votes
1 answer

How to upload files with the OpenAI API

In order to make a fine-tuned ChatGPT model, we need to upload a JSON file of training data. The OpenAI doc for file upload is here: https://platform.openai.com/docs/api-reference/files/upload But... I don't see how to append the actual file…
Brian Risk
  • 1,244
  • 13
  • 23
3
votes
2 answers

How to send OpenAI stream response from Nextjs API to client

I tried openai-streams + nextjs-openai, they only works for Node 18+, however, they failed on Node 17 and lower. I'm restricted to Node 17 and lower as Digital Oceans App Platform currently not supporting Node 18. I also tried this method which…
samchuang
  • 411
  • 5
  • 15
3
votes
2 answers

RateLimit error llama_index code with openai api key

My code is import os import sys import transformers from transformers import AutoModelForSequenceClassification, AutoTokenizer from llama_index import Document, GPTVectorStoreIndex os.environ['OPENAI_API_KEY'] = 'my-openapi-key' # Load the…
Ankit Bansal
  • 2,162
  • 8
  • 42
  • 79
3
votes
0 answers

Is there a way to stream OpenAI (chatGPT) responsse when using firebase cloud functions as a backend?

I'm currently building a chatbot using OpenAI's ChatGPT and Firebase Cloud Functions as the backend. I want to create a real-time chat experience where the responses from ChatGPT are streamed back to the client as they are generated. However, I'm…
3
votes
1 answer

Different answers from chatgpt-api and web interface

I'm trying to integrate openai (==0.27.6) into my system, and it works kinda fine, however, the replies I'm getting through the API are totally worse than the answers from the web interface (https://chat.openai.com/chat) . The way I'm using it with…
user2194805
  • 1,201
  • 1
  • 17
  • 35
3
votes
1 answer

Chrome Extension with Chat GPT-3.5 - "you must provide a model parameter"

I am making a chrome extension that uses Chat GPT 3.5 and have coded a simple prompt to send to the API using openai api and returns a value in the console. I have my code below and keep getting this error... error: code: null message: "you…