Skip to content

.Net: AzureOpenAI migration breaking changes #7053

Description

@SergeyMenshykh

These are the breaking changes that have been made to AzureOpenAIChatCompletionService and its associated classes during the migration to Azure.AI.OpenAI SDK v2. The list should be reviewed to minimize the number of breaking changes.

AzureOpenAIChatCompletionService

  • AzureOpenAIChatCompletionService

    • Metadata: .Net: Decide on the metadata names for the newAzureOpenAIChatCompletionService #7066
      • The Created key is renamed to CreatedAt.
      • The PromptFilterResults metadata type has changed from IReadOnlyList<ContentFilterResultsForPrompt> to ContentFilterResultForPrompt.
      • The Usage metadata type has changed from CompletionsUsage to ChatTokenUsage.
      • The ContentFilterResults metadata type has changed from ContentFilterResultsForChoice to ContentFilterResultForResponse.
      • The FinishReason metadata string has changed: stop to Stop, tool_calls to ToolCalls, etc.
      • The LogProbabilityInfo type has changed from ChatChoiceLogProbabilityInfo to IReadOnlyList<ChatTokenLogProbabilityInfo>.
      • The FinishDetails, Index, and Enhancements metadata have been removed.
    • Metrics: The meter s_meter = new("Microsoft.SemanticKernel.Connectors.OpenAI"); and the relevant counters still have old names that contain "openai" in them, such as semantic_kernel.connectors.openai.tokens.prompt, semantic_kernel.connectors.openai.tokens.completion, etc. .Net: Decide on the meter and metrics names for the new AzureOpenAIChatCompletionService #7054
  • OpenAIChatMessageContent

    • The Tools property type has changed from IReadOnlyList<ChatCompletionsToolCall> to IReadOnlyList<ChatToolCall>.
    • Inner content type has changed from ChatCompletionsFunctionToolCall to ChatToolCall.
    • Metadata:
  • OpenAIStreamingChatMessageContent

    • The FinishReason property type has changed from CompletionsFinishReason to FinishReason.
    • The ToolCallUpdate property has been renamed to ToolCallUpdates and its type has changed from StreamingToolCallUpdate? to IReadOnlyList<StreamingChatToolCallUpdate>?.
    • The AuthorName property is not initialized because it's not provided by the underlying library anymore - [QUERY] StreamingChatCompletionUpdate.AuthorName property Azure/azure-sdk-for-net#44930
  • OpenAIPromptExecutionSettings

    • The ResultsPerPrompt property has been removed
    • The AzureChatExtensionsOptions property is replaced by the new AzureChatDataSource one and moved to AzureOpenAIPromptExecutionSettings class. The property type has changed from AzureChatExtensionsOptions? to AzureChatDataSource?

AzureOpenAITextGenerationService

  • The service has not been migrated because it's not supported by the new version of the Azure SDK.

AzureOpenAIAudioToTextService

  • AzureOpenAIAudioToTextService
    • Metadata:
      • The Segments metadata type has changed from IReadOnlyList<AudioTranscriptionSegment> to IReadOnlyList<TranscribedSegment>.

Changes related to all or most the classes

  • The classes were moved to the new namespace - Microsoft.SemanticKernel.Connectors.AzureOpenAI;
  • Constructors and extension methods of the services that accepted the Azure SDK OpenAIClient as the openAIClient parameter have been changed to use the new AzureOpenAIClient client instead, and the parameter has been renamed to azureOpenAIClient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETIssue or Pull requests regarding .NET codeai connectorAnything related to AI connectorsneeds discussionIssues that require discussion by the internal Semantic Kernel team before proceeding

    Type

    No type

    Projects

    Status
    Sprint: Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions