Javascript – formatting of chat gpt responses
I am using chat gpt api on my react application. The problem i am facing is how to format the response coming from chat gpt. If is ask it to give me a response in table format it provides weird…
I am using chat gpt api on my react application. The problem i am facing is how to format the response coming from chat gpt. If is ask it to give me a response in table format it provides weird…
I have a FastAPI application that uses Server Sent Events (SSE) for streaming the response of a generative AI model, similar to the API of OpenAI. The application is deployed using the following architecture: FastAPI application hosted by Gunicorn with…
I’m trying to use LangChain’s AzureOpenAI as below but getting this error. Do you know how can I fix this? openai.error.InvalidRequestError: Resource not found # Import Azure OpenAI from langchain.llms import AzureOpenAI import openai import os os.environ["OPENAI_API_TYPE"] = "azure" os.environ["OPENAI_API_KEY"]…
I am having trouble using the OpenAI API with Node.js. Specifically, I am trying to use the openai.Completion object, but I keep getting a Cannot find module '@openai/api' error. I have already tried installing the @openai/api package using npm install…
I am testing a script to convert audio to text. However, while calling the API I am getting an error. Here is the path I am using 'https://api.openai.com/v1/audio/transcriptions?engine=whisper-1'; And the error I am getting is "error": { "message": "you must…
Trying to run an embeddings query on data stored from openAI. Currently using Supabase functions, using the following library. Any ideas on how to fix this? OpenAI Embeddings response is successful - const [{ embedding }] = embeddingResponse.data.data; const query_embedding…
I'm building a Flutter app that requires the OpenAI GPT3 API, and I'm not sure how to implement it. Currently, I'm using a single API key that's stored in a .env file and accessed via the flutter_dotenv package. I'm wondering…
I'm building a webpage using openai gpt api in reactjs. I saved my api key on .env file then gitignored it. And I deployed my code with gh-pages, but openai detects it and rotate the key automatically. How can I…
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({ model: 'gpt-3.5-turbo', messages: [{ role: 'user', content: 'hello' }], temperature: 0.3, max_tokens:…
I use openai/client-php. require __DIR__ . '/vendor/autoload.php'; use OpenAIClient; use OpenAIAPIRequest; $yourApiKey = 'sk-fEpZ.......'; $client = new Client(new Request($yourApiKey)); function generateText($client, $model, $prompt, $length, $temperature = 0.5) { $response = $client->completions()->create( $model, [ 'prompt' => $prompt, 'max_tokens' => $length, 'temperature'…