ai-shell icon indicating copy to clipboard operation
ai-shell copied to clipboard

Add Azure OpenAI support

Open akira-cn opened this issue 2 years ago • 6 comments

Now you can use Microsoft azure openAI as your ai service.

  1. Set OPENAI_API_ENDPOINT to Azure-OpenAI's EndPoints and set AZURE_OPENAI_DEPLOYMENT to your developmentId.

  2. Use your azureApiKey as OPENAI_KEY.

e.g.

ai config set OPENAI_API_ENDPOINT=https://<your-endpoint>.openai.azure.com
ai config set AZURE_OPENAI_DEPLOYMENT=<your-deployment-id>
ai config set OPENAI_KEY=<your token>

Get more details please follow the instruction here.

akira-cn avatar Sep 07 '23 07:09 akira-cn

thanks @akira-cn! can take a. look at this in a bit

steve8708 avatar Sep 12 '23 20:09 steve8708

code looks good to me, just need build to pass to merge

steve8708 avatar Sep 14 '23 17:09 steve8708

just about to merge this but looks like we've run into a merge conflict

steve8708 avatar Sep 21 '23 15:09 steve8708

Quick note, there probably should be check to remove trailing / in ai config set OPENAI_API_ENDPOINT as when you copy your endpoint from azure, it has trailing / in url.

And if that is there, ai-shell will just output:

{
  "error": {
    "code": "404",
    "message": "Resource not found"
  }
}

Don't ask me how I know :sweat_smile:

Racle avatar Oct 13 '23 13:10 Racle

Need this feature. Will the conflicts be resolved?

qingpengchen2011 avatar Feb 19 '24 02:02 qingpengchen2011

waiting for the pr

huseyinulas avatar Mar 11 '24 08:03 huseyinulas

going to close this out given no activity, feel free to reopen if any updates

steve8708 avatar May 23 '24 12:05 steve8708