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 Cohere
#endif
public bool IsStream => Stream != null;

/// <summary>
///
/// </summary>
public bool TryPickStream(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatStreamEvent? value)
{
value = Stream;
return IsStream;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Cohere
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Lg3v2o))]
#endif
public bool IsLg3v2o => Lg3v2o != null;

/// <summary>
///
/// </summary>
public bool TryPickLg3v2o(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatCitationGenerationEventLg3v2o? value)
{
value = Lg3v2o;
return IsLg3v2o;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -118,8 +144,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Cohere.ChatStreamEvent?, TResult>? stream = null,
global::System.Func<global::Cohere.ChatCitationGenerationEventLg3v2o?, TResult>? lg3v2o = null,
global::System.Func<global::Cohere.ChatStreamEvent, TResult>? stream = null,
global::System.Func<global::Cohere.ChatCitationGenerationEventLg3v2o, TResult>? lg3v2o = null,
bool validate = true)
{
if (validate)
Expand All @@ -143,8 +169,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Cohere.ChatStreamEvent?>? stream = null,
global::System.Action<global::Cohere.ChatCitationGenerationEventLg3v2o?>? lg3v2o = null,
global::System.Action<global::Cohere.ChatStreamEvent>? stream = null,

global::System.Action<global::Cohere.ChatCitationGenerationEventLg3v2o>? lg3v2o = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsStream)
{
stream?.Invoke(Stream!);
}
else if (IsLg3v2o)
{
lg3v2o?.Invoke(Lg3v2o!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Cohere.ChatStreamEvent>? stream = null,
global::System.Action<global::Cohere.ChatCitationGenerationEventLg3v2o>? lg3v2o = null,
bool validate = true)
{
if (validate)
Expand Down
58 changes: 54 additions & 4 deletions src/libs/Cohere/Generated/Cohere.Models.ChatContentDeltaEvent.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace Cohere
#endif
public bool IsStreamType => StreamType != null;

/// <summary>
///
/// </summary>
public bool TryPickStreamType(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatStreamEventType? value)
{
value = StreamType;
return IsStreamType;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Cohere
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Event3m0vqs))]
#endif
public bool IsEvent3m0vqs => Event3m0vqs != null;

/// <summary>
///
/// </summary>
public bool TryPickEvent3m0vqs(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatContentDeltaEvent3m0vqs? value)
{
value = Event3m0vqs;
return IsEvent3m0vqs;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -118,8 +144,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Cohere.ChatStreamEventType?, TResult>? streamType = null,
global::System.Func<global::Cohere.ChatContentDeltaEvent3m0vqs?, TResult>? event3m0vqs = null,
global::System.Func<global::Cohere.ChatStreamEventType, TResult>? streamType = null,
global::System.Func<global::Cohere.ChatContentDeltaEvent3m0vqs, TResult>? event3m0vqs = null,
bool validate = true)
{
if (validate)
Expand All @@ -143,8 +169,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Cohere.ChatStreamEventType?>? streamType = null,
global::System.Action<global::Cohere.ChatContentDeltaEvent3m0vqs?>? event3m0vqs = null,
global::System.Action<global::Cohere.ChatStreamEventType>? streamType = null,

global::System.Action<global::Cohere.ChatContentDeltaEvent3m0vqs>? event3m0vqs = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsStreamType)
{
streamType?.Invoke(StreamType!);
}
else if (IsEvent3m0vqs)
{
event3m0vqs?.Invoke(Event3m0vqs!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Cohere.ChatStreamEventType>? streamType = null,
global::System.Action<global::Cohere.ChatContentDeltaEvent3m0vqs>? event3m0vqs = null,
bool validate = true)
{
if (validate)
Expand Down
58 changes: 54 additions & 4 deletions src/libs/Cohere/Generated/Cohere.Models.ChatContentEndEvent.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace Cohere
#endif
public bool IsStreamType => StreamType != null;

/// <summary>
///
/// </summary>
public bool TryPickStreamType(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatStreamEventType? value)
{
value = StreamType;
return IsStreamType;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Cohere
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Ma278i))]
#endif
public bool IsMa278i => Ma278i != null;

/// <summary>
///
/// </summary>
public bool TryPickMa278i(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatContentEndEventMa278i? value)
{
value = Ma278i;
return IsMa278i;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -118,8 +144,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Cohere.ChatStreamEventType?, TResult>? streamType = null,
global::System.Func<global::Cohere.ChatContentEndEventMa278i?, TResult>? ma278i = null,
global::System.Func<global::Cohere.ChatStreamEventType, TResult>? streamType = null,
global::System.Func<global::Cohere.ChatContentEndEventMa278i, TResult>? ma278i = null,
bool validate = true)
{
if (validate)
Expand All @@ -143,8 +169,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Cohere.ChatStreamEventType?>? streamType = null,
global::System.Action<global::Cohere.ChatContentEndEventMa278i?>? ma278i = null,
global::System.Action<global::Cohere.ChatStreamEventType>? streamType = null,

global::System.Action<global::Cohere.ChatContentEndEventMa278i>? ma278i = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsStreamType)
{
streamType?.Invoke(StreamType!);
}
else if (IsMa278i)
{
ma278i?.Invoke(Ma278i!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Cohere.ChatStreamEventType>? streamType = null,
global::System.Action<global::Cohere.ChatContentEndEventMa278i>? ma278i = null,
bool validate = true)
{
if (validate)
Expand Down
58 changes: 54 additions & 4 deletions src/libs/Cohere/Generated/Cohere.Models.ChatContentStartEvent.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ namespace Cohere
#endif
public bool IsStreamType => StreamType != null;

/// <summary>
///
/// </summary>
public bool TryPickStreamType(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatStreamEventType? value)
{
value = StreamType;
return IsStreamType;
}

/// <summary>
///
/// </summary>
Expand All @@ -42,6 +55,19 @@ namespace Cohere
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Event6xvlq1))]
#endif
public bool IsEvent6xvlq1 => Event6xvlq1 != null;

/// <summary>
///
/// </summary>
public bool TryPickEvent6xvlq1(
#if NET6_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)]
#endif
out global::Cohere.ChatContentStartEvent6xvlq1? value)
{
value = Event6xvlq1;
return IsEvent6xvlq1;
}
/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -118,8 +144,8 @@ public bool Validate()
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Cohere.ChatStreamEventType?, TResult>? streamType = null,
global::System.Func<global::Cohere.ChatContentStartEvent6xvlq1?, TResult>? event6xvlq1 = null,
global::System.Func<global::Cohere.ChatStreamEventType, TResult>? streamType = null,
global::System.Func<global::Cohere.ChatContentStartEvent6xvlq1, TResult>? event6xvlq1 = null,
bool validate = true)
{
if (validate)
Expand All @@ -143,8 +169,32 @@ public bool Validate()
///
/// </summary>
public void Match(
global::System.Action<global::Cohere.ChatStreamEventType?>? streamType = null,
global::System.Action<global::Cohere.ChatContentStartEvent6xvlq1?>? event6xvlq1 = null,
global::System.Action<global::Cohere.ChatStreamEventType>? streamType = null,

global::System.Action<global::Cohere.ChatContentStartEvent6xvlq1>? event6xvlq1 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsStreamType)
{
streamType?.Invoke(StreamType!);
}
else if (IsEvent6xvlq1)
{
event6xvlq1?.Invoke(Event6xvlq1!);
}
}

/// <summary>
///
/// </summary>
public void Switch(
global::System.Action<global::Cohere.ChatStreamEventType>? streamType = null,
global::System.Action<global::Cohere.ChatContentStartEvent6xvlq1>? event6xvlq1 = null,
bool validate = true)
{
if (validate)
Expand Down
Loading