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 @@ -26,5 +26,6 @@ partial void Authorizing(
ref string apiKey);
partial void Authorized(
global::System.Net.Http.HttpClient client);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace Inworld.Realtime
#endif
public bool IsSttTranscription => SttTranscription != null;

/// <summary>
///
/// </summary>
public bool TryPickSttTranscription(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.SttTranscription? value)
{
value = SttTranscription;
return IsSttTranscription;
}

/// <summary>
///
/// </summary>
Expand All @@ -43,6 +56,19 @@ namespace Inworld.Realtime
#endif
public bool IsSttUsage => SttUsage != null;

/// <summary>
///
/// </summary>
public bool TryPickSttUsage(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.SttUsage? value)
{
value = SttUsage;
return IsSttUsage;
}

/// <summary>
///
/// </summary>
Expand All @@ -59,6 +85,19 @@ namespace Inworld.Realtime
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(SttStarted))]
#endif
public bool IsSttStarted => SttStarted != null;

/// <summary>
///
/// </summary>
public bool TryPickSttStarted(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.SttSpeechStarted? value)
{
value = SttStarted;
return IsSttStarted;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -157,9 +196,9 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Inworld.Realtime.SttTranscription?, TResult>? sttTranscription = null,
global::System.Func<global::Inworld.Realtime.SttUsage?, TResult>? sttUsage = null,
global::System.Func<global::Inworld.Realtime.SttSpeechStarted?, TResult>? sttStarted = null,
global::System.Func<global::Inworld.Realtime.SttTranscription, TResult>? sttTranscription = null,
global::System.Func<global::Inworld.Realtime.SttUsage, TResult>? sttUsage = null,
global::System.Func<global::Inworld.Realtime.SttSpeechStarted, TResult>? sttStarted = null,
bool validate = true)
{
if (validate)
Expand Down Expand Up @@ -187,9 +226,39 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Inworld.Realtime.SttTranscription?>? sttTranscription = null,
global::System.Action<global::Inworld.Realtime.SttUsage?>? sttUsage = null,
global::System.Action<global::Inworld.Realtime.SttSpeechStarted?>? sttStarted = null,
global::System.Action<global::Inworld.Realtime.SttTranscription>? sttTranscription = null,

global::System.Action<global::Inworld.Realtime.SttUsage>? sttUsage = null,

global::System.Action<global::Inworld.Realtime.SttSpeechStarted>? sttStarted = null,
bool validate = true)
{
if (validate)
{
Validate();
}

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

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Inworld.Realtime.SttTranscription>? sttTranscription = null,
global::System.Action<global::Inworld.Realtime.SttUsage>? sttUsage = null,
global::System.Action<global::Inworld.Realtime.SttSpeechStarted>? sttStarted = null,
bool validate = true)
{
if (validate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace Inworld.Realtime
#endif
public bool IsTtsContextCreated => TtsContextCreated != null;

/// <summary>
///
/// </summary>
public bool TryPickTtsContextCreated(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.TtsContextCreated? value)
{
value = TtsContextCreated;
return IsTtsContextCreated;
}

/// <summary>
///
/// </summary>
Expand All @@ -43,6 +56,19 @@ namespace Inworld.Realtime
#endif
public bool IsTtsAudioChunk => TtsAudioChunk != null;

/// <summary>
///
/// </summary>
public bool TryPickTtsAudioChunk(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.TtsAudioChunk? value)
{
value = TtsAudioChunk;
return IsTtsAudioChunk;
}

/// <summary>
///
/// </summary>
Expand All @@ -60,6 +86,19 @@ namespace Inworld.Realtime
#endif
public bool IsTtsFlushCompleted => TtsFlushCompleted != null;

/// <summary>
///
/// </summary>
public bool TryPickTtsFlushCompleted(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.TtsFlushCompleted? value)
{
value = TtsFlushCompleted;
return IsTtsFlushCompleted;
}

/// <summary>
///
/// </summary>
Expand All @@ -76,6 +115,19 @@ namespace Inworld.Realtime
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(TtsContextClosed))]
#endif
public bool IsTtsContextClosed => TtsContextClosed != null;

/// <summary>
///
/// </summary>
public bool TryPickTtsContextClosed(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Inworld.Realtime.TtsContextClosed? value)
{
value = TtsContextClosed;
return IsTtsContextClosed;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -196,10 +248,10 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Inworld.Realtime.TtsContextCreated?, TResult>? ttsContextCreated = null,
global::System.Func<global::Inworld.Realtime.TtsAudioChunk?, TResult>? ttsAudioChunk = null,
global::System.Func<global::Inworld.Realtime.TtsFlushCompleted?, TResult>? ttsFlushCompleted = null,
global::System.Func<global::Inworld.Realtime.TtsContextClosed?, TResult>? ttsContextClosed = null,
global::System.Func<global::Inworld.Realtime.TtsContextCreated, TResult>? ttsContextCreated = null,
global::System.Func<global::Inworld.Realtime.TtsAudioChunk, TResult>? ttsAudioChunk = null,
global::System.Func<global::Inworld.Realtime.TtsFlushCompleted, TResult>? ttsFlushCompleted = null,
global::System.Func<global::Inworld.Realtime.TtsContextClosed, TResult>? ttsContextClosed = null,
bool validate = true)
{
if (validate)
Expand Down Expand Up @@ -231,10 +283,46 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Inworld.Realtime.TtsContextCreated?>? ttsContextCreated = null,
global::System.Action<global::Inworld.Realtime.TtsAudioChunk?>? ttsAudioChunk = null,
global::System.Action<global::Inworld.Realtime.TtsFlushCompleted?>? ttsFlushCompleted = null,
global::System.Action<global::Inworld.Realtime.TtsContextClosed?>? ttsContextClosed = null,
global::System.Action<global::Inworld.Realtime.TtsContextCreated>? ttsContextCreated = null,

global::System.Action<global::Inworld.Realtime.TtsAudioChunk>? ttsAudioChunk = null,

global::System.Action<global::Inworld.Realtime.TtsFlushCompleted>? ttsFlushCompleted = null,

global::System.Action<global::Inworld.Realtime.TtsContextClosed>? ttsContextClosed = null,
bool validate = true)
{
if (validate)
{
Validate();
}

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

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Inworld.Realtime.TtsContextCreated>? ttsContextCreated = null,
global::System.Action<global::Inworld.Realtime.TtsAudioChunk>? ttsAudioChunk = null,
global::System.Action<global::Inworld.Realtime.TtsFlushCompleted>? ttsFlushCompleted = null,
global::System.Action<global::Inworld.Realtime.TtsContextClosed>? ttsContextClosed = null,
bool validate = true)
{
if (validate)
Expand Down
Loading