Richasy / FantasyCopilot

A new-age AI desktop tool
MIT License
430 stars 19 forks source link

[Feature] Add an option to set the api_version for Azure OpenAI #82

Open balthild opened 1 year ago

balthild commented 1 year ago

Description

I'm attempting to use the HKUST's Azure OpenAI service (doc link), which only supports some specific API versions. If other API versions are used, it will result in a 404 error.

图片

2023-05-15 图片

2022-12-01 (although this version is listed in the docs...): 图片

Solution

The KernelBuilder from semantic-kernel accepts a config object containing the API version.

https://github.com/Richasy/FantasyCopilot/blob/491f18a75830dd45d421891a90bdb1c26eb6b5a2/src/Services/Services.Desktop/KernelService/KernelService.cs#L188C27-L188C57

https://github.com/microsoft/semantic-kernel/blob/d70bd6b3aeff651214f036435175449128d68bd3/dotnet/src/Connectors/Connectors.AI.OpenAI/OpenAIKernelBuilderExtensions.cs#L341

Plan B

No response

Additional

No response

Richasy commented 1 year ago

Hi @balthild , I understand your appeal, but unfortunately, Semantic Kernel does not provide api version configuration for basic chat. What you provide is AzureChatCompletionWithDataConfig, which requires the client to provide the name and key of the associated database. This is usually used in professional data models and does not apply to your situation.

Until Semantic Kernel implements this feature (or I have time to submit a PR to SK), I will not be able to provide effective help for the time being.

balthild commented 1 year ago

Oh... didn't notice that. Thanks for the clarification.