Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ partial void ProcessCreateAccessTokenResponseContent(
pathTemplate: "\"/waves/v1/auth/token\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -268,7 +268,7 @@ partial void ProcessCreateAccessTokenResponseContent(
pathTemplate: "\"/waves/v1/auth/token\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: __exception,
clientOptions: Options,
Expand Down Expand Up @@ -309,7 +309,7 @@ partial void ProcessCreateAccessTokenResponseContent(
pathTemplate: "\"/waves/v1/auth/token\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -357,7 +357,7 @@ partial void ProcessCreateAccessTokenResponseContent(
pathTemplate: "\"/waves/v1/auth/token\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand All @@ -379,7 +379,7 @@ partial void ProcessCreateAccessTokenResponseContent(
pathTemplate: "\"/waves/v1/auth/token\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ public static class AutoSDKConditionalRequests
{
send = send ?? throw new global::System.ArgumentNullException(nameof(send));
requestOptions = CloneRequestOptions(requestOptions);
if (!string.IsNullOrWhiteSpace(entityTag))
if (entityTag is { } nonEmptyEntityTag && !string.IsNullOrWhiteSpace(nonEmptyEntityTag))
{
requestOptions.Headers["If-None-Match"] = entityTag!;
requestOptions.Headers["If-None-Match"] = nonEmptyEntityTag;
}

try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ partial void ProcessCompleteResponseContent(
pathTemplate: "\"/waves/v1/chat/completions\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -362,7 +362,7 @@ partial void ProcessCompleteResponseContent(
pathTemplate: "\"/waves/v1/chat/completions\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: null,
exception: __exception,
clientOptions: Options,
Expand Down Expand Up @@ -403,7 +403,7 @@ partial void ProcessCompleteResponseContent(
pathTemplate: "\"/waves/v1/chat/completions\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down Expand Up @@ -451,7 +451,7 @@ partial void ProcessCompleteResponseContent(
pathTemplate: "\"/waves/v1/chat/completions\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand All @@ -473,7 +473,7 @@ partial void ProcessCompleteResponseContent(
pathTemplate: "\"/waves/v1/chat/completions\"",
httpMethod: "POST",
baseUri: BaseUri,
request: __httpRequest!,
request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."),
response: __response,
exception: null,
clientOptions: Options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(string), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<string?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(string).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatCompletionRequestStopVariant1!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickChatCompletionRequestStopVariant1(), typeInfo);
}
else if (value.IsChatCompletionRequestStopVariant2)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::System.Collections.Generic.IList<string>), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Collections.Generic.IList<string>?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::System.Collections.Generic.IList<string>).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatCompletionRequestStopVariant2!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickChatCompletionRequestStopVariant2(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::SmallestAI.ChatCompletionRequestToolChoice0), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::SmallestAI.ChatCompletionRequestToolChoice0> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::SmallestAI.ChatCompletionRequestToolChoice0).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatCompletionRequestToolChoice0!.Value, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickChatCompletionRequestToolChoice0(), typeInfo);
}
else if (value.IsChatCompletionRequestToolChoice1)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::SmallestAI.ChatCompletionRequestToolChoice1), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::SmallestAI.ChatCompletionRequestToolChoice1?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::SmallestAI.ChatCompletionRequestToolChoice1).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.ChatCompletionRequestToolChoice1!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickChatCompletionRequestToolChoice1(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::SmallestAI.TranscriptionResponse), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::SmallestAI.TranscriptionResponse?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::SmallestAI.TranscriptionResponse).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.TranscriptionResponse!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickTranscriptionResponse(), typeInfo);
}
else if (value.IsAsyncAccepted)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::SmallestAI.AsyncAccepted), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::SmallestAI.AsyncAccepted?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::SmallestAI.AsyncAccepted).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.AsyncAccepted!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickAsyncAccepted(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public bool TryPickChatCompletionRequestStopVariant1(
/// <summary>
///
/// </summary>
public string PickChatCompletionRequestStopVariant1() => IsChatCompletionRequestStopVariant1
? ChatCompletionRequestStopVariant1!
public string PickChatCompletionRequestStopVariant1() => ChatCompletionRequestStopVariant1 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'ChatCompletionRequestStopVariant1' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool TryPickChatCompletionRequestStopVariant2(
/// <summary>
///
/// </summary>
public global::System.Collections.Generic.IList<string> PickChatCompletionRequestStopVariant2() => IsChatCompletionRequestStopVariant2
? ChatCompletionRequestStopVariant2!
public global::System.Collections.Generic.IList<string> PickChatCompletionRequestStopVariant2() => ChatCompletionRequestStopVariant2 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'ChatCompletionRequestStopVariant2' but the value was {ToString()}.");
/// <summary>
///
Expand Down Expand Up @@ -154,13 +154,13 @@ public bool Validate()
Validate();
}

if (IsChatCompletionRequestStopVariant1 && chatCompletionRequestStopVariant1 != null)
if (ChatCompletionRequestStopVariant1 is { } __value0 && chatCompletionRequestStopVariant1 != null)
{
return chatCompletionRequestStopVariant1(ChatCompletionRequestStopVariant1!);
return chatCompletionRequestStopVariant1(__value0);
}
else if (IsChatCompletionRequestStopVariant2 && chatCompletionRequestStopVariant2 != null)
else if (ChatCompletionRequestStopVariant2 is { } __value1 && chatCompletionRequestStopVariant2 != null)
{
return chatCompletionRequestStopVariant2(ChatCompletionRequestStopVariant2!);
return chatCompletionRequestStopVariant2(__value1);
}

return default(TResult);
Expand All @@ -180,13 +180,13 @@ public void Match(
Validate();
}

if (IsChatCompletionRequestStopVariant1)
if (ChatCompletionRequestStopVariant1 is { } __value0)
{
chatCompletionRequestStopVariant1?.Invoke(ChatCompletionRequestStopVariant1!);
chatCompletionRequestStopVariant1?.Invoke(__value0);
}
else if (IsChatCompletionRequestStopVariant2)
else if (ChatCompletionRequestStopVariant2 is { } __value1)
{
chatCompletionRequestStopVariant2?.Invoke(ChatCompletionRequestStopVariant2!);
chatCompletionRequestStopVariant2?.Invoke(__value1);
}
}

Expand All @@ -203,13 +203,13 @@ public void Switch(
Validate();
}

if (IsChatCompletionRequestStopVariant1)
if (ChatCompletionRequestStopVariant1 is { } __value0)
{
chatCompletionRequestStopVariant1?.Invoke(ChatCompletionRequestStopVariant1!);
chatCompletionRequestStopVariant1?.Invoke(__value0);
}
else if (IsChatCompletionRequestStopVariant2)
else if (ChatCompletionRequestStopVariant2 is { } __value1)
{
chatCompletionRequestStopVariant2?.Invoke(ChatCompletionRequestStopVariant2!);
chatCompletionRequestStopVariant2?.Invoke(__value1);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public bool TryPickChatCompletionRequestToolChoice0(
/// <summary>
///
/// </summary>
public global::SmallestAI.ChatCompletionRequestToolChoice0 PickChatCompletionRequestToolChoice0() => IsChatCompletionRequestToolChoice0
? ChatCompletionRequestToolChoice0!.Value
public global::SmallestAI.ChatCompletionRequestToolChoice0 PickChatCompletionRequestToolChoice0() => ChatCompletionRequestToolChoice0 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'ChatCompletionRequestToolChoice0' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool TryPickChatCompletionRequestToolChoice1(
/// <summary>
///
/// </summary>
public global::SmallestAI.ChatCompletionRequestToolChoice1 PickChatCompletionRequestToolChoice1() => IsChatCompletionRequestToolChoice1
? ChatCompletionRequestToolChoice1!
public global::SmallestAI.ChatCompletionRequestToolChoice1 PickChatCompletionRequestToolChoice1() => ChatCompletionRequestToolChoice1 is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'ChatCompletionRequestToolChoice1' but the value was {ToString()}.");
/// <summary>
///
Expand Down Expand Up @@ -177,13 +177,13 @@ public bool Validate()
Validate();
}

if (IsChatCompletionRequestToolChoice0 && chatCompletionRequestToolChoice0 != null)
if (ChatCompletionRequestToolChoice0 is { } __value0 && chatCompletionRequestToolChoice0 != null)
{
return chatCompletionRequestToolChoice0(ChatCompletionRequestToolChoice0!);
return chatCompletionRequestToolChoice0(__value0);
}
else if (IsChatCompletionRequestToolChoice1 && chatCompletionRequestToolChoice1 != null)
else if (ChatCompletionRequestToolChoice1 is { } __value1 && chatCompletionRequestToolChoice1 != null)
{
return chatCompletionRequestToolChoice1(ChatCompletionRequestToolChoice1!);
return chatCompletionRequestToolChoice1(__value1);
}

return default(TResult);
Expand All @@ -203,13 +203,13 @@ public void Match(
Validate();
}

if (IsChatCompletionRequestToolChoice0)
if (ChatCompletionRequestToolChoice0 is { } __value0)
{
chatCompletionRequestToolChoice0?.Invoke(ChatCompletionRequestToolChoice0!);
chatCompletionRequestToolChoice0?.Invoke(__value0);
}
else if (IsChatCompletionRequestToolChoice1)
else if (ChatCompletionRequestToolChoice1 is { } __value1)
{
chatCompletionRequestToolChoice1?.Invoke(ChatCompletionRequestToolChoice1!);
chatCompletionRequestToolChoice1?.Invoke(__value1);
}
}

Expand All @@ -226,13 +226,13 @@ public void Switch(
Validate();
}

if (IsChatCompletionRequestToolChoice0)
if (ChatCompletionRequestToolChoice0 is { } __value0)
{
chatCompletionRequestToolChoice0?.Invoke(ChatCompletionRequestToolChoice0!);
chatCompletionRequestToolChoice0?.Invoke(__value0);
}
else if (IsChatCompletionRequestToolChoice1)
else if (ChatCompletionRequestToolChoice1 is { } __value1)
{
chatCompletionRequestToolChoice1?.Invoke(ChatCompletionRequestToolChoice1!);
chatCompletionRequestToolChoice1?.Invoke(__value1);
}
}

Expand Down
Loading
Loading