Skip to content

Commit f5b4dfd

Browse files
Azure OpenAI updates (Azure#46103)
* Update OpenAI.TestFramework for Sytem.ClientModel version 1.1.0 * Update OpenAI.TestFramework code * Update all code use to GA System.ClientModel 1.1.0 (#266) --------- Co-authored-by: Anne Thompson <[email protected]> * Update Azure OpenAI code * Update Azure OpenAI test code * Revert change * Fix anaylyze build failures * Try to work around build failure * Remove files accidentally added to wrong folder * Address PR feedback * Address spell checker issues + update for newer System.Text.Json version * More spell checker fixes * Update tests since typo was corrected. --------- Co-authored-by: Anne Thompson <[email protected]>
1 parent 01a4635 commit f5b4dfd

File tree

156 files changed

+2902
-2607
lines changed

Some content is hidden

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

156 files changed

+2902
-2607
lines changed

.vscode/cspell.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"*.user",
3535
".vscode/cspell.json",
3636
"assets.json",
37+
"eng/Packages.Data.props",
3738
"sdk/confidentialledger/Azure.Security.CodeTransparency/tests/TestFiles/*",
3839
// These services are opted out of public API surface spell checking.
3940
// Spelling issues must be addressed before adding these back in.
@@ -48,6 +49,7 @@
4849
"sdk/modelsrepository/*/api/*.cs",
4950
"sdk/monitor/Azure.ResourceManager.Monitor/api/*.cs",
5051
"sdk/objectanchors/*/api/*.cs",
52+
"sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json",
5153
"sdk/purview/*/api/*.cs",
5254
"sdk/remoterendering/*/api/*.cs",
5355
"sdk/videoanalyzer/*/api/*.cs",
@@ -975,6 +977,25 @@
975977
"ipfix"
976978
]
977979
},
980+
{
981+
"filename": "**/sdk/openai/**/*",
982+
"words": [
983+
"AOAI",
984+
"Arrr",
985+
"Dall",
986+
"Dalle",
987+
"Dall-E",
988+
"devcert",
989+
"Filip",
990+
"Filip's",
991+
"granularities",
992+
"haikus",
993+
"msdocs",
994+
"OpenAI",
995+
"Pavleski",
996+
"Tekakwitha"
997+
]
998+
},
978999
{
9791000
"filename": "**/sdk/operationalinsights/**/*.cs",
9801001
"words": [

eng/Packages.Data.props

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
<!-- BCL packages -->
8888
<PackageReference Update="System.Buffers" Version="4.5.1" />
89-
<PackageReference Update="System.ClientModel" Version="1.0.0" />
89+
<PackageReference Update="System.ClientModel" Version="1.1.0" />
9090
<PackageReference Update="System.IO.Hashing" Version="6.0.0" />
9191
<PackageReference Update="System.Memory" Version="4.5.5" />
9292
<PackageReference Update="System.Memory.Data" Version="1.0.2" />
@@ -157,7 +157,7 @@
157157
<PackageReference Update="Microsoft.Identity.Client.Extensions.Msal" Version="4.62.0" />
158158
<!--
159159
TODO: This package needs to be released as GA and arch-board approved before taking a dependency in any stable SDK library.
160-
Currently, it is referencd by Azure.Identity.Broker which is still in beta
160+
Currently, it is referenced by Azure.Identity.Broker which is still in beta
161161
-->
162162
<PackageReference Update="Microsoft.Identity.Client.Broker" Version="4.62.0" />
163163

@@ -179,7 +179,7 @@
179179
</ItemGroup>
180180

181181
<ItemGroup Condition="$(MSBuildProjectName.StartsWith('Azure.AI.OpenAI'))">
182-
<PackageReference Update="OpenAI" Version="2.0.0-beta.7" />
182+
<PackageReference Update="OpenAI" Version="2.0.0-beta.12" />
183183
</ItemGroup>
184184

185185
<!--
@@ -350,6 +350,7 @@
350350
<PackageReference Update="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
351351
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
352352
<PackageReference Update="PublicApiGenerator" Version="10.0.1" />
353+
<PackageReference Update="System.ClientModel" Version="1.1.0" />
353354
<PackageReference Update="System.Diagnostics.TraceSource" Version="4.3.0" />
354355
<PackageReference Update="System.IO.Compression" Version="4.3.0" />
355356
<PackageReference Update="System.IO.Pipelines" Version="4.5.1" />

sdk/openai/Azure.AI.OpenAI.Assistants/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
364364
[openai_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
365365
[openai_rest]: https://learn.microsoft.com/azure/cognitive-services/openai/reference
366366
[azure_openai_completions_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/completions
367-
[azure_openai_embeddgings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
367+
[azure_openai_embeddings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
368368
[openai_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md
369369
[cla]: https://cla.microsoft.com
370370
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/

sdk/openai/Azure.AI.OpenAI/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<ExternalAzureCoreLibrary>../../external/Azure.Core.Slim/netstandard2.0/Azure.Core.Slim.dll</ExternalAzureCoreLibrary>
1414
-->
1515
</PropertyGroup>
16-
16+
1717
<!--
1818
Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props
1919
-->

sdk/openai/Azure.AI.OpenAI/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ ChatCompletion completion = chatClient.CompleteChat(
157157
[
158158
// System messages represent instructions or other guidance about how the assistant should behave
159159
new SystemChatMessage("You are a helpful assistant that talks like a pirate."),
160-
// User messages represent user input, whether historical or the most recen tinput
160+
// User messages represent user input, whether historical or the most recent input
161161
new UserChatMessage("Hi, can you help me?"),
162162
// Assistant messages in a request represent conversation history for responses
163163
new AssistantChatMessage("Arrr! Of course, me hearty! What can I do for ye?"),
@@ -362,7 +362,9 @@ foreach (KeyValuePair<int, string> indexToIdPair in toolCallIdsByIndex)
362362
functionArgumentBuildersByIndex[indexToIdPair.Key].ToString()));
363363
}
364364

365-
conversationMessages.Add(new AssistantChatMessage(toolCalls, contentBuilder.ToString()));
365+
var assistantChatMessage = new AssistantChatMessage(toolCalls);
366+
assistantChatMessage.Content.Add(ChatMessageContentPart.CreateTextPart(contentBuilder.ToString()));
367+
conversationMessages.Add(assistantChatMessage);
366368

367369
// Placeholder: each tool call must be resolved, like in the non-streaming case
368370
string GetToolCallOutput(ChatToolCall toolCall) => null;
@@ -526,11 +528,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
526528
[azure_openai_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/src/Custom/AzureOpenAIClient.cs
527529
[openai_rest]: https://learn.microsoft.com/azure/cognitive-services/openai/reference
528530
[azure_openai_completions_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/completions
529-
[azure_openai_embeddgings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
531+
[azure_openai_embeddings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
530532
[openai_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md
531533
[cla]: https://cla.microsoft.com
532534
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
533535
[code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/
534536
[email_opencode]: mailto:[email protected]
535537

536-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png)
538+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/openai/Azure.AI.OpenAI/README.png)

0 commit comments

Comments
 (0)