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_78406505 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Problem with deploying finetuned gemma in AWS sagemaker as an endpoint | Problem with deploying finetuned gemma in AWS sagemaker as an endpoint
I have finetuned a gemma 7b LLM from HuggingFace using Lora and stored the model as a compressed .tar.gz file.
I have finetuned locally in sagemaker.
this is my .tar.gz file structure of finetuned model :
finetuned_gemma/model-00004-of-00004.... | https://stackoverflow.com/questions/78406505/problem-with-deploying-finetuned-gemma-in-aws-sagemaker-as-an-endpoint | amazon-web-services, huggingface-transformers, amazon-sagemaker, large-language-model, gemma | 1,714,456,758 |
se_78408757 | stackoverflow | ARTIFICIAL_INTELLIGENCE | langchain: Using ainvoke while invoking a chain gives error | langchain: Using ainvoke while invoking a chain gives error
I'm trying to use ainvoke while making my function asynchronous.
async def get_result(template, user_question):
prompt = ChatPromptTemplate.from_template(template)
model = mixtral_llm
sql_response = (
RunnablePassthrough.assign(schema=get_... | https://stackoverflow.com/questions/78408757/langchain-using-ainvoke-while-invoking-a-chain-gives-error | python, python-3.x, x86-64, langchain, large-language-model | 1,714,482,769 |
se_78271514 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Large language model (TheBloke/Llama-2-7B-Chat-GPTQ) | Large language model (TheBloke/Llama-2-7B-Chat-GPTQ)
Can someone please list the steps to set up the llama model locally, this model will run without internet on the VM machine.
I am using the below model.
TheBloke/Llama-2-7B-Chat-GPTQ.
I tried the text generation method but I don't know how to connect it in Python co... | https://stackoverflow.com/questions/78271514/large-language-model-thebloke-llama-2-7b-chat-gptq | large-language-model, llama | 1,712,201,384 |
se_78377343 | stackoverflow | ARTIFICIAL_INTELLIGENCE | converting json data to vector for better langchain chatbot results | converting json data to vector for better langchain chatbot results
im creating a chatbot for my university website as a project.
for the last 3 days i've been searching all over the internet how to use Langchain with json data such that my chatbot is fast. i came up with this:
from langchain_google_genai import ChatG... | https://stackoverflow.com/questions/78377343/converting-json-data-to-vector-for-better-langchain-chatbot-results | python, json, nlp, langchain, large-language-model | 1,713,950,979 |
se_78354136 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Send a Streaming Response via LlamaIndex to a FastAPI Endpoint? | How to Send a Streaming Response via LlamaIndex to a FastAPI Endpoint?
I need to send a streaming response using LlamaIndex to my FastAPI endpoint. Below is the code I've written so far:
@bot_router.post("/bot/pdf_convo")
async def pdf_convo(query: QuestionInput):
chat_engine = cache["chat_engine"]
user_questi... | https://stackoverflow.com/questions/78354136/how-to-send-a-streaming-response-via-llamaindex-to-a-fastapi-endpoint | python, nlp, openai-api, large-language-model, llama-index | 1,713,534,556 |
se_77605224 | stackoverflow | ARTIFICIAL_INTELLIGENCE | cannot pickle '_thread.RLock' object while serializing FAISS object | cannot pickle '_thread.RLock' object while serializing FAISS object
I am trying to create a langchain model. I got OpenAI setup and embedded some data through URLS in a FAISS object. But I am unable to pickle the objects and getting an error saying that it contains '_thread.Rlock'. After I got to know that, it... | https://stackoverflow.com/questions/77605224/cannot-pickle-thread-rlock-object-while-serializing-faiss-object | python, pickle, langchain, large-language-model, faiss | 1,701,769,854 |
se_78391934 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I use Google's Gemini with a large amount of external data quickly? | How do I use Google's Gemini with a large amount of external data quickly?
I am using Gemini to analyze a vast amount of feedback data from customers. I want to ask the model questions like "what are the most common complaints?" and "what do customers like about our services?".
I am currently just prefixing the pr... | https://stackoverflow.com/questions/78391934/how-do-i-use-googles-gemini-with-a-large-amount-of-external-data-quickly | large-language-model, google-gemini | 1,714,149,940 |
se_78271686 | stackoverflow | ARTIFICIAL_INTELLIGENCE | "Text Input in Streamlit Removes Entered Text Upon Hitting Enter Key: How to Fix?" | "Text Input in Streamlit Removes Entered Text Upon Hitting Enter Key: How to Fix?"
the input stored in user_question i need when press enter the txt in textbox getting clear and the output displing what can i did i tried js and streamlit function but when enter input and press send btn or press enter no outp... | https://stackoverflow.com/questions/78271686/text-input-in-streamlit-removes-entered-text-upon-hitting-enter-key-how-to-fix | python, nlp, artificial-intelligence, streamlit, large-language-model | 1,712,205,118 |
se_78390576 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Estimating Token Consumption and Response Token Count in Databricks using dbrx-instruct | Estimating Token Consumption and Response Token Count in Databricks using dbrx-instruct
I'm trying to understand how to estimate the token consumption and response token count in Databricks using dbrx-instruct. I want to create a function that can predict the number of tokens I'll be requesting based on my query and h... | https://stackoverflow.com/questions/78390576/estimating-token-consumption-and-response-token-count-in-databricks-using-dbrx-i | databricks, large-language-model | 1,714,135,780 |
se_78381104 | stackoverflow | ARTIFICIAL_INTELLIGENCE | FileManager.default.copyItem throws error "The file doesn't exist" | FileManager.default.copyItem throws error "The file doesn't exist"
I am a beginner at SwiftUI and my practice code repo is here. I am trying to use LLMFarm Core to create a local LLM. While trying to run this code
try FileManager.default.copyItem(atPath: temporaryURL.path, toPath: fileURL.path)
I'm getti... | https://stackoverflow.com/questions/78381104/filemanager-default-copyitem-throws-error-the-file-doesnt-exist | ios, swift, large-language-model | 1,713,991,258 |
se_77475671 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain UnstructuredURLLoader shows Libmagic Unavailble | Langchain UnstructuredURLLoader shows Libmagic Unavailble
Attempting to use UnstructuredURLLoader but getting a 'libmagic is unavailable'.
I have:
Install langchain
Install unstructured libmagic python-magic python-magic-bin
Install python-magic-bin==0.4.13
python_magic-0.4.13-py2.py3-none-any.whl (I even tried other... | https://stackoverflow.com/questions/77475671/langchain-unstructuredurlloader-shows-libmagic-unavailble | python, loader, langchain, large-language-model, libmagic | 1,699,895,803 |
se_78219840 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Langchain LLM model that query and provide response based on json | Langchain LLM model that query and provide response based on json
Im planning to develop an langchain that will take user input and provide them with url related to their request.
My data format is in json (its around 35 pages)
{ page_name:{data:"",url:""}, .. }
data is the content in that page
url is the path
I tri... | https://stackoverflow.com/questions/78219840/langchain-llm-model-that-query-and-provide-response-based-on-json | python, langchain, large-language-model, google-gemini | 1,711,377,278 |
se_78354052 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trying to deploy a Custom Model into OpenSearch throws a RuntimeError: KeyError: token_type_ids | Trying to deploy a Custom Model into OpenSearch throws a RuntimeError: KeyError: token_type_ids
For a specific use case, I had to deploy a custom model into OpenSearch, First of the all, I exported a HuggingFace Model into TorchScript and had registered successfully then I tried to deploy it but unfortunately deploy o... | https://stackoverflow.com/questions/78354052/trying-to-deploy-a-custom-model-into-opensearch-throws-a-runtimeerror-keyerror | machine-learning, artificial-intelligence, large-language-model, opensearch, huggingface | 1,713,533,778 |
se_78383583 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Training a LLM to execute functions | Training a LLM to execute functions
I want develop a chatbot that is able to perform actions and answer questions in a given Smart Home environment.
I am curious how to do this with an LLM. How can I customize/train a model to execute code?
Just a simple example: When I tell the chatbot "turn on the light in the livin... | https://stackoverflow.com/questions/78383583/training-a-llm-to-execute-functions | python, machine-learning, nlp, chatbot, large-language-model | 1,714,036,987 |
se_78375860 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Phi-3 can't deal with Japanese. How can I solve this issue? | Phi-3 can't deal with Japanese. How can I solve this issue?
I enjoy Phi-3 which Microsoft made.
I meet the error of onnxruntime_genai. onnxruntime_genai is library of Phi-3.
How can I solve this issue ?
import onnxruntime_genai as og
list_error = [234, 170, 132, 233, 161, 147, 232, 146, 145, 174, 152, 183, 141, 1... | https://stackoverflow.com/questions/78375860/phi-3-cant-deal-with-japanese-how-can-i-solve-this-issue | python, large-language-model | 1,713,929,946 |
se_77760091 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM Application throwing Error for the RAG Approach | LLM Application throwing Error for the RAG Approach
I was doing the example as per the explanation here - https://www.linkedin.com/pulse/get-insight-from-your-business-data-build-llm-application-jain/
I have tried the RetrievalQA Chain as per the example. Only change is instead of PDF loader I have CSV file and I used... | https://stackoverflow.com/questions/77760091/llm-application-throwing-error-for-the-rag-approach | python, large-language-model | 1,704,388,753 |
se_78347352 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to make conversationalretrievalchain to include metadata in the prompt using langchain with chromadb to make the LLM aware of metadata? | how to make conversationalretrievalchain to include metadata in the prompt using langchain with chromadb to make the LLM aware of metadata?
im trying to do a bot that answer questions from a chromadb , i have stored multiple pdf files with metadata like the filename and candidate name , my problem is when i use conver... | https://stackoverflow.com/questions/78347352/how-to-make-conversationalretrievalchain-to-include-metadata-in-the-prompt-using | python, openai-api, langchain, large-language-model | 1,713,442,338 |
se_78355357 | stackoverflow | ARTIFICIAL_INTELLIGENCE | LLM prompt chain does not behave as expected | LLM prompt chain does not behave as expected
I'm trying to rephrase wording of an original text, and translate that into desirable language.
For that purpose, I decided to use chains on LangChain.
Although, the output is always rephrased, it is never translated.
The key code snippets are as below.
# Define the ChatPro... | https://stackoverflow.com/questions/78355357/llm-prompt-chain-does-not-behave-as-expected | python, openai-api, langchain, large-language-model | 1,713,547,732 |
se_78358083 | stackoverflow | ARTIFICIAL_INTELLIGENCE | The LSTM training model predicts results that consistently form a horizontal line without any amplitude | The LSTM training model predicts results that consistently form a horizontal line without any amplitude
The code of LSTM models:
class Net(nn.Module):
def __init__(self,input_size,hidden_size,num_layers,output_size,batch_size,seq_length) -> None:
super(Net,self).__init__()
self.input_size=input_siz... | https://stackoverflow.com/questions/78358083/the-lstm-training-model-predicts-results-that-consistently-form-a-horizontal-lin | deep-learning, lstm, recurrent-neural-network, large-language-model | 1,713,613,974 |
se_78357335 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to add streaming to my gradio chatbot when using Llama cpp pyhton with langchain | How to add streaming to my gradio chatbot when using Llama cpp pyhton with langchain
I am integrating Llama Cpp Python library to run huggingface LLMs on local, I am able to generate the output of text but i would like to add streaming to my chatbot so as soon as the generation is started gradio starts to get text.
He... | https://stackoverflow.com/questions/78357335/how-to-add-streaming-to-my-gradio-chatbot-when-using-llama-cpp-pyhton-with-langc | python, langchain, large-language-model, gradio, llama-cpp-python | 1,713,597,446 |
se_78005051 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ModuleNotFoundError: No module named 'llama_index.graph_stores' | ModuleNotFoundError: No module named 'llama_index.graph_stores'
I am trying to use the NebulaGraphStore class from llama_index via from llama_index.graph_stores.nebula import NebulaGraphStore as suggested by the llama_index documentation, but the following error occurred:
ModuleNotFoundError ... | https://stackoverflow.com/questions/78005051/modulenotfounderror-no-module-named-llama-index-graph-stores | python, langchain, large-language-model, llama-index, nebula-graph | 1,708,054,338 |
se_77901752 | stackoverflow | ARTIFICIAL_INTELLIGENCE | 429 - Openai API Rate limit error with no usuage | 429 - Openai API Rate limit error with no usuage
I am recieving the following error. However, when I check my usuage on API dashboard, it says nothing and I have not used any credits. I am not sure why is this error occuring.. I am not even sure if the Quota resets monthly. What can I do about it?
openai.RateLimitErro... | https://stackoverflow.com/questions/77901752/429-openai-api-rate-limit-error-with-no-usuage | openai-api, rate-limiting, large-language-model, http-status-code-429 | 1,706,551,425 |
se_78356146 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Finetuned quantized model is hallucinating. How to reduce hallucination from quantized finetuned model? | Finetuned quantized model is hallucinating. How to reduce hallucination from quantized finetuned model?
Problem:
I have fine-tuned an open source LLM model (Falcon-7b-sharded) using PEFT finetuning technique. But the output of the model is not satisfactory. The model seems to hallucinate. How can the output be improve... | https://stackoverflow.com/questions/78356146/finetuned-quantized-model-is-hallucinating-how-to-reduce-hallucination-from-qua | python, gpu, chatbot, huggingface-transformers, large-language-model | 1,713,560,335 |
se_79836446 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Open-WebUI Not Detecting Model from lama.cpp | Open-WebUI Not Detecting Model from lama.cpp
I have Open-WebUI running in Docker and connected it to the lama.cpp server API.
I followed the instructions from this URL:
https://docs.openwebui.com/tutorials/integrations/deepseekr1-dynamic/#step-1-install-llamacpp
The API connection is successful; I receive a valid resp... | https://stackoverflow.com/questions/79836446/open-webui-not-detecting-model-from-lama-cpp | openai-api, llamacpp | 1,764,725,998 |
se_79930338 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use AI as programmer | How to use AI as programmer
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically. | https://stackoverflow.com/questions/79930338/how-to-use-ai-as-programmer | artificial-intelligence, openai-api, claude | 1,776,891,414 |
se_77709076 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Certificate verify error while using the Anthropic client SDK | Certificate verify error while using the Anthropic client SDK
I am trying to use the Anthropic client SDK to call the API and get the below error.
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self
signed certificate in certificate chain (_ssl.c:1129)
How can I overcome this? | https://stackoverflow.com/questions/77709076/certificate-verify-error-while-using-the-anthropic-client-sdk | openai-api, large-language-model, claude | 1,703,366,114 |
se_79966853 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I implement per-user AI API cost limits without adding latency to every request? | How do I implement per-user AI API cost limits without adding latency to every request?
I'm building a web app where end users make calls to the OpenAI API. I want to set monthly spend limits per user tier (e.g. free users get $0.50/month, paid users get $10/month) and block users who exceed their limit.
My first appr... | https://stackoverflow.com/questions/79966853/how-do-i-implement-per-user-ai-api-cost-limits-without-adding-latency-to-every-r | next.js, serverless, openai-api, supabase, rate-limiting | 1,782,393,793 |
se_76040306 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt' | ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt'
I'd like to use ChatGPTLLMPredictor from llama_index.langchain_helpers.chatgpt, but I got an error below on M1 Macbook Air.
ModuleNotFoundError: No module named 'llama_index.langchain_helpers.chatgpt'
My code looks like this and line... | https://stackoverflow.com/questions/76040306/modulenotfounderror-no-module-named-llama-index-langchain-helpers-chatgpt | python, python-3.x, openai-api, chatgpt-api, llama-index | 1,681,779,242 |
se_79962250 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Can anyone tell me how I could do this? | Can anyone tell me how I could do this?
I need to build an AI agent, preferably in Python, that performs end-to-end testing of a web application. The idea is that the agent can automatically explore the web app, generate its own test scenarios, execute them, and produce a detailed report of what works and what doesn't... | https://stackoverflow.com/questions/79962250/can-anyone-tell-me-how-i-could-do-this | python, web-applications, playwright, openai-api, testautomationfx | 1,781,710,214 |
se_78056561 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How are tools passed to llm? (final prompt sent to openai chat model) | How are tools passed to llm? (final prompt sent to openai chat model)
When using the openai chat api, we send an array of messages and tools. How are they assembled into a single prompt?
System:
Tools:
User:
Assistant:
User:
I tried setting langchain.debug = True, but I don't see the tools being passed to the llm.
fr... | https://stackoverflow.com/questions/78056561/how-are-tools-passed-to-llm-final-prompt-sent-to-openai-chat-model | nlp, openai-api, langchain | 1,708,875,186 |
se_79894013 | stackoverflow | ARTIFICIAL_INTELLIGENCE | MessageChatMemoryAdvisor stores raw JSON response when using JSON_OBJECT response format, causing context loss on conversation reload | MessageChatMemoryAdvisor stores raw JSON response when using JSON_OBJECT response format, causing context loss on conversation reload
Spring AI Version: 1.0.0
Java Version: 21
Model: OpenAI GPT-4o
When using ResponseFormat.Type.JSON_OBJECT with MessageChatMemoryAdvisor and JdbcChatMemoryRepository,the advisor stores t... | https://stackoverflow.com/questions/79894013/messagechatmemoryadvisor-stores-raw-json-response-when-using-json-object-respons | spring, openai-api, spring-ai | 1,771,771,375 |
se_78668431 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I get my AI chatbot to remember past answers? | How can I get my AI chatbot to remember past answers?
I have a problem that I have been struggling with for a long time. In my small pet project, I am creating a chatbot that could respond using data from the database, as well as tools for currency conversion. The problem is that there is no way I can add to it the ab... | https://stackoverflow.com/questions/78668431/how-can-i-get-my-ai-chatbot-to-remember-past-answers | python, openai-api, streamlit, large-language-model, langchain-agents | 1,719,331,284 |
se_76441686 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ValidationError for trying to use langchain with ChatOpenAI() | ValidationError for trying to use langchain with ChatOpenAI()
I am newbie to LLM and I have been trying to implement recent deep learning tutorial in my notebook. I have set an openai.api_key="sk-xxxxxxxx". This key works perfectly when prompting and getting output from GPT, but the problem arises when I import langch... | https://stackoverflow.com/questions/76441686/validationerror-for-trying-to-use-langchain-with-chatopenai | python-3.x, openai-api, langchain, py-langchain | 1,686,324,557 |
se_79918935 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get started with building a simple LLM-based models using Python? | How to get started with building a simple LLM-based models using Python?
How to start learning llms ,any video suggestion or guidline for a beginner. I’m a beginner in machine learning with basic Python knowledge.
I want to start learning about LLMs creations.
So far I have:
Learned basic Python
Read about transformer... | https://stackoverflow.com/questions/79918935/how-to-get-started-with-building-a-simple-llm-based-models-using-python | artificial-intelligence, openai-api, large-language-model, ml | 1,775,123,284 |
se_79850479 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Is it possible to create a custom GPT and connect it to external services like Notion? | Is it possible to create a custom GPT and connect it to external services like Notion?
Is it possible to create a custom GPT and connect it with available connectors?
I want to create a GPT that can create and read documents in Notion, basically acting like a second memory/brain. The idea is to tell it things I learn ... | https://stackoverflow.com/questions/79850479/is-it-possible-to-create-a-custom-gpt-and-connect-it-to-external-services-like-n | artificial-intelligence, openai-api, langchain, chatgpt-api, gpt-4 | 1,766,073,158 |
se_77413194 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to increase the code view box size of ChatGPT web interface | How to increase the code view box size of ChatGPT web interface
It is frustrating how small the code viewing is in ChatGPT and to make the matters worse it has a fixed width that does not change with the size of the browser window.
A temporary solution is this bookmarklet to maximize all the elements:
Create a bookmar... | https://stackoverflow.com/questions/77413194/how-to-increase-the-code-view-box-size-of-chatgpt-web-interface | openai-api | 1,698,963,677 |
se_79758871 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to send file input (PDF/Excel) to OpenRouter Chat Completions API? | How to send file input (PDF/Excel) to OpenRouter Chat Completions API?
I’m building a Next.js API route to connect with the OpenRouter Chat Completions API.
For text-only messages, everything works fine. For images, sending them as image_url also works:
content: [
{ type: 'text', text: "Describe this image" },
{ t... | https://stackoverflow.com/questions/79758871/how-to-send-file-input-pdf-excel-to-openrouter-chat-completions-api | typescript, openai-api, next.js14, next.js15, openrouter | 1,757,334,247 |
se_79582388 | stackoverflow | ARTIFICIAL_INTELLIGENCE | VS Code AI chat consumes too many OpenAI tokens — is this expected? | VS Code AI chat consumes too many OpenAI tokens — is this expected?
I'm trying to use the AI-powered agent chat feature in VS Code (the built-in AI assistant). I'm using my own OpenAI API key (gpt-4o, gpt-4.1) and the chat works in general — but I'm seeing extremely high token usage and I'm not able to work more than ... | https://stackoverflow.com/questions/79582388/vs-code-ai-chat-consumes-too-many-openai-tokens-is-this-expected | visual-studio-code, openai-api | 1,745,065,664 |
se_79923286 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI RAG LangChain tool calling is not working/compatible with withStructuredOutput()? | OpenAI RAG LangChain tool calling is not working/compatible with withStructuredOutput()?
I have a OpenAI model with Retrieval-Augmented Generation (RAG):
import {OpenAIEmbeddingFunction} from "@chroma-core/openai";
import chromaClient from "../config/chromadb";
import {tool} from "@langchain/core/tools";
import {Chrom... | https://stackoverflow.com/questions/79923286/openai-rag-langchain-tool-calling-is-not-working-compatible-with-withstructuredo | node.js, openai-api, langchain, rag, tool-calling | 1,775,796,396 |
se_79646075 | stackoverflow | ARTIFICIAL_INTELLIGENCE | difflib.SequenceMatcher suddenly returns different similarity ratio without code or environment changes | difflib.SequenceMatcher suddenly returns different similarity ratio without code or environment changes
We're using Python’s difflib.SequenceMatcher to compare strings in a production system. Here's the simplified relevant code:
from difflib import SequenceMatcher
similarity = SequenceMatcher(
None,
normaliz... | https://stackoverflow.com/questions/79646075/difflib-sequencematcher-suddenly-returns-different-similarity-ratio-without-code | python, openai-api, difflib, sequencematcher | 1,748,637,953 |
se_79920358 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use Structured Output in Open AI Response API Create Response | How to use Structured Output in Open AI Response API Create Response
Open AI API Create a model response says it can enable Structured Output but cannot find the way to provide the JSON schema for the output to use.
Configuring { "type": "json_schema" } enables Structured Outputs
Open AI document - Structured model ... | https://stackoverflow.com/questions/79920358/how-to-use-structured-output-in-open-ai-response-api-create-response | openai-api, open-ai-response-api | 1,775,367,527 |
se_79921243 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Looking for a reliable and cost-effective token relay for GPT/Claude/Gemini API | Looking for a reliable and cost-effective token relay for GPT/Claude/Gemini API
I'm developing an AI application that uses GPT-5.4 and Claude-sonnet-4-6. The official API costs are too high for my scale (thousands of requests per day). I've heard about token relay services that resell API access at much lower prices
D... | https://stackoverflow.com/questions/79921243/looking-for-a-reliable-and-cost-effective-token-relay-for-gpt-claude-gemini-api | token, openai-api, claude | 1,775,527,421 |
se_79920345 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Does ordering for different roles like system, user, assistant... matter when calling chat completion api? Can I have system prompts in between? | Does ordering for different roles like system, user, assistant... matter when calling chat completion api? Can I have system prompts in between?
Does ordering for different roles like system, user, assistant... matter when calling chat completion api?
Traditionally:
await openai.chat.completions.create({
model: pe... | https://stackoverflow.com/questions/79920345/does-ordering-for-different-roles-like-system-user-assistant-matter-when-ca | chatbot, openai-api, large-language-model | 1,775,362,949 |
se_79897528 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Realtime API via WebRTC receives random voice input when user is silent – possible speaker echo or background noise | OpenAI Realtime API via WebRTC receives random voice input when user is silent – possible speaker echo or background noise
Problem
I'm building a Flutter app using the OpenAI Realtime API over WebRTC (with flutter_webrtc) for live voice chat. The system often receives and transcribes user speech when nobody is speakin... | https://stackoverflow.com/questions/79897528/openai-realtime-api-via-webrtc-receives-random-voice-input-when-user-is-silent | flutter, webrtc, openai-api, flutter-webrtc, echo-cancellation | 1,772,166,010 |
se_79919543 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Need to design a pdf batch file processsing system | Need to design a pdf batch file processsing system
I get around 100,000 pdf files (1-50MB each) a month. We get file IDs, pull and parse files, build chunks, embed them, and store documents + vectors for semantic search.
What can be the best design for processing these files in batch, speed is a major concern me.
How ... | https://stackoverflow.com/questions/79919543/need-to-design-a-pdf-batch-file-processsing-system | azure, vector, architecture, openai-api, azure-document-intelligence | 1,775,214,049 |
se_77890911 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY env variable" | OpenAI API error: "The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY env variable"
I'm a little confused about using OpenAI in Python and need a little help to make this code work. I tried several solutions found on StackOverflow, none of them are ... | https://stackoverflow.com/questions/77890911/openai-api-error-the-api-key-client-option-must-be-set-either-by-passing-api-k | python, environment-variables, openai-api, api-key, gpt-3 | 1,706,352,728 |
se_79918080 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure OpenAI Realtime API: Token usage from `response.done` event does not match Azure Cost Management meter data | Azure OpenAI Realtime API: Token usage from `response.done` event does not match Azure Cost Management meter data
Problem
I'm using the Azure OpenAI Realtime API (gpt-realtime-mini-2025-12-15) via the .NET OpenAI.Realtime SDK to measure token consumption. The response.done server event includes a usage object with a d... | https://stackoverflow.com/questions/79918080/azure-openai-realtime-api-token-usage-from-response-done-event-does-not-match | azure, openai-api, azure-openai, azure-cost-calculation | 1,775,001,990 |
se_79918066 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Moderation API returns 429 Too Many Requests even with no prior usage | OpenAI Moderation API returns 429 Too Many Requests even with no prior usage
I’m trying to use the OpenAI Moderation API for text moderation, but every request returns a 429 Too Many Requests error — even though I haven’t made any prior requests with this API key.
Error response:
{
"error": {
"message": "Too Man... | https://stackoverflow.com/questions/79918066/openai-moderation-api-returns-429-too-many-requests-even-with-no-prior-usage | openai-api | 1,774,998,138 |
se_76232902 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to incrementally build index using chatgpt dev api | How to incrementally build index using chatgpt dev api
I am using chatgpt dev api to train a model on my custom data but I need to incrementally train it as it would not be ideal to create the index on all docs every time some new data is added as the cost would be calculated on the the complete list of docs so what i... | https://stackoverflow.com/questions/76232902/how-to-incrementally-build-index-using-chatgpt-dev-api | openai-api, chatgpt-api | 1,683,861,565 |
se_79598199 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Chaining multiple GPT-4 Turbo API calls with function calling and dynamic memory/context injection | Chaining multiple GPT-4 Turbo API calls with function calling and dynamic memory/context injection
I'm working on a modular pipeline using OpenAI's GPT-4 Turbo (via /v1/chat/completions) that involves multi-step prompt chains. Each step has a specific role (e.g., intent detection → function execution → summarization →... | https://stackoverflow.com/questions/79598199/chaining-multiple-gpt-4-turbo-api-calls-with-function-calling-and-dynamic-memory | python, artificial-intelligence, openai-api | 1,745,924,515 |
se_79912858 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why does the first response in my OpenAI Realtime C# session show cached token usage (cached_input_tokens) even though no prior context exists? | Why does the first response in my OpenAI Realtime C# session show cached token usage (cached_input_tokens) even though no prior context exists?
I'm working with the OpenAI.Realtime C# SDK and logging detailed token‑usage metrics for a multi‑turn audio conversation. My setup is based on a custom RealtimeScenarioBase cl... | https://stackoverflow.com/questions/79912858/why-does-the-first-response-in-my-openai-realtime-c-session-show-cached-token-u | c#, .net, openai-api, azure-openai | 1,774,276,797 |
se_76421921 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using GPT 4 or GPT 3.5 with SQL Database Agent throws OutputParserException: Could not parse LLM output: | Using GPT 4 or GPT 3.5 with SQL Database Agent throws OutputParserException: Could not parse LLM output:
I am using the SQL Database Agent to query a postgres database. I want to use gpt 4 or gpt 3.5 models in the OpenAI llm passed to the agent, but it says I must use ChatOpenAI. Using ChatOpenAI throws parsing errors... | https://stackoverflow.com/questions/76421921/using-gpt-4-or-gpt-3-5-with-sql-database-agent-throws-outputparserexception-cou | openai-api, gpt-3, langchain, gpt-4 | 1,686,130,843 |
se_77271033 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Resource not found error when running miscrosoft semantic-kernel | Resource not found error when running miscrosoft semantic-kernel
I am getting the following error when trying to run semantic-kernel using azure open ai
Error: (<ErrorCodes.ServiceError: 6>, 'OpenAI service failed to complete the chat', InvalidRequestError(message='Resource not found', param=None, code='404', http_sta... | https://stackoverflow.com/questions/77271033/resource-not-found-error-when-running-miscrosoft-semantic-kernel | python, azure, openai-api, azure-openai, semantic-kernel | 1,697,009,803 |
se_72028213 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI example code errors with "Await is only valid in async functions and the top level bodies of modules" | OpenAI example code errors with "Await is only valid in async functions and the top level bodies of modules"
Apologies if this seems simple. I'm relatively new to this.
As said in the title, I get the error "Await is only valid in async functions and the top level bodies of modules". I'm confused because fro... | https://stackoverflow.com/questions/72028213/openai-example-code-errors-with-await-is-only-valid-in-async-functions-and-the | javascript, node.js, openai-api | 1,651,060,256 |
se_79833481 | stackoverflow | ARTIFICIAL_INTELLIGENCE | RAG with Pinecone + GPT-5 for generating new math problems: incoherent outputs, mixed chunks, and lack of originality | RAG with Pinecone + GPT-5 for generating new math problems: incoherent outputs, mixed chunks, and lack of originality
I’m building a tool that generates new mathematics exam problems using an internal database of past problems.
My current setup uses a RAG pipeline, Pinecone as the vector database, and GPT-5 as the LLM... | https://stackoverflow.com/questions/79833481/rag-with-pinecone-gpt-5-for-generating-new-math-problems-incoherent-outputs | openai-api, large-language-model, vector-database, rag, pinecone | 1,764,444,121 |
se_79387281 | stackoverflow | ARTIFICIAL_INTELLIGENCE | how to do call recording using livekit egress without amazon s3 or gcp or azure? | how to do call recording using livekit egress without amazon s3 or gcp or azure?
How can I record calls using LiveKit Egress without integrating with cloud services like Amazon S3, GCP, or Azure? Is there a way to implement this recording process using alternative storage options or local storage? Please provide a det... | https://stackoverflow.com/questions/79387281/how-to-do-call-recording-using-livekit-egress-without-amazon-s3-or-gcp-or-azure | python, openai-api, livekit, egress | 1,737,829,924 |
se_78836024 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Efficiently Maintaining Chat Context with GenAI API (GPT, Claude) Without Resending All Prompts | Efficiently Maintaining Chat Context with GenAI API (GPT, Claude) Without Resending All Prompts
I'm using the GenAI API (GPT, Claude) to create a conversational AI that handles multi-turn dialogues. My goal is to maintain the context of the conversation without resending all previous prompts with each new request, as ... | https://stackoverflow.com/questions/78836024/efficiently-maintaining-chat-context-with-genai-api-gpt-claude-without-resend | python, artificial-intelligence, chat, openai-api | 1,722,884,044 |
se_75922009 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Trying to retrieve messages from Telegram group using Telethon and receiving error 'Cannot find any entity corresponding to 'test chat' | Trying to retrieve messages from Telegram group using Telethon and receiving error 'Cannot find any entity corresponding to 'test chat'
I am trying to send messages retrieved from a channel on Telegram to chatgpt but when I run the code i keep getting this error :
ValueError: Cannot find any entity corresp... | https://stackoverflow.com/questions/75922009/trying-to-retrieve-messages-from-telegram-group-using-telethon-and-receiving-err | python, telegram, telethon, openai-api | 1,680,541,394 |
se_79892835 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Data processing and automation of template filling | Data processing and automation of template filling
I need to automate marketplace template filling from supplier product tables.
Input:
- data: list[dict] or pandas DataFrame with product rows
- templates_info: list of templates with id + cols_info (rules for each output field)
Output:
- one JSON per product, strictly... | https://stackoverflow.com/questions/79892835/data-processing-and-automation-of-template-filling | excel, artificial-intelligence, openai-api, bulk, openai-agents | 1,771,582,474 |
se_79891731 | stackoverflow | ARTIFICIAL_INTELLIGENCE | what did perplexity ai do that chatgpt didnt have at that time for it to become popular and how can someone find such gaps | what did perplexity ai do that chatgpt didnt have at that time for it to become popular and how can someone find such gaps
What specific features or capabilities did Perplexity AI introduce that ChatGPT did not have at that time which helped it gain rapid popularity, and what practical methods can developers or founde... | https://stackoverflow.com/questions/79891731/what-did-perplexity-ai-do-that-chatgpt-didnt-have-at-that-time-for-it-to-become | openai-api, perplexity | 1,771,435,759 |
se_78023750 | stackoverflow | ARTIFICIAL_INTELLIGENCE | use embeddings stored in vector db to reduce work for LLM generating response | use embeddings stored in vector db to reduce work for LLM generating response
I'm trying to understand what the correct strategy is for storing and using embeddings in a vector database, to be used with an LLM. If my goal is to reduce the amount of work the LLM has to do when generating a response, (So you can think ... | https://stackoverflow.com/questions/78023750/use-embeddings-stored-in-vector-db-to-reduce-work-for-llm-generating-response | openai-api, langchain, large-language-model, vector-database | 1,708,379,938 |
se_79887759 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to run multiple ChatGPT codex sessions on a single source code | How to run multiple ChatGPT codex sessions on a single source code
What is a way to have multiple codex sessions (one account) working on different branches of a project at the same time to manage multiple tasks without conflict using Codex. I am using VsCode. | https://stackoverflow.com/questions/79887759/how-to-run-multiple-chatgpt-codex-sessions-on-a-single-source-code | visual-studio-code, openai-api, openai-codex | 1,770,849,412 |
se_79879409 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How do I include encrypted reasoning items when using C# OpenAIClient Responses API and Microsoft.Extensions.AI and doing a stateless session? | How do I include encrypted reasoning items when using C# OpenAIClient Responses API and Microsoft.Extensions.AI and doing a stateless session?
I have figured out how to enable a stateless session using the C# client by setting store to false in ChatOptions like this (StoredOutputEnabled = false):
IChatClient c... | https://stackoverflow.com/questions/79879409/how-do-i-include-encrypted-reasoning-items-when-using-c-openaiclient-responses | c#, openai-api | 1,769,777,436 |
se_79867418 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI Realtime Proper way to truncate a live streaming conversation on speech interruption Twilio media streams | OpenAI Realtime Proper way to truncate a live streaming conversation on speech interruption Twilio media streams
I’m implementing a real-time voice call flow using Twilio Media Streams connected to a bidirectional WebSocket service that generates and streams audio responses back to the caller.
The call flow is roughly... | https://stackoverflow.com/questions/79867418/openai-realtime-proper-way-to-truncate-a-live-streaming-conversation-on-speech-i | python, twilio, real-time, openai-api | 1,768,353,599 |
se_79801693 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I configure a custom OpenAI-compatible model in Continue.dev? | How can I configure a custom OpenAI-compatible model in Continue.dev?
I'm trying to configure a Z.ai GLM model in the Continue.dev Visual Studio Code extension, but the model doesn't appear in the dropdown menu, despite having what appears to be a correct configuration.
My current configuration
I have the following in... | https://stackoverflow.com/questions/79801693/how-can-i-configure-a-custom-openai-compatible-model-in-continue-dev | vscode-extensions, openai-api | 1,761,560,065 |
se_79876802 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to properly retrieve context in an OpenAI Realtime conversation using response.create | How to properly retrieve context in an OpenAI Realtime conversation using response.create
I’m trying to generate an out-of-band response in Realtime OpenAI using response.create without appending to the default conversation. I want to summarize the conversation and output the client’s sentiment, but every time I send:... | https://stackoverflow.com/questions/79876802/how-to-properly-retrieve-context-in-an-openai-realtime-conversation-using-respon | python, real-time, openai-api | 1,769,479,448 |
se_79878117 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI GPT-5 Javascript code to translate subtitle .SRT file -- API Timeout | OpenAI GPT-5 Javascript code to translate subtitle .SRT file -- API Timeout
I'm trying to translate Japanese subtitles to English using the openAI API. The following code works if the subtitle file is very short, but for more than a ~100 lines I get a APIConnectionTimeoutError: Request timed out.
In order for it to wo... | https://stackoverflow.com/questions/79878117/openai-gpt-5-javascript-code-to-translate-subtitle-srt-file-api-timeout | openai-api, translate, gpt-5 | 1,769,617,876 |
se_77494703 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to generate description for image using Chat GPT API using "gpt-4-vision-preview" in Laravel? | How to generate description for image using Chat GPT API using "gpt-4-vision-preview" in Laravel?
Here's with this code i want to generate description for the provided image with the help of Chat GPT API using "gpt-4-vision-preview" model. But the cide is not working. Please help.
<?php
namespace App\Http\C... | https://stackoverflow.com/questions/77494703/how-to-generate-description-for-image-using-chat-gpt-api-using-gpt-4-vision-pre | php, laravel, openai-api, chatgpt-api, chat-gpt-4 | 1,700,136,859 |
se_79783362 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to stream responses token-by-token from OpenAI ChatGPT API using Python? | How to stream responses token-by-token from OpenAI ChatGPT API using Python?
I'm using OpenAI's API in Python, and right now the response is returned only after the full answer is generated.
Example:
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Explain ... | https://stackoverflow.com/questions/79783362/how-to-stream-responses-token-by-token-from-openai-chatgpt-api-using-python | python, openai-api, chatgpt-api | 1,759,725,813 |
se_78177250 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API error: "You tried to access openai.Image, but this is no longer supported in openai>=1.0.0" | OpenAI API error: "You tried to access openai.Image, but this is no longer supported in openai>=1.0.0"
I am working on my own project to create a business card based on the information a user provides. I am using Streamlit and OpenAI to do this.
I keep getting this error:
APIRemovedInV1: You tried to acc... | https://stackoverflow.com/questions/78177250/openai-api-error-you-tried-to-access-openai-image-but-this-is-no-longer-suppo | python, openai-api, streamlit | 1,710,716,684 |
se_79850718 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI image input token caching | OpenAI image input token caching
OpenAI GPT-Image API: Image input tokens not caching despite documentation suggesting they should
Problem Summary
I'm using OpenAI's GPT-Image models (gpt-image-1.5, gpt-image-1, gpt-image-1-mini) to generate multiple scenes with consistent reference characters. According to OpenAI's d... | https://stackoverflow.com/questions/79850718/openai-image-input-token-caching | openai-api, chatgpt-api, image-generation, cost-optimization | 1,766,096,117 |
se_79869652 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Issues converting Figma designs to a full WordPress theme using Open AI | Issues converting Figma designs to a full WordPress theme using Open AI
What I am trying to do
Fetch design data (frames, components, styles) from Figma using the Figma API
Process that data and send it to the Open AI API
Generate:
WordPress theme structure
PHP templates
HTML/CSS (and possibly JS)
Automatical... | https://stackoverflow.com/questions/79869652/issues-converting-figma-designs-to-a-full-wordpress-theme-using-open-ai | php, wordpress, artificial-intelligence, openai-api, figma-api | 1,768,583,839 |
se_79821532 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to make an AI model come alive? | How to make an AI model come alive?
For fun, I developed an AI model with short-term, medium-term, and long-term memory, inspired by neuro-sama. (I'm a regular backend developer, I don't know much about AI).
How it works:
mic -> vad -> local STT whisper -> core llm
twitch chat -> llm determining the interest of the me... | https://stackoverflow.com/questions/79821532/how-to-make-an-ai-model-come-alive | artificial-intelligence, openai-api | 1,763,304,274 |
se_75726313 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to Resolve "InvalidRequestError: This model's maximum context length is exceeded" in OpenAI API | How to Resolve "InvalidRequestError: This model's maximum context length is exceeded" in OpenAI API
I'm encountering an error with my OpenAI API code and I'm not sure of the best way to resolve it. I'm using the "text-davinci-003" model to generate an AI response using the following code:
completion = op... | https://stackoverflow.com/questions/75726313/how-to-resolve-invalidrequesterror-this-models-maximum-context-length-is-exce | python, openai-api | 1,678,736,903 |
se_79864079 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure PTU deployment of gpt-5.1 always response with "Invalid prompt: your prompt was flagged as potentially violating our usage policy" | Azure PTU deployment of gpt-5.1 always response with "Invalid prompt: your prompt was flagged as potentially violating our usage policy"
This is for chat/completions API. responses API works fine.
Details:
curl -X POST "https://blah.openai.azure.com/openai/v1/chat/completions" \
-H "Content-Type: applicati... | https://stackoverflow.com/questions/79864079/azure-ptu-deployment-of-gpt-5-1-always-response-with-invalid-prompt-your-promp | azure, openai-api, foundry | 1,767,949,916 |
se_77310403 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to POST a fine-tuning job to OpenAI API using the correct file format? | How to POST a fine-tuning job to OpenAI API using the correct file format?
I am new to the OpenAI API and I am trying to understand fine-tuning to use the API.
I checked what fine-tuning files I have available using this request in VS Code Rest Client:
GET https://api.openai.com/v1/files
Authorization: Bearer {{key}} ... | https://stackoverflow.com/questions/77310403/how-to-post-a-fine-tuning-job-to-openai-api-using-the-correct-file-format | rest, curl, openai-api | 1,697,557,246 |
se_78331627 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use RAG with conversation history for follow up questions? | How to use RAG with conversation history for follow up questions?
I am building custom AI chatbot service where user can upload pdf, docx, web pages, etc and I create a custom AI chatbot using RAG.
For follow up questions I try to repharse the question based on conversation history and then use that to retrieve contex... | https://stackoverflow.com/questions/78331627/how-to-use-rag-with-conversation-history-for-follow-up-questions | openai-api, chatgpt-api | 1,713,229,128 |
se_75494945 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAi api 429 rate limit error without reaching rate limit | OpenAi api 429 rate limit error without reaching rate limit
On occasion I'm getting a rate limit error without being over my rate limit. I'm using the text completions endpoint on the paid api which has a rate limit of 3,000 requests per minute. I am using at most 3-4 requests per minute.
Sometimes I will get the foll... | https://stackoverflow.com/questions/75494945/openai-api-429-rate-limit-error-without-reaching-rate-limit | openai-api, gpt-3 | 1,676,739,902 |
se_76648707 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to get ChatGPT to return the source of information returned when trained with own data | How to get ChatGPT to return the source of information returned when trained with own data
I'm trying to use the include my own data to train with ChatGPT by storing the data in a vector database (Pinecone). I'm using the ChatGPT retrieval plugin to vectorise the data and store it in Python. The plugin can be found he... | https://stackoverflow.com/questions/76648707/how-to-get-chatgpt-to-return-the-source-of-information-returned-when-trained-wit | openai-api, chatgpt-api, pinecone | 1,688,923,662 |
se_76261677 | stackoverflow | ARTIFICIAL_INTELLIGENCE | ChatGPT API - creating longer JSON response bigger than gpt-3.5-turbo token limit | ChatGPT API - creating longer JSON response bigger than gpt-3.5-turbo token limit
I have some use case for ChatGPT API which I don't know how to handle.
I'm creating Python app and I have method which creates request with some instructions and some data to rewrite for ChatGPT. It looks like this (instructions and data... | https://stackoverflow.com/questions/76261677/chatgpt-api-creating-longer-json-response-bigger-than-gpt-3-5-turbo-token-limi | python, openai-api, chatgpt-api | 1,684,230,940 |
se_76879776 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to create a mock Azure.AI.OpenAI.ChatCompletions object to test functions using OpenAI? | How to create a mock Azure.AI.OpenAI.ChatCompletions object to test functions using OpenAI?
I have a simple function that takes a prompt, sends it to a model on our Azure OpenAI instance, and returns the content of the LLM's response:
public async Task<string> GetChatCompletion(string deploymentName, ChatCompl... | https://stackoverflow.com/questions/76879776/how-to-create-a-mock-azure-ai-openai-chatcompletions-object-to-test-functions-us | c#, openai-api, azure-openai, azure-ai | 1,691,708,281 |
se_76582684 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Return ReadableStream from NextJs (express) via chatGpt api stream | Return ReadableStream from NextJs (express) via chatGpt api stream
I am very new to nodejs, but playing around with some of the new chatgpt stuff.
I have some code which takes a topic and generates a joke. This is using the streaming version of https://api.openai.com/v1/chat/completions
I can see the stream is coming ... | https://stackoverflow.com/questions/76582684/return-readablestream-from-nextjs-express-via-chatgpt-api-stream | node.js, nestjs, openai-api, chatgpt-api | 1,688,053,789 |
se_76675721 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to use gpt4 in vb.net? | How to use gpt4 in vb.net?
I am trying to make a simple chat app with gpt4 but i got stuck, and gpt itself cant help me :D
So, i tried few end points i saw online, but nothing works. I get allways "The API response is missing or empty.". What is missing here?
My code:
Imports System.Net.Http
Imports System.Text
Im... | https://stackoverflow.com/questions/76675721/how-to-use-gpt4-in-vb-net | vb.net, openai-api | 1,689,219,306 |
se_79851244 | stackoverflow | ARTIFICIAL_INTELLIGENCE | JsonOutputParser in LangChain raises OutputParserException when model includes conversational text | JsonOutputParser in LangChain raises OutputParserException when model includes conversational text
I am using LangChain to extract structured data from a user query using gpt-3.5-turbo. I have defined a Pydantic object and am passing the format instructions to the prompt.
However, occasionally the model returns text l... | https://stackoverflow.com/questions/79851244/jsonoutputparser-in-langchain-raises-outputparserexception-when-model-includes-c | python, openai-api, langchain, large-language-model | 1,766,159,459 |
se_79850632 | stackoverflow | ARTIFICIAL_INTELLIGENCE | passing fresh JWT to AzureOpenAI | passing fresh JWT to AzureOpenAI
I am attempting to pass a JWT to an AzureOpenAI call but the service responds with a 401. When I instantiate AzureOpenAI with a JWT-injected default header, it works. However, the JWT can become stale in which case I need to send it a fresh JWT instead. I have tried setting azureADToke... | https://stackoverflow.com/questions/79850632/passing-fresh-jwt-to-azureopenai | typescript, azure, jwt, openai-api | 1,766,085,819 |
se_79848775 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why is OpenAI’s ChatGPT SDK preferred at the enterprise level over Google Gemini? | Why is OpenAI’s ChatGPT SDK preferred at the enterprise level over Google Gemini?
I’ve noticed that many enterprises seem to adopt OpenAI’s ChatGPT SDK more frequently than Google Gemini or other AI platforms. From my understanding, both platforms provide similar foundational AI capabilities.
I’m trying to understand ... | https://stackoverflow.com/questions/79848775/why-is-openai-s-chatgpt-sdk-preferred-at-the-enterprise-level-over-google-gemini | artificial-intelligence, openai-api, enterprise, chatgpt-api, google-gemini | 1,765,906,976 |
se_78670411 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Using Files / Batch API through Azure Open AI Endpoint | Using Files / Batch API through Azure Open AI Endpoint
This link provides the steps to access openai through Azure OpenAI with APIM.
https://github.com/microsoft/AzureOpenAI-with-APIM/blob/main/example_code/example.py
Following is the code as given in the above link to use chat_completions API by OpenAI .
apim_url =... | https://stackoverflow.com/questions/78670411/using-files-batch-api-through-azure-open-ai-endpoint | openai-api, azure-openai | 1,719,378,200 |
se_79830225 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Open's AI MCP server redirect URI | Open's AI MCP server redirect URI
I am configuring Open AI to talk to my MCP server , which uses SSO.
On the Chat GPT web UI, when adding a connector, by clicking on the connectors section and adding a new one:
I add the Client ID and Secret and they are received correctly on my MCP server.
I then click save and ... | https://stackoverflow.com/questions/79830225/opens-ai-mcp-server-redirect-uri | openai-api, model-context-protocol | 1,764,114,115 |
se_79775007 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How to stop ChatGPT Realtime from speaking JSON when using both text (JSON) and audio (TTS) in the same response? | How to stop ChatGPT Realtime from speaking JSON when using both text (JSON) and audio (TTS) in the same response?
I’m trying to use the ChatGPT Realtime API to recognize spoken commands and to have natural language conversation.
What I need:
User speaks a command (e.g. “Turn on the living room lights”).
Note the user ... | https://stackoverflow.com/questions/79775007/how-to-stop-chatgpt-realtime-from-speaking-json-when-using-both-text-json-and | openai-api, chatgpt-api | 1,758,812,396 |
se_75941852 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAI API Key Works This Way, But Not That Way? Very Confused? | OpenAI API Key Works This Way, But Not That Way? Very Confused?
I'm trying to use the OpenAI API. But my API key is valid in some code, but invalid in other code. I cannot understand why.
When I use it like this, it works:
import openai
openai.api_key = 'KEY'
completion = openai.ChatCompletion.create(
model="gpt-3... | https://stackoverflow.com/questions/75941852/openai-api-key-works-this-way-but-not-that-way-very-confused | python, openai-api | 1,680,711,645 |
se_79837650 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Turn off gpt-5-nano reasoning | Turn off gpt-5-nano reasoning
I am performing name/gender inference and I want to use the gpt-5-nano model because it is fast. The problem is that I can't seem to turn off reasoning even with the reasoning=None flag. I can't even seem to set a limit of ~100 tokens for reasoning. I can get 4o-mini to work but it is slo... | https://stackoverflow.com/questions/79837650/turn-off-gpt-5-nano-reasoning | python, openai-api | 1,764,834,767 |
se_79803694 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How can I efficiently run a RAG pipeline fully in Node.js using OpenAI embeddings and FAISS without relying on Python? | How can I efficiently run a RAG pipeline fully in Node.js using OpenAI embeddings and FAISS without relying on Python?
I am working with a small Retrieval-Augmented Generation (RAG) setup and I want to run the entire pipeline purely in Node.js without using any Python-based services.
Workflow I am going to follow :
G... | https://stackoverflow.com/questions/79803694/how-can-i-efficiently-run-a-rag-pipeline-fully-in-node-js-using-openai-embedding | node.js, openai-api, faiss, retrieval-augmented-generation, advice | 1,761,735,601 |
se_79834103 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Unable to download package | Unable to download package
I have issues with downloading "@stream-io/openai-realtime-api" package in NextJS project.
Error:
enter image description here
I tried to clear cash, change registry, used "--legacy-peer-deps" yet noting works.
I also tried to add it to package.json and then run "npm install" but it also did... | https://stackoverflow.com/questions/79834103/unable-to-download-package | typescript, npm, next.js, package, openai-api | 1,764,526,391 |
se_79831967 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Weird OpenAI streaming bug: concurrent JS streams randomly mix chunks across responses | Weird OpenAI streaming bug: concurrent JS streams randomly mix chunks across responses
I’m hitting a super weird issue with OpenAI’s streaming API.
I’m building a multi-message streaming thing in plain JS (no frameworks) where I need to pipe multiple OpenAI responses one after another. It looks fine on localhost, but ... | https://stackoverflow.com/questions/79831967/weird-openai-streaming-bug-concurrent-js-streams-randomly-mix-chunks-across-res | javascript, node.js, openai-api | 1,764,264,353 |
se_79833726 | stackoverflow | ARTIFICIAL_INTELLIGENCE | OpenAPI Spec client fail to compile with ambiguous types | OpenAPI Spec client fail to compile with ambiguous types
I downloaded the OpenAI's OpenAPI Spec file and tried to generate and compile the client and faced a few issues and wonder if anyone knows the fix for it.
This is the specification: https://app.stainless.com/api/spec/documented/openai/openapi.documented.yml
Howe... | https://stackoverflow.com/questions/79833726/openapi-spec-client-fail-to-compile-with-ambiguous-types | openai-api, openapi-generator | 1,764,484,617 |
se_79833466 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Azure OpenAI model token rate limit header (x-ratelimit-limit-tokens) is -1 | Azure OpenAI model token rate limit header (x-ratelimit-limit-tokens) is -1
I am trying to get my current rate limit for an OpenAI model hosted on Azure. The response headers contain keys x-ratelimit-limit-tokens and x-ratelimit-remaining-tokens which are supposed to contain the model's / deployment's rate limits (see... | https://stackoverflow.com/questions/79833466/azure-openai-model-token-rate-limit-header-x-ratelimit-limit-tokens-is-1 | azure, openai-api | 1,764,442,834 |
se_79672813 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Add web_search_preview tool to langchain invoke | Add web_search_preview tool to langchain invoke
I'm working with LangGraph and LangChain, and I need to add the web_search_preview tool to my model when using model.invoke() within a state graph node. I can see that the tool works when used directly with the OpenAI client, but I'm having trouble integrating it into my... | https://stackoverflow.com/questions/79672813/add-web-search-preview-tool-to-langchain-invoke | python, openai-api, langchain, langgraph | 1,750,386,644 |
se_79827864 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Does OpenAI API TPM limit count input tokens, output tokens, or both? | Does OpenAI API TPM limit count input tokens, output tokens, or both?
I’m a bit confused about how OpenAI’s API rate limits work - specifically the TPM (tokens per minute) limit.
If I have, for example, 2 million TPM, is that limit calculated based on:
only the input tokens I send in my request,
or both input + outp... | https://stackoverflow.com/questions/79827864/does-openai-api-tpm-limit-count-input-tokens-output-tokens-or-both | tokenize, openai-api | 1,763,899,944 |
se_79375332 | stackoverflow | ARTIFICIAL_INTELLIGENCE | How does `llm.bind_tools` work in langchain? | How does `llm.bind_tools` work in langchain?
I need to understand how exactly does langchain convert information from code to LLM prompt, because end of the day, the LLM will need only text to be passed to it.
If I am incorrect somewhere in my understanding, kindly point it out as well when answering the question
This... | https://stackoverflow.com/questions/79375332/how-does-llm-bind-tools-work-in-langchain | nlp, openai-api, langchain, large-language-model, py-langchain | 1,737,479,739 |
se_79817907 | stackoverflow | ARTIFICIAL_INTELLIGENCE | Why doesn’t ChatGPT MCP Connector send client_id in /token request even though AS requires client_secret_post? | Why doesn’t ChatGPT MCP Connector send client_id in /token request even though AS requires client_secret_post?
I'm integrating my own MCP server with OAuth authentication through the ChatGPT Connector.
During the authorization code exchange, the connector doesn’t send the client_id field in the POST request to the /to... | https://stackoverflow.com/questions/79817907/why-doesn-t-chatgpt-mcp-connector-send-client-id-in-token-request-even-though-a | oauth-2.0, openai-api, chatgpt-api, model-context-protocol | 1,762,960,946 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.