Closed johannesamee closed 1 month ago
I haven't used azure openai in some time, but can you manufacture a base URL that contains this configuration in it? I believe that's how Gemini works.
If not, I can plumb these fields through for you within the next few days
I was experimenting with it a bit and it seemed like it put the /chat/completions
part after the ?api-version=xxxx-xx-xx
at the end making the URL invalid.
Hi, been looking for the Azure Open AI option aswell.
Here's the LangChain.js class: https://github.com/langchain-ai/langchainjs/blob/3ad93f6f11fdacd125d2143208da19a2a3915fa4/libs/langchain-openai/src/azure/llms.ts#L12
You need api version, deployment name (which differs from the model name since this will be set freely in Azure Open AI Studio)
The full end url looks something like this: baseurl.com/openai/deployments/[your deployment name]/chat/completions?api-version=2024-05-15
Awesome tool by the way!!
Gotcha, looks like some naive string concatenation on my end. I blame copilot 😅
I will either add a dedicated azure openai LLM target, or expose the options in the base openai config
@johannesamee Planning on merging and releasing #39 within the next few hours
This is now released, please let me know how it works you for you!
@cephalization Awesome that you implemented this as fast as you did! 🙌
After some testing I got it to work perfectly, initially I set the baseUrl
to https://MY-INSTANCE-NAME.openai.azure.com/
because that's how Azure displays it in their portals/playgrounds.
When I set it to https://MY-INSTANCE-NAME.openai.azure.com/openai/deployments
it worked like a charm!
https://github.com/DeabLabs/cannoli/blob/09f850ae2f6fae6e6866e65026d0c4a8c1f489f0/main.ts#L1289
.setPlaceholder("https://YOUR-INSTANCE-NAME.openai.azure.com/openai/deployments")
.setPlaceholder("https://[instanceName].openai.azure.com/openai/deployments")
Or something similar might be something to add!
@johannesamee
It should actually work just fine if you leave out baseURL entirely! Let me know how that goes for you. I will make it more apparent that baseURL is optional, and only required if you have a special url for your deployment
A-maze-ing! I can confirm this config works:
@cephalization Ah gotcha, that makes sense!
Been testing around and everything works perfectly, thanks again for getting this added so fast!
I would love to see an option for Azure OpenAI in the
AI Provider
dropdown that when selected displays the extra configuration fields needed to connect to Azure OpenAI resources:Instance Name
Deployment Name
model
API Version