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
4 changes: 2 additions & 2 deletions src/libs/Inworld/Generated/Inworld.AutoSDKHttpResponse.g.cs
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
10 changes: 5 additions & 5 deletions src/libs/Inworld/Generated/Inworld.ModelsClient.ListModels.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ partial void ProcessListModelsResponseContent(
pathTemplate: "\"/llm/v1alpha/models\"",
httpMethod: "GET",
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 @@ -196,7 +196,7 @@ partial void ProcessListModelsResponseContent(
pathTemplate: "\"/llm/v1alpha/models\"",
httpMethod: "GET",
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 @@ -237,7 +237,7 @@ partial void ProcessListModelsResponseContent(
pathTemplate: "\"/llm/v1alpha/models\"",
httpMethod: "GET",
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 @@ -285,7 +285,7 @@ partial void ProcessListModelsResponseContent(
pathTemplate: "\"/llm/v1alpha/models\"",
httpMethod: "GET",
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 @@ -307,7 +307,7 @@ partial void ProcessListModelsResponseContent(
pathTemplate: "\"/llm/v1alpha/models\"",
httpMethod: "GET",
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 @@ -176,19 +176,19 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.SttTranscription), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.SttTranscription?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.SttTranscription).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.SttTranscription!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickSttTranscription(), typeInfo);
}
else if (value.IsSttUsage)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.SttUsage), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.SttUsage?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.SttUsage).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.SttUsage!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickSttUsage(), typeInfo);
}
else if (value.IsSttStarted)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.SttSpeechStarted), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.SttSpeechStarted?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.SttSpeechStarted).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.SttStarted!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickSttStarted(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,25 +235,25 @@ public override void Write(
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.TtsContextCreated), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.TtsContextCreated?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.TtsContextCreated).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.TtsContextCreated!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickTtsContextCreated(), typeInfo);
}
else if (value.IsTtsAudioChunk)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.TtsAudioChunk), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.TtsAudioChunk?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.TtsAudioChunk).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.TtsAudioChunk!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickTtsAudioChunk(), typeInfo);
}
else if (value.IsTtsFlushCompleted)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.TtsFlushCompleted), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.TtsFlushCompleted?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.TtsFlushCompleted).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.TtsFlushCompleted!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickTtsFlushCompleted(), typeInfo);
}
else if (value.IsTtsContextClosed)
{
var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::Inworld.Realtime.TtsContextClosed), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::Inworld.Realtime.TtsContextClosed?> ??
throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::Inworld.Realtime.TtsContextClosed).Name}");
global::System.Text.Json.JsonSerializer.Serialize(writer, value.TtsContextClosed!, typeInfo);
global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickTtsContextClosed(), typeInfo);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public bool TryPickSttTranscription(
/// <summary>
///
/// </summary>
public global::Inworld.Realtime.SttTranscription PickSttTranscription() => IsSttTranscription
? SttTranscription!
public global::Inworld.Realtime.SttTranscription PickSttTranscription() => SttTranscription is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'SttTranscription' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool TryPickSttUsage(
/// <summary>
///
/// </summary>
public global::Inworld.Realtime.SttUsage PickSttUsage() => IsSttUsage
? SttUsage!
public global::Inworld.Realtime.SttUsage PickSttUsage() => SttUsage is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'SttUsage' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -116,8 +116,8 @@ public bool TryPickSttStarted(
/// <summary>
///
/// </summary>
public global::Inworld.Realtime.SttSpeechStarted PickSttStarted() => IsSttStarted
? SttStarted!
public global::Inworld.Realtime.SttSpeechStarted PickSttStarted() => SttStarted is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'SttStarted' but the value was {ToString()}.");
/// <summary>
///
Expand Down Expand Up @@ -242,17 +242,17 @@ public bool Validate()
Validate();
}

if (IsSttTranscription && sttTranscription != null)
if (SttTranscription is { } __value0 && sttTranscription != null)
{
return sttTranscription(SttTranscription!);
return sttTranscription(__value0);
}
else if (IsSttUsage && sttUsage != null)
else if (SttUsage is { } __value1 && sttUsage != null)
{
return sttUsage(SttUsage!);
return sttUsage(__value1);
}
else if (IsSttStarted && sttStarted != null)
else if (SttStarted is { } __value2 && sttStarted != null)
{
return sttStarted(SttStarted!);
return sttStarted(__value2);
}

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

if (IsSttTranscription)
if (SttTranscription is { } __value0)
{
sttTranscription?.Invoke(SttTranscription!);
sttTranscription?.Invoke(__value0);
}
else if (IsSttUsage)
else if (SttUsage is { } __value1)
{
sttUsage?.Invoke(SttUsage!);
sttUsage?.Invoke(__value1);
}
else if (IsSttStarted)
else if (SttStarted is { } __value2)
{
sttStarted?.Invoke(SttStarted!);
sttStarted?.Invoke(__value2);
}
}

Expand All @@ -302,17 +302,17 @@ public void Switch(
Validate();
}

if (IsSttTranscription)
if (SttTranscription is { } __value0)
{
sttTranscription?.Invoke(SttTranscription!);
sttTranscription?.Invoke(__value0);
}
else if (IsSttUsage)
else if (SttUsage is { } __value1)
{
sttUsage?.Invoke(SttUsage!);
sttUsage?.Invoke(__value1);
}
else if (IsSttStarted)
else if (SttStarted is { } __value2)
{
sttStarted?.Invoke(SttStarted!);
sttStarted?.Invoke(__value2);
}
}

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

/// <summary>
Expand Down Expand Up @@ -79,8 +79,8 @@ public bool TryPickTtsAudioChunk(
/// <summary>
///
/// </summary>
public global::Inworld.Realtime.TtsAudioChunk PickTtsAudioChunk() => IsTtsAudioChunk
? TtsAudioChunk!
public global::Inworld.Realtime.TtsAudioChunk PickTtsAudioChunk() => TtsAudioChunk is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'TtsAudioChunk' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -116,8 +116,8 @@ public bool TryPickTtsFlushCompleted(
/// <summary>
///
/// </summary>
public global::Inworld.Realtime.TtsFlushCompleted PickTtsFlushCompleted() => IsTtsFlushCompleted
? TtsFlushCompleted!
public global::Inworld.Realtime.TtsFlushCompleted PickTtsFlushCompleted() => TtsFlushCompleted is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'TtsFlushCompleted' but the value was {ToString()}.");

/// <summary>
Expand Down Expand Up @@ -153,8 +153,8 @@ public bool TryPickTtsContextClosed(
/// <summary>
///
/// </summary>
public global::Inworld.Realtime.TtsContextClosed PickTtsContextClosed() => IsTtsContextClosed
? TtsContextClosed!
public global::Inworld.Realtime.TtsContextClosed PickTtsContextClosed() => TtsContextClosed is { } value
? value
: throw new global::System.InvalidOperationException($"Expected union variant 'TtsContextClosed' but the value was {ToString()}.");
/// <summary>
///
Expand Down Expand Up @@ -307,21 +307,21 @@ public bool Validate()
Validate();
}

if (IsTtsContextCreated && ttsContextCreated != null)
if (TtsContextCreated is { } __value0 && ttsContextCreated != null)
{
return ttsContextCreated(TtsContextCreated!);
return ttsContextCreated(__value0);
}
else if (IsTtsAudioChunk && ttsAudioChunk != null)
else if (TtsAudioChunk is { } __value1 && ttsAudioChunk != null)
{
return ttsAudioChunk(TtsAudioChunk!);
return ttsAudioChunk(__value1);
}
else if (IsTtsFlushCompleted && ttsFlushCompleted != null)
else if (TtsFlushCompleted is { } __value2 && ttsFlushCompleted != null)
{
return ttsFlushCompleted(TtsFlushCompleted!);
return ttsFlushCompleted(__value2);
}
else if (IsTtsContextClosed && ttsContextClosed != null)
else if (TtsContextClosed is { } __value3 && ttsContextClosed != null)
{
return ttsContextClosed(TtsContextClosed!);
return ttsContextClosed(__value3);
}

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

if (IsTtsContextCreated)
if (TtsContextCreated is { } __value0)
{
ttsContextCreated?.Invoke(TtsContextCreated!);
ttsContextCreated?.Invoke(__value0);
}
else if (IsTtsAudioChunk)
else if (TtsAudioChunk is { } __value1)
{
ttsAudioChunk?.Invoke(TtsAudioChunk!);
ttsAudioChunk?.Invoke(__value1);
}
else if (IsTtsFlushCompleted)
else if (TtsFlushCompleted is { } __value2)
{
ttsFlushCompleted?.Invoke(TtsFlushCompleted!);
ttsFlushCompleted?.Invoke(__value2);
}
else if (IsTtsContextClosed)
else if (TtsContextClosed is { } __value3)
{
ttsContextClosed?.Invoke(TtsContextClosed!);
ttsContextClosed?.Invoke(__value3);
}
}

Expand All @@ -378,21 +378,21 @@ public void Switch(
Validate();
}

if (IsTtsContextCreated)
if (TtsContextCreated is { } __value0)
{
ttsContextCreated?.Invoke(TtsContextCreated!);
ttsContextCreated?.Invoke(__value0);
}
else if (IsTtsAudioChunk)
else if (TtsAudioChunk is { } __value1)
{
ttsAudioChunk?.Invoke(TtsAudioChunk!);
ttsAudioChunk?.Invoke(__value1);
}
else if (IsTtsFlushCompleted)
else if (TtsFlushCompleted is { } __value2)
{
ttsFlushCompleted?.Invoke(TtsFlushCompleted!);
ttsFlushCompleted?.Invoke(__value2);
}
else if (IsTtsContextClosed)
else if (TtsContextClosed is { } __value3)
{
ttsContextClosed?.Invoke(TtsContextClosed!);
ttsContextClosed?.Invoke(__value3);
}
}

Expand Down
Loading
Loading