-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
726 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/libs/Anthropic/Generated/Anthropic.Models.ImageBlockType.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Anthropic | ||
{ | ||
/// <summary> | ||
/// The type of content block.<br/> | ||
/// Default Value: image | ||
/// </summary> | ||
public enum ImageBlockType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Image, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ImageBlockTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ImageBlockType value) | ||
{ | ||
return value switch | ||
{ | ||
ImageBlockType.Image => "image", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ImageBlockType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"image" => ImageBlockType.Image, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/libs/Anthropic/Generated/Anthropic.Models.TextBlockType.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Anthropic | ||
{ | ||
/// <summary> | ||
/// The type of content block.<br/> | ||
/// Default Value: text | ||
/// </summary> | ||
public enum TextBlockType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
Text, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class TextBlockTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this TextBlockType value) | ||
{ | ||
return value switch | ||
{ | ||
TextBlockType.Text => "text", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static TextBlockType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"text" => TextBlockType.Text, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/libs/Anthropic/Generated/Anthropic.Models.ToolResultBlockType.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Anthropic | ||
{ | ||
/// <summary> | ||
/// The type of content block.<br/> | ||
/// Default Value: tool_result | ||
/// </summary> | ||
public enum ToolResultBlockType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
ToolResult, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ToolResultBlockTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ToolResultBlockType value) | ||
{ | ||
return value switch | ||
{ | ||
ToolResultBlockType.ToolResult => "tool_result", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ToolResultBlockType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"tool_result" => ToolResultBlockType.ToolResult, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/libs/Anthropic/Generated/Anthropic.Models.ToolUseBlockType.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
#nullable enable | ||
|
||
namespace Anthropic | ||
{ | ||
/// <summary> | ||
/// The type of content block.<br/> | ||
/// Default Value: tool_use | ||
/// </summary> | ||
public enum ToolUseBlockType | ||
{ | ||
/// <summary> | ||
/// | ||
/// </summary> | ||
ToolUse, | ||
} | ||
|
||
/// <summary> | ||
/// Enum extensions to do fast conversions without the reflection. | ||
/// </summary> | ||
public static class ToolUseBlockTypeExtensions | ||
{ | ||
/// <summary> | ||
/// Converts an enum to a string. | ||
/// </summary> | ||
public static string ToValueString(this ToolUseBlockType value) | ||
{ | ||
return value switch | ||
{ | ||
ToolUseBlockType.ToolUse => "tool_use", | ||
_ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), | ||
}; | ||
} | ||
/// <summary> | ||
/// Converts an string to a enum. | ||
/// </summary> | ||
public static ToolUseBlockType? ToEnum(string value) | ||
{ | ||
return value switch | ||
{ | ||
"tool_use" => ToolUseBlockType.ToolUse, | ||
_ => null, | ||
}; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/libs/Anthropic/Generated/JsonConverters.ImageBlockType.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#nullable enable | ||
|
||
namespace Anthropic.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ImageBlockTypeJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Anthropic.ImageBlockType> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Anthropic.ImageBlockType Read( | ||
ref global::System.Text.Json.Utf8JsonReader reader, | ||
global::System.Type typeToConvert, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
switch (reader.TokenType) | ||
{ | ||
case global::System.Text.Json.JsonTokenType.String: | ||
{ | ||
var stringValue = reader.GetString(); | ||
if (stringValue != null) | ||
{ | ||
return global::Anthropic.ImageBlockTypeExtensions.ToEnum(stringValue) ?? default; | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Anthropic.ImageBlockType)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Anthropic.ImageBlockType value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
writer.WriteStringValue(global::Anthropic.ImageBlockTypeExtensions.ToValueString(value)); | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
src/libs/Anthropic/Generated/JsonConverters.ImageBlockTypeNullable.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#nullable enable | ||
|
||
namespace Anthropic.JsonConverters | ||
{ | ||
/// <inheritdoc /> | ||
public sealed class ImageBlockTypeNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::Anthropic.ImageBlockType?> | ||
{ | ||
/// <inheritdoc /> | ||
public override global::Anthropic.ImageBlockType? Read( | ||
ref global::System.Text.Json.Utf8JsonReader reader, | ||
global::System.Type typeToConvert, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
switch (reader.TokenType) | ||
{ | ||
case global::System.Text.Json.JsonTokenType.String: | ||
{ | ||
var stringValue = reader.GetString(); | ||
if (stringValue != null) | ||
{ | ||
return global::Anthropic.ImageBlockTypeExtensions.ToEnum(stringValue); | ||
} | ||
|
||
break; | ||
} | ||
case global::System.Text.Json.JsonTokenType.Number: | ||
{ | ||
var numValue = reader.GetInt32(); | ||
return (global::Anthropic.ImageBlockType)numValue; | ||
} | ||
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | ||
} | ||
|
||
return default; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override void Write( | ||
global::System.Text.Json.Utf8JsonWriter writer, | ||
global::Anthropic.ImageBlockType? value, | ||
global::System.Text.Json.JsonSerializerOptions options) | ||
{ | ||
writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); | ||
|
||
if (value == null) | ||
{ | ||
writer.WriteNullValue(); | ||
} | ||
else | ||
{ | ||
writer.WriteStringValue(global::Anthropic.ImageBlockTypeExtensions.ToValueString(value.Value)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.