Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Added AzureChatExtensionsOptions property and deprecated WithData classes #6454

Merged

Conversation

dmytrostruk
Copy link
Member

Motivation and Context

Fixes: #4787
Fixes: #6061
Fixes: #6448
Fixes: #6112

Discussion: #6016 (reply in thread)

There are two reasons why this change is required:

  1. Azure .NET SDK supports chat completion on your data functionality out-of-the-box, which means that now we don't need custom implementation.
  2. Chat completion on your data new API has breaking changes, which makes current WithData classes non-functional.

Description

  1. AzureChatExtensionsOptions property was added to OpenAIPromptExecutionSettings. Initial idea was to add it on AzureOpenAIChatCompletionService class level (in all constructors and extension methods), but it looks like this configuration contains some properties which should be useful per request (e.g. index name, search filter etc). Later, we can also add it on service class level, if needed (although I would do that when Options classes for all AddChatCompletion... extension methods will be introduced, to avoid more parameters in these methods at the moment).
  2. AzureChatExtensionsOptions property is marked with JsonIgnore attribute, because it's still needs to be investigated if this configuration is serializable. It supports not only Azure AI Search configuration, but also other configurations like Azure Cosmos DB for MongoDB, Pinecone etc. We can release it without JSON serialization first, to unblock code-first customers, and we can add support for JSON serialization later (i.e. config.json files), if there will be such request.

Note: It looks like OpenAIPromptExecutionSettings is not ideal place for Azure-specific AzureChatExtensionsOptions property. I was thinking to add derived AzureOpenAIPromptExecutionSettings : OpenAIPromptExecutionSettings class (and unmark OpenAIPromptExecutionSettings as sealed), but this looks like some scope of work which should be implemented when OpenAI and Azure OpenAI functionality will be separated by SDKs.

Contribution Checklist

@dmytrostruk dmytrostruk self-assigned this May 31, 2024
@dmytrostruk dmytrostruk requested a review from a team as a code owner May 31, 2024 03:50
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels May 31, 2024
@dmytrostruk dmytrostruk added this pull request to the merge queue Jun 3, 2024
Merged via the queue into microsoft:main with commit 060699c Jun 3, 2024
15 checks passed
@dmytrostruk dmytrostruk deleted the fix-chat-completion-with-data branch June 3, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
4 participants