.Net: Added AzureChatExtensionsOptions property and deprecated WithData classes #6454
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
chat completion on your data
functionality out-of-the-box, which means that now we don't need custom implementation.Chat completion on your data
new API has breaking changes, which makes currentWithData
classes non-functional.Description
AzureChatExtensionsOptions
property was added toOpenAIPromptExecutionSettings
. Initial idea was to add it onAzureOpenAIChatCompletionService
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 allAddChatCompletion...
extension methods will be introduced, to avoid more parameters in these methods at the moment).AzureChatExtensionsOptions
property is marked withJsonIgnore
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-specificAzureChatExtensionsOptions
property. I was thinking to add derivedAzureOpenAIPromptExecutionSettings : OpenAIPromptExecutionSettings
class (and unmarkOpenAIPromptExecutionSettings
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