OpenAI icon indicating copy to clipboard operation
OpenAI copied to clipboard

Support Azure openai

Open iHTCboy opened this issue 1 year ago • 8 comments

Getting error: The data couldn't be read because its missing

iHTCboy avatar Apr 23 '23 04:04 iHTCboy

Is it possible to pass in a different host? Or organisation identifier? Not sure how it looks from the Azure side (looking at https://github.com/MacPaw/OpenAI/blob/main/Sources/OpenAI/OpenAI.swift)

SunburstEnzo avatar Apr 23 '23 13:04 SunburstEnzo

Looks like there is a subtle difference in the api usage. https://github.com/stulzq/azure-openai-proxy This repo identifies it

VatsaPatel avatar Apr 25 '23 05:04 VatsaPatel

We could definitely abstract the deployment name from the endpoint? So for OpenAI it would just be "/v1" OpenAI: ".../v1/chat/completions" Azure: ".../azuredeployment/chat/completions"

Is that enough or are there additional changes needed?

SunburstEnzo avatar Apr 26 '23 15:04 SunburstEnzo

Is that enough or are there additional changes needed?

For Azure OpenAI services, we need API_KEY and more, which are deployment_id and endpoint

ifsheldon avatar Aug 19 '23 15:08 ifsheldon

I've added support for Azure on my fork. Maybe it's useful for you

https://github.com/longseespace/OpenAI/commit/196e465e8a1c2eaece9a516cab60c90a7b4e7159

longseespace avatar Aug 22 '23 10:08 longseespace

Why not add support for Azure? is it that hard? @longseespace did it.

iTarek avatar Sep 18 '23 18:09 iTarek

Why not add support for Azure? is it that hard? @longseespace did it.

I second that.

winstonschen avatar Dec 20 '23 15:12 winstonschen

It's sad that this library is dead and completely unmaintained 😥

tisfeng avatar Sep 01 '24 11:09 tisfeng