64bit / async-openai

Rust library for OpenAI

Home Page:https://docs.rs/async-openai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Microsoft Azure Endpoints

64bit opened this issue · comments

commented

I made something quick because I got access: https://github.com/Kakise/az-openai-rs you can check it out and I can test your changes if needed @64bit

Nice project! Thank you for offering to test @Kakise!
I might attempt to implement support over weekend, and let you know when ready for testing.

Does it support all the same APIs as OpenAI? Are there any major difference you noticed other than the mechanics of API call?

commented

@64bit right now I only tested completions and embeddings but it does support all OpenAI APIs.

The main difference I noticed is how you call your model. For OpenAI it's passed in the body and for Azure it's passed in the url

Hi @Kakise , thank you for your response, I had opportunity to look into this today and I discovered that only embedding, completions, and chat completions APIs are currently supported in 2023-03-15-preview api version.

SO I have made the changes to support Azure in #67 , I have tested all the examples on OpenAI after this change.

For testing on Azure and make it as simple for you I have added a new example called examples/azure-openai-service with three API calls in it for embedding, completioins and chat completion. You will only need to change api_key, endpoint and deployment id.

Can you please run that example and post output? I can add output to examples/azure-openai-service/README.md

Hope all goes well, thank you for your help on this!