Skip to content

Commit 41953d6

Browse files
committed
fb
1 parent b8281f3 commit 41953d6

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

api/OpenAI.net8.0.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
namespace OpenAI {
2-
[Experimental("OPENAI001")]
3-
public enum CreateChatCompletionRequestModality {
4-
Text = 0,
5-
Audio = 1
6-
}
72
public class OpenAIClient {
83
protected OpenAIClient();
94
public OpenAIClient(ApiKeyCredential credential, OpenAIClientOptions options);
@@ -1772,6 +1767,11 @@ public class ChatCompletionRequestAssistantMessage : ChatMessage, IJsonModel<Cha
17721767
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
17731768
}
17741769
[Experimental("OPENAI001")]
1770+
public enum ChatCompletionRequestModality {
1771+
Text = 0,
1772+
Audio = 1
1773+
}
1774+
[Experimental("OPENAI001")]
17751775
public class ChatCompletionRequestUserMessage : ChatMessage, IJsonModel<ChatCompletionRequestUserMessage>, IPersistableModel<ChatCompletionRequestUserMessage> {
17761776
public ChatCompletionRequestUserMessage();
17771777
public string Name { get; set; }
@@ -2353,7 +2353,7 @@ public class CreateChatCompletionOptions : JsonModel<CreateChatCompletionOptions
23532353
public int? MaxTokens { get; set; }
23542354
public IList<ChatMessage> Messages { get; }
23552355
public IDictionary<string, string> Metadata { get; }
2356-
public IList<CreateChatCompletionRequestModality> Modalities { get; set; }
2356+
public IList<ChatCompletionRequestModality> Modalities { get; set; }
23572357
public string Model { get; set; }
23582358
public int? N { get; set; }
23592359
public bool? ParallelToolCalls { get; set; }

api/OpenAI.netstandard2.0.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
namespace OpenAI {
2-
public enum CreateChatCompletionRequestModality {
3-
Text = 0,
4-
Audio = 1
5-
}
62
public class OpenAIClient {
73
protected OpenAIClient();
84
public OpenAIClient(ApiKeyCredential credential, OpenAIClientOptions options);
@@ -1551,6 +1547,10 @@ public class ChatCompletionRequestAssistantMessage : ChatMessage, IJsonModel<Cha
15511547
protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options);
15521548
protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options);
15531549
}
1550+
public enum ChatCompletionRequestModality {
1551+
Text = 0,
1552+
Audio = 1
1553+
}
15541554
public class ChatCompletionRequestUserMessage : ChatMessage, IJsonModel<ChatCompletionRequestUserMessage>, IPersistableModel<ChatCompletionRequestUserMessage> {
15551555
public ChatCompletionRequestUserMessage();
15561556
public string Name { get; set; }
@@ -2026,7 +2026,7 @@ public class CreateChatCompletionOptions : JsonModel<CreateChatCompletionOptions
20262026
public int? MaxTokens { get; set; }
20272027
public IList<ChatMessage> Messages { get; }
20282028
public IDictionary<string, string> Metadata { get; }
2029-
public IList<CreateChatCompletionRequestModality> Modalities { get; set; }
2029+
public IList<ChatCompletionRequestModality> Modalities { get; set; }
20302030
public string Model { get; set; }
20312031
public int? N { get; set; }
20322032
public bool? ParallelToolCalls { get; set; }

src/Custom/Chat/CreateChatCompletionOptions.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public CreateChatCompletionOptions(IEnumerable<ChatMessage> messages, string mod
2424
}
2525

2626
#pragma warning disable SCME0001 // Type is for evaluation purposes only and is subject to change or removal in future updates.
27-
internal CreateChatCompletionOptions(IDictionary<string, string> metadata, float? temperature, float? topP, string user, ChatServiceTier? serviceTier, IList<ChatMessage> messages, string model, IList<CreateChatCompletionRequestModality> modalities, ChatReasoningEffortLevel? reasoningEffort, int? maxCompletionTokens, float? frequencyPenalty, float? presencePenalty, ChatWebSearchOptions webSearchOptions, int? topLogprobs, ResponseFormat responseFormat, ChatAudioOptions audio, bool? store, bool? stream, IList<string> stop, IDictionary<int, int> logitBias, bool? logprobs, int? maxTokens, int? n, ChatOutputPrediction prediction, long? seed, ChatCompletionStreamOptions streamOptions, IList<ChatTool> tools, BinaryData toolChoice, bool? parallelToolCalls, BinaryData functionCall, IList<ChatFunction> functions, in JsonPatch patch)
27+
internal CreateChatCompletionOptions(IDictionary<string, string> metadata, float? temperature, float? topP, string user, ChatServiceTier? serviceTier, IList<ChatMessage> messages, string model, IList<ChatCompletionRequestModality> modalities, ChatReasoningEffortLevel? reasoningEffort, int? maxCompletionTokens, float? frequencyPenalty, float? presencePenalty, ChatWebSearchOptions webSearchOptions, int? topLogprobs, ResponseFormat responseFormat, ChatAudioOptions audio, bool? store, bool? stream, IList<string> stop, IDictionary<int, int> logitBias, bool? logprobs, int? maxTokens, int? n, ChatOutputPrediction prediction, long? seed, ChatCompletionStreamOptions streamOptions, IList<ChatTool> tools, BinaryData toolChoice, bool? parallelToolCalls, BinaryData functionCall, IList<ChatFunction> functions, in JsonPatch patch)
2828
{
2929
// Plugin customization: ensure initialization of collections
3030
Metadata = metadata ?? new ChangeTrackingDictionary<string, string>();
@@ -34,7 +34,7 @@ internal CreateChatCompletionOptions(IDictionary<string, string> metadata, float
3434
ServiceTier = serviceTier;
3535
Messages = messages ?? new ChangeTrackingList<ChatMessage>();
3636
Model = model;
37-
Modalities = modalities ?? new ChangeTrackingList<CreateChatCompletionRequestModality>();
37+
Modalities = modalities ?? new ChangeTrackingList<ChatCompletionRequestModality>();
3838
ReasoningEffort = reasoningEffort;
3939
MaxCompletionTokens = maxCompletionTokens;
4040
FrequencyPenalty = frequencyPenalty;
@@ -77,7 +77,7 @@ internal CreateChatCompletionOptions(IDictionary<string, string> metadata, float
7777

7878
public string Model { get; set; }
7979

80-
public IList<CreateChatCompletionRequestModality> Modalities { get; set; }
80+
public IList<ChatCompletionRequestModality> Modalities { get; set; }
8181

8282
public ChatReasoningEffortLevel? ReasoningEffort { get; set; }
8383

@@ -215,11 +215,11 @@ public static CreateChatCompletionOptions Create(IEnumerable<ChatMessage> messag
215215

216216
if (options.ResponseModalities.HasFlag(ChatResponseModalities.Audio))
217217
{
218-
request.Modalities.Add(CreateChatCompletionRequestModality.Audio);
218+
request.Modalities.Add(ChatCompletionRequestModality.Audio);
219219
}
220220
if (options.ResponseModalities.HasFlag(ChatResponseModalities.Text))
221221
{
222-
request.Modalities.Add(CreateChatCompletionRequestModality.Text);
222+
request.Modalities.Add(ChatCompletionRequestModality.Text);
223223
}
224224
if (options.StreamOptions != null)
225225
{
@@ -274,7 +274,7 @@ internal static CreateChatCompletionOptions DeserializeCreateChatCompletionReque
274274
ChatServiceTier? serviceTier = default;
275275
IList<ChatMessage> messages = default;
276276
string model = default;
277-
IList<CreateChatCompletionRequestModality> modalities = default;
277+
IList<ChatCompletionRequestModality> modalities = default;
278278
ChatReasoningEffortLevel? reasoningEffort = default;
279279
int? maxCompletionTokens = default;
280280
float? frequencyPenalty = default;
@@ -379,7 +379,7 @@ internal static CreateChatCompletionOptions DeserializeCreateChatCompletionReque
379379
{
380380
continue;
381381
}
382-
List<CreateChatCompletionRequestModality> array = new List<CreateChatCompletionRequestModality>();
382+
List<ChatCompletionRequestModality> array = new List<ChatCompletionRequestModality>();
383383
foreach (var item in prop.Value.EnumerateArray())
384384
{
385385
array.Add(item.GetString().ToCreateChatCompletionRequestModality());
@@ -620,7 +620,7 @@ internal static CreateChatCompletionOptions DeserializeCreateChatCompletionReque
620620
serviceTier,
621621
messages,
622622
model,
623-
modalities ?? new ChangeTrackingList<CreateChatCompletionRequestModality>(),
623+
modalities ?? new ChangeTrackingList<ChatCompletionRequestModality>(),
624624
reasoningEffort,
625625
maxCompletionTokens,
626626
frequencyPenalty,

src/Custom/Chat/CreateChatCompletionRequestModality.Serialization.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
using System;
22

3-
namespace OpenAI
3+
namespace OpenAI.Chat
44
{
55
internal static partial class CreateChatCompletionRequestModalityExtensions
66
{
7-
public static string ToSerialString(this CreateChatCompletionRequestModality value) => value switch
7+
public static string ToSerialString(this ChatCompletionRequestModality value) => value switch
88
{
9-
CreateChatCompletionRequestModality.Text => "text",
10-
CreateChatCompletionRequestModality.Audio => "audio",
9+
ChatCompletionRequestModality.Text => "text",
10+
ChatCompletionRequestModality.Audio => "audio",
1111
_ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CreateChatCompletionRequestModality value.")
1212
};
1313

14-
public static CreateChatCompletionRequestModality ToCreateChatCompletionRequestModality(this string value)
14+
public static ChatCompletionRequestModality ToCreateChatCompletionRequestModality(this string value)
1515
{
1616
if (StringComparer.OrdinalIgnoreCase.Equals(value, "text"))
1717
{
18-
return CreateChatCompletionRequestModality.Text;
18+
return ChatCompletionRequestModality.Text;
1919
}
2020
if (StringComparer.OrdinalIgnoreCase.Equals(value, "audio"))
2121
{
22-
return CreateChatCompletionRequestModality.Audio;
22+
return ChatCompletionRequestModality.Audio;
2323
}
2424
throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CreateChatCompletionRequestModality value.");
2525
}

src/Custom/Chat/CreateChatCompletionRequestModality.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System.Diagnostics.CodeAnalysis;
22

3-
namespace OpenAI
3+
namespace OpenAI.Chat
44
{
55
[Experimental("OPENAI001")]
6-
public enum CreateChatCompletionRequestModality
6+
public enum ChatCompletionRequestModality
77
{
88
Text,
99
Audio

0 commit comments

Comments
 (0)