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_75918257 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Simple URLSession not functioning in swift, what am I doing wrong? | Simple URLSession not functioning in swift, what am I doing wrong?
I'm looking to create a simple CLI in Swift for working with OpenAI's GPT models. I've tried various approaches. The code below is the simplest version and still not functional -- I believe the closure is not being called.
let endpoint = "https://api.o... | https://stackoverflow.com/questions/75918257/simple-urlsession-not-functioning-in-swift-what-am-i-doing-wrong | swift, python-requests, openai-api, urlsession | 1,680,516,261 |
se_76741896 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Properly count amount of tokens in the whole request payload - OpenAI | Properly count amount of tokens in the whole request payload - OpenAI
17.10.24: Title edited for easier search
Original title: What part of OpenAI API request payload is limited by the max amount tokens?
I kinda understand how to count tokens out of characters, but what do I actually have to count?
If I have a payloa... | https://stackoverflow.com/questions/76741896/properly-count-amount-of-tokens-in-the-whole-request-payload-openai | openai-api, chatgpt-api, gpt-3, gpt-4 | 1,689,986,280 |
se_79065993 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Not able to run my org's Azure OpenAI API with SpaCy-LLM | Not able to run my org's Azure OpenAI API with SpaCy-LLM
I am trying to run spacy-llm with my organization's azure openai api that they have provided me.
But since I am pretty beginner in Python, I guess I am not writing the config file correctly, and hence getting the 403 Forbidden error.
I am not able to underst... | https://stackoverflow.com/questions/79065993/not-able-to-run-my-orgs-azure-openai-api-with-spacy-llm | spacy, openai-api | 1,728,390,807 |
se_78370813 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ASSISTANT API ERROR : Files with extensions [none] are not supported for retrieval | ASSISTANT API ERROR : Files with extensions [none] are not supported for retrieval
hi i am facing error using assistant api chatgpt-4 when trying to upload files to specific thread using message
Issue summary
i am building exam generator ai that takes files(books) and creates question based on the file content using... | https://stackoverflow.com/questions/78370813/assistant-api-error-files-with-extensions-none-are-not-supported-for-retriev | openai-api, chatgpt-api | 1,713,860,247 |
se_76755817 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API for nodejs get "Billing hard limit has been reached" | OpenAI API for nodejs get "Billing hard limit has been reached"
I want use openai API in my nodejs backend and create an image and show it in my frontend code. I get the API Key but when I want to use it it tells me:
"Billing hard limit has been reached"
How to resolve this issue? | https://stackoverflow.com/questions/76755817/openai-api-for-nodejs-get-billing-hard-limit-has-been-reached | javascript, node.js, reactjs, openai-api | 1,690,211,460 |
se_76301928 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to incorporate context/chat history in OpenAI ChatBot using ChatGPT and langchain in Python? | How to incorporate context/chat history in OpenAI ChatBot using ChatGPT and langchain in Python?
Please bear with me as this is literally the first major code I have ever written and its for OpenAI's ChatGPT API.
What I intend to do with this code is load a pdf document or a group of pdf documents. Then split them up ... | https://stackoverflow.com/questions/76301928/how-to-incorporate-context-chat-history-in-openai-chatbot-using-chatgpt-and-lang | python, openai-api, chatgpt-api, langchain, py-langchain | 1,684,703,340 |
se_75377374 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Embeddings API: How to get an embedding and calculate cosine similarity? | OpenAI Embeddings API: How to get an embedding and calculate cosine similarity?
I have an OpenAI embedding generated from their API.
I see examples of putting that vector into Postgres or Sqlite and then running a query against it.
I'm looking for simple code in python where I can use a text string and see how close t... | https://stackoverflow.com/questions/75377374/openai-embeddings-api-how-to-get-an-embedding-and-calculate-cosine-similarity | python, openai-api | 1,675,793,601 |
se_78666875 | stackoverflow | ARTIFICIAL_INTELLIGENCE | gpt-4o model provider errror | gpt-4o model provider errror
I am working on a projejct and when i run an X function, it fails. When I log my eventData, I get an error "Failed to find a model provider for model [gpt-4o]. Is it because I'm not a paid user? If yes, then how can I downgrade it to gpt-3.5? I'm using openAI keys ...
I attempted to genera... | https://stackoverflow.com/questions/78666875/gpt-4o-model-provider-errror | openai-api, chatgpt-api, chat-gpt-4 | 1,719,312,512 |
se_79087961 | stackoverflow | ARTIFICIAL_INTELLIGENCE | permission denied when npm-installing OpenAI realtime API | permission denied when npm-installing OpenAI realtime API
All I'm trying to do is npm install openai realtime API and I'm getting permission denied.
npm i openai/openai-realtime-api-beta
npm error code 128
npm error An unknown git error occurred
npm error command git --no-replace-objects ls-remote ssh://git@github.com... | https://stackoverflow.com/questions/79087961/permission-denied-when-npm-installing-openai-realtime-api | npm, openai-api | 1,728,947,958 |
se_77702820 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting formatted response from Chatgpt api | Getting formatted response from Chatgpt api
I’d like to get responses from ChatGPT in a neat and organized format, like bullet points. For instance, if I ask about five uses of Next.js, I’d prefer the answers to be presented as five distinct bullet points instead of a long paragraph. also i would like to know how to a... | https://stackoverflow.com/questions/77702820/getting-formatted-response-from-chatgpt-api | artificial-intelligence, chatbot, next.js13, openai-api | 1,703,237,897 |
se_79083740 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Has anyone used langchain with openai recently? I am getting lots of version incompatible errors when trying install and run? | Has anyone used langchain with openai recently? I am getting lots of version incompatible errors when trying install and run?
I am trying to run the below code which i saw from a tutorial. I am trying to run openai api and generate some blog titles.
from langchain.prompts.chat import ChatPromptTemplate
from langchain_... | https://stackoverflow.com/questions/79083740/has-anyone-used-langchain-with-openai-recently-i-am-getting-lots-of-version-inc | python, openai-api, large-language-model, py-langchain | 1,728,840,200 |
se_76097111 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Multiturn conversation + nested dialog Bot with Langchain and OpenAI | Multiturn conversation + nested dialog Bot with Langchain and OpenAI
Currently exploring Langchain and OpenAI.
Is it possible to use Langchain and OpenAI only to build a multiturn conversation + nested dialog like below's example? At the end, we also want to get the name, email and feedback. This can be done with MS B... | https://stackoverflow.com/questions/76097111/multiturn-conversation-nested-dialog-bot-with-langchain-and-openai | bots, openai-api, langchain | 1,682,386,444 |
se_77314576 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can’t consume the Azure OpenAI API | Can’t consume the Azure OpenAI API
I seem unable to consume my Azure OpenAI API. The model is deployed.
I’m getting the following error message:
“openai.error.InvalidRequestError: Must provide an ‘engine’ or ‘deployment_id’ parameter to create a <class ‘openai.api_resources.chat_completion.ChatCompletion’>”
import o... | https://stackoverflow.com/questions/77314576/can-t-consume-the-azure-openai-api | python, azure, openai-api | 1,697,617,218 |
se_78981542 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting "model_not_found" error while using Azure OpenAI API with code interpreter | Getting "model_not_found" error while using Azure OpenAI API with code interpreter
I'm trying to integrate the code interpreter using Azure OpenAI but encountering an error related to thread.id. I'm following the documentation but seem to be missing something. Here's my code:
import os
from openai import Azu... | https://stackoverflow.com/questions/78981542/getting-model-not-found-error-while-using-azure-openai-api-with-code-interpret | python, openai-api, azure-openai, code-interpreter | 1,726,220,183 |
se_79075105 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What might be the issue to this error? I have tried using grit command and tried downgrading openai still it won't work? | What might be the issue to this error? I have tried using grit command and tried downgrading openai still it won't work?
I am currently working on the chat module for the parsed resume and I am using chain but I am getting the error below.
{ "detail": "Failed to get the answer \n\nYou tried to access openai.ChatCo... | https://stackoverflow.com/questions/79075105/what-might-be-the-issue-to-this-error-i-have-tried-using-grit-command-and-tried | openai-api, langchain | 1,728,573,331 |
se_77923115 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Next.js useChat hook with a custom endpoint | Next.js useChat hook with a custom endpoint
I am trying to implement a chatbot using useChat hook from next.js. Here is the link the SDK
https://sdk.vercel.ai/docs/api-reference/use-chat
All the examples that I have found is using default route of api/chat on the same project but I need to use this with external API w... | https://stackoverflow.com/questions/77923115/next-js-usechat-hook-with-a-custom-endpoint | reactjs, next.js13, openai-api, chatgpt-api | 1,706,818,562 |
se_79071696 | stackoverflow | ARTIFICIAL_INTELLIGENCE | The value of citation entity field 'citation.appearance.abstract' exceeds the length limit. The maximum length is '480' characters | The value of citation entity field 'citation.appearance.abstract' exceeds the length limit. The maximum length is '480' characters
I have a problem integrating Azure OpenAI with Microsoft Teams through the Teams toolkit. The response generated by the API exceeds the character limit allowed in Teams, wh... | https://stackoverflow.com/questions/79071696/the-value-of-citation-entity-field-citation-appearance-abstract-exceeds-the-le | full-text-search, microsoft-teams, openai-api, teams-toolkit, azure-search-.net-sdk | 1,728,500,304 |
se_79033555 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to make sure OpenAI object stays in its context in ASP.NET Core 6 MVC ajax calls | How to make sure OpenAI object stays in its context in ASP.NET Core 6 MVC ajax calls
We have implemented OpenAI chatbot in our ASP.NET Core 6 MVC project. Installed OpenAI nuget package. It is working fine for one question, but observed than for next questions it is not staying in its own context. It is considering th... | https://stackoverflow.com/questions/79033555/how-to-make-sure-openai-object-stays-in-its-context-in-asp-net-core-6-mvc-ajax-c | .net-6.0, openai-api, chatgpt-api, chat-gpt-4 | 1,727,503,961 |
se_78934914 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Open AI integration | Open AI integration
I have basic OPEN AI account and I am developing a POC where the goal is to get data from JIRA and then analyze it using OPEN AI. There is no restriction on what to analyze and how much to analyze, I can make it as minimum as possible, I just want this to work once.
The following is my script for j... | https://stackoverflow.com/questions/78934914/open-ai-integration | python, flask, openai-api, jira-rest-api, chatgpt-api | 1,725,102,601 |
se_76037154 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to use Llama Index with AWS Lambda | Unable to use Llama Index with AWS Lambda
I am using Llama Index to create a custom bot using AWS Lambda, but when I try to create its layer and upload it to the AWS layer, I am getting "package not found" errors for different libraries. I tried to delete some packages from the Llama Index package and use AWS packages... | https://stackoverflow.com/questions/76037154/unable-to-use-llama-index-with-aws-lambda | python, aws-lambda, openai-api, chatgpt-api, llama-index | 1,681,747,817 |
se_78528163 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain OpenAI .with_structured_output() JSON mode | Langchain OpenAI .with_structured_output() JSON mode
I am not sure what setting the method parameter to "json_mode" (i.e. method="json_mode") in with_structured_output() does. It seems to make no difference to the output.
The documentation gives two options:
structured_llm = model.with_structured_output(Joke)
and
s... | https://stackoverflow.com/questions/78528163/langchain-openai-with-structured-output-json-mode | openai-api, langchain | 1,716,548,924 |
se_79062070 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Create an assistant and continue to use the thread until the user stop the conversation | Create an assistant and continue to use the thread until the user stop the conversation
I'm doing same experiment with ChatGPT and I found the NuGet called OpenAI-DotNet that seems quite easy to use. What I like to have is a conversation between the user and the AI. I understood that the Assistant is the right way to ... | https://stackoverflow.com/questions/79062070/create-an-assistant-and-continue-to-use-the-thread-until-the-user-stop-the-conve | c#, openai-api, chatgpt-api | 1,728,306,215 |
se_77519983 | stackoverflow | ARTIFICIAL_INTELLIGENCE | An error occurred: 'Transcription' object is not subscriptable | An error occurred: 'Transcription' object is not subscriptable
from openai import OpenAI
client = OpenAI(api_key="my_key")
audio_file_path ="C:/Users/name/OneDrive/VS Folder/speech.mp3"
with open(audio_file_path, "rb") as audio_file:
try:
transcript = client.audio.transcriptions.create(
... | https://stackoverflow.com/questions/77519983/an-error-occurred-transcription-object-is-not-subscriptable | python, openai-api | 1,700,533,922 |
se_79028964 | stackoverflow | ARTIFICIAL_INTELLIGENCE | function calling enforcing azure openai | function calling enforcing azure openai
I'm using function calling. I have 2 : preferred and alternative date. The agent should ask for preferred date and then ask for alternative after receiving the first one.
def prepare_functions(self):
"""Prepare the functions that the agent can use during the conversation."""... | https://stackoverflow.com/questions/79028964/function-calling-enforcing-azure-openai | azure, azure-functions, openai-api | 1,727,381,152 |
se_76747784 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Django request returning null? | Django request returning null?
I'm building a chatbot withing Django using chat GPT's API and I'm following this tutorial https://www.youtube.com/watch?v=qrZGfBBlXpk.
Anyway I don't see any difference in my code yet I'm running into a peculiar problem when I request from my html mile during the message sending process... | https://stackoverflow.com/questions/76747784/django-request-returning-null | python, django, fetch-api, chatbot, openai-api | 1,690,108,631 |
se_78359093 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I avoid this error trying to get a response from the OpenAI API? | How can I avoid this error trying to get a response from the OpenAI API?
I'm trying to get a response from chat GPT in python.
I tried this code block:
from openai import OpenAI
client = OpenAI(api_key="sk-proj-0Xo*******************************qOd")
def chat_with_chatgpt(prompt, model="gpt-3.5-turbo"):
response... | https://stackoverflow.com/questions/78359093/how-can-i-avoid-this-error-trying-to-get-a-response-from-the-openai-api | python, openai-api, chatgpt-api | 1,713,633,238 |
se_79056146 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Simple chatbot returning results without spaces | Simple chatbot returning results without spaces
I created a LLM chatbot where it answers questions from a book on deep learning. I've managed to run everything but when I ask it any similarity search, the result it returns does not have any spaces.
nizedasacrucialtechnologythoughthefirstexperimentswithartificialneuraln... | https://stackoverflow.com/questions/79056146/simple-chatbot-returning-results-without-spaces | openai-api, lang, chromadb | 1,728,089,825 |
se_79042708 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to forward OpenAI's stream response using FastAPI in python? | How to forward OpenAI's stream response using FastAPI in python?
This is my code to retrieve stream response from OpenAI's model which is event based. (I have shown only core part)
client = OpenAI(api_key=OPEN_AI_API_KEY)
class EventHandler(AssistantEventHandler):
def on_text_delta(self, delta: TextDelta, sna... | https://stackoverflow.com/questions/79042708/how-to-forward-openais-stream-response-using-fastapi-in-python | python, stream, fastapi, openai-api | 1,727,778,316 |
se_77420027 | stackoverflow | ARTIFICIAL_INTELLIGENCE | BUG: “Error: 413 The data value transmitted exceeds the capacity limit.” when calling v1/images/edits | BUG: “Error: 413 The data value transmitted exceeds the capacity limit.” when calling v1/images/edits
I’m trying to send an image from my Firebase Storage bucket to openai edit image API, but I’m getting the error above on the title.
exports.sendToOpenAI = functions.https.onRequest(async (req, res) => {
corsMiddle... | https://stackoverflow.com/questions/77420027/bug-error-413-the-data-value-transmitted-exceeds-the-capacity-limit-when-ca | javascript, node.js, firebase, openai-api, chatgpt-api | 1,699,050,854 |
se_79019184 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure Content Filter returning content=None but no filter was triggered | Azure Content Filter returning content=None but no filter was triggered
I'm encountering an issue with the Azure OpenAI content filter (for responses from gpt-4o) where the content is returned as None, but all the content filters (hate, self-harm, sexual, violence) are evaluated as False. This is confusing because no ... | https://stackoverflow.com/questions/79019184/azure-content-filter-returning-content-none-but-no-filter-was-triggered | azure, artificial-intelligence, openai-api, azure-openai, gpt-4 | 1,727,189,464 |
se_79044466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeScript error with OpenAI API: Argument of type 'any' is not assignable to parameter of type 'never' when filtering annotations | TypeScript error with OpenAI API: Argument of type 'any' is not assignable to parameter of type 'never' when filtering annotations
I'm parsing annotations from OpenAI Assistants responses and seeing this.
Error Message:
./node_modules/openai/src/_vendor/partial-json-parser/parser.ts:182:18
Type error: ... | https://stackoverflow.com/questions/79044466/typescript-error-with-openai-api-argument-of-type-any-is-not-assignable-to-pa | typescript, openai-api, nextjs14 | 1,727,810,311 |
se_79042871 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Spring AI OpenAI Chat - Error while extracting response for type [OpenAiApi$ChatCompletion] and content type [application/json] | Spring AI OpenAI Chat - Error while extracting response for type [OpenAiApi$ChatCompletion] and content type [application/json]
In my Spring Boot (3.3.4) app I am trying to use Spring AI OpenAI. I am completely new to this.
This is my setup:
application.properties
spring.ai.openai.api-key=key
spring.ai.openai.chat.opt... | https://stackoverflow.com/questions/79042871/spring-ai-openai-chat-error-while-extracting-response-for-type-openaiapichat | spring-boot, openai-api, spring-ai | 1,727,781,075 |
se_79041160 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Not getting all the possible options when chatting over my chatbot | Not getting all the possible options when chatting over my chatbot
I am trying to build a simple chatbot over a PDF document using Llamaindex
so its like , some experiences/trips catalogue
and if i ask lets say , give me all experiences related to "Fashion"
i just get normally 2 experiences, though there are more than... | https://stackoverflow.com/questions/79041160/not-getting-all-the-possible-options-when-chatting-over-my-chatbot | openai-api, llama-index, claude | 1,727,734,312 |
se_76002754 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I refactor the below code to allow me generate coherent and flowing document in chatGPT? | How do I refactor the below code to allow me generate coherent and flowing document in chatGPT?
Am currently trying to test large text with OPENAI gpt-4 model.I am trying to refactor the below code so that the model can generate coherent,readable and flowing document.The code below does return 5000 words unfortunately... | https://stackoverflow.com/questions/76002754/how-do-i-refactor-the-below-code-to-allow-me-generate-coherent-and-flowing-docum | php, laravel, openai-api, guzzle | 1,681,371,029 |
se_78147997 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ModuleNotFoundError: No module named 'pydantic_core._pydantic_core' When importing openai python sdk to renpy | ModuleNotFoundError: No module named 'pydantic_core._pydantic_core' When importing openai python sdk to renpy
when importing openai python sdk in a renpy project
init python:
from openai import OpenAI
This error appear
I'm sorry, but an uncaught exception occurred. While running game cod... | https://stackoverflow.com/questions/78147997/modulenotfounderror-no-module-named-pydantic-core-pydantic-core-when-importi | python, openai-api, pydantic, renpy | 1,710,254,376 |
se_76950609 | stackoverflow | ARTIFICIAL_INTELLIGENCE | What is the difference between OpenAI and ChatOpenAI in LangChain? | What is the difference between OpenAI and ChatOpenAI in LangChain?
I read the LangChain Quickstart.
There is a demo inside:
from langchain.llms import OpenAI
from langchain.chat_models import ChatOpenAI
llm = OpenAI()
chat_model = ChatOpenAI()
llm.predict("hi!")
>>> "Hi"
chat_model.predict("hi!")
>>> "Hi"
I search... | https://stackoverflow.com/questions/76950609/what-is-the-difference-between-openai-and-chatopenai-in-langchain | openai-api, langchain | 1,692,685,833 |
se_79033247 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why does OpenAI Whisper return "None"? | Why does OpenAI Whisper return "None"?
I'm trying to transcribe an MP3 file using OpenAI’s Whisper model, but the transcriptions.create() method consistently returns None. I’ve tried different MP3 files, converted them to WAV, updated the OpenAI library, and added error handling, but I still can’t figure out... | https://stackoverflow.com/questions/79033247/why-does-openai-whisper-return-none | python, ffmpeg, openai-api | 1,727,484,175 |
se_79034385 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Handle '429 Too Many Requests' Error in OpenAI API When Using React? | How to Handle '429 Too Many Requests' Error in OpenAI API When Using React?
I'm building a React app that integrates with the OpenAI API for generating tags. However, I'm encountering a 429 Too Many Requests error frequently. How can I handle this error effectively? What are the best practices for managing API... | https://stackoverflow.com/questions/79034385/how-to-handle-429-too-many-requests-error-in-openai-api-when-using-react | reactjs, openai-api | 1,727,532,355 |
se_79035724 | stackoverflow | ARTIFICIAL_INTELLIGENCE | TypeError: "Text must be a string when stream is False" using ElevenLabs `generate` function in Python | TypeError: "Text must be a string when stream is False" using ElevenLabs `generate` function in Python
I'm working on a Python script that transcribes audio using OpenAI's Whisper API, translates the text to French using DeepL, and then generates speech from the translated text using the ElevenLabs API. Howe... | https://stackoverflow.com/questions/79035724/typeerror-text-must-be-a-string-when-stream-is-false-using-elevenlabs-genera | openai-api, deepl, elevenlabs | 1,727,590,914 |
se_79032395 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValueError(f"Missing some input keys: {missing_keys}") | ValueError(f"Missing some input keys: {missing_keys}")
I am facing an error:
ValueError(f"Missing some input keys: {missing_keys}")
from this code. I am trying to parse resumes that are not supposed to have the keywords Name, phone, about_me in them.
However, it parses the keyword it finds similar to the Py... | https://stackoverflow.com/questions/79032395/valueerrorfmissing-some-input-keys-missing-keys | python, fastapi, openai-api, large-language-model, resume | 1,727,458,345 |
se_79026052 | stackoverflow | ARTIFICIAL_INTELLIGENCE | CloudFlare 400 Error When Calling OpenAI Completions API on CloudRun | CloudFlare 400 Error When Calling OpenAI Completions API on CloudRun
Running into a weird error where I get a 400 error from cloud-flare when calling the completions API from GCP Cloud Run. The error doesn't occur locally for identical requests.
The error response:
<html>
<head><title>400 Bad Request</title></head>
... | https://stackoverflow.com/questions/79026052/cloudflare-400-error-when-calling-openai-completions-api-on-cloudrun | google-cloud-platform, openai-api | 1,727,336,566 |
se_76669635 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Get chatGPT to respond with a single direct answer | Get chatGPT to respond with a single direct answer
I am querying a text using chatGPT. But I need chatGPT to respond with single direct answers, rather than long stories or irrelevant text. Any way to achieve this?
My code looks like:
from langchain.document_loaders import TextLoader
from langchain.vectorstores import... | https://stackoverflow.com/questions/76669635/get-chatgpt-to-respond-with-a-single-direct-answer | python, nlp, openai-api, langchain, chat-gpt-4 | 1,689,158,100 |
se_76233163 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValueError: `run` not supported when there is not exactly one output key. Got ['answer', 'sources', 'source_documents']. (langchain/Streamlit) | ValueError: `run` not supported when there is not exactly one output key. Got ['answer', 'sources', 'source_documents']. (langchain/Streamlit)
I got an error says
ValueError: `run` not supported when there is not exactly one output key. Got ['answer', 'sources', 'source_documents'].
Here's the... | https://stackoverflow.com/questions/76233163/valueerror-run-not-supported-when-there-is-not-exactly-one-output-key-got | python, openai-api, langchain, py-langchain | 1,683,866,305 |
se_79026315 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using Langchain ChatOpenAI functionality with LiteLLM | Using Langchain ChatOpenAI functionality with LiteLLM
I have initially written two functions to provide me with a model and function calling directly from OpenAI. Here is the complete code:
from langchain_openai import ChatOpenAI
def get_open_ai(temperature=0, model='gpt-4'):
llm = ChatOpenAI(
model=model,
... | https://stackoverflow.com/questions/79026315/using-langchain-chatopenai-functionality-with-litellm | python, machine-learning, openai-api, large-language-model, py-langchain | 1,727,340,279 |
se_79019686 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Chatgpt base64 encoded image | Chatgpt base64 encoded image
I’m trying to pass a base64 encoded image to gpt-4o, but gets an 400 Invalid base64 image_url.
I use the following code:
const openairesponse = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: 'system', content: "Convert the image to text" },
{
"role": "use... | https://stackoverflow.com/questions/79019686/chatgpt-base64-encoded-image | node.js, openai-api | 1,727,197,788 |
se_79018974 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create Langfuse Trace via .Net code | How to create Langfuse Trace via .Net code
I am developing an AI solution which combine of .Net and Python app. The reason for Python app is mostly to communicate with OpenAI and Langfuse. I want to cut off the Python app to make solution simpler and easier to deploy, but couldn't find a way to write Langfuse trace vi... | https://stackoverflow.com/questions/79018974/how-to-create-langfuse-trace-via-net-code | .net, artificial-intelligence, openai-api | 1,727,186,567 |
se_79007855 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Inquiry About Intent Feature in OpenAI and Azure AI Search Integration | Inquiry About Intent Feature in OpenAI and Azure AI Search Integration
I am interested in understanding the logic behind the intent feature in the integration between OpenAI's chat completions and Azure AI Search. Specifically, I noticed that when appending and sending chat history for retrieval-augmented generation (... | https://stackoverflow.com/questions/79007855/inquiry-about-intent-feature-in-openai-and-azure-ai-search-integration | azure, openai-api, azure-openai | 1,726,855,730 |
se_78793356 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Assistants API error: "'Assistants' has no attribute 'files'" | OpenAI Assistants API error: "'Assistants' has no attribute 'files'"
I have the code below, which I have to integrate, but it's showing up that 'Assistants' have no attribute 'file'. This code is around 8 months old, and I understand that the API probably changed since then, but I cannot find... | https://stackoverflow.com/questions/78793356/openai-assistants-api-error-assistants-has-no-attribute-files | python-3.x, openai-api, openai-assistants-api | 1,721,911,186 |
se_78858561 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to calculate embedding vectors using the OpenAI API for MongoDB vector search? | How to calculate embedding vectors using the OpenAI API for MongoDB vector search?
I am trying to follow the example from the official MongoDB documentation.
It mentioned that the search vector was based on the string "historical heist" using the OpenAI text-embedding-ada-002 model. However, when I tried to validate t... | https://stackoverflow.com/questions/78858561/how-to-calculate-embedding-vectors-using-the-openai-api-for-mongodb-vector-searc | mongodb, mongodb-query, openai-api, mongodb-atlas, vector-search | 1,723,386,418 |
se_78824299 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API returns null when I retrieve the fine-tuned model | OpenAI API returns null when I retrieve the fine-tuned model
I'm fine-tuning a model and generating actions from text. I create a train.jsonl file, upload it, and fine-tune the model. However, when I try to get the name of the model I just created, it returns null.
I fine-tune a model like this:
const model = await op... | https://stackoverflow.com/questions/78824299/openai-api-returns-null-when-i-retrieve-the-fine-tuned-model | node.js, openai-api, fine-tuning | 1,722,584,455 |
se_78826508 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error when fine-tuning: "This is not a chat model and thus not supported in the v1/chat/completions endpoint" | OpenAI API error when fine-tuning: "This is not a chat model and thus not supported in the v1/chat/completions endpoint"
I've fine-tuned a model using the OpenAI API. Now I want to use this fine-tuned model.
This is my code:
const response = await openai.chat.completions.create({
model: process.env.FINE... | https://stackoverflow.com/questions/78826508/openai-api-error-when-fine-tuning-this-is-not-a-chat-model-and-thus-not-suppor | node.js, openai-api, fine-tuning | 1,722,617,540 |
se_78947943 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "Unknown request URL: POST /v1/fine-tunes" | OpenAI API error: "Unknown request URL: POST /v1/fine-tunes"
This is my code:
import openai
import os
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.getenv('API_KEY')
def upload_file(file_path):
try:
response = openai.File.create(
file=open(file_path, "rb"),
... | https://stackoverflow.com/questions/78947943/openai-api-error-unknown-request-url-post-v1-fine-tunes | openai-api, chatgpt-api | 1,725,442,875 |
se_78212945 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Open AI API Key missing | Open AI API Key missing
I have been using open ai for a while in many projects, today i created a new apiKey for my new project, whene i initialize open ai i get this error:
Unhandled Runtime Error
Error: The OPENAI_API_KEY environment variable is missing or empty; either provide it, or instantiate the OpenAI client w... | https://stackoverflow.com/questions/78212945/open-ai-api-key-missing | typescript, azure, next.js, openai-api, azure-openai | 1,711,238,613 |
se_78994718 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I provide custom data via API to Azure OpenAI Model | How can I provide custom data via API to Azure OpenAI Model
I have created a chat model using Azure open ai and providing it custom data source with help of container and Azure ai search, but this is static. And I am using that API in my app. But what I want to do is that. But now I want to Integration it such a way t... | https://stackoverflow.com/questions/78994718/how-can-i-provide-custom-data-via-api-to-azure-openai-model | azure, openai-api, azure-openai, azure-ai | 1,726,586,326 |
se_76206459 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to continue incomplete response of openai API | How to continue incomplete response of openai API
In OpenAI API, how to programmatically check if the response is incomplete? If so, you can add another command like "continue" or "expand" or programmatically continue it perfectly.
In my experience,
I know that if the response is incomplete, the API would return:
"fin... | https://stackoverflow.com/questions/76206459/how-to-continue-incomplete-response-of-openai-api | python, machine-learning, artificial-intelligence, openai-api, chatgpt-api | 1,683,613,989 |
se_79000476 | stackoverflow | ARTIFICIAL_INTELLIGENCE | 404 error with insomnia any help greatly appreciated | 404 error with insomnia any help greatly appreciated
We are reviving a 404 error with http://127.0.0.1:5000/chat we access "hello world" from http://127.0.0.1:5000 our web browser. We seem to have tried everything, any insight would be greatly appreciated, thx
from flask import Flask, request, jsonify, send_from_dire... | https://stackoverflow.com/questions/79000476/404-error-with-insomnia-any-help-greatly-appreciated | http-status-code-404, openai-api, insomnia | 1,726,703,570 |
se_76305207 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI api - asynchronous API calls | OpenAI api - asynchronous API calls
I work with the OpenAI API. I have extracted slides text from a PowerPoint presentation, and written a prompt for each slide. Now, I want to make asynchronous API calls,
so that all the slides are processed at the same time.
this is the code from the async main function:
for prompt ... | https://stackoverflow.com/questions/76305207/openai-api-asynchronous-api-calls | python, python-asyncio, openai-api | 1,684,751,015 |
se_77242784 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ElasticsearchDatabaseChain in langchain Index specification | ElasticsearchDatabaseChain in langchain Index specification
from elasticsearch import Elasticsearch
from langchain.chat_models import ChatOpenAI
from langchain.chains.elasticsearch_database import ElasticsearchDatabaseChain
ELASTIC_SEARCH_SERVER = "https://elastic:pass@localhost:9200"
db = Elasticsearch(ELASTIC_SEARC... | https://stackoverflow.com/questions/77242784/elasticsearchdatabasechain-in-langchain-index-specification | elasticsearch, streamlit, openai-api, langchain, large-language-model | 1,696,579,186 |
se_76139203 | stackoverflow | ARTIFICIAL_INTELLIGENCE | using openai to call openai.Completion.create the response is shorter than what chatgpt returns | using openai to call openai.Completion.create the response is shorter than what chatgpt returns
I have a paid account for chatgpt and using the latest 4 version, when I ask it to answer a question it send back a response that is like 4k characters. When I use the api for same question, I get back a much shorter respo... | https://stackoverflow.com/questions/76139203/using-openai-to-call-openai-completion-create-the-response-is-shorter-than-what | response, openai-api, short | 1,682,818,668 |
se_78986801 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ImportError: cannot import name 'Iterator' from 'typing_extensions' (/databricks/python/lib/python3.10/site-packages/typing_extensions.py) | ImportError: cannot import name 'Iterator' from 'typing_extensions' (/databricks/python/lib/python3.10/site-packages/typing_extensions.py)
I'm facing the following issue on Azure Databricks when trying to import from openai import OpenAI after installing openai.
Here's the error:
ImportError: cannot im... | https://stackoverflow.com/questions/78986801/importerror-cannot-import-name-iterator-from-typing-extensions-databricks | python, databricks, azure-databricks, openai-api | 1,726,384,006 |
se_75740325 | stackoverflow | ARTIFICIAL_INTELLIGENCE | react-native using expo-av IOS recorded mp4 file form data call to openai's audio transcriptions saying invalid file format | react-native using expo-av IOS recorded mp4 file form data call to openai's audio transcriptions saying invalid file format
I've been at this all night, I'm attempting to record myself on my iPhone via expo using expo-av (records speech via iPhone) and upload it to openai's transcriptions endpoint using whisper-1 ... | https://stackoverflow.com/questions/75740325/react-native-using-expo-av-ios-recorded-mp4-file-form-data-call-to-openais-audi | typescript, react-native, expo, openai-api | 1,678,851,610 |
se_78056641 | stackoverflow | ARTIFICIAL_INTELLIGENCE | failed React Native stream response for OpenAI completion API from server to client using fetch | failed React Native stream response for OpenAI completion API from server to client using fetch
From what I understand here:
Using Readable Streams MDN
I should be able to use the Fetch API to send a result from the server to the client and get the response.body, i.e:
fetch(...).then((response) => response.body);
In m... | https://stackoverflow.com/questions/78056641/failed-react-native-stream-response-for-openai-completion-api-from-server-to-cli | react-native, stream, fetch, streaming, openai-api | 1,708,876,636 |
se_75826303 | stackoverflow | ARTIFICIAL_INTELLIGENCE | is there any way to stream response word by word of chatgpt api directly in react native (with javascript) | is there any way to stream response word by word of chatgpt api directly in react native (with javascript)
I want to use Chat GPT Turbo api directly in react native (expo) with word by word stream here is working example without stream
fetch(`https://api.openai.com/v1/chat/completions`, {
body: JSON.stringify({
... | https://stackoverflow.com/questions/75826303/is-there-any-way-to-stream-response-word-by-word-of-chatgpt-api-directly-in-reac | javascript, react-native, expo, openai-api, chatgpt-api | 1,679,593,077 |
se_78980169 | stackoverflow | ARTIFICIAL_INTELLIGENCE | "AzureChatCitation citation" is not working with the CompleteChatStreamingAsync streamer on | "AzureChatCitation citation" is not working with the CompleteChatStreamingAsync streamer on
I am trying to chat with Azure OpenAI models using my own data. I have uploaded my PDF documents into Azure Blob Storage and created a search index for them. I have a C# application where I’m trying to stream an LLM’s... | https://stackoverflow.com/questions/78980169/azurechatcitation-citation-is-not-working-with-the-completechatstreamingasync | openai-api, azure-cognitive-search, azure-openai, azure-search-.net-sdk, azure-ai-search | 1,726,183,235 |
se_78979528 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Send Google Drive API File Download to OpenAI | Send Google Drive API File Download to OpenAI
I'm trying to send a file from Google Drive to OpenAI API via chat completion
I've already authenticated and I'm able to list files and get the file in question. The Google API returns the data as a Blob.
The problem I'm running into is that when I try to convert the Blob ... | https://stackoverflow.com/questions/78979528/send-google-drive-api-file-download-to-openai | node.js, google-drive-api, openai-api, supabase, deno | 1,726,166,257 |
se_78977010 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Next.js Edge Function: Module Not Found Error ('path') and Internal Server Error When Using OpenAI Integration | Next.js Edge Function: Module Not Found Error ('path') and Internal Server Error When Using OpenAI Integration
Description
I'm encountering an issue where the path module is not being found in my Node.js environment. This problem occurs when trying to send message in the chatbox.
Error Message
Module not found... | https://stackoverflow.com/questions/78977010/next-js-edge-function-module-not-found-error-path-and-internal-server-error | next.js, path, chatbot, openai-api, vercel-ai | 1,726,126,701 |
se_78976210 | stackoverflow | ARTIFICIAL_INTELLIGENCE | issubclass() arg 1 TypeError when importing langchain_openai | issubclass() arg 1 TypeError when importing langchain_openai
Hi I'm working inside Jupyter Notebook.
I run into the following errors when I tried to run
from langchain_openai import ChatOpenAI
The notebook ran successfully on another computer so I'm not sure if some dependencies got messed up.
TypeError ... | https://stackoverflow.com/questions/78976210/issubclass-arg-1-typeerror-when-importing-langchain-openai | jupyter-notebook, openai-api, langchain | 1,726,107,033 |
se_78528368 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI APIConnectionError: Connection error | OpenAI APIConnectionError: Connection error
I consistently receive an openai.APIConnectionError: Connection error message when attempting to use the API, while working on a project with langchain and streamlit.
I have tried debugging it by following through all necessary details related to the error on the openai docu... | https://stackoverflow.com/questions/78528368/openai-apiconnectionerror-connection-error | python, openai-api, streamlit, langchain, vector-database | 1,716,551,188 |
se_77896210 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "Your authentication token is not from a valid issuer." | OpenAI API error: "Your authentication token is not from a valid issuer."
I was following the Andrew Ng course on prompt engineering and there they provided us a codeplayground to play with the code and through there I got this
openai_apikey= "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcHAiLCJzdWIiOiIxNjc0NTM2IiwiYXVk... | https://stackoverflow.com/questions/77896210/openai-api-error-your-authentication-token-is-not-from-a-valid-issuer | openai-api, chatgpt-api | 1,706,471,604 |
se_78952799 | stackoverflow | ARTIFICIAL_INTELLIGENCE | The chatCompletion operation does not work with the specified model gpt-4o-mini | The chatCompletion operation does not work with the specified model gpt-4o-mini
Context
I have below the Python code.
client = AzureOpenAI(
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
api_version = os.getenv('AZURE_OPENAI_API_VERSION'),
azure_endpoint = os.getenv('AZURE_OPENAI_ENDPOINT')
)
messages = ... | https://stackoverflow.com/questions/78952799/the-chatcompletion-operation-does-not-work-with-the-specified-model-gpt-4o-mini | python, openai-api, azure-openai, gpt-4o-mini | 1,725,535,871 |
se_78942031 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain returning answers out of context | Langchain returning answers out of context
I am trying to build a tool where the users can upload a file to my hosted vectorDb in Qdrant and then they can ask question only about that file.
My tech stack includes python, streamlit, langchain, vectordb and openai api.
Right now is working well but if for example I have... | https://stackoverflow.com/questions/78942031/langchain-returning-answers-out-of-context | python, openai-api, large-language-model, py-langchain, vector-database | 1,725,310,818 |
se_78014866 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Open Ai Transcription Api not transcripting full audio in Iphone browser | Open Ai Transcription Api not transcripting full audio in Iphone browser
When I send audio recordings to the OpenAI Whisper API using iphone browser, it only gives starting one or two words of that audio. It working fine on windows, mac and also on android browser but not transcipting whole audio in iphone.
Below is m... | https://stackoverflow.com/questions/78014866/open-ai-transcription-api-not-transcripting-full-audio-in-iphone-browser | openai-api | 1,708,240,193 |
se_78959794 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to convert the result from openai call, convert it into json and write to .txt file? | how to convert the result from openai call, convert it into json and write to .txt file?
I am very new to python and only know the basics, so basically I am calling openai and getting a response in return and want to write that response in a .txt file.
I want to convert the response in json before writing in the file.... | https://stackoverflow.com/questions/78959794/how-to-convert-the-result-from-openai-call-convert-it-into-json-and-write-to-t | python, json, openai-api | 1,725,700,939 |
se_76961751 | stackoverflow | ARTIFICIAL_INTELLIGENCE | next.js 13 build error for private identifiers when using openai 4.0 package | next.js 13 build error for private identifiers when using openai 4.0 package
I added the new 4.0 openai package in my next.js app, i'm using it in the server of the app only and when building i get the error.
- info Linting and checking validity of types .Failed to compile.
./node_modules/openai/src/core.ts:539:3
Typ... | https://stackoverflow.com/questions/76961751/next-js-13-build-error-for-private-identifiers-when-using-openai-4-0-package | node.js, reactjs, next.js, openai-api | 1,692,796,773 |
se_78959524 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using LCEL with Memory | Using LCEL with Memory
I had a LLMChain which I want to change now with LCEL to have proper support for streaming.
My original chain was:
llm_chain = LLMChain(
llm=llm_chat,
prompt=prompt,
output_key="answer",
verbose=False,
)
My updated chain is:
retrieved_chat... | https://stackoverflow.com/questions/78959524/using-lcel-with-memory | python, openai-api, langchain, large-language-model | 1,725,690,986 |
se_78960303 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Flask streaming chat Interface | Flask streaming chat Interface
I’m trying to make a Flask interface for an assistant I have created via the OpenAI API.
The assistant is setup correctly and streams output to a console perfectly. However, I am having a lot of trouble figuring out how to set up a Flask-app to stream the output for the chat bot correctl... | https://stackoverflow.com/questions/78960303/flask-streaming-chat-interface | python, flask, openai-api | 1,725,717,432 |
se_78959767 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Getting an error with OpenAI integration into my Swift app | Getting an error with OpenAI integration into my Swift app
I am trying to make an app to provide a trivia question to the users using top 5 medical journal abstracts and the question will be generated using openAI gpt 3.5 turbo. I keep getting an error in the statement:
let chatQuery = ChatQuery(messages: [message], m... | https://stackoverflow.com/questions/78959767/getting-an-error-with-openai-integration-into-my-swift-app | ios, swift, xcode, openai-api | 1,725,700,092 |
se_78958346 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I import a env file from os to jupyter notebook? | How can I import a env file from os to jupyter notebook?
I am not able to import my API key to my jupyter notebook which is on web browser, I tried importing it shows None. What do I do?
I was excepting the API key to be printed as that is what I tried importing, but it printed None. | https://stackoverflow.com/questions/78958346/how-can-i-import-a-env-file-from-os-to-jupyter-notebook | python, jupyter-notebook, environment-variables, openai-api | 1,725,647,248 |
se_78338438 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Reading Documents Directly from Llama Index as Files Instead of Specifying a Folder Path | Reading Documents Directly from Llama Index as Files Instead of Specifying a Folder Path
I'm using llama index and want to directly read documents as files instead of specifying the folder path as described in the official documentation. The current method assumes that llama index users always have a downloaded file i... | https://stackoverflow.com/questions/78338438/reading-documents-directly-from-llama-index-as-files-instead-of-specifying-a-fol | nlp, openai-api, large-language-model, llama, llama-index | 1,713,329,536 |
se_78823867 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why is occurrence of ** for headings in GPT 4o responses not getting suppressed? | Why is occurrence of ** for headings in GPT 4o responses not getting suppressed?
I am getting response for queries using API that might have headings in answers for GPT 4o. Like below:
**Heading**:\n - Details on the heading…
But I do not want these headings within asterisks or any other formatting.
Adding prompt for ... | https://stackoverflow.com/questions/78823867/why-is-occurrence-of-for-headings-in-gpt-4o-responses-not-getting-suppressed | openai-api, prompt, gpt-4 | 1,722,575,908 |
se_78952522 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to extract information from a photo of a document | How to extract information from a photo of a document
I want to build a simple tool that will allow a user to take a photo of a document and extract information such as date/time and some other information
It is simple to do this through Chat GPT's UI, upload an image, ask it for some information from the document. Bu... | https://stackoverflow.com/questions/78952522/how-to-extract-information-from-a-photo-of-a-document | artificial-intelligence, openai-api, large-language-model | 1,725,531,769 |
se_73822353 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I get word-level timestamps in OpenAI's Whisper ASR? | How can I get word-level timestamps in OpenAI's Whisper ASR?
I use OpenAI's Whisper python lib for speech recognition. How can I get word-level timestamps?
To transcribe with OpenAI's Whisper (tested on Ubuntu 20.04 x64 LTS with an Nvidia GeForce RTX 3090):
conda create -y --name whisperpy39 python==3.9
conda act... | https://stackoverflow.com/questions/73822353/how-can-i-get-word-level-timestamps-in-openais-whisper-asr | python, timestamp, speech-recognition, openai-api, openai-whisper | 1,663,899,326 |
se_78933658 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to provide a cancellation token to AzureOpenAI's ChatClient with streaming API | How to provide a cancellation token to AzureOpenAI's ChatClient with streaming API
I have an Azure FunctionApp written in c# that makes call to Azure Open AI chat completion client.
In my function app, I am using "Azure.AI.OpenAI" library.
If I make API call to generate the response in its entirety and send back s... | https://stackoverflow.com/questions/78933658/how-to-provide-a-cancellation-token-to-azureopenais-chatclient-with-streaming-a | c#, azure, openai-api, azure-openai, cancellation-token | 1,725,049,607 |
se_78950333 | stackoverflow | ARTIFICIAL_INTELLIGENCE | openai.OpenAIError:The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable | openai.OpenAIError:The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
I got the error "openai.OpenAIError: The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable... | https://stackoverflow.com/questions/78950333/openai-openaierrorthe-api-key-client-option-must-be-set-either-by-passing-api-k | python, openai-api, chatgpt-api | 1,725,479,358 |
se_78396642 | stackoverflow | ARTIFICIAL_INTELLIGENCE | module 'openai' has no attribute 'OpenAI' | module 'openai' has no attribute 'OpenAI'
I installed the latest openai version:
pip install openai==1.23.6
then
from openai import OpenAI
I get error
cannot import name 'OpenAI' from 'openai'
From https://pypi.org/project/openai/ openai version 1.23.6 example
import os
from openai import OpenAI
c... | https://stackoverflow.com/questions/78396642/module-openai-has-no-attribute-openai | python, openai-api | 1,714,259,928 |
se_77469966 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0" | OpenAI API error: "You tried to access openai.Completion, but this is no longer supported in openai>=1.0.0"
I want to translate the texts in a csv file into English using the GPT 4 model, but I constantly get the following error. Even though I updated the version, I continue to get the same error.
import ... | https://stackoverflow.com/questions/77469966/openai-api-error-you-tried-to-access-openai-completion-but-this-is-no-longer | python, openai-api, gpt-3 | 1,699,810,798 |
se_77597119 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trying to implement a chatgpt using openai API into an HTML webpage | Trying to implement a chatgpt using openai API into an HTML webpage
I'm trying to use a Python script that calls the OpenAI API to get a response from ChatGPT as it currently stands the Python script works and displays the conversation in the terminal but the assignment requires it to be displayed on my HTML webpage. ... | https://stackoverflow.com/questions/77597119/trying-to-implement-a-chatgpt-using-openai-api-into-an-html-webpage | python, html, openai-api, html-helper | 1,701,661,459 |
se_77857466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | With Langchain, how can I change the OpenAI API key at runtime? | With Langchain, how can I change the OpenAI API key at runtime?
Context
I'm working with Langchain Expression Language (LCEL) in Python.
I'm using the ChatOpenAI class (source code) within a FastAPI API. The code initializes at startup and then the chain is called with various arguments as requests flow in. I want to ... | https://stackoverflow.com/questions/77857466/with-langchain-how-can-i-change-the-openai-api-key-at-runtime | python, fastapi, openai-api, langchain, py-langchain | 1,705,892,559 |
se_77713816 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Gemini API : Error when calling .generate_content(prompt) | Gemini API : Error when calling .generate_content(prompt)
I am rather new to developing with LLMs.
I am trying to write an RAG based app in Streamlit with Gemini's API using google embeddings.
The goal of the app is to retrieve information from PDFs (which is my RAG's knowledge base) when answering the user's requests... | https://stackoverflow.com/questions/77713816/gemini-api-error-when-calling-generate-contentprompt | openai-api, large-language-model, faiss, openaiembeddings, google-gemini | 1,703,510,778 |
se_78936437 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Accessing Custom GPT (https://chat.openai.com/) using Flutter | Accessing Custom GPT (https://chat.openai.com/) using Flutter
I have created my custom GPT on https://chat.openai.com/. Now I want to write a flutter App to chat with this custom GPT. I have used chat_gpt_sdk and is able to communicate with Chat GPT. Unfortunately I am not sure how I can communicate with the Custom GP... | https://stackoverflow.com/questions/78936437/accessing-custom-gpt-https-chat-openai-com-using-flutter | flutter, openai-api | 1,725,155,314 |
se_76879007 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Install the correct onnxruntime for chromadb with pip install | Install the correct onnxruntime for chromadb with pip install
I am trying to install chromadb on my Jupyter notebook (Anaconda) using:
pip install chromadb
I get error:
ERROR: Could not find a version that satisfies the requirement onnxruntime>=1.14.1 (from chromadb) (from versions: 1.2.0, 1.3.0, 1.4.0, 1.5.1, 1.5.2,... | https://stackoverflow.com/questions/76879007/install-the-correct-onnxruntime-for-chromadb-with-pip-install | python, pip, openai-api, vector-database, chromadb | 1,691,698,108 |
se_77124022 | stackoverflow | ARTIFICIAL_INTELLIGENCE | [Error: Invalid URL (POST /v1/chat/completions/)]: React Native/ChatGPT API in Android problem | [Error: Invalid URL (POST /v1/chat/completions/)]: React Native/ChatGPT API in Android problem
I'm building a simple ChatGPT API connection on React Native using Expo, and when i run the app in web browser there's no problem, problem comes when i run it on Android via Expo Go, i got this error:
[Error: Invalid URL (PO... | https://stackoverflow.com/questions/77124022/error-invalid-url-post-v1-chat-completions-react-native-chatgpt-api-in-a | javascript, react-native, expo, openai-api, chatgpt-api | 1,694,995,886 |
se_78931599 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I optimize the data I am embedding to increase vector search result quality? | How can I optimize the data I am embedding to increase vector search result quality?
I am trying to implement semantic/vector search for images.
To do that, I am using gpt-4-mini to analyze an image and create data from it with this prompt:
Your job is to generate json data from a given image.
R... | https://stackoverflow.com/questions/78931599/how-can-i-optimize-the-data-i-am-embedding-to-increase-vector-search-result-qual | typescript, postgresql, openai-api, supabase, openaiembeddings | 1,725,014,860 |
se_77728888 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Return arguments from function calling with OpenAI API when streaming? | Return arguments from function calling with OpenAI API when streaming?
I've made a simple OpenAI API example with function calling. I'm only using function calling to format the response, I'm not calling multiple functions or any external APIs.
When I don't stream the response I can return the function arguments, whic... | https://stackoverflow.com/questions/77728888/return-arguments-from-function-calling-with-openai-api-when-streaming | json, next.js, openai-api | 1,703,793,064 |
se_78915693 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using tools with Azure OpenAI batch jobs | Using tools with Azure OpenAI batch jobs
When I submit a batch job using Azure OpenAI 'Batch jobs' and include 'tools' in the specification of each job, I receive a response that appears to ignore tools specification.
Is there any way to use tools with Azure OpenAI batch jobs? | https://stackoverflow.com/questions/78915693/using-tools-with-azure-openai-batch-jobs | azure, openai-api, pydantic, azure-openai | 1,724,693,845 |
se_78928512 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to set top_k value in Llama cpp Python server | Unable to set top_k value in Llama cpp Python server
I start llama cpp Python server with the command:
python -m llama_cpp.server --model D:\Mistral-7B-Instruct-v0.3.Q4_K_M.gguf --n_ctx 8192 --chat_format functionary
Then I run my Python script which looks like this:
from openai import OpenAI
import json
import reques... | https://stackoverflow.com/questions/78928512/unable-to-set-top-k-value-in-llama-cpp-python-server | python-3.x, openai-api, llama, llama-cpp-python, llamacpp | 1,724,944,385 |
se_76685545 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ChatGPT - a way to determine if a response is "not unknown"? | ChatGPT - a way to determine if a response is "not unknown"?
Right now, there doesn't seem to be a way of determining if response from chatgpt is vague / not known without checking the response content.
import openai
# Set up OpenAI API client
openai.api_key = 'YOUR_API_KEY'
# Defin... | https://stackoverflow.com/questions/76685545/chatgpt-a-way-to-determine-if-a-response-is-not-unknown | openai-api, chatgpt-api | 1,689,319,651 |
se_78915355 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to present the model's response content when using Few-shot prompting with function calling in LangChain and GPT-4 API? | How to present the model's response content when using Few-shot prompting with function calling in LangChain and GPT-4 API?
I referred to an example from LangChain about using few-shot prompting along with function calling for my project. The following code snippet is taken from LangChain's documentation:
from lan... | https://stackoverflow.com/questions/78915355/how-to-present-the-models-response-content-when-using-few-shot-prompting-with-f | python, openai-api, langchain, large-language-model, chatgpt-function-call | 1,724,687,999 |
se_78173243 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Vector store created using existing graph for multiple nodes/labels | Vector store created using existing graph for multiple nodes/labels
Am trying to create vector stores on top of my existing KG using from_existing_graph, (followed tomaz and Saurav Joshi neo4j blog posts) - this method is allowing me to create embedding/vector index only for single label due to which am unable to get... | https://stackoverflow.com/questions/78173243/vector-store-created-using-existing-graph-for-multiple-nodes-labels | neo4j, openai-api, langchain, large-language-model | 1,710,621,497 |
se_78904104 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Progromatically Determine when Azure Open AI Finds no Results in Indexed Documents | How to Progromatically Determine when Azure Open AI Finds no Results in Indexed Documents
When using Azure Open AI and Azure Search service with an index of documents as configured in the "bring your own data" example. How can you programmatically determine if the API call successfully found an answer?
The problem is ... | https://stackoverflow.com/questions/78904104/how-to-progromatically-determine-when-azure-open-ai-finds-no-results-in-indexed | azure, openai-api, azure-cognitive-search, chatgpt-api, azure-openai | 1,724,379,122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.