MacPaw / OpenAI

Swift community driven package for OpenAI public API
MIT License
1.99k stars 327 forks source link

Support Azure openai #61

Open iHTCboy opened 1 year ago

iHTCboy commented 1 year ago

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

SunburstEnzo commented 1 year ago

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)

VatsaPatel commented 1 year ago

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

SunburstEnzo commented 1 year ago

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?

ifsheldon commented 1 year ago

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

longseespace commented 1 year ago

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

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

iTarek commented 1 year ago

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

winstonschen commented 9 months ago

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

I second that.

tisfeng commented 2 weeks ago

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