azure-openai-node icon indicating copy to clipboard operation
azure-openai-node copied to clipboard

Axios Error:

Open richardeee opened this issue 1 year ago • 1 comments

Hi, when using this library, I encountered following problem:

My Code:

  const reqBody = await req.json();
  const openAIApi = new OpenAIApi(
    new Configuration({ 
      apiKey: openAIApiKey,
      azure: {
        endpoint: openAIEndPoint,
        apiKey: openAIApiKey,
        deploymentName: openAIChatGPTDeploymentName,
      }
    })
  );
  console.log("reqBody", reqBody)
  const res = await openAIApi.createChatCompletion({
    model: openAIChatGPTDeploymentName,
    prompt: reqBody.messages,
    temperature: 0,
    frequency_penalty: 0.0,
    presence_penalty: 0.0,
    max_tokens: 1000,
  }); 

Error:

error - adapter is not a function

In my package.json:

"axios": "^1.3.4",

Is anything wrong with my code or dependencies?

richardeee avatar Mar 30 '23 02:03 richardeee