Skip to content

.Net: OpenAI V2 & Assistants V2 - GA #7151

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 117 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 113 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
5f023b5
.Net OpenAI SDK V2 - Phase 00 (Feature Branch) (#6894)
RogerBarreto Jun 20, 2024
00f80bc
feat: add empty AzureOpenAI and AzureOpenAI.UnitTests projects.
SergeyMenshykh Jun 20, 2024
5cd0a28
fix: temporarily disable package validation
SergeyMenshykh Jun 20, 2024
5852395
fix: publish configuration for the OpenAIV2 project
SergeyMenshykh Jun 20, 2024
e7632f0
.Net: Empty projects for the new AzureOpenAI connector (#6900)
SergeyMenshykh Jun 20, 2024
af19aa7
.Net OpenAI SDK V2 - Phase 01 Embeddings + ClientCore (Feature Branch…
RogerBarreto Jun 24, 2024
6729af1
.Net: Copy code related to AzureChatCompletionSeervice from Connector…
SergeyMenshykh Jun 24, 2024
c967a24
.Net OpenAI V2 - Text to Image Service - Phase 02 (#6951)
RogerBarreto Jun 26, 2024
c8d9ade
.Net OpenAI V2 - Internal Utilities - Phase 03 (#6970)
RogerBarreto Jun 26, 2024
f8a22b8
.Net: Migrate Azure Chat Completion Service to AzureOpenAI SDK v2 (#6…
SergeyMenshykh Jun 27, 2024
6af09e2
.Net: Extension methods & integration tests for AzureOpenAIChatComple…
SergeyMenshykh Jun 28, 2024
05374c8
.Net: Copy AzureOpenAITextEmbeddingGenerationService to Connectors.Az…
SergeyMenshykh Jul 1, 2024
c4c1878
.Net: AzureOpenAIChatCompletionService Functionality Cleanup (#7024)
SergeyMenshykh Jul 1, 2024
2941245
.Net: Migrate AzureOpenAITextEmbeddingGenerationService to Azure AI S…
SergeyMenshykh Jul 2, 2024
5bc3a78
.Net: Move AzureOpenAIChatCompletionService to the Services folder (#…
SergeyMenshykh Jul 2, 2024
3ebe6ef
.Net: OpenAI V2 - Migrate Audio Services Phase 04 (#7029)
RogerBarreto Jul 2, 2024
f266504
.Net: Split ClientCore class (#7060)
SergeyMenshykh Jul 2, 2024
edb7442
.Net: Tidying up AzureOpenAIChatCompletionService (#7073)
SergeyMenshykh Jul 3, 2024
d3cf959
.Net: Remove exception utility duplicate (#7074)
SergeyMenshykh Jul 3, 2024
1f16875
.Net: Split service collection and kernel builder extension methods i…
SergeyMenshykh Jul 3, 2024
47676ae
.Net: Copy OpenAITextToImageService related code to AzureOpenAI proje…
SergeyMenshykh Jul 3, 2024
c54127a
Merge from main
crickman Jul 3, 2024
43d7ecb
Add connector unit tests: Qdrant, Redis
crickman Jul 3, 2024
48eb9c3
.Net: Migrate AzureOpenAITextToImageService to Azure.AI.OpenAI v2 (#7…
SergeyMenshykh Jul 4, 2024
caed23a
.Net: OpenAI V2 - Migrated FileService - Phase 05 (#7076)
RogerBarreto Jul 4, 2024
965fe63
.Net: Copy AzureOpenAITextToAudioService related code to AzureOpenAI …
SergeyMenshykh Jul 4, 2024
6d7434f
.Net: Migrate AzureOpenAITextToImageService to Azure.AI.OpenAI SDK v2…
SergeyMenshykh Jul 5, 2024
5eefea7
.Net: Clean-up (#7107)
SergeyMenshykh Jul 5, 2024
ba1df51
.Net: Prepare AzureOpenAIAudioToTextService for migration to the Azur…
SergeyMenshykh Jul 5, 2024
b458a74
.Net: Migrate AzureOpenAITextToAudioService to Azure.AI.OpenAI SDK v2…
SergeyMenshykh Jul 5, 2024
7b21ee8
.Net: Migrate AzureOpenAIAudioToTextService to Azure.AI.OpenAI SDK v2…
SergeyMenshykh Jul 8, 2024
d230cce
.Net: OpenAI V2 - Audio to Text - Response Format as Enum conversion …
RogerBarreto Jul 8, 2024
9238604
.Net: AzureOpenAI services cleanup (#7140)
SergeyMenshykh Jul 8, 2024
13a9318
.Net: Copy OpenAI file service to the Connectors.AzureOpenAI project …
SergeyMenshykh Jul 8, 2024
f5b9bdc
.Net: OpenAI V2 Connector - ChatCompletion + FC - Phase 06 (#7138)
RogerBarreto Jul 9, 2024
f7e7e29
.Net: OpenAI V2 - FileService Obsolescence (#7184)
RogerBarreto Jul 10, 2024
3325773
.Net: OpenAI V2 - Reverting all avoidable Breaking Changes - Phase 08…
RogerBarreto Jul 11, 2024
bd4dde0
.Net: Remove AzureOpenAIFileService (#7195)
SergeyMenshykh Jul 11, 2024
64120d3
.Net: OpenAI V2 Removing LogActivity Extra Implementation (#7205)
RogerBarreto Jul 11, 2024
a10e9f2
.Net: Align metadata names with underlying library ones (#7207)
SergeyMenshykh Jul 11, 2024
5dadd59
Merge branch 'main' into feature-connectors-openai
crickman Jul 12, 2024
89c2096
Merge branch 'main' into feature-connectors-openai
crickman Jul 12, 2024
80c8518
Merge branch 'feature-connectors-openai' of https://github.com/micros…
crickman Jul 12, 2024
f0b2757
.Net: Remove time stamp granularities (#7214)
SergeyMenshykh Jul 12, 2024
49ff10f
.Net: Rollback unnecessary breaking change (#7222)
SergeyMenshykh Jul 12, 2024
a3145a2
.Net: Preparing grounds for Concepts OpenAI V2 migration (#7229)
RogerBarreto Jul 12, 2024
5b30e33
.Net: Remove unnecessary breaking changes (#7235)
SergeyMenshykh Jul 12, 2024
66a9f24
Merge branch 'feature-connectors-openai' of https://github.com/micros…
crickman Jul 12, 2024
9fae258
.Net Remove Azure* redundant function calling classes (#7236)
SergeyMenshykh Jul 15, 2024
3851576
.Net: Remove unnecessary azure chat message content classes (#7259)
SergeyMenshykh Jul 15, 2024
4c6b99b
.Net: Minimize *prompt execution settings duplication (#7265)
SergeyMenshykh Jul 16, 2024
44f27a2
.Net: Cleanup (#7266)
SergeyMenshykh Jul 16, 2024
c425b78
.Net: OpenAI V2 - Concepts Migration - Phase 2.0 (#7233)
RogerBarreto Jul 16, 2024
f356b9d
.Net: Chat history serialization test + bug fix (#7305)
SergeyMenshykh Jul 17, 2024
fd79d99
Merge branch 'feature-connectors-openai' of https://github.com/micros…
crickman Jul 17, 2024
7f98d4f
Resolve merge from main
crickman Jul 17, 2024
8797fc9
Fix merge (exclude new concept sample and demo)
crickman Jul 17, 2024
3b8e54f
.Net: Refactor samples to use new {Azure}OpenAI connectors (#7334)
SergeyMenshykh Jul 17, 2024
d436430
.Net: Test execution settings compatibility (#7337)
SergeyMenshykh Jul 18, 2024
c03cc7f
.Net: Migrate remaining samples to new {Azure}OpenAI services (#7353)
SergeyMenshykh Jul 18, 2024
974dc99
.Net: OpenAI V2 - Demos Migration (#7384)
RogerBarreto Jul 22, 2024
6044fbb
Merge branch 'main' into feature-connectors-openai
crickman Jul 23, 2024
dd0e4fa
Merge branch 'main' into feature-connectors-openai
RogerBarreto Jul 23, 2024
ecd3fee
.Net: OpenAI V2 Optional Settings (#7409)
RogerBarreto Jul 23, 2024
89773be
Merge branch 'main' into feature-connectors-openai
RogerBarreto Jul 23, 2024
497f225
.Net: Net: OpenAI v2 Reusability (#7427)
RogerBarreto Jul 24, 2024
2f4785e
Merge branch 'main' into feature-connectors-openai
crickman Jul 24, 2024
3117d3c
.Net: OpenAI V2 Migration - Decomission V1 Phase 01 (#7446)
RogerBarreto Jul 25, 2024
61328ec
Merge branch 'main' into feature-connectors-openai
crickman Jul 25, 2024
12925ab
Merge branch 'main' into feature-connectors-openai
crickman Jul 25, 2024
21a905f
Merge new agent samples
crickman Jul 25, 2024
6c6bc5c
.Net: OpenAI V2 IntegrationTests Merge - Phase 02 (#7453)
RogerBarreto Jul 25, 2024
718505f
.Net: OpenAI V2 -> OpenAI Renaming - Phase 03 (#7454)
RogerBarreto Jul 26, 2024
8f26ee7
Merge branch 'main' into feature-connectors-openai
RogerBarreto Jul 26, 2024
93bfab4
.Net: OpenAI V2 Migration - Apply recommendations (#7471)
RogerBarreto Jul 27, 2024
8dbba0f
Merge branch 'main' into feature-connectors-openai
crickman Jul 29, 2024
4135c51
Merge branch 'main' into feature-connectors-openai
RogerBarreto Jul 29, 2024
719cce3
.Net: OpenAI V2 Migration - Small fixes (#7532)
RogerBarreto Jul 31, 2024
f0c97df
Merge branch 'main' into feature-connectors-openai
crickman Jul 31, 2024
6aa0d26
Merge branch 'main' into feature-connectors-openai
crickman Aug 1, 2024
a7e8c94
Merge branch 'main' into feature-connectors-openai
crickman Aug 5, 2024
c31269f
Merge branch 'main' into feature-connectors-openai
crickman Aug 5, 2024
65bfdf8
Merge branch 'main' into feature-connectors-openai
RogerBarreto Aug 6, 2024
d492d84
.Net: [Feature branch] Added release candidate suffix for production …
dmytrostruk Aug 6, 2024
092992b
Merge branch 'main' of https://github.com/microsoft/semantic-kernel i…
RogerBarreto Aug 7, 2024
84aece3
Fix Azure namespace
RogerBarreto Aug 7, 2024
77fefb9
Fix namespace order
RogerBarreto Aug 7, 2024
eeef023
Merge branch 'main' into feature-connectors-openai
crickman Aug 7, 2024
e8ace92
.Net: Allow chat history mutation from auto-function invocation filte…
SergeyMenshykh Aug 8, 2024
a18953f
.Net: Enable code coverage for OpenAi connectors (#7970)
SergeyMenshykh Aug 8, 2024
196cadd
Update base package version
crickman Aug 8, 2024
73319b1
Merge branch 'main' into feature-connectors-openai
crickman Aug 8, 2024
8be28e1
.Net: OpenAI V2 - Small fix (#8015)
RogerBarreto Aug 9, 2024
9e59698
.Net Agents - Assistant V2 Migration (#7126)
crickman Aug 12, 2024
45169b9
.Net: AzureOpenAI - Enable package validation (#8097)
RogerBarreto Aug 13, 2024
f673b55
Merge branch 'main' into feature-connectors-openai
RogerBarreto Aug 19, 2024
86e1df6
.Net: OpenAI V2 - Prompty UT Fix (#8277)
RogerBarreto Aug 19, 2024
ac038d2
Resolve sync with main
crickman Aug 19, 2024
3b95272
Merge branch 'main' into feature-connectors-openai
crickman Aug 19, 2024
5774c73
Sync new sample
crickman Aug 19, 2024
c93a56a
Namespace in sample
crickman Aug 19, 2024
c262d99
Resolve merge from main
crickman Aug 20, 2024
4d4e3ad
.Net: OpenAI V2 Version Update and Adjustments (#8392)
RogerBarreto Aug 27, 2024
335fafb
Python: .Net: OpenAI V2 Main Merge Conflict Fix (#8399)
RogerBarreto Aug 27, 2024
09190d0
.Net: [Feature Branch] .Net: Increase RC package version to 1.18.1 (#…
dmytrostruk Aug 27, 2024
742aa47
Python: .Net: OpenAI V2 - `main` MergeFix (#8405)
RogerBarreto Aug 28, 2024
0e7bf89
.Net: OpenAI V2 Bugfix for Streaming Asynchronous Filter Results (#8422)
RogerBarreto Aug 30, 2024
355729a
.Net: OpenAI V2 - Azure SDK beta.4 update + Integration Tests Fix (#8…
RogerBarreto Sep 2, 2024
ef2b8f3
.Net: Openai V2 - IT Passing, Client Request Body Optionality Improve…
RogerBarreto Sep 3, 2024
dd86e71
.Net: Prevent assigning a nullable variable to a non-nullable propert…
SergeyMenshykh Sep 3, 2024
ec49b50
Python: .Net OpenAI V2 MergeFix for GA (#8486)
RogerBarreto Sep 3, 2024
9dc683e
Merge branch 'main' into feature-connectors-openai
RogerBarreto Sep 3, 2024
972aff6
.Net: Update package version (#8496)
dmytrostruk Sep 3, 2024
541ca7c
.Net: [Feature Branch] Added required configuration (#8498)
dmytrostruk Sep 3, 2024
81ca740
.Net: [Feature Branch] Added configuration for text-to-image service …
dmytrostruk Sep 3, 2024
02d2208
.Net: [Feature Branch] Updated integration tests (#8500)
dmytrostruk Sep 3, 2024
9c2ee04
Added service id to OpenAI text-to-image config
dmytrostruk Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .github/_typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extend-exclude = [
"test_code_tokenizer.py",
"*response.json",
"test_content.txt",
"serializedChatHistoryV1_15_1.json"
]

[default.extend-words]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
reports: "./TestResults/Coverage/**/coverage.cobertura.xml"
targetdir: "./TestResults/Reports"
reporttypes: "JsonSummary"
assemblyfilters: "+Microsoft.SemanticKernel.Abstractions;+Microsoft.SemanticKernel.Core;+Microsoft.SemanticKernel.PromptTemplates.Handlebars;+Microsoft.SemanticKernel.Connectors.OpenAI;+Microsoft.SemanticKernel.Yaml;+Microsoft.SemanticKernel.Agents.Abstractions;+Microsoft.SemanticKernel.Agents.Core;+Microsoft.SemanticKernel.Agents.OpenAI"
assemblyfilters: "+Microsoft.SemanticKernel.Abstractions;+Microsoft.SemanticKernel.Core;+Microsoft.SemanticKernel.PromptTemplates.Handlebars;+Microsoft.SemanticKernel.Connectors.OpenAI;+Microsoft.SemanticKernel.Connectors.AzureOpenAI;+Microsoft.SemanticKernel.Yaml;+Microsoft.SemanticKernel.Agents.Abstractions;+Microsoft.SemanticKernel.Agents.Core;+Microsoft.SemanticKernel.Agents.OpenAI"

- name: Check coverage
shell: pwsh
Expand Down
7 changes: 6 additions & 1 deletion dotnet/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup>
<!-- In "main" branch this flag should be always "false". -->
<IsReleaseCandidate>false</IsReleaseCandidate>
</PropertyGroup>

<PropertyGroup>
<!-- Disable NuGet packaging by default. Projects can override. -->
<IsPackable>disable</IsPackable>
Expand All @@ -30,4 +35,4 @@
<_Parameter1>false</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
</Project>
</Project>
5 changes: 3 additions & 2 deletions dotnet/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="OpenAI" Version="2.0.0-beta.10" />
<PackageVersion Include="System.ClientModel" Version="1.1.0-beta.7" />
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.17" />
<PackageVersion Include="Azure.AI.OpenAI.Assistants" Version="1.0.0-beta.4" />
<PackageVersion Include="Azure.AI.OpenAI" Version="2.0.0-beta.4" />
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.3.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />
Expand Down
27 changes: 27 additions & 0 deletions dotnet/SK-dotnet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIModelRouter", "samples\De
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.AzureCosmosDBNoSQL.UnitTests", "src\Connectors\Connectors.AzureCosmosDBNoSQL.UnitTests\Connectors.AzureCosmosDBNoSQL.UnitTests.csproj", "{385A8FE5-87E2-4458-AE09-35E10BD2E67F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.OpenAI.UnitTests", "src\Connectors\Connectors.OpenAI.UnitTests\Connectors.OpenAI.UnitTests.csproj", "{36DDC119-C030-407E-AC51-A877E9E0F660}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.AzureOpenAI", "src\Connectors\Connectors.AzureOpenAI\Connectors.AzureOpenAI.csproj", "{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.AzureOpenAI.UnitTests", "src\Connectors\Connectors.AzureOpenAI.UnitTests\Connectors.AzureOpenAI.UnitTests.csproj", "{8CF06B22-50F3-4F71-A002-622DB49DF0F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -819,6 +825,24 @@ Global
{385A8FE5-87E2-4458-AE09-35E10BD2E67F}.Publish|Any CPU.Build.0 = Debug|Any CPU
{385A8FE5-87E2-4458-AE09-35E10BD2E67F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{385A8FE5-87E2-4458-AE09-35E10BD2E67F}.Release|Any CPU.Build.0 = Release|Any CPU
{36DDC119-C030-407E-AC51-A877E9E0F660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36DDC119-C030-407E-AC51-A877E9E0F660}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36DDC119-C030-407E-AC51-A877E9E0F660}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
{36DDC119-C030-407E-AC51-A877E9E0F660}.Publish|Any CPU.Build.0 = Debug|Any CPU
{36DDC119-C030-407E-AC51-A877E9E0F660}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36DDC119-C030-407E-AC51-A877E9E0F660}.Release|Any CPU.Build.0 = Release|Any CPU
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Publish|Any CPU.Build.0 = Publish|Any CPU
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Release|Any CPU.Build.0 = Release|Any CPU
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Publish|Any CPU.Build.0 = Debug|Any CPU
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -931,6 +955,9 @@ Global
{2918478E-BC86-4D53-9D01-9C318F80C14F} = {0247C2C9-86C3-45BA-8873-28B0948EDC0C}
{E06818E3-00A5-41AC-97ED-9491070CDEA1} = {5D4C0700-BBB5-418F-A7B2-F392B9A18263}
{385A8FE5-87E2-4458-AE09-35E10BD2E67F} = {0247C2C9-86C3-45BA-8873-28B0948EDC0C}
{36DDC119-C030-407E-AC51-A877E9E0F660} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
{8CF06B22-50F3-4F71-A002-622DB49DF0F5} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FBDC56A3-86AD-4323-AA0F-201E59123B83}
Expand Down
196 changes: 196 additions & 0 deletions dotnet/docs/OPENAI-CONNECTOR-MIGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# OpenAI Connector Migration Guide

This manual prepares you for the migration of your OpenAI Connector to the new OpenAI Connector. The new OpenAI Connector is a complete rewrite of the existing OpenAI Connector and is designed to be more efficient, reliable, and scalable. This manual will guide you through the migration process and help you understand the changes that have been made to the OpenAI Connector.

## 1. Package Setup when Using Azure

If you are working with Azure and or OpenAI public APIs, you will need to change the package from `Microsoft.SemanticKernel.Connectors.OpenAI` to `Microsoft.SemanticKernel.Connectors.AzureOpenAI`,

> [!IMPORTANT]
> The `Microsoft.SemanticKernel.Connectors.AzureOpenAI` package depends on the `Microsoft.SemanticKernel.Connectors.OpenAI` package so there's no need to add both to your project when using `OpenAI` related types.

```diff
- // Before
- using Microsoft.SemanticKernel.Connectors.OpenAI;
+ After
+ using Microsoft.SemanticKernel.Connectors.AzureOpenAI;
```

### 1.1 AzureOpenAIClient

When using Azure with OpenAI, before where you were using `OpenAIClient` you will need to update your code to use the new `AzureOpenAIClient` type.

### 1.2 Services

All services below now belong to the `Microsoft.SemanticKernel.Connectors.AzureOpenAI` namespace.

- `AzureOpenAIAudioToTextService`
- `AzureOpenAIChatCompletionService`
- `AzureOpenAITextEmbeddingGenerationService`
- `AzureOpenAITextToAudioService`
- `AzureOpenAITextToImageService`

## 2. Text Generation Deprecated

The latest `OpenAI` SDK does not support text generation modality, when migrating to their underlying SDK we had to drop the support and removed `TextGeneration` specific services but the existing `ChatCompletion` ones still supports (implements `ITextGenerationService`).

If you were using any of the `OpenAITextGenerationService` or `AzureOpenAITextGenerationService` you will need to update your code to target a chat completion model instead, using `OpenAIChatCompletionService` or `AzureOpenAIChatCompletionService` instead.

> [!NOTE]
> OpenAI and AzureOpenAI `ChatCompletion` services also implement the `ITextGenerationService` interface and that may not require any changes to your code if you were targeting the `ITextGenerationService` interface.

tags:
`OpenAITextGenerationService`,`AzureOpenAITextGenerationService`,
`AddOpenAITextGeneration`,`AddAzureOpenAITextGeneration`

## 3. ChatCompletion Multiple Choices Deprecated

The latest `OpenAI` SDK does not support multiple choices, when migrating to their underlying SDK we had to drop the support and removed `ResultsPerPrompt` also from the `OpenAIPromptExecutionSettings`.

tags: `ResultsPerPrompt`,`results_per_prompt`

## 4. OpenAI File Service Deprecation

The `OpenAIFileService` was deprecated in the latest version of the OpenAI Connector. We strongly recommend to update your code to use the new `OpenAIClient.GetFileClient()` for file management operations.

## 5. SemanticKernel MetaPackage

To be retro compatible with the new OpenAI and AzureOpenAI Connectors, our `Microsoft.SemanticKernel` meta package changed its dependency to use the new `Microsoft.SemanticKernel.Connectors.AzureOpenAI` package that depends on the `Microsoft.SemanticKernel.Connectors.OpenAI` package. This way if you are using the metapackage, no change is needed to get access to `Azure` related types.

## 6. Contents

### 6.1 OpenAIChatMessageContent

- The `Tools` property type has changed from `IReadOnlyList<ChatCompletionsToolCall>` to `IReadOnlyList<ChatToolCall>`.

- Inner content type has changed from `ChatCompletionsFunctionToolCall` to `ChatToolCall`.

- Metadata type `FunctionToolCalls` has changed from `IEnumerable<ChatCompletionsFunctionToolCall>` to `IEnumerable<ChatToolCall>`.

### 6.2 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<StreamingToolCallUpdate>?`.
- The `AuthorName` property is not initialized because it's not provided by the underlying library anymore.

## 6.3 Metrics for AzureOpenAI Connector

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`
- `semantic_kernel.connectors.openai.tokens.total`

## 7. Using Azure with your data (Data Sources)

With the new `AzureOpenAIClient`, you can now specify your datasource thru the options and that requires a small change in your code to the new type.

Before

```csharp
var promptExecutionSettings = new OpenAIPromptExecutionSettings
{
AzureChatExtensionsOptions = new AzureChatExtensionsOptions
{
Extensions = [ new AzureSearchChatExtensionConfiguration
{
SearchEndpoint = new Uri(TestConfiguration.AzureAISearch.Endpoint),
Authentication = new OnYourDataApiKeyAuthenticationOptions(TestConfiguration.AzureAISearch.ApiKey),
IndexName = TestConfiguration.AzureAISearch.IndexName
}]
};
};
```

After

```csharp
var promptExecutionSettings = new AzureOpenAIPromptExecutionSettings
{
AzureChatDataSource = new AzureSearchChatDataSource
{
Endpoint = new Uri(TestConfiguration.AzureAISearch.Endpoint),
Authentication = DataSourceAuthentication.FromApiKey(TestConfiguration.AzureAISearch.ApiKey),
IndexName = TestConfiguration.AzureAISearch.IndexName
}
};
```

## 8. Breaking glass scenarios

Breaking glass scenarios are scenarios where you may need to update your code to use the new OpenAI Connector. Below are some of the breaking changes that you may need to be aware of.

#### 8.1 KernelContent Metadata

Some of the keys in the content metadata dictionary have changed, you will need to update your code to when using the previous key names.

- `Created` -> `CreatedAt`

#### 8.2 Prompt Filter Results

The `PromptFilterResults` metadata type has changed from `IReadOnlyList<ContentFilterResultsForPrompt>` to `ContentFilterResultForPrompt`.

#### 8.3 Content Filter Results

The `ContentFilterResultsForPrompt` type has changed from `ContentFilterResultsForChoice` to `ContentFilterResultForResponse`.

#### 8.4 Finish Reason

The FinishReason metadata string value has changed from `stop` to `Stop`

#### 8.5 Tool Calls

The ToolCalls metadata string value has changed from `tool_calls` to `ToolCalls`

#### 8.6 LogProbs / Log Probability Info

The `LogProbabilityInfo` type has changed from `ChatChoiceLogProbabilityInfo` to `IReadOnlyList<ChatTokenLogProbabilityInfo>`.

#### 8.7 Finish Details, Index, and Enhancements

All of above have been removed.

#### 8.8 Token Usage

The Token usage naming convention from `OpenAI` changed from `Completion`, `Prompt` tokens to `Output` and `Input` respectively. You will need to update your code to use the new naming.

The type also changed from `CompletionsUsage` to `ChatTokenUsage`.

[Example of Token Usage Metadata Changes](https://github.com/microsoft/semantic-kernel/pull/7151/files#diff-a323107b9f8dc8559a83e50080c6e34551ddf6d9d770197a473f249589e8fb47)

```diff
- Before
- var usage = FunctionResult.Metadata?["Usage"] as CompletionsUsage;
- var completionTokesn = usage?.CompletionTokens ?? 0;
- var promptTokens = usage?.PromptTokens ?? 0;

+ After
+ var usage = FunctionResult.Metadata?["Usage"] as ChatTokenUsage;
+ var promptTokens = usage?.InputTokens ?? 0;
+ var completionTokens = completionTokens: usage?.OutputTokens ?? 0;

totalTokens: usage?.TotalTokens ?? 0;
```

#### 8.9 OpenAIClient

The `OpenAIClient` type previously was a Azure specific namespace type but now it is an `OpenAI` SDK namespace type, you will need to update your code to use the new `OpenAIClient` type.

When using Azure, you will need to update your code to use the new `AzureOpenAIClient` type.

#### 8.10 Pipeline Configuration

The new `OpenAI` SDK uses a different pipeline configuration, and has a dependency on `System.ClientModel` package. You will need to update your code to use the new `HttpClientPipelineTransport` transport configuration where before you were using `HttpClientTransport` from `Azure.Core.Pipeline`.

[Example of Pipeline Configuration](https://github.com/microsoft/semantic-kernel/pull/7151/files#diff-fab02d9a75bf43cb57f71dddc920c3f72882acf83fb125d8cad963a643d26eb3)

```diff
var clientOptions = new OpenAIClientOptions
{
- // Before: From Azure.Core.Pipeline
- Transport = new HttpClientTransport(httpClient),

+ // After: From OpenAI SDK -> System.ClientModel
+ Transport = new HttpClientPipelineTransport(httpClient),
};
```
5 changes: 2 additions & 3 deletions dotnet/nuget/nuget-package.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<Project>
<PropertyGroup>
<!-- Central version prefix - applies to all nuget packages. -->
<VersionPrefix>1.17.2</VersionPrefix>

<VersionPrefix>1.18.2</VersionPrefix>
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</PackageVersion>

<Configurations>Debug;Release;Publish</Configurations>
<IsPackable>true</IsPackable>

<!-- Package validation. Baseline Version should be lower or equal to current version. -->
<PackageValidationBaselineVersion>1.17.2</PackageValidationBaselineVersion>
<PackageValidationBaselineVersion>1.18.0-rc</PackageValidationBaselineVersion>
<!-- Validate assembly attributes only for Publish builds -->
<NoWarn Condition="'$(Configuration)' != 'Publish'">$(NoWarn);CP0003</NoWarn>
<!-- Do not validate reference assemblies -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Agents;
/// Demonstrate usage of <see cref="IAutoFunctionInvocationFilter"/> for both direction invocation
/// of <see cref="ChatCompletionAgent"/> and via <see cref="AgentChat"/>.
/// </summary>
public class ChatCompletion_FunctionTermination(ITestOutputHelper output) : BaseTest(output)
public class ChatCompletion_FunctionTermination(ITestOutputHelper output) : BaseAgentsTest(output)
{
[Fact]
public async Task UseAutoFunctionInvocationFilterWithAgentInvocationAsync()
Expand Down Expand Up @@ -44,25 +44,25 @@ public async Task UseAutoFunctionInvocationFilterWithAgentInvocationAsync()
Console.WriteLine("================================");
foreach (ChatMessageContent message in chat)
{
this.WriteContent(message);
this.WriteAgentChatMessage(message);
}

// Local function to invoke agent and display the conversation messages.
async Task InvokeAgentAsync(string input)
{
ChatMessageContent userContent = new(AuthorRole.User, input);
chat.Add(userContent);
this.WriteContent(userContent);
ChatMessageContent message = new(AuthorRole.User, input);
chat.Add(message);
this.WriteAgentChatMessage(message);

await foreach (ChatMessageContent content in agent.InvokeAsync(chat))
await foreach (ChatMessageContent response in agent.InvokeAsync(chat))
{
// Do not add a message implicitly added to the history.
if (!content.Items.Any(i => i is FunctionCallContent || i is FunctionResultContent))
if (!response.Items.Any(i => i is FunctionCallContent || i is FunctionResultContent))
{
chat.Add(content);
chat.Add(response);
}

this.WriteContent(content);
this.WriteAgentChatMessage(response);
}
}
}
Expand Down Expand Up @@ -98,28 +98,23 @@ public async Task UseAutoFunctionInvocationFilterWithAgentChatAsync()
ChatMessageContent[] history = await chat.GetChatMessagesAsync().ToArrayAsync();
for (int index = history.Length; index > 0; --index)
{
this.WriteContent(history[index - 1]);
this.WriteAgentChatMessage(history[index - 1]);
}

// Local function to invoke agent and display the conversation messages.
async Task InvokeAgentAsync(string input)
{
ChatMessageContent userContent = new(AuthorRole.User, input);
chat.AddChatMessage(userContent);
this.WriteContent(userContent);
ChatMessageContent message = new(AuthorRole.User, input);
chat.AddChatMessage(message);
this.WriteAgentChatMessage(message);

await foreach (ChatMessageContent content in chat.InvokeAsync(agent))
await foreach (ChatMessageContent response in chat.InvokeAsync(agent))
{
this.WriteContent(content);
this.WriteAgentChatMessage(response);
}
}
}

private void WriteContent(ChatMessageContent content)
{
Console.WriteLine($"[{content.Items.LastOrDefault()?.GetType().Name ?? "(empty)"}] {content.Role} : '{content.Content}'");
}

private Kernel CreateKernelWithFilter()
{
IKernelBuilder builder = Kernel.CreateBuilder();
Expand Down
Loading
Loading