cfortuner / promptable

Build LLM apps in Typescript/Javascript. 🧑‍💻 🧑‍💻 🧑‍💻 🚀 🚀 🚀
https://docs-promptable.vercel.app
MIT License
1.77k stars 120 forks source link

Azure OpenAI Support? #51

Open Elvincth opened 1 year ago

Elvincth commented 1 year ago

I tried to override openai config the base url like this:

const configuration = new Configuration({ basePath: "https:/xxx.openai.azure.com/openai/deployments/demo", apiKey: process.env.AZURE_OPENAI_API_KEY, });

But no luck. Any suggestions would be appreciated.

mlnj commented 1 year ago

This works for me:

{
  basePath: "https://xxx.openai.azure.com/openai/deployments/xxx",
  baseOptions: {
    headers: { "api-key": env. AZURE_OPENAI_API_KEY },
    params: {
      "api-version": "2023-03-15-preview",     // https://oai.azure.com/portal/chat
    },
  },
}