-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
AudioTranscriptionOptions.cs
111 lines (106 loc) · 6.12 KB
/
AudioTranscriptionOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
namespace Azure.AI.OpenAI
{
/// <summary> The configuration information for an audio transcription request. </summary>
public partial class AudioTranscriptionOptions
{
/// <summary>
/// Keeps track of any properties unknown to the library.
/// <para>
/// To assign an object to the value of this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
/// </para>
/// <para>
/// To assign an already formatted json string to this property use <see cref="BinaryData.FromString(string)"/>.
/// </para>
/// <para>
/// Examples:
/// <list type="bullet">
/// <item>
/// <term>BinaryData.FromObjectAsJson("foo")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("\"foo\"")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// </list>
/// </para>
/// </summary>
private IDictionary<string, BinaryData> _serializedAdditionalRawData;
/// <summary> Initializes a new instance of <see cref="AudioTranscriptionOptions"/>. </summary>
/// <param name="audioData">
/// The audio data to transcribe. This must be the binary content of a file in one of the supported media formats:
/// flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, webm.
/// </param>
/// <param name="filename"> The optional filename or descriptive identifier to associate with with the audio data. </param>
/// <param name="responseFormat"> The requested format of the transcription response data, which will influence the content and detail of the result. </param>
/// <param name="language">
/// The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code
/// such as 'en' or 'fr'.
/// Providing this known input language is optional but may improve the accuracy and/or latency of transcription.
/// </param>
/// <param name="prompt">
/// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the
/// prompt should match the primary spoken language of the audio data.
/// </param>
/// <param name="temperature">
/// The sampling temperature, between 0 and 1.
/// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
/// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
/// </param>
/// <param name="timestampGranularities">
/// The timestamp granularities to populate for this transcription.
/// `response_format` must be set `verbose_json` to use timestamp granularities.
/// Either or both of these options are supported: `word`, or `segment`.
/// Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.
/// </param>
/// <param name="deploymentName"> The model to use for this transcription request. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
internal AudioTranscriptionOptions(BinaryData audioData, string filename, AudioTranscriptionFormat? responseFormat, string language, string prompt, float? temperature, IList<AudioTranscriptionTimestampGranularity> timestampGranularities, string deploymentName, IDictionary<string, BinaryData> serializedAdditionalRawData)
{
AudioData = audioData;
Filename = filename;
ResponseFormat = responseFormat;
Language = language;
Prompt = prompt;
Temperature = temperature;
TimestampGranularities = timestampGranularities;
DeploymentName = deploymentName;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
/// <summary> The optional filename or descriptive identifier to associate with with the audio data. </summary>
public string Filename { get; set; }
/// <summary> The requested format of the transcription response data, which will influence the content and detail of the result. </summary>
public AudioTranscriptionFormat? ResponseFormat { get; set; }
/// <summary>
/// The primary spoken language of the audio data to be transcribed, supplied as a two-letter ISO-639-1 language code
/// such as 'en' or 'fr'.
/// Providing this known input language is optional but may improve the accuracy and/or latency of transcription.
/// </summary>
public string Language { get; set; }
/// <summary>
/// An optional hint to guide the model's style or continue from a prior audio segment. The written language of the
/// prompt should match the primary spoken language of the audio data.
/// </summary>
public string Prompt { get; set; }
/// <summary>
/// The sampling temperature, between 0 and 1.
/// Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
/// If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.
/// </summary>
public float? Temperature { get; set; }
}
}