Skip to content
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

Azure OpenAI updates #46103

Merged
merged 14 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"*.user",
".vscode/cspell.json",
"assets.json",
"eng/Packages.Data.props",
"sdk/confidentialledger/Azure.Security.CodeTransparency/tests/TestFiles/*",
// These services are opted out of public API surface spell checking.
// Spelling issues must be addressed before adding these back in.
Expand All @@ -48,6 +49,7 @@
"sdk/modelsrepository/*/api/*.cs",
"sdk/monitor/Azure.ResourceManager.Monitor/api/*.cs",
"sdk/objectanchors/*/api/*.cs",
"sdk/openai/Azure.AI.OpenAI/tests/Assets/playback_test_config.json",
"sdk/purview/*/api/*.cs",
"sdk/remoterendering/*/api/*.cs",
"sdk/videoanalyzer/*/api/*.cs",
Expand Down Expand Up @@ -975,6 +977,25 @@
"ipfix"
]
},
{
"filename": "**/sdk/openai/**/*",
"words": [
"AOAI",
"Arrr",
"Dall",
"Dalle",
"Dall-E",
"devcert",
"Filip",
"Filip's",
"granularities",
"haikus",
"msdocs",
"OpenAI",
"Pavleski",
"Tekakwitha"
]
},
{
"filename": "**/sdk/operationalinsights/**/*.cs",
"words": [
Expand Down
7 changes: 4 additions & 3 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

<!-- BCL packages -->
<PackageReference Update="System.Buffers" Version="4.5.1" />
<PackageReference Update="System.ClientModel" Version="1.0.0" />
<PackageReference Update="System.ClientModel" Version="1.1.0" />
ralph-msft marked this conversation as resolved.
Show resolved Hide resolved
<PackageReference Update="System.IO.Hashing" Version="6.0.0" />
<PackageReference Update="System.Memory" Version="4.5.5" />
<PackageReference Update="System.Memory.Data" Version="1.0.2" />
Expand Down Expand Up @@ -157,7 +157,7 @@
<PackageReference Update="Microsoft.Identity.Client.Extensions.Msal" Version="4.62.0" />
<!--
TODO: This package needs to be released as GA and arch-board approved before taking a dependency in any stable SDK library.
Currently, it is referencd by Azure.Identity.Broker which is still in beta
Currently, it is referenced by Azure.Identity.Broker which is still in beta
-->
<PackageReference Update="Microsoft.Identity.Client.Broker" Version="4.62.0" />

Expand All @@ -179,7 +179,7 @@
</ItemGroup>

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

<!--
Expand Down Expand Up @@ -350,6 +350,7 @@
<PackageReference Update="Polly.Contrib.WaitAndRetry" Version="1.1.1" />
<PackageReference Update="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Update="PublicApiGenerator" Version="10.0.1" />
<PackageReference Update="System.ClientModel" Version="1.1.0" />
<PackageReference Update="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Update="System.IO.Compression" Version="4.3.0" />
<PackageReference Update="System.IO.Pipelines" Version="4.5.1" />
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/Azure.AI.OpenAI.Assistants/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[openai_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
[openai_rest]: https://learn.microsoft.com/azure/cognitive-services/openai/reference
[azure_openai_completions_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/completions
[azure_openai_embeddgings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
[azure_openai_embeddings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
[openai_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md
[cla]: https://cla.microsoft.com
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
Expand Down
2 changes: 1 addition & 1 deletion sdk/openai/Azure.AI.OpenAI/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ExternalAzureCoreLibrary>../../external/Azure.Core.Slim/netstandard2.0/Azure.Core.Slim.dll</ExternalAzureCoreLibrary>
-->
</PropertyGroup>

<!--
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
-->
Expand Down
10 changes: 6 additions & 4 deletions sdk/openai/Azure.AI.OpenAI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ ChatCompletion completion = chatClient.CompleteChat(
[
// System messages represent instructions or other guidance about how the assistant should behave
new SystemChatMessage("You are a helpful assistant that talks like a pirate."),
// User messages represent user input, whether historical or the most recen tinput
// User messages represent user input, whether historical or the most recent input
new UserChatMessage("Hi, can you help me?"),
// Assistant messages in a request represent conversation history for responses
new AssistantChatMessage("Arrr! Of course, me hearty! What can I do for ye?"),
Expand Down Expand Up @@ -362,7 +362,9 @@ foreach (KeyValuePair<int, string> indexToIdPair in toolCallIdsByIndex)
functionArgumentBuildersByIndex[indexToIdPair.Key].ToString()));
}

conversationMessages.Add(new AssistantChatMessage(toolCalls, contentBuilder.ToString()));
var assistantChatMessage = new AssistantChatMessage(toolCalls);
assistantChatMessage.Content.Add(ChatMessageContentPart.CreateTextPart(contentBuilder.ToString()));
conversationMessages.Add(assistantChatMessage);

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

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