skip to Main Content

what should I do to make the azure openai return stream events with java 11

I am using this code to return a stream response when using azure openai api: public void getChatCompletion(SseEmitter emitter, String prompt, String azureOpenaiKey) { String endpoint = "https://xxxx.openai.azure.com/"; String deploymentOrModelId = "xxx-ai"; OpenAIClient client = new OpenAIClientBuilder() .endpoint(endpoint) .credential(new AzureKeyCredential(azureOpenaiKey))…

VIEW QUESTION

Unsupported data type when making API request to Azure Open AI

I'm getting "unsupported data" error when trying to send post request to Azure OpenAI. What should I do to fix the error? https://myopenai.openai.azure.com/openai/deployments/code-davinci-002/completions?api-version=2023-03-15-preview&API-KEY=xxxxxxxxxxxx&content-type=application/json api-version = 2023-03-15-preview API-KEY = xxxxx content-type = application/json { "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Say…

VIEW QUESTION
Back To Top
Search