id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_75733749 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Embeddings API: How to change the embedding output dimension? | OpenAI Embeddings API: How to change the embedding output dimension?
In the official OpenAI node library Create embeddings if for example using the model text-embedding-ada-002 the embeddings returned is an array of around 1536.
import {Configuration, OpenAIApi} from 'openai'
openai = new OpenAIApi(this.configuration... | https://stackoverflow.com/questions/75733749/openai-embeddings-api-how-to-change-the-embedding-output-dimension | node.js, openai-api, azure-openai, text-embedding-ada-002 | 1,678,800,338 |
se_76546004 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Fine-tuning API: Why would I use LlamaIndex or LangChain instead of fine-tuning a model? | OpenAI Fine-tuning API: Why would I use LlamaIndex or LangChain instead of fine-tuning a model?
I'm just getting started with working with LLMs, particularly OpenAIs and other OSS models. There are a lot of guides on using LlamaIndex to create a store of all your documents and then query on them. I trie... | https://stackoverflow.com/questions/76546004/openai-fine-tuning-api-why-would-i-use-llamaindex-or-langchain-instead-of-fine | openai-api, langchain, chatgpt-api, language-model, llama-index | 1,687,608,752 |
se_78595968 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Assistants API: How do I use it instead of the Completions or Chat Completions API? | OpenAI Assistants API: How do I use it instead of the Completions or Chat Completions API?
I have an assistant with an ID created at https://platform.openai.com/.
I want to use it instead of the Completions API or Chat Completions API. How do I do that?
import { config } from "dotenv";
config();
import { OpenAI } from... | https://stackoverflow.com/questions/78595968/openai-assistants-api-how-do-i-use-it-instead-of-the-completions-or-chat-comple | openai-api, openai-assistants-api | 1,717,857,215 |
se_78227301 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "TypeError: Cannot read properties of undefined (reading 'create')" | OpenAI API error: "TypeError: Cannot read properties of undefined (reading 'create')"
I am creating a chat summarizer app where the input is an Excel file with chat transcripts. Each row of the Excel sheet corresponds to a new chat. The app summarizes the chat in the adjacent column.
The problem is t... | https://stackoverflow.com/questions/78227301/openai-api-error-typeerror-cannot-read-properties-of-undefined-reading-crea | nlp, openai-api, chatgpt-api, chatgpt-function-call | 1,711,475,519 |
se_78285635 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: How do I fix error 400 when using the Chat Completions API? | OpenAI API error: How do I fix error 400 when using the Chat Completions API?
I am trying to make a small webpage where a button click would allow me to fetch the latest news in German from the OpenAI API.
Unfortunately, there's something wrong with my API calls which I want further help with. I am getting the followi... | https://stackoverflow.com/questions/78285635/openai-api-error-how-do-i-fix-error-400-when-using-the-chat-completions-api | javascript, openai-api, api-key, chatgpt-api | 1,712,431,286 |
se_78504532 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: How do I fix error 404 when I connect WhatsApp chatbot to OpenAI API? | OpenAI API error: How do I fix error 404 when I connect WhatsApp chatbot to OpenAI API?
How to fix the error in this code
const axios = require('axios');
const { API_KEY_OPEN_AI } = require('../config');
const ChatAIHandler = async (text, msg) => {
const cmd = text.split('/');
if (cmd.length < 2) {
... | https://stackoverflow.com/questions/78504532/openai-api-error-how-do-i-fix-error-404-when-i-connect-whatsapp-chatbot-to-open | http-status-code-404, whatsapp, openai-api, gpt-3 | 1,716,175,293 |
se_78565484 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API: Is the /v1/chat/completions endpoint a legacy endpoint? | OpenAI API: Is the /v1/chat/completions endpoint a legacy endpoint?
Goal
I am currently working on a project where I am integrating GPT-3.5 models into my application.
Problem
However, I have encountered an issue where only gpt-3.5-turbo-instruct seems to be working with the /v1/chat/completions endpoint. When I try t... | https://stackoverflow.com/questions/78565484/openai-api-is-the-v1-chat-completions-endpoint-a-legacy-endpoint | python, discord, openai-api, chatgpt-api, gpt-4 | 1,717,303,458 |
se_78261613 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Fine-tuning API error: "ImportError: cannot import name 'FineTune'" | OpenAI Fine-tuning API error: "ImportError: cannot import name 'FineTune'"
I'm having an issue with the OpenAI Fine-tuning API, getting the same error message after having tried several versions:
ImportError: cannot import name 'FineTune' from 'openai.cli'
Which is related to the following imports:
f... | https://stackoverflow.com/questions/78261613/openai-fine-tuning-api-error-importerror-cannot-import-name-finetune | python, openai-api, fine-tuning | 1,712,064,081 |
se_78502965 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Assistants API: Is there a better way to wait for the assistant's response, and how do I display the assistant's answer incrementally? | OpenAI Assistants API: Is there a better way to wait for the assistant's response, and how do I display the assistant's answer incrementally?
Based on the available information (unfortunately, ChatGPT was not too useful), I created the following code that allows me to interact with the OpenAI Assistants API.
H... | https://stackoverflow.com/questions/78502965/openai-assistants-api-is-there-a-better-way-to-wait-for-the-assistants-respons | python, python-3.x, openai-api, openai-assistants-api | 1,716,130,380 |
se_78521707 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Chat Completions API: How do I solve the APIRemovedInV1 error when using the OpenAI Python library for GPT-4? | OpenAI Chat Completions API: How do I solve the APIRemovedInV1 error when using the OpenAI Python library for GPT-4?
This is a snippet where I have been encountering the problem:
def generate_response(prompt):
response = openai.chatcompletion.create(
model="gpt-4", # Use "gpt-4" as the model identifier if... | https://stackoverflow.com/questions/78521707/openai-chat-completions-api-how-do-i-solve-the-apiremovedinv1-error-when-using | python, openai-api, gpt-4 | 1,716,451,472 |
se_78513041 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Completions API: How do I extract the text from the response? | OpenAI Completions API: How do I extract the text from the response?
I am attempting to extract text from OpenAI, but I need some help with the correct syntax.
My code:
_model = "gpt-3.5-turbo-instruct"
# Summarize the text using an AI model (e.g., OpenAI's GPT)
try:
summary = openai.completions.create(
mo... | https://stackoverflow.com/questions/78513041/openai-completions-api-how-do-i-extract-the-text-from-the-response | python, openai-api, gpt-3 | 1,716,306,971 |
se_78596555 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Assistants API v2: Should I attach files to the thread or to the assistant? | OpenAI Assistants API v2: Should I attach files to the thread or to the assistant?
I am using the OpenAI Assistants API, and I have the option to add my PDF files as a knowledge base.
Should I attach files to the thread or to the assistant?
I am super confused here.
Or should I add them both times?
What would work bes... | https://stackoverflow.com/questions/78596555/openai-assistants-api-v2-should-i-attach-files-to-the-thread-or-to-the-assistan | openai-api, gpt-4, openai-assistants-api | 1,717,870,288 |
se_77816816 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Assistants API: How to get response from the /v1/assistants API endpoint in Postman? | OpenAI Assistants API: How to get response from the /v1/assistants API endpoint in Postman?
I created an assistant using platform.openai.com and am trying to access it from Postman.
POST: https://api.openai.com/v1/assistants/{assistant-id}/completions
Body:
{
"prompt": "Tell me a funny daddy joke about computers.",
... | https://stackoverflow.com/questions/77816816/openai-assistants-api-how-to-get-response-from-the-v1-assistants-api-endpoint | postman, http-post, openai-api, openai-assistants-api | 1,705,268,901 |
se_78216840 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is this error - > APIConnectionError: Connection error | What is this error - > APIConnectionError: Connection error
I am trying to use Streamlit in Snowflake to connect to OpenAI.
import openai
client = openai.OpenAI(api_key='SECRETKEY')
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{
"role": "user",
"content": "hello ... | https://stackoverflow.com/questions/78216840/what-is-this-error-apiconnectionerror-connection-error | snowflake-cloud-data-platform, openai-api, streamlit | 1,711,334,316 |
se_78595918 | stackoverflow | ARTIFICIAL_INTELLIGENCE | "resource not found" error when trying to use Azure OpenAI Assistant API | "resource not found" error when trying to use Azure OpenAI Assistant API
In the example below, the first part, which uses the completion API succeeds. The second part, which attempts to use the assistant API, with the same endpoint, API key and deployment name, throws a "resource not found" exception. What a... | https://stackoverflow.com/questions/78595918/resource-not-found-error-when-trying-to-use-azure-openai-assistant-api | azure, openai-api, azure-openai | 1,717,855,953 |
se_75256485 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Training / using OpenAI GPT-3 for translations | Training / using OpenAI GPT-3 for translations
I'm trying to use OpenAI for translation of my products descriptions from one language to some other languages (EN, DE, CZ, SK, HU, PL, SI...). The translations, especially to SK/CZ/HU/PL languages are (mainly gramatically) quite bad (using text-davinci-003 model). I've g... | https://stackoverflow.com/questions/75256485/training-using-openai-gpt-3-for-translations | nlp, translate, openai-api, machine-translation, gpt-3 | 1,674,813,371 |
se_78366363 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to implement openAI API? | How to implement openAI API?
When I run this :
import os
import openai
openai.api_key = "my_api_key"
messages = [
{"role": "system", "content": "You're a recruiter who asks tough interview questions"}
]
while True:
content = input("User: ")
messages.append({"role": "user", "content": content})
compl... | https://stackoverflow.com/questions/78366363/how-to-implement-openai-api | python, version, openai-api, chatgpt-api | 1,713,790,137 |
se_78606418 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Issue with load_summarize_chain in LangChain Summarizing Incorrect Document Content | Issue with load_summarize_chain in LangChain Summarizing Incorrect Document Content
I'm using LangChain's load_summarize_chain function combined with map_reduce and gpt-3.5-turbo-instruct to summarize multiple documents within a specific folder. Each folder has a unique ID and contains documents related to a single to... | https://stackoverflow.com/questions/78606418/issue-with-load-summarize-chain-in-langchain-summarizing-incorrect-document-cont | python, openai-api, langchain | 1,718,096,457 |
se_78603640 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Detect hand-checked boxes in a pdf document with GPT-4o | Detect hand-checked boxes in a pdf document with GPT-4o
i am working on a open ai assistant which function is to validate a series of contracts based on how many checkboxes are checked.
However, it seems difficult to the assistant to do this task.
I have been trying two options:
Uploading it as a scanned pdf (unselec... | https://stackoverflow.com/questions/78603640/detect-hand-checked-boxes-in-a-pdf-document-with-gpt-4o | ocr, openai-api, gpt-4 | 1,718,038,922 |
se_75373129 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI GPT-3 API error: "This model's maximum context length is 2049 tokens" | OpenAI GPT-3 API error: "This model's maximum context length is 2049 tokens"
I have two issues relating to the response result from OpenAI completion.
The following result doesn't return back the full text when I give a content of 500 words and prompt with "Fix grammar mistakes" (Is tokens issue?)
The s... | https://stackoverflow.com/questions/75373129/openai-gpt-3-api-error-this-models-maximum-context-length-is-2049-tokens | javascript, php, json, openai-api, gpt-3 | 1,675,771,678 |
se_78600925 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to detect multiple tasks in a single command using LLM or any NLP model? | How to detect multiple tasks in a single command using LLM or any NLP model?
I am building a bot that takes inputs from users and performs action. Now I want it to differentiate between commands that contain single task and multiple tasks.
How can I make this a reality? Should I utilize prompting but there are infinit... | https://stackoverflow.com/questions/78600925/how-to-detect-multiple-tasks-in-a-single-command-using-llm-or-any-nlp-model | artificial-intelligence, openai-api, prompt, large-language-model | 1,718,003,488 |
se_78598645 | stackoverflow | ARTIFICIAL_INTELLIGENCE | The [dense_vector] field [vector] in doc [document with id '] has a different number of dimensions [384] than defined in the mapping [1000] | The [dense_vector] field [vector] in doc [document with id '] has a different number of dimensions [384] than defined in the mapping [1000]
I am getting this error while trying to persist embeddings into elastic search. I am taking a file using post call in spring boot app and then using langchain4j elasticsearch ... | https://stackoverflow.com/questions/78598645/the-dense-vector-field-vector-in-doc-document-with-id-has-a-different-nu | spring-boot, elasticsearch, openai-api, langchain4j | 1,717,937,685 |
se_75774873 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "This is a chat model and not supported in the v1/completions endpoint" | OpenAI API error: "This is a chat model and not supported in the v1/completions endpoint"
import discord
import openai
import os
openai.api_key = os.environ.get("OPENAI_API_KEY")
#Specify the intent
intents = discord.Intents.default()
intents.members = True
#Create Client
client = discord.Client(intents=... | https://stackoverflow.com/questions/75774873/openai-api-error-this-is-a-chat-model-and-not-supported-in-the-v1-completions | python, discord, openai-api, chatgpt-api | 1,679,130,687 |
se_78596140 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Create Vector Store on OpenAI with curl, and Upload 2 PDfs to it with curl | Create Vector Store on OpenAI with curl, and Upload 2 PDfs to it with curl
I learned that OpenAI has integrated vector store now so I do not need an external vector database. So my question is if it is all possible with just API requests using curl
Can I create a vector store with curl .
and then upload 2 PDFs to vect... | https://stackoverflow.com/questions/78596140/create-vector-store-on-openai-with-curl-and-upload-2-pdfs-to-it-with-curl | openai-api, gpt-4 | 1,717,860,471 |
se_78546836 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure AI search fields mapping JSON and retrievable fields | Azure AI search fields mapping JSON and retrievable fields
I'm currently implementing RAG on Azure using OpenAI and Azure AI Search, formerly known as Cognitive Services. I have around 50-65 JSON files that I need to search on my enterprise data. It turns out that in the referencing of the chatbot, I'm only getting th... | https://stackoverflow.com/questions/78546836/azure-ai-search-fields-mapping-json-and-retrievable-fields | azure, openai-api, langchain, azure-ai-search | 1,716,940,626 |
se_78556659 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Twilio play sound after digits input | Twilio play sound after digits input
I'd like to play an mp3 immediately after the user inputs their digits and #. But in my experience, the user has to wait for several seconds before the next sound plays. Is there a way to play a sound immediately after the user inputs digits and # (the sound will be something like ... | https://stackoverflow.com/questions/78556659/twilio-play-sound-after-digits-input | javascript, twilio, openai-api | 1,717,092,840 |
se_78578319 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SSL: CERTIFICATE_VERIFY_FAILED error when accessing openai api | SSL: CERTIFICATE_VERIFY_FAILED error when accessing openai api
I recently came across this error when trying to use openai api.
ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1006)
I do not understand, I never had this problem before and w... | https://stackoverflow.com/questions/78578319/ssl-certificate-verify-failed-error-when-accessing-openai-api | python-3.x, ssl-certificate, openai-api | 1,717,548,527 |
se_77830060 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to handle the response OpenAI Text-To-Speech API in Node.js? | How to handle the response OpenAI Text-To-Speech API in Node.js?
Here's my code:
const speechUrl = 'https://api.openai.com/v1/audio/speech';
const headers = {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`
};
async function voiceGenerator(text) {
console.l... | https://stackoverflow.com/questions/77830060/how-to-handle-the-response-openai-text-to-speech-api-in-node-js | node.js, response, openai-api | 1,705,467,669 |
se_77210263 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to send data in batches to a LLM | How to send data in batches to a LLM
I have a question on batch processing with LLMs and wanted to see if anyone can help with this.
Is there a way to send data in batches to a LLM to be processed by a GPU? Say for eg. if I wanted to get daily sentiment ratings, rather than sending daily posts to a LLM, is there a way... | https://stackoverflow.com/questions/77210263/how-to-send-data-in-batches-to-a-llm | batch-processing, openai-api, large-language-model, llama, gpt-4 | 1,696,159,350 |
se_78574662 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting token exceed error while using OpenAI API | Getting token exceed error while using OpenAI API
I am trying to fetch data from the CSV file via OpenAI API but I am getting an error as token exceed. I have used both GPT-3.5 turbo and all the version of GPT-4 model to check on that.
Is there any changes what I need to do in the prompt or should I use some other met... | https://stackoverflow.com/questions/78574662/getting-token-exceed-error-while-using-openai-api | c#, openai-api, gpt-3, gpt-4 | 1,717,495,271 |
se_77066847 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create a Model in Minds DB, search with OPEN API | How to create a Model in Minds DB, search with OPEN API
I am having a table with Questions and Answers. And I need to create a Model in Minds DB with this table but unable to create. What is my need is open AI should answer my Question form my table, How can we achieve this with help of MindsDB, I am using PHP as as s... | https://stackoverflow.com/questions/77066847/how-to-create-a-model-in-minds-db-search-with-open-api | php, chat, openai-api, chatgpt-api, mindsdb | 1,694,175,728 |
se_78569010 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why isn't OpenAI API Assistant aware of my vector store | Why isn't OpenAI API Assistant aware of my vector store
I have an assistant configured with openai api v2 using gpt-4o. The assistant is linked to a vector store containing pdf documents. When testing the assistant in the openai playground it replies based on the content in the pdf documents. However, when setting... | https://stackoverflow.com/questions/78569010/why-isnt-openai-api-assistant-aware-of-my-vector-store | php, openai-api, openai-assistants-api | 1,717,400,784 |
se_78555052 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Does the Code interpreter in Azure open AI support Arabic language from the files | Does the Code interpreter in Azure open AI support Arabic language from the files
I'm trying to use the Azure OpenAI and the code interpreter to perform some data analysis on some CSV files but it doesn't return the Arabic values from the files.
Instead, it shows it as question marks (????).
If there some docs about i... | https://stackoverflow.com/questions/78555052/does-the-code-interpreter-in-azure-open-ai-support-arabic-language-from-the-file | python, azure, openai-api, azure-openai | 1,717,073,089 |
se_76025799 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Create multi-message conversations with the GPT API | Create multi-message conversations with the GPT API
I am experimenting with the GPT API by OpenAI and am learning how to use the GPT-3.5-Turbo model. I found a quickstart example on the web:
def generate_chat_completion(messages, model="gpt-3.5-turbo", temperature=1, max_tokens=None):
headers = {
"Content-... | https://stackoverflow.com/questions/76025799/create-multi-message-conversations-with-the-gpt-api | python, python-requests, openai-api, gpt-3, chatgpt-api | 1,681,616,563 |
se_78574282 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API key gives ratelimit error even though api key not used | OpenAI API key gives ratelimit error even though api key not used
I am trying to make a chatbot using the Langchain-Openai.I have never done this before. I created a brand new api key, which was never used before. I copied code from the official langchain-openai docs, and the following code:
from langchain_core.prompt... | https://stackoverflow.com/questions/78574282/openai-api-key-gives-ratelimit-error-even-though-api-key-not-used | python, chatbot, openai-api, langchain, rate-limiting | 1,717,490,641 |
se_78555060 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure OpenAI error Error code: 400 - {'statusCode': 400, 'message': "Unable to parse and estimate tokens from incoming request | Azure OpenAI error Error code: 400 - {'statusCode': 400, 'message': "Unable to parse and estimate tokens from incoming request
I used this API a lot in the last few days, and today it's not working, and I don't know what's wrong:
prompt = """some complex prompt (just text
"""
response = client.cha... | https://stackoverflow.com/questions/78555060/azure-openai-error-error-code-400-statuscode-400-message-unable-to-p | python, chatbot, openai-api, large-language-model, azure-openai | 1,717,073,146 |
se_78422965 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure AI. Failed to connect data. Could not 'MergeOrUpload' document to the search index | Azure AI. Failed to connect data. Could not 'MergeOrUpload' document to the search index
I'm trying to add data from Blob storage to Azure Open AI Studio.
After launching and preparing a small number of files, an error occurs:
Could not 'MergeOrUpload' document to the search index
There are 7000 files in the ... | https://stackoverflow.com/questions/78422965/azure-ai-failed-to-connect-data-could-not-mergeorupload-document-to-the-sear | azure, azure-storage, openai-api | 1,714,716,898 |
se_78334865 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Trace Source Data in an OpenAI-based Chatbot Using Langchain and Third-Party Custom Tools like Tavily API | How to Trace Source Data in an OpenAI-based Chatbot Using Langchain and Third-Party Custom Tools like Tavily API
I'm developing a chatbot leveraging OpenAI's model with Langchain and integrating third-party tools like Tavily Search. I've structured my chatbot to use a main OpenAI chat model agent that can utilize cust... | https://stackoverflow.com/questions/78334865/how-to-trace-source-data-in-an-openai-based-chatbot-using-langchain-and-third-pa | nestjs, openai-api, langchain, langchain-js, langchain-agents | 1,713,273,936 |
se_78552532 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What does the error 'module 'langchain' has no attribute 'verbose' refer to? | What does the error 'module 'langchain' has no attribute 'verbose' refer to?
Kind of new to Langchain/Qdrant but I'm building a recommendation engine to recommend users based on the contents of their associated PDF files, and I need to process PDFs and store their chunks in a vector database (I'm u... | https://stackoverflow.com/questions/78552532/what-does-the-error-module-langchain-has-no-attribute-verbose-refer-to | python, version-control, openai-api, langchain, py-langchain | 1,717,033,056 |
se_78570329 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Server sent event (SSE) timing delays Golang backend React frontend | Server sent event (SSE) timing delays Golang backend React frontend
I'm trying to implement an AI chat interface with a typewriter effect like ChatGPT. My backend API is written in Go and uses sashabaranov/go-openai for interfacing with OpenAI. Here's the controller, which is served at the route /answer/api/v1/chat/co... | https://stackoverflow.com/questions/78570329/server-sent-event-sse-timing-delays-golang-backend-react-frontend | reactjs, go, openai-api | 1,717,418,542 |
se_76020058 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Chat completions /v1/chat/completions results is very different than the ChatGPT result | Chat completions /v1/chat/completions results is very different than the ChatGPT result
I find out the API /v1/chat/completions result is very different than the web page result.
This is the API response for Q: "content": "What is the birthday of George Washington"
curl --location 'https://api.openai.com/v1/chat/c... | https://stackoverflow.com/questions/76020058/chat-completions-v1-chat-completions-results-is-very-different-than-the-chatgpt | openai-api, chatgpt-api | 1,681,525,070 |
se_76066707 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get ChatGPT API to respond similarly to web version? | How to get ChatGPT API to respond similarly to web version?
I just started playing around with chatgpt api, and was wondering how I can receive a response paragraph similar to what's on the web?
Here is a sample:
s = "Who is Harry Potter?"
response = openai.Completion.create(model="text-davinci-003", prompt=s, tempera... | https://stackoverflow.com/questions/76066707/how-to-get-chatgpt-api-to-respond-similarly-to-web-version | python, python-3.x, openai-api, chatgpt-api | 1,682,010,986 |
se_78566807 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do you format the messages parameters in OpenAI using model gpt-4 using Python | How do you format the messages parameters in OpenAI using model gpt-4 using Python
Why do they have 20 different codes for 20 different models in OpenAI? In any case, I've tried to mimic my code as close as possible to existing codes found on the internet but I keep getting errors. I realize that there are different... | https://stackoverflow.com/questions/78566807/how-do-you-format-the-messages-parameters-in-openai-using-model-gpt-4-using-pyth | openai-api | 1,717,340,383 |
se_78566179 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting Exception in Tkinter callback error | Getting Exception in Tkinter callback error
Was implementing chatgpt on Raspberry Pi-4, using Google voice recognizer. When I run the code, it is able to take input from microphone and display it but showing the error after that. Error it is showing:
Exception in Tkinter callback
Traceback (most recent call last):
F... | https://stackoverflow.com/questions/78566179/getting-exception-in-tkinter-callback-error | python, openai-api, raspberry-pi4 | 1,717,326,109 |
se_78546737 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Incompatibility between openai and fastapi | Incompatibility between openai and fastapi
python '3.12.3', fastapi '0.111.0', openai '1.30.4' (although the same happens with python 3.8 and 3.10)
Anyone know how to get around this?
(3.12venv) Delphi:dispatcher LarryMartell$ python
Python 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:48) [Clang 13.0.0 (clang-1300.0... | https://stackoverflow.com/questions/78546737/incompatibility-between-openai-and-fastapi | fastapi, openai-api, pydantic | 1,716,937,306 |
se_77008683 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError: OpenAIApi is not a constructor | TypeError: OpenAIApi is not a constructor
i got error:
const openai = new OpenAIApi({ key: apiKey });
^
TypeError: OpenAIApi is not a constructor
when I'm trying to create an openai api using nodejs (v16.7.0). I've followed the code in documentation and installed the openai api (v4.3.1)
code I used:
c... | https://stackoverflow.com/questions/77008683/typeerror-openaiapi-is-not-a-constructor | javascript, node.js, artificial-intelligence, openai-api | 1,693,403,531 |
se_78545765 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Problems with the openai assistant api connecting to my ionic application (node.js) | Problems with the openai assistant api connecting to my ionic application (node.js)
I am developing an assistant chatbot app for a company, I use ionic framework 7 and I want to use the openai assistant to connect as the chatbot of that application. I am having problems with the connection with the openai assistant an... | https://stackoverflow.com/questions/78545765/problems-with-the-openai-assistant-api-connecting-to-my-ionic-application-node | ionic-framework, openai-api, openai-assistants-api | 1,716,919,534 |
se_78548674 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Extract Information from a Large Markdown File to Fill a JSON Using OpenAI? | How to Extract Information from a Large Markdown File to Fill a JSON Using OpenAI?
I have a large markdown (MD) file from which I need to extract information to fill a JSON file. How can I provide the MD file as context in an OpenAI request to generate the filled JSON? I tried dividing it into chunks, but the results ... | https://stackoverflow.com/questions/78548674/how-to-extract-information-from-a-large-markdown-file-to-fill-a-json-using-opena | openai-api, chatgpt-api, gpt-4 | 1,716,975,928 |
se_76343128 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to make a Discord bot handle 'requests.post' as a command instead of plain text in Discord | How to make a Discord bot handle 'requests.post' as a command instead of plain text in Discord
In my python code, im generating prompts using ChatGPT and sending them automatically to the discord bot Midjourney. With the /imagine part that already comes with the generated prompts, it usually commands the bot t... | https://stackoverflow.com/questions/76343128/how-to-make-a-discord-bot-handle-requests-post-as-a-command-instead-of-plain-t | python, python-requests, discord, openai-api, image-generation | 1,685,122,450 |
se_77398067 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OPENAI key not found, despite positive echo command for the environment variable | OPENAI key not found, despite positive echo command for the environment variable
I set the openai key in my bash_profile and when I run echo $OPENAI_API_KEY the key is displayed. However when I want to pass the key in my python project using:
os.environ["OPENAI_API_KEY"] or os.getenv("OPENAI_API_KEY") I get the error:... | https://stackoverflow.com/questions/77398067/openai-key-not-found-despite-positive-echo-command-for-the-environment-variable | environment-variables, openai-api, api-key | 1,698,774,166 |
se_78543858 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Kernel crashes when running a FAISS similarity search | Kernel crashes when running a FAISS similarity search
I am working with langChain right now and created a FAISS vector store. Since today, my kernel crashes when running a similarity search on my vector store. Has anyone an idea why this is happening?
from langchain_community.document_loaders import PyPDFLoader
from l... | https://stackoverflow.com/questions/78543858/kernel-crashes-when-running-a-faiss-similarity-search | openai-api, langchain, faiss, similarity-search, vectorstore | 1,716,896,083 |
se_78545487 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Integrating OpenAI API into a Pyscript page - Requests keep timing out | Integrating OpenAI API into a Pyscript page - Requests keep timing out
I have a Pyscript page that searches a news archive and returns a list of news summaries. I want to then feed this list of summaries into gpt-4o and get back a brief summary of the material. The problem I'm encountering is that my request keeps tim... | https://stackoverflow.com/questions/78545487/integrating-openai-api-into-a-pyscript-page-requests-keep-timing-out | python, request, openai-api, pyscript | 1,716,915,074 |
se_78545085 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Openai NotFoundError | Openai NotFoundError
I tried to make an API connection from QlikSense for Llama3 model, but when I try to test the connection I get the error: 'The remote server returned an error: (404) Not Found'.
I used:
URL: http://localhost:5000/v1/chat/completions
Method: POST
Request body:
{
"messages": [
{
"r... | https://stackoverflow.com/questions/78545085/openai-notfounderror | openai-api | 1,716,909,860 |
se_78544968 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API using C# - I want to ask the questions from the uploaded pdf file, but the prompt is giving some random answers | OpenAI API using C# - I want to ask the questions from the uploaded pdf file, but the prompt is giving some random answers
I am new in the world of using OpenAI API. I am using c# web api application to run my project. I have uploaded the pdf file and response is coming as successful. When i am trying to fetch the ans... | https://stackoverflow.com/questions/78544968/openai-api-using-c-i-want-to-ask-the-questions-from-the-uploaded-pdf-file-bu | c#, openai-api | 1,716,908,416 |
se_78540935 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure AI Search index is disabled in Azure OpenAI studio | Azure AI Search index is disabled in Azure OpenAI studio
I created some indexes and they work fine, but more recently I created a new index, "mind-star-index" and I can search over it in Azure AI search, but I cannot connect it to OpenAI because it is greyed out as shown in the image.
I could not fin a suitable answer... | https://stackoverflow.com/questions/78540935/azure-ai-search-index-is-disabled-in-azure-openai-studio | azure, search, openai-api | 1,716,840,882 |
se_75827468 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why am I getting a 401 error even though I am getting a response when linking my Next.js site with ChatGPT? | 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 r... | https://stackoverflow.com/questions/75827468/why-am-i-getting-a-401-error-even-though-i-am-getting-a-response-when-linking-my | next.js, openai-api, chatgpt-api | 1,679,601,240 |
se_77173368 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Do GPT-4 and GPT-3.5 share the same token encoder? | Do GPT-4 and GPT-3.5 share the same token encoder?
I want to know if I can use the same token counter for various GPT models - especially GPT-3, GPT-3.5, and GPT-4.
GPT models by OpenAI need texts to be tokenized (using Byte Pair Encoding, BPE), see Interactive GPT tokenizer. I haven't found a direct statement if they... | https://stackoverflow.com/questions/77173368/do-gpt-4-and-gpt-3-5-share-the-same-token-encoder | token, openai-api, gpt-3, gpt-4 | 1,695,650,892 |
se_78538140 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is changing syntax of require("node:fs") to require("fs") an acceptable workaround inside OpenAI package | Is changing syntax of require("node:fs") to require("fs") an acceptable workaround inside OpenAI package
I am working on an already-created project and trying to add OpenAI to it. I had been initially informed that Node 16 version is to be used but found out later through other devs that everyone i... | https://stackoverflow.com/questions/78538140/is-changing-syntax-of-requirenodefs-to-requirefs-an-acceptable-workarou | javascript, node.js, npm, openai-api | 1,716,800,731 |
se_77374908 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error installing Openai in PyCharm CE 2023.2.3 (Python 3.12). (aiohttp whl error) | Error installing Openai in PyCharm CE 2023.2.3 (Python 3.12). (aiohttp whl error)
I am hoping someone can help me figure out the best course of action for an issue I am having. I am trying to play with the ChatGPT API. As suggested, I am doing an install, which seems to through an error. Please see the log below. ... | https://stackoverflow.com/questions/77374908/error-installing-openai-in-pycharm-ce-2023-2-3-python-3-12-aiohttp-whl-error | python, python-3.x, pip, openai-api, aiohttp | 1,698,416,394 |
se_77521121 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValidationError: 1 validation error for SQLDatabaseToolkit llm value is not a valid dict | ValidationError: 1 validation error for SQLDatabaseToolkit llm value is not a valid dict
Trying to conenct postgresql with langchain.llm used - AzureOpenAI
from langchain.llms import AzureOpenAI
llms = AzureOpenAI( temperature=0,deployment_name="gpt3turbo".......)
toolkit = SQLDatabaseToolkit(db=db,llm=llms)
Error:... | https://stackoverflow.com/questions/77521121/validationerror-1-validation-error-for-sqldatabasetoolkit-llm-value-is-not-a-va | python, pip, openai-api, langchain, azure-openai | 1,700,553,245 |
se_78534830 | stackoverflow | ARTIFICIAL_INTELLIGENCE | chatbot memory problem for langchain using ConversationalRetrievalChain | chatbot memory problem for langchain using ConversationalRetrievalChain
i have build a chatbot on custom data using langchain, but the chatbot can not remember my previous questions, I found it difficult with the ConversationalRetrievalChain.
My code is as below:
`class MyBot(ActivityHandler):
def __init__(self, c... | https://stackoverflow.com/questions/78534830/chatbot-memory-problem-for-langchain-using-conversationalretrievalchain | nlp, chatbot, openai-api, langchain, conversational-ai | 1,716,715,908 |
se_78535463 | stackoverflow | ARTIFICIAL_INTELLIGENCE | React Typewriter-effect doesn't work properly on mutation | React Typewriter-effect doesn't work properly on mutation
in this code the new answer comes from a mutation function from tanstack query. I want an effect like chatgpt to run the code only if the answer is new but this simple typewriter won't run even without that functionality until I refresh the page.
I expected... | https://stackoverflow.com/questions/78535463/react-typewriter-effect-doesnt-work-properly-on-mutation | javascript, reactjs, openai-api, tanstack | 1,716,731,781 |
se_78533963 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I identify silences in audio in Node.js? | How can I identify silences in audio in Node.js?
I'm working on implementing a real time chatbot using openai's GPT4o model, so far I've got mostly everything working except one key piece which is knowing when the audio streamed by the frontend is voice vs silence. I thought this was going to be trivial to solve but t... | https://stackoverflow.com/questions/78533963/how-can-i-identify-silences-in-audio-in-node-js | node.js, websocket, openai-api, audio-streaming, audio-processing | 1,716,680,805 |
se_78522460 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to format gpt-x output in react.js | How to format gpt-x output in react.js
Using OpenAI api i receive raw formatting from GPT-x which i'd like to display in HTML using React.js. I've explored using react-markdown with the remark-math plugin, but GPT seems to respond with parenthesized math - "( \frac{3}{4} )" - instead of dollar-delimited math - "$\fra... | https://stackoverflow.com/questions/78522460/how-to-format-gpt-x-output-in-react-js | reactjs, markdown, openai-api, remarkjs | 1,716,459,847 |
se_78531189 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Error adding private sharing PCS to public sharing PCS for share | Error adding private sharing PCS to public sharing PCS for share
I am attempting to use the open ai image API and send images. Unfortunately, they don't let you send image data directly, instead, you have to save and share the image to the cloud, and send their API a link.
I am trying to save the image via icloud, an... | https://stackoverflow.com/questions/78531189/error-adding-private-sharing-pcs-to-public-sharing-pcs-for-share | icloud, openai-api, cloudkit | 1,716,601,041 |
se_78105511 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ImportError: cannot import name 'Ollama' from 'llama_index.llms' (unknown location) | ImportError: cannot import name 'Ollama' from 'llama_index.llms' (unknown location)
Getting error while importing Ollama from 'llama_index.llms' in Linux OS.
from llama_index.llms import Ollama
response = llm.complete(f"What is code?")
print(response)
I installed Ollama from, curl -fsSL https://olla... | https://stackoverflow.com/questions/78105511/importerror-cannot-import-name-ollama-from-llama-index-llms-unknown-locati | python-3.x, openai-api, llama-index, mistral-7b, ollama | 1,709,617,036 |
se_78530722 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Despite method being POST, its a GET when implemented | Despite method being POST, its a GET when implemented
I'm trying to use the ChatGPT API and I'm using POST as the method to send it to the API, however, on the page when I hit the submit button, it doesn't go through. When, in the browser's dev console, I hit "open in new tab", It says "cannot GET /ask".
This is the s... | https://stackoverflow.com/questions/78530722/despite-method-being-post-its-a-get-when-implemented | javascript, nginx, openai-api | 1,716,585,305 |
se_78525825 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Chat Completions API for in context learning | OpenAI Chat Completions API for in context learning
The change from Completions API to Chat Completions API has confused on how I should structure my input to the model. Could someone teach me how I can convert the input to a format compatible with the Chat Completions API ?
prompt = """
You are a smart assistant that... | https://stackoverflow.com/questions/78525825/openai-chat-completions-api-for-in-context-learning | openai-api | 1,716,503,524 |
se_78523676 | stackoverflow | ARTIFICIAL_INTELLIGENCE | AttributeError: 'OpenAI' object has no attribute 'fine_tunes' | AttributeError: 'OpenAI' object has no attribute 'fine_tunes'
I work with Python in Jupyter Notebook 7.0.8 :
Here is the error generated by the following cell:
The error:
---------------------------------------------------------------------------
AttributeError Traceback (mos... | https://stackoverflow.com/questions/78523676/attributeerror-openai-object-has-no-attribute-fine-tunes | jupyter-notebook, openai-api, large-language-model, gpt-3, fine-tuning | 1,716,472,815 |
se_76262208 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OPENAI - AZURE SSL error certification verification error | OPENAI - AZURE SSL error certification verification error
whenever i make a request to azure-openai to create some embeddings the result is the error:
Error communicating with OpenAI: HTTPSConnectionPool(host='form-chatgpt-open-ai.openai.azure.com', port=443): Max retries exceeded with url: //openai/deployments/embedd... | https://stackoverflow.com/questions/76262208/openai-azure-ssl-error-certification-verification-error | azure, ssl, openai-api | 1,684,234,491 |
se_78422839 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to set up streaming of responses from an Azure Function API, which is designed to utilize Azure OpenAI | How to set up streaming of responses from an Azure Function API, which is designed to utilize Azure OpenAI
How can I set up streaming of responses from an Azure Function API, which is designed to utilize Azure OpenAI using Python language, to be consumed by an Angular UI application? This Angular UI application commun... | https://stackoverflow.com/questions/78422839/how-to-set-up-streaming-of-responses-from-an-azure-function-api-which-is-design | angular, azure, .net-core, openai-api, azure-openai | 1,714,714,147 |
se_76195150 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I create a memory storage to use as a context information for my OpenAI-ChatGPT Python Script? | How can I create a memory storage to use as a context information for my OpenAI-ChatGPT Python Script?
I wanted to make a smart assistant capable of storing all historical conversations that I have with it.
My idea is to be able to have long discussions that can be stored and retrieved over time as I expand some topic... | https://stackoverflow.com/questions/76195150/how-can-i-create-a-memory-storage-to-use-as-a-context-information-for-my-openai | python, openai-api, chatgpt-api | 1,683,477,962 |
se_78515857 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Flask-SocketIO - Method Not Allowed | Flask-SocketIO - Method Not Allowed
I have a program that generates notes based on a topic, using OpenAI's API. I am using Flask-SocketIO to make it happen in real time on the website. I send the request to the API by clicking a button on the website, and it is supposed to update the InnerHTML of a div to the However,... | https://stackoverflow.com/questions/78515857/flask-socketio-method-not-allowed | javascript, python, flask, socket.io, openai-api | 1,716,362,144 |
se_78448177 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError: Cannot read properties of undefined (reading '0') open ai | TypeError: Cannot read properties of undefined (reading '0') open ai
` this is embedding.ts
import { OpenAIApi, Configuration } from "openai-edge";
const config = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(config);
export async function getEmbeddings(text:... | https://stackoverflow.com/questions/78448177/typeerror-cannot-read-properties-of-undefined-reading-0-open-ai | reactjs, next.js, openai-api, embedding, pinecone | 1,715,167,987 |
se_78374283 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Cannot read properties of undefined (reading 'choices') in React application using OpenAI API | Cannot read properties of undefined (reading 'choices') in React application using OpenAI API
Edit: Issue was solved
I'm working on a React application where I'm using the OpenAI API to communicate with the AI. In my application, I'm trying to send user input to the API and receive a response from the AI. Howe... | https://stackoverflow.com/questions/78374283/cannot-read-properties-of-undefined-reading-choices-in-react-application-usi | javascript, reactjs, promise, openai-api | 1,713,895,503 |
se_78335859 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Inconsistent Output with HuggingFace ChatHuggingFace in Google Colab and Langchain Documentation | Inconsistent Output with HuggingFace ChatHuggingFace in Google Colab and Langchain Documentation
I am using the HuggingFace ChatHuggingFace module to generate text in a Google Colab notebook. However, I noticed that the output I receive differs from the output shown in the Langchain documentation, even when using the ... | https://stackoverflow.com/questions/78335859/inconsistent-output-with-huggingface-chathuggingface-in-google-colab-and-langcha | chat, huggingface-transformers, openai-api, langchain, huggingface-hub | 1,713,282,868 |
se_78496206 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Indexer does not recognize fields for mapping | Indexer does not recognize fields for mapping
Dears, good morning.
I have a problem creating the indexer and index in my search service.
I have a folder with several JSON files inside the azure blob, the json structure is as follows:
{
"modelo": "55uq7950psb",
"caracteristicas": {
"Processador": "Proce... | https://stackoverflow.com/questions/78496206/indexer-does-not-recognize-fields-for-mapping | azure, search, indexing, openai-api, azure-search-.net-sdk | 1,715,955,081 |
se_71893613 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to suppress OpenAI API warnings in Python | How to suppress OpenAI API warnings in Python
When can I suppress warnings such as:
message='Request to OpenAI API' method=post path=https://api.openai.com/v1/engines/davinci/completions
when I am running OpenAI in python? | https://stackoverflow.com/questions/71893613/how-to-suppress-openai-api-warnings-in-python | python, openai-api | 1,650,109,580 |
se_76198905 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Streaming an API proxy in Vapor | Streaming an API proxy in Vapor
I'm trying to make a proxy for the openAI chat api in Vapor, so that my iOS app won't need to know the api key. The thing that makes this a bit tricky is that I want to use streaming: stream=true. So I want to call this proxy from my iOS app, and it calls the openAI api with the key, an... | https://stackoverflow.com/questions/76198905/streaming-an-api-proxy-in-vapor | swift, reverse-proxy, openai-api, vapor | 1,683,535,543 |
se_78505196 | stackoverflow | ARTIFICIAL_INTELLIGENCE | SyntaxError: cannot assign to function call here. Maybe you meant '==' when using os.environ in Python | SyntaxError: cannot assign to function call here. Maybe you meant '==' when using os.environ in Python
I am creating a AI agent in my Jupyter Notebook on Anaconda. When I enter the following settings I get an error.
import os
os.environ("OPENAI_API_KEY")=openai_api_key
os.environ("OPENAI_MODEL_NAME")="gpt-3.5-... | https://stackoverflow.com/questions/78505196/syntaxerror-cannot-assign-to-function-call-here-maybe-you-meant-when-usin | python, jupyter-notebook, openai-api | 1,716,189,520 |
se_75804599 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API: How do I count tokens before(!) I send an API request? | OpenAI API: How do I count tokens before(!) I send an API request?
OpenAI's text models have a context length, e.g.: Curie has a context length of 2049 tokens.
They provide max_tokens and stop parameters to control the length of the generated sequence. Therefore the generation stops either when stop token is obtained,... | https://stackoverflow.com/questions/75804599/openai-api-how-do-i-count-tokens-before-i-send-an-api-request | python, openai-api, chatgpt-api, gpt-3, gpt-4 | 1,679,420,110 |
se_78477036 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get SQL query from NLP using Openai? | How to get SQL query from NLP using Openai?
I am working on a POC for NLP to SQL query using the Langchain framework and OpenAI. Sometimes, the generated query has errors and giving wrong query. How can I improve the query generation process?
Should I consider fine-tuning or any other method? Please provide some sugge... | https://stackoverflow.com/questions/78477036/how-to-get-sql-query-from-nlp-using-openai | openai-api, langchain, large-language-model, azure-openai | 1,715,678,418 |
se_76098432 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use StuffDocumentsChain with ConversationChain in LangChain? | How to use StuffDocumentsChain with ConversationChain in LangChain?
I want to use StuffDocumentsChain but with behaviour of ConversationChain the suggested example in the documentation doesn't work as I want:
import fs from 'fs';
import path from 'path';
import { OpenAI } from "langchain/llms/openai";
import { Recursi... | https://stackoverflow.com/questions/76098432/how-to-use-stuffdocumentschain-with-conversationchain-in-langchain | typescript, artificial-intelligence, openai-api, langchain | 1,682,406,339 |
se_78498262 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using JSON mode with OpenAI package for R | Using JSON mode with OpenAI package for R
I'm using Openai package in for the R language. I'm looking for a way to switch to JSON mode with the completion api.
At the moment I'm using the create_chat_completion function such as:
create_chat_completion( model = model_type,
messages = user_conver... | https://stackoverflow.com/questions/78498262/using-json-mode-with-openai-package-for-r | r, openai-api | 1,715,988,411 |
se_78497875 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Enforcing tokens per minute rate limit in FastAPI | Enforcing tokens per minute rate limit in FastAPI
I'm developing FastAPI endpoints that rely on calls to OpenAI's chat completion. Some of the calls use asyncio.gather to make concurrent requests to OpenAI. Because of this, I'm worried about rate limits. I'm currently using Semaphore to limit the requests per minute, ... | https://stackoverflow.com/questions/78497875/enforcing-tokens-per-minute-rate-limit-in-fastapi | python-asyncio, fastapi, openai-api, large-language-model | 1,715,978,567 |
se_77531732 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Handling RateLimitError in OpenAI API while using Google Colab | Handling RateLimitError in OpenAI API while using Google Colab
I'm trying to generate academic papers using OpenAI's API in Google Colab. However, I'm encountering a RateLimitError that says "You exceeded your current quota, please check your plan and billing details." Here's the code I'm using:
!pip install openai
# ... | https://stackoverflow.com/questions/77531732/handling-ratelimiterror-in-openai-api-while-using-google-colab | openai-api | 1,700,671,246 |
se_78489459 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Combine text embeddings | Combine text embeddings
What's the best way to combine text embeddings into one and then search in vector db?
I'm trying to create a recommendation system, so when a user clicks on another category, I get the text embedding and I add it to the "combined embedding".
For example, If a user clicks on food recipes, the u... | https://stackoverflow.com/questions/78489459/combine-text-embeddings | openai-api, text-processing, word-embedding | 1,715,858,115 |
se_78487894 | stackoverflow | ARTIFICIAL_INTELLIGENCE | I want to change icons(Play and Pause) while textToSpeech speaking and stop in RecyclerView Android | I want to change icons(Play and Pause) while textToSpeech speaking and stop in RecyclerView Android
I want to make ChatScreen like ChatGPT . In ChatScreen i want to change play - pause icons while TextToSpeech speaking or stop in RecyclerView. I'm Working in this since three or four days.
I Tried This but i can't get ... | https://stackoverflow.com/questions/78487894/i-want-to-change-iconsplay-and-pause-while-texttospeech-speaking-and-stop-in-r | android, android-recyclerview, text-to-speech, openai-api, chatgpt-api | 1,715,840,459 |
se_78218999 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LangChain Agents: Conversational React Description | LangChain Agents: Conversational React Description
Previously I used initialize_agent method by passing agent=AgentType.CONVERSATIONAL_REACT_DESCRIPTION to initialize a conversation react agent in LangChain v0.0.
agent_executor = initialize_agent(tools=tools,
llm=llm,
... | https://stackoverflow.com/questions/78218999/langchain-agents-conversational-react-description | python, openai-api, langchain, large-language-model | 1,711,368,927 |
se_75824798 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get token usage for each openAI ChatCompletion API call in streaming mode? | How to get token usage for each openAI ChatCompletion API call in streaming mode?
According to openAI's documentation,
https://platform.openai.com/docs/guides/chat/chat-vs-completions
you should get token usage from the response. However, I am currently working making the API call with stream set to True. The response... | https://stackoverflow.com/questions/75824798/how-to-get-token-usage-for-each-openai-chatcompletion-api-call-in-streaming-mode | openai-api | 1,679,584,499 |
se_76137987 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Completion Stream with Node.js and Express.js | OpenAI Completion Stream with Node.js and Express.js
I'm trying to build a ChatGPT website clone and now I need to make the stream completion effect that shows the result word-per-word.
My server is a TypeScript Node.js app that uses the Express.js framework.
Here's the route:
import express, { Request, Response } fro... | https://stackoverflow.com/questions/76137987/openai-completion-stream-with-node-js-and-express-js | node.js, express, sockets, events, openai-api | 1,682,795,747 |
se_77899036 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LangChain not using tools every time | LangChain not using tools every time
I am building a LangChain application using OpenAI.
I am using 3 tools-
Two tools are pdf based tools, reading pdf and finding similarity scores with the user query
One tool is excel based tool, reading pdf and finding similarity scores with the user query
But when I asked a ques... | https://stackoverflow.com/questions/77899036/langchain-not-using-tools-every-time | python, azure, openai-api, langchain, azure-openai | 1,706,524,267 |
se_78020093 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Chatbot that dynamically selects between database or PDF based on user input | Chatbot that dynamically selects between database or PDF based on user input
I have developed two separate chatbots: one that searches data from my database and another that searches from PDF documents. Now, I want to create a unified chatbot that intelligently decides where to search based on the user's input.
Could ... | https://stackoverflow.com/questions/78020093/chatbot-that-dynamically-selects-between-database-or-pdf-based-on-user-input | artificial-intelligence, chatbot, openai-api, azure-ai, azure-ai-search | 1,708,339,838 |
se_78475466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Real-time text-to-speech with Deepgram on React Native | Real-time text-to-speech with Deepgram on React Native
I am trying to integrate STT and TTS using Deepgram and my custom LLM stack with headers into my React Native app. But I am struggling to find proper streaming packages that may allow me to use packets vs. sending the entire file once it is ready.
Has anyone done ... | https://stackoverflow.com/questions/78475466/real-time-text-to-speech-with-deepgram-on-react-native | react-native, text-to-speech, openai-api, audio-streaming, openai-whisper | 1,715,654,322 |
se_75049140 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI GPT-3 API error 429: "Request failed with status code 429" | OpenAI GPT-3 API error 429: "Request failed with status code 429"
I'm trying to connect OpenAI API to my Vue.js project. Everything is OK but every time I try to POST request, I get a 429 status code (too many request) but I didn't even had the chance to make one. Any help?
Response:
{
"message": "Reques... | https://stackoverflow.com/questions/75049140/openai-gpt-3-api-error-429-request-failed-with-status-code-429 | vue.js, openai-api, gpt-3 | 1,673,192,760 |
se_78472731 | stackoverflow | ARTIFICIAL_INTELLIGENCE | call a chatGPT Assistant through API in R | call a chatGPT Assistant through API in R
I'm trying to create a GPT in R for my shinyapps using an specific assistant created in the openAi platform
So far I have managed to call the API's (or even use a document as a reference) in R itself, but still don't know how to call an Assistant
This is the code I'm using, bu... | https://stackoverflow.com/questions/78472731/call-a-chatgpt-assistant-through-api-in-r | r, openai-api | 1,715,608,272 |
se_78423502 | stackoverflow | ARTIFICIAL_INTELLIGENCE | 'AsyncStream' object is not iterable when streaming openAI Assistant thread runs | 'AsyncStream' object is not iterable when streaming openAI Assistant thread runs
I am currently trying to stream a response with openAIs new assistant update. I followed the official documentation here but it doesn't want to work. I keep getting this error:
File "/home/vscode/.local/lib/python3.12/site-package... | https://stackoverflow.com/questions/78423502/asyncstream-object-is-not-iterable-when-streaming-openai-assistant-thread-runs | python, openai-api | 1,714,724,847 |
se_78334712 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Fine-tuned openAI API is giving NotFoundError: Error code: 404 | Fine-tuned openAI API is giving NotFoundError: Error code: 404
this is my first openAI fine-tuning job so I don't know much. I am trying to fine-tune OpenAI API to generate product ID based on the description. The code runs successfully and also generates model ID, I also got billed for it. However, when I want to use... | https://stackoverflow.com/questions/78334712/fine-tuned-openai-api-is-giving-notfounderror-error-code-404 | nlp, openai-api, fine-tuning | 1,713,272,261 |
se_75299615 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API: Can I remove the line break from the response with a parameter? | OpenAI API: Can I remove the line break from the response with a parameter?
I've starting using OpenAI API in R. I downloaded the openai package. I keep getting a double linebreak in the text response. Here's an example of my code:
library(openai)
vector = create_completion(
model = "text-davinci-003",
prompt = ... | https://stackoverflow.com/questions/75299615/openai-api-can-i-remove-the-line-break-from-the-response-with-a-parameter | r, openai-api, gpt-3 | 1,675,180,002 |
se_78436688 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain Agents and tools: how to pass extra argument to tools other than input | Langchain Agents and tools: how to pass extra argument to tools other than input
My LLM app contains a session for each user and userid.
Here I want to pass userId (id of user who is currently using LLM app) to getPrice tools.
How to send userId to tools?
from langchain import hub
from langchain.agents import AgentExe... | https://stackoverflow.com/questions/78436688/langchain-agents-and-tools-how-to-pass-extra-argument-to-tools-other-than-input | openai-api, langchain, large-language-model, langchain-agents | 1,714,999,275 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.