Skip to content

Commit

Permalink
Merge pull request #57 from tryAGI/bot/update-openapi_202410010053
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 1, 2024
2 parents c373768 + 87b7934 commit f24bc3f
Show file tree
Hide file tree
Showing 5 changed files with 310 additions and 0 deletions.
68 changes: 68 additions & 0 deletions src/libs/Anthropic/Generated/Anthropic.Models.Block.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,74 @@ public bool Validate()
return IsText && !IsImage && !IsToolUse && !IsToolResult || !IsText && IsImage && !IsToolUse && !IsToolResult || !IsText && !IsImage && IsToolUse && !IsToolResult || !IsText && !IsImage && !IsToolUse && IsToolResult;
}

/// <summary>
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Anthropic.TextBlock?, TResult>? text = null,
global::System.Func<global::Anthropic.ImageBlock?, TResult>? image = null,
global::System.Func<global::Anthropic.ToolUseBlock?, TResult>? toolUse = null,
global::System.Func<global::Anthropic.ToolResultBlock?, TResult>? toolResult = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsText && text != null)
{
return text(Text!);
}
else if (IsImage && image != null)
{
return image(Image!);
}
else if (IsToolUse && toolUse != null)
{
return toolUse(ToolUse!);
}
else if (IsToolResult && toolResult != null)
{
return toolResult(ToolResult!);
}

return default(TResult);
}

/// <summary>
///
/// </summary>
public void Match(
global::System.Action<global::Anthropic.TextBlock?>? text = null,
global::System.Action<global::Anthropic.ImageBlock?>? image = null,
global::System.Action<global::Anthropic.ToolUseBlock?>? toolUse = null,
global::System.Action<global::Anthropic.ToolResultBlock?>? toolResult = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsText)
{
text?.Invoke(Text!);
}
else if (IsImage)
{
image?.Invoke(Image!);
}
else if (IsToolUse)
{
toolUse?.Invoke(ToolUse!);
}
else if (IsToolResult)
{
toolResult?.Invoke(ToolResult!);
}
}

/// <summary>
///
/// </summary>
Expand Down
48 changes: 48 additions & 0 deletions src/libs/Anthropic/Generated/Anthropic.Models.BlockDelta.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,54 @@ public bool Validate()
return IsText && !IsInputJson || !IsText && IsInputJson;
}

/// <summary>
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Anthropic.TextBlockDelta?, TResult>? text = null,
global::System.Func<global::Anthropic.InputJsonBlockDelta?, TResult>? inputJson = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsText && text != null)
{
return text(Text!);
}
else if (IsInputJson && inputJson != null)
{
return inputJson(InputJson!);
}

return default(TResult);
}

/// <summary>
///
/// </summary>
public void Match(
global::System.Action<global::Anthropic.TextBlockDelta?>? text = null,
global::System.Action<global::Anthropic.InputJsonBlockDelta?>? inputJson = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsText)
{
text?.Invoke(Text!);
}
else if (IsInputJson)
{
inputJson?.Invoke(InputJson!);
}
}

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,104 @@ public bool Validate()
return IsStart && !IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && !IsContentBlockStart && IsContentBlockDelta && !IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && IsContentBlockStop && !IsPing || !IsStart && !IsDelta && !IsStop && !IsContentBlockStart && !IsContentBlockDelta && !IsContentBlockStop && IsPing;
}

/// <summary>
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<global::Anthropic.MessageStartEvent?, TResult>? start = null,
global::System.Func<global::Anthropic.MessageDeltaEvent?, TResult>? delta = null,
global::System.Func<global::Anthropic.MessageStopEvent?, TResult>? stop = null,
global::System.Func<global::Anthropic.ContentBlockStartEvent?, TResult>? contentBlockStart = null,
global::System.Func<global::Anthropic.ContentBlockDeltaEvent?, TResult>? contentBlockDelta = null,
global::System.Func<global::Anthropic.ContentBlockStopEvent?, TResult>? contentBlockStop = null,
global::System.Func<global::Anthropic.PingEvent?, TResult>? ping = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsStart && start != null)
{
return start(Start!);
}
else if (IsDelta && delta != null)
{
return delta(Delta!);
}
else if (IsStop && stop != null)
{
return stop(Stop!);
}
else if (IsContentBlockStart && contentBlockStart != null)
{
return contentBlockStart(ContentBlockStart!);
}
else if (IsContentBlockDelta && contentBlockDelta != null)
{
return contentBlockDelta(ContentBlockDelta!);
}
else if (IsContentBlockStop && contentBlockStop != null)
{
return contentBlockStop(ContentBlockStop!);
}
else if (IsPing && ping != null)
{
return ping(Ping!);
}

return default(TResult);
}

/// <summary>
///
/// </summary>
public void Match(
global::System.Action<global::Anthropic.MessageStartEvent?>? start = null,
global::System.Action<global::Anthropic.MessageDeltaEvent?>? delta = null,
global::System.Action<global::Anthropic.MessageStopEvent?>? stop = null,
global::System.Action<global::Anthropic.ContentBlockStartEvent?>? contentBlockStart = null,
global::System.Action<global::Anthropic.ContentBlockDeltaEvent?>? contentBlockDelta = null,
global::System.Action<global::Anthropic.ContentBlockStopEvent?>? contentBlockStop = null,
global::System.Action<global::Anthropic.PingEvent?>? ping = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsStart)
{
start?.Invoke(Start!);
}
else if (IsDelta)
{
delta?.Invoke(Delta!);
}
else if (IsStop)
{
stop?.Invoke(Stop!);
}
else if (IsContentBlockStart)
{
contentBlockStart?.Invoke(ContentBlockStart!);
}
else if (IsContentBlockDelta)
{
contentBlockDelta?.Invoke(ContentBlockDelta!);
}
else if (IsContentBlockStop)
{
contentBlockStop?.Invoke(ContentBlockStop!);
}
else if (IsPing)
{
ping?.Invoke(Ping!);
}
}

/// <summary>
///
/// </summary>
Expand Down
48 changes: 48 additions & 0 deletions src/libs/Anthropic/Generated/AnyOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,54 @@ public bool Validate()
return IsValue1 || IsValue2;
}

/// <summary>
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<T1, TResult>? value1 = null,
global::System.Func<T2, TResult>? value2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1 && value1 != null)
{
return value1(Value1!);
}
else if (IsValue2 && value2 != null)
{
return value2(Value2!);
}

return default(TResult);
}

/// <summary>
///
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1)
{
value1?.Invoke(Value1!);
}
else if (IsValue2)
{
value2?.Invoke(Value2!);
}
}

/// <summary>
///
/// </summary>
Expand Down
48 changes: 48 additions & 0 deletions src/libs/Anthropic/Generated/OneOf.2.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,54 @@ public bool Validate()
return IsValue1 && !IsValue2 || !IsValue1 && IsValue2;
}

/// <summary>
///
/// </summary>
public TResult? Match<TResult>(
global::System.Func<T1, TResult>? value1 = null,
global::System.Func<T2, TResult>? value2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1 && value1 != null)
{
return value1(Value1!);
}
else if (IsValue2 && value2 != null)
{
return value2(Value2!);
}

return default(TResult);
}

/// <summary>
///
/// </summary>
public void Match(
global::System.Action<T1>? value1 = null,
global::System.Action<T2>? value2 = null,
bool validate = true)
{
if (validate)
{
Validate();
}

if (IsValue1)
{
value1?.Invoke(Value1!);
}
else if (IsValue2)
{
value2?.Invoke(Value2!);
}
}

/// <summary>
///
/// </summary>
Expand Down

0 comments on commit f24bc3f

Please sign in to comment.