Skip to content

Commit cc63d56

Browse files
crickmanRogerBarretoSergeyMenshykhdmytrostrukrogerio-barreto
authored
.Net: OpenAI V2 & Assistants V2 - GA (microsoft#7151)
Accumulation of incremental changes that were reviewed separately. This change fundamentally grapples with updating the Azure AI OpenAI SDK from V1 to V2. This involves: - Including the OpenAI SDK dependency - Refactoring the OpenAI Connector - Introducing an Azure OpenAI Connector - Update the experimental `Agents.OpenAI` to support V2 assistant features (breaking change) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Roger Barreto <[email protected]> Co-authored-by: SergeyMenshykh <[email protected]> Co-authored-by: SergeyMenshykh <[email protected]> Co-authored-by: Dmytro Struk <[email protected]> Co-authored-by: Roger Barreto <[email protected]> Co-authored-by: Dr. Artificial曾小健 <[email protected]> Co-authored-by: westey <[email protected]> Co-authored-by: Mark Wallace <[email protected]> Co-authored-by: Tao Chen <[email protected]> Co-authored-by: Evan Mattson <[email protected]> Co-authored-by: Maurycy Markowski <[email protected]> Co-authored-by: gparmigiani <[email protected]> Co-authored-by: Atiqur Rahman Foyshal <[email protected]> Co-authored-by: Eduard van Valkenburg <[email protected]> Co-authored-by: Andrew Desousa <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marcelo Garcia <[email protected]> Co-authored-by: Marcelo Garcia 🛸 <[email protected]> Co-authored-by: Eirik Tsarpalis <[email protected]>
1 parent 0bee1c1 commit cc63d56

File tree

364 files changed

+15290
-12136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

364 files changed

+15290
-12136
lines changed

Diff for: .github/_typos.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extend-exclude = [
1616
"test_code_tokenizer.py",
1717
"*response.json",
1818
"test_content.txt",
19+
"serializedChatHistoryV1_15_1.json"
1920
]
2021

2122
[default.extend-words]

Diff for: .github/workflows/dotnet-build-and-test.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
AzureOpenAI__Label: azure-text-davinci-003
9797
AzureOpenAIEmbedding__Label: azure-text-embedding-ada-002
9898
AzureOpenAI__DeploymentName: ${{ vars.AZUREOPENAI__DEPLOYMENTNAME }}
99+
AzureOpenAI__ChatDeploymentName: ${{ vars.AZUREOPENAI__CHATDEPLOYMENTNAME }}
99100
AzureOpenAIEmbeddings__DeploymentName: ${{ vars.AZUREOPENAIEMBEDDING__DEPLOYMENTNAME }}
100101
AzureOpenAI__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
101102
AzureOpenAIEmbeddings__Endpoint: ${{ secrets.AZUREOPENAI_EASTUS__ENDPOINT }}
@@ -110,14 +111,20 @@ jobs:
110111
OpenAITextToAudio__ModelId: ${{ vars.OPENAITEXTTOAUDIO__MODELID }}
111112
OpenAIAudioToText__ApiKey: ${{ secrets.OPENAIAUDIOTOTEXT__APIKEY }}
112113
OpenAIAudioToText__ModelId: ${{ vars.OPENAIAUDIOTOTEXT__MODELID }}
114+
OpenAITextToImage__ApiKey: ${{ secrets.OPENAITEXTTOIMAGE__APIKEY }}
115+
OpenAITextToImage__ModelId: ${{ vars.OPENAITEXTTOIMAGE__MODELID }}
113116
AzureOpenAITextToAudio__ApiKey: ${{ secrets.AZUREOPENAITEXTTOAUDIO__APIKEY }}
114117
AzureOpenAITextToAudio__Endpoint: ${{ secrets.AZUREOPENAITEXTTOAUDIO__ENDPOINT }}
115118
AzureOpenAITextToAudio__DeploymentName: ${{ vars.AZUREOPENAITEXTTOAUDIO__DEPLOYMENTNAME }}
116119
AzureOpenAIAudioToText__ApiKey: ${{ secrets.AZUREOPENAIAUDIOTOTEXT__APIKEY }}
117120
AzureOpenAIAudioToText__Endpoint: ${{ secrets.AZUREOPENAIAUDIOTOTEXT__ENDPOINT }}
118121
AzureOpenAIAudioToText__DeploymentName: ${{ vars.AZUREOPENAIAUDIOTOTEXT__DEPLOYMENTNAME }}
122+
AzureOpenAITextToImage__ApiKey: ${{ secrets.AZUREOPENAITEXTTOIMAGE__APIKEY }}
123+
AzureOpenAITextToImage__Endpoint: ${{ secrets.AZUREOPENAITEXTTOIMAGE__ENDPOINT }}
124+
AzureOpenAITextToImage__DeploymentName: ${{ vars.AZUREOPENAITEXTTOIMAGE__DEPLOYMENTNAME }}
119125
Bing__ApiKey: ${{ secrets.BING__APIKEY }}
120126
OpenAI__ApiKey: ${{ secrets.OPENAI__APIKEY }}
127+
OpenAI__ChatModelId: ${{ vars.OPENAI__CHATMODELID }}
121128

122129
# Generate test reports and check coverage
123130
- name: Generate test reports
@@ -126,7 +133,7 @@ jobs:
126133
reports: "./TestResults/Coverage/**/coverage.cobertura.xml"
127134
targetdir: "./TestResults/Reports"
128135
reporttypes: "JsonSummary"
129-
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"
136+
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"
130137

131138
- name: Check coverage
132139
shell: pwsh

Diff for: dotnet/Directory.Build.props

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
<ImplicitUsings>disable</ImplicitUsings>
1212
</PropertyGroup>
1313

14+
<PropertyGroup>
15+
<!-- In "main" branch this flag should be always "false". -->
16+
<IsReleaseCandidate>false</IsReleaseCandidate>
17+
</PropertyGroup>
18+
1419
<PropertyGroup>
1520
<!-- Disable NuGet packaging by default. Projects can override. -->
1621
<IsPackable>disable</IsPackable>
@@ -30,4 +35,4 @@
3035
<_Parameter1>false</_Parameter1>
3136
</AssemblyAttribute>
3237
</ItemGroup>
33-
</Project>
38+
</Project>

Diff for: dotnet/Directory.Packages.props

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
66
</PropertyGroup>
77
<ItemGroup>
8+
<PackageVersion Include="OpenAI" Version="2.0.0-beta.10" />
9+
<PackageVersion Include="System.ClientModel" Version="1.1.0-beta.7" />
810
<PackageVersion Include="Azure.AI.ContentSafety" Version="1.0.0" />
9-
<PackageVersion Include="Azure.AI.OpenAI" Version="1.0.0-beta.17" />
10-
<PackageVersion Include="Azure.AI.OpenAI.Assistants" Version="1.0.0-beta.4" />
11+
<PackageVersion Include="Azure.AI.OpenAI" Version="2.0.0-beta.4" />
1112
<PackageVersion Include="Azure.Identity" Version="1.12.0" />
1213
<PackageVersion Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.3.0" />
1314
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />

Diff for: dotnet/SK-dotnet.sln

+27
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIModelRouter", "samples\De
326326
EndProject
327327
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.AzureCosmosDBNoSQL.UnitTests", "src\Connectors\Connectors.AzureCosmosDBNoSQL.UnitTests\Connectors.AzureCosmosDBNoSQL.UnitTests.csproj", "{385A8FE5-87E2-4458-AE09-35E10BD2E67F}"
328328
EndProject
329+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.OpenAI.UnitTests", "src\Connectors\Connectors.OpenAI.UnitTests\Connectors.OpenAI.UnitTests.csproj", "{36DDC119-C030-407E-AC51-A877E9E0F660}"
330+
EndProject
331+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.AzureOpenAI", "src\Connectors\Connectors.AzureOpenAI\Connectors.AzureOpenAI.csproj", "{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}"
332+
EndProject
333+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Connectors.AzureOpenAI.UnitTests", "src\Connectors\Connectors.AzureOpenAI.UnitTests\Connectors.AzureOpenAI.UnitTests.csproj", "{8CF06B22-50F3-4F71-A002-622DB49DF0F5}"
334+
EndProject
329335
Global
330336
GlobalSection(SolutionConfigurationPlatforms) = preSolution
331337
Debug|Any CPU = Debug|Any CPU
@@ -819,6 +825,24 @@ Global
819825
{385A8FE5-87E2-4458-AE09-35E10BD2E67F}.Publish|Any CPU.Build.0 = Debug|Any CPU
820826
{385A8FE5-87E2-4458-AE09-35E10BD2E67F}.Release|Any CPU.ActiveCfg = Release|Any CPU
821827
{385A8FE5-87E2-4458-AE09-35E10BD2E67F}.Release|Any CPU.Build.0 = Release|Any CPU
828+
{36DDC119-C030-407E-AC51-A877E9E0F660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
829+
{36DDC119-C030-407E-AC51-A877E9E0F660}.Debug|Any CPU.Build.0 = Debug|Any CPU
830+
{36DDC119-C030-407E-AC51-A877E9E0F660}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
831+
{36DDC119-C030-407E-AC51-A877E9E0F660}.Publish|Any CPU.Build.0 = Debug|Any CPU
832+
{36DDC119-C030-407E-AC51-A877E9E0F660}.Release|Any CPU.ActiveCfg = Release|Any CPU
833+
{36DDC119-C030-407E-AC51-A877E9E0F660}.Release|Any CPU.Build.0 = Release|Any CPU
834+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
835+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
836+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Publish|Any CPU.ActiveCfg = Publish|Any CPU
837+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Publish|Any CPU.Build.0 = Publish|Any CPU
838+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
839+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0}.Release|Any CPU.Build.0 = Release|Any CPU
840+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
841+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
842+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Publish|Any CPU.ActiveCfg = Debug|Any CPU
843+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Publish|Any CPU.Build.0 = Debug|Any CPU
844+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
845+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5}.Release|Any CPU.Build.0 = Release|Any CPU
822846
EndGlobalSection
823847
GlobalSection(SolutionProperties) = preSolution
824848
HideSolutionNode = FALSE
@@ -931,6 +955,9 @@ Global
931955
{2918478E-BC86-4D53-9D01-9C318F80C14F} = {0247C2C9-86C3-45BA-8873-28B0948EDC0C}
932956
{E06818E3-00A5-41AC-97ED-9491070CDEA1} = {5D4C0700-BBB5-418F-A7B2-F392B9A18263}
933957
{385A8FE5-87E2-4458-AE09-35E10BD2E67F} = {0247C2C9-86C3-45BA-8873-28B0948EDC0C}
958+
{36DDC119-C030-407E-AC51-A877E9E0F660} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
959+
{7AAD7388-307D-41FB-B80A-EF9E3A4E31F0} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
960+
{8CF06B22-50F3-4F71-A002-622DB49DF0F5} = {1B4CBDE0-10C2-4E7D-9CD0-FE7586C96ED1}
934961
EndGlobalSection
935962
GlobalSection(ExtensibilityGlobals) = postSolution
936963
SolutionGuid = {FBDC56A3-86AD-4323-AA0F-201E59123B83}

Diff for: dotnet/docs/OPENAI-CONNECTOR-MIGRATION.md

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
# OpenAI Connector Migration Guide
2+
3+
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.
4+
5+
## 1. Package Setup when Using Azure
6+
7+
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`,
8+
9+
> [!IMPORTANT]
10+
> 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.
11+
12+
```diff
13+
- // Before
14+
- using Microsoft.SemanticKernel.Connectors.OpenAI;
15+
+ After
16+
+ using Microsoft.SemanticKernel.Connectors.AzureOpenAI;
17+
```
18+
19+
### 1.1 AzureOpenAIClient
20+
21+
When using Azure with OpenAI, before where you were using `OpenAIClient` you will need to update your code to use the new `AzureOpenAIClient` type.
22+
23+
### 1.2 Services
24+
25+
All services below now belong to the `Microsoft.SemanticKernel.Connectors.AzureOpenAI` namespace.
26+
27+
- `AzureOpenAIAudioToTextService`
28+
- `AzureOpenAIChatCompletionService`
29+
- `AzureOpenAITextEmbeddingGenerationService`
30+
- `AzureOpenAITextToAudioService`
31+
- `AzureOpenAITextToImageService`
32+
33+
## 2. Text Generation Deprecated
34+
35+
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`).
36+
37+
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.
38+
39+
> [!NOTE]
40+
> 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.
41+
42+
tags:
43+
`OpenAITextGenerationService`,`AzureOpenAITextGenerationService`,
44+
`AddOpenAITextGeneration`,`AddAzureOpenAITextGeneration`
45+
46+
## 3. ChatCompletion Multiple Choices Deprecated
47+
48+
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`.
49+
50+
tags: `ResultsPerPrompt`,`results_per_prompt`
51+
52+
## 4. OpenAI File Service Deprecation
53+
54+
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.
55+
56+
## 5. SemanticKernel MetaPackage
57+
58+
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.
59+
60+
## 6. Contents
61+
62+
### 6.1 OpenAIChatMessageContent
63+
64+
- The `Tools` property type has changed from `IReadOnlyList<ChatCompletionsToolCall>` to `IReadOnlyList<ChatToolCall>`.
65+
66+
- Inner content type has changed from `ChatCompletionsFunctionToolCall` to `ChatToolCall`.
67+
68+
- Metadata type `FunctionToolCalls` has changed from `IEnumerable<ChatCompletionsFunctionToolCall>` to `IEnumerable<ChatToolCall>`.
69+
70+
### 6.2 OpenAIStreamingChatMessageContent
71+
72+
- The `FinishReason` property type has changed from `CompletionsFinishReason` to `FinishReason`.
73+
- The `ToolCallUpdate` property has been renamed to `ToolCallUpdates` and its type has changed from `StreamingToolCallUpdate?` to `IReadOnlyList<StreamingToolCallUpdate>?`.
74+
- The `AuthorName` property is not initialized because it's not provided by the underlying library anymore.
75+
76+
## 6.3 Metrics for AzureOpenAI Connector
77+
78+
The meter `s_meter = new("Microsoft.SemanticKernel.Connectors.OpenAI");` and the relevant counters still have old names that contain "openai" in them, such as:
79+
80+
- `semantic_kernel.connectors.openai.tokens.prompt`
81+
- `semantic_kernel.connectors.openai.tokens.completion`
82+
- `semantic_kernel.connectors.openai.tokens.total`
83+
84+
## 7. Using Azure with your data (Data Sources)
85+
86+
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.
87+
88+
Before
89+
90+
```csharp
91+
var promptExecutionSettings = new OpenAIPromptExecutionSettings
92+
{
93+
AzureChatExtensionsOptions = new AzureChatExtensionsOptions
94+
{
95+
Extensions = [ new AzureSearchChatExtensionConfiguration
96+
{
97+
SearchEndpoint = new Uri(TestConfiguration.AzureAISearch.Endpoint),
98+
Authentication = new OnYourDataApiKeyAuthenticationOptions(TestConfiguration.AzureAISearch.ApiKey),
99+
IndexName = TestConfiguration.AzureAISearch.IndexName
100+
}]
101+
};
102+
};
103+
```
104+
105+
After
106+
107+
```csharp
108+
var promptExecutionSettings = new AzureOpenAIPromptExecutionSettings
109+
{
110+
AzureChatDataSource = new AzureSearchChatDataSource
111+
{
112+
Endpoint = new Uri(TestConfiguration.AzureAISearch.Endpoint),
113+
Authentication = DataSourceAuthentication.FromApiKey(TestConfiguration.AzureAISearch.ApiKey),
114+
IndexName = TestConfiguration.AzureAISearch.IndexName
115+
}
116+
};
117+
```
118+
119+
## 8. Breaking glass scenarios
120+
121+
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.
122+
123+
#### 8.1 KernelContent Metadata
124+
125+
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.
126+
127+
- `Created` -> `CreatedAt`
128+
129+
#### 8.2 Prompt Filter Results
130+
131+
The `PromptFilterResults` metadata type has changed from `IReadOnlyList<ContentFilterResultsForPrompt>` to `ContentFilterResultForPrompt`.
132+
133+
#### 8.3 Content Filter Results
134+
135+
The `ContentFilterResultsForPrompt` type has changed from `ContentFilterResultsForChoice` to `ContentFilterResultForResponse`.
136+
137+
#### 8.4 Finish Reason
138+
139+
The FinishReason metadata string value has changed from `stop` to `Stop`
140+
141+
#### 8.5 Tool Calls
142+
143+
The ToolCalls metadata string value has changed from `tool_calls` to `ToolCalls`
144+
145+
#### 8.6 LogProbs / Log Probability Info
146+
147+
The `LogProbabilityInfo` type has changed from `ChatChoiceLogProbabilityInfo` to `IReadOnlyList<ChatTokenLogProbabilityInfo>`.
148+
149+
#### 8.7 Finish Details, Index, and Enhancements
150+
151+
All of above have been removed.
152+
153+
#### 8.8 Token Usage
154+
155+
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.
156+
157+
The type also changed from `CompletionsUsage` to `ChatTokenUsage`.
158+
159+
[Example of Token Usage Metadata Changes](https://github.com/microsoft/semantic-kernel/pull/7151/files#diff-a323107b9f8dc8559a83e50080c6e34551ddf6d9d770197a473f249589e8fb47)
160+
161+
```diff
162+
- Before
163+
- var usage = FunctionResult.Metadata?["Usage"] as CompletionsUsage;
164+
- var completionTokesn = usage?.CompletionTokens ?? 0;
165+
- var promptTokens = usage?.PromptTokens ?? 0;
166+
167+
+ After
168+
+ var usage = FunctionResult.Metadata?["Usage"] as ChatTokenUsage;
169+
+ var promptTokens = usage?.InputTokens ?? 0;
170+
+ var completionTokens = completionTokens: usage?.OutputTokens ?? 0;
171+
172+
totalTokens: usage?.TotalTokens ?? 0;
173+
```
174+
175+
#### 8.9 OpenAIClient
176+
177+
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.
178+
179+
When using Azure, you will need to update your code to use the new `AzureOpenAIClient` type.
180+
181+
#### 8.10 Pipeline Configuration
182+
183+
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`.
184+
185+
[Example of Pipeline Configuration](https://github.com/microsoft/semantic-kernel/pull/7151/files#diff-fab02d9a75bf43cb57f71dddc920c3f72882acf83fb125d8cad963a643d26eb3)
186+
187+
```diff
188+
var clientOptions = new OpenAIClientOptions
189+
{
190+
- // Before: From Azure.Core.Pipeline
191+
- Transport = new HttpClientTransport(httpClient),
192+
193+
+ // After: From OpenAI SDK -> System.ClientModel
194+
+ Transport = new HttpClientPipelineTransport(httpClient),
195+
};
196+
```

Diff for: dotnet/nuget/nuget-package.props

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<Project>
22
<PropertyGroup>
33
<!-- Central version prefix - applies to all nuget packages. -->
4-
<VersionPrefix>1.17.2</VersionPrefix>
5-
4+
<VersionPrefix>1.18.2</VersionPrefix>
65
<PackageVersion Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</PackageVersion>
76
<PackageVersion Condition="'$(VersionSuffix)' == ''">$(VersionPrefix)</PackageVersion>
87

98
<Configurations>Debug;Release;Publish</Configurations>
109
<IsPackable>true</IsPackable>
1110

1211
<!-- Package validation. Baseline Version should be lower or equal to current version. -->
13-
<PackageValidationBaselineVersion>1.17.2</PackageValidationBaselineVersion>
12+
<PackageValidationBaselineVersion>1.18.0-rc</PackageValidationBaselineVersion>
1413
<!-- Validate assembly attributes only for Publish builds -->
1514
<NoWarn Condition="'$(Configuration)' != 'Publish'">$(NoWarn);CP0003</NoWarn>
1615
<!-- Do not validate reference assemblies -->

0 commit comments

Comments
 (0)