Skip to content

Commit 92dd1ee

Browse files
committed
Update docs metadata
1 parent 502c97f commit 92dd1ee

File tree

2 files changed

+66
-14
lines changed

2 files changed

+66
-14
lines changed

api/overview/azure/preview/ai.openai-readme.md

Lines changed: 64 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ title: Azure OpenAI client library for .NET
33
keywords: Azure, dotnet, SDK, API, Azure.AI.OpenAI, openai
44
author: jpalvarezl
55
ms.author: josealvar
6-
ms.date: 08/25/2023
6+
ms.date: 09/21/2023
77
ms.topic: reference
88
ms.devlang: dotnet
99
ms.service: openai
1010
---
11-
# Azure OpenAI client library for .NET - version 1.0.0-beta.7
11+
# Azure OpenAI client library for .NET - version 1.0.0-beta.8
1212

1313

1414
The Azure OpenAI client library for .NET is an adaptation of OpenAI's REST APIs that provides an idiomatic interface
@@ -22,7 +22,7 @@ Use the client library for Azure OpenAI to:
2222

2323
Azure OpenAI is a managed service that allows developers to deploy, tune, and generate content from OpenAI models on Azure resources.
2424

25-
[Source code](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/openai/Azure.AI.OpenAI/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.AI.OpenAI) | [API reference documentation](https://learn.microsoft.com/azure/cognitive-services/openai/reference) | [Product documentation](https://learn.microsoft.com/azure/cognitive-services/openai/) | [Samples](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/openai/Azure.AI.OpenAI/tests/Samples)
25+
[Source code](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/openai/Azure.AI.OpenAI/src) | [Package (NuGet)](https://www.nuget.org/packages/Azure.AI.OpenAI) | [API reference documentation](https://learn.microsoft.com/azure/cognitive-services/openai/reference) | [Product documentation](https://learn.microsoft.com/azure/cognitive-services/openai/) | [Samples](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/openai/Azure.AI.OpenAI/tests/Samples)
2626

2727
## Getting started
2828

@@ -101,18 +101,18 @@ We guarantee that all client instance methods are thread-safe and independent of
101101

102102
### Additional concepts
103103
<!-- CLIENT COMMON BAR -->
104-
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
105-
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
106-
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
107-
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
108-
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/core/Azure.Core/samples/Diagnostics.md) |
104+
[Client options](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
105+
[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
106+
[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
107+
[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
108+
[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/core/Azure.Core/samples/Diagnostics.md) |
109109
[Mocking](https://learn.microsoft.com/dotnet/azure/sdk/unit-testing-mocking) |
110110
[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
111111
<!-- CLIENT COMMON BAR -->
112112

113113
## Examples
114114

115-
You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_1.0.0-beta.7/sdk/openai/Azure.AI.OpenAI/tests/Samples).
115+
You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/Azure.AI.OpenAI_1.0.0-beta.8/sdk/openai/Azure.AI.OpenAI/tests/Samples).
116116

117117
### Generate Chatbot Response
118118

@@ -242,6 +242,8 @@ You can read more about Chat Functions on OpenAI's blog: https://openai.com/blog
242242
**NOTE**: Chat Functions require model versions beginning with gpt-4 and gpt-3.5-turbo's `-0613` labels. They are not
243243
available with older versions of the models.
244244

245+
**NOTE:** The concurrent use of Chat Functions and [Azure Chat Extensions](#use-your-own-data-with-azure-openai) on a single request is not yet supported. Supplying both will result in the Chat Functions information being ignored and the operation behaving as if only the Azure Chat Extensions were provided. To address this limitation, consider separating the evaluation of Chat Functions and Azure Chat Extensions across multiple requests in your solution design.
246+
245247
To use Chat Functions, you first define the function you'd like the model to be able to use when appropriate. Using
246248
the example from the linked blog post, above:
247249

@@ -334,7 +336,10 @@ if (responseChoice.FinishReason == CompletionsFinishReason.FunctionCall)
334336
ChatRole.Function,
335337
JsonSerializer.Serialize(
336338
functionResultData,
337-
new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }));
339+
new JsonSerializerOptions() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }))
340+
{
341+
Name = responseChoice.Message.FunctionCall.Name
342+
};
338343
conversationMessages.Add(functionResponseMessage);
339344
// Now make a new request using all three messages in conversationMessages
340345
}
@@ -346,6 +351,8 @@ if (responseChoice.FinishReason == CompletionsFinishReason.FunctionCall)
346351
The use your own data feature is unique to Azure OpenAI and won't work with a client configured to use the non-Azure service.
347352
See [the Azure OpenAI using your own data quickstart](https://learn.microsoft.com/azure/ai-services/openai/use-your-data-quickstart) for conceptual background and detailed setup instructions.
348353

354+
**NOTE:** The concurrent use of [Chat Functions](#use-chat-functions) and Azure Chat Extensions on a single request is not yet supported. Supplying both will result in the Chat Functions information being ignored and the operation behaving as if only the Azure Chat Extensions were provided. To address this limitation, consider separating the evaluation of Chat Functions and Azure Chat Extensions across multiple requests in your solution design.
355+
349356
```C# Snippet:ChatUsingYourOwnData
350357
var chatCompletionsOptions = new ChatCompletionsOptions()
351358
{
@@ -403,6 +410,51 @@ Response<ImageGenerations> imageGenerations = await client.GetImageGenerationsAs
403410
Uri imageUri = imageGenerations.Value.Data[0].Url;
404411
```
405412

413+
### Transcribe audio data with Whisper speech models
414+
415+
```C# Snippet:TranscribeAudio
416+
using Stream audioStreamFromFile = File.OpenRead("myAudioFile.mp3");
417+
BinaryData audioFileData = BinaryData.FromStream(audioStreamFromFile);
418+
419+
var transcriptionOptions = new AudioTranscriptionOptions()
420+
{
421+
AudioData = BinaryData.FromStream(audioStreamFromFile),
422+
ResponseFormat = AudioTranscriptionFormat.Verbose,
423+
};
424+
425+
Response<AudioTranscription> transcriptionResponse = await client.GetAudioTranscriptionAsync(
426+
deploymentId: "my-whisper-deployment", // whisper-1 as model name for non-Azure OpenAI
427+
transcriptionOptions);
428+
AudioTranscription transcription = transcriptionResponse.Value;
429+
430+
// When using Simple, SRT, or VTT formats, only transcription.Text will be populated
431+
Console.WriteLine($"Transcription ({transcription.Duration.Value.TotalSeconds}s):");
432+
Console.WriteLine(transcription.Text);
433+
```
434+
435+
### Translate audio data to English with Whisper speech models
436+
437+
```C# Snippet:TranslateAudio
438+
using Stream audioStreamFromFile = File.OpenRead("mySpanishAudioFile.mp3");
439+
BinaryData audioFileData = BinaryData.FromStream(audioStreamFromFile);
440+
441+
var translationOptions = new AudioTranslationOptions()
442+
{
443+
AudioData = BinaryData.FromStream(audioStreamFromFile),
444+
ResponseFormat = AudioTranslationFormat.Verbose,
445+
};
446+
447+
Response<AudioTranslation> translationResponse = await client.GetAudioTranslationAsync(
448+
deploymentId: "my-whisper-deployment", // whisper-1 as model name for non-Azure OpenAI
449+
translationOptions);
450+
AudioTranslation translation = translationResponse.Value;
451+
452+
// When using Simple, SRT, or VTT formats, only translation.Text will be populated
453+
Console.WriteLine($"Translation ({translation.Duration.Value.TotalSeconds}s):");
454+
// .Text will be translated to English (ISO-639-1 "en")
455+
Console.WriteLine(translation.Text);
456+
```
457+
406458
## Troubleshooting
407459

408460
When you interact with Azure OpenAI using the .NET SDK, errors returned by the service correspond to the same HTTP status codes returned for [REST API][openai_rest] requests.
@@ -432,11 +484,11 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
432484
[msdocs_openai_embedding]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
433485
[style-guide-msft]: /style-guide/capitalization
434486
[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
435-
[openai_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
487+
[openai_client_class]: https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/sdk/openai/Azure.AI.OpenAI/src/Generated/OpenAIClient.cs
436488
[openai_rest]: https://learn.microsoft.com/azure/cognitive-services/openai/reference
437489
[azure_openai_completions_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/how-to/completions
438490
[azure_openai_embeddgings_docs]: https://learn.microsoft.com/azure/cognitive-services/openai/concepts/understand-embeddings
439-
[openai_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.7/CONTRIBUTING.md
491+
[openai_contrib]: https://github.com/Azure/azure-sdk-for-net/blob/Azure.AI.OpenAI_1.0.0-beta.8/CONTRIBUTING.md
440492
[cla]: https://cla.microsoft.com
441493
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
442494
[code_of_conduct_faq]: https://opensource.microsoft.com/codeofconduct/faq/

metadata/preview/Azure.AI.OpenAI.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "Azure.AI.OpenAI",
3-
"Version": "1.0.0-beta.7",
3+
"Version": "1.0.0-beta.8",
44
"DevVersion": null,
55
"DirectoryPath": "sdk/openai/Azure.AI.OpenAI",
66
"ServiceDirectory": "openai",
@@ -10,7 +10,7 @@
1010
"SdkType": "client",
1111
"IsNewSdk": true,
1212
"ArtifactName": "Azure.AI.OpenAI",
13-
"ReleaseStatus": "2023-08-25",
13+
"ReleaseStatus": "2023-09-21",
1414
"Namespaces": [
1515
"Azure.AI.OpenAI",
1616
"Microsoft.Extensions.Azure"

0 commit comments

Comments
 (0)