From a7f516851d4ea2e9fdd88ed186bbb24e66cfefe2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 15 Oct 2026 02:19:40 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...peSafeClient.SystemoneV1SystemonePost.g.cs | 16 ++ ...afeAI.Generated.JsonConverters.Answer.g.cs | 17 +- ....Generated.JsonConverters.AssetFormat.g.cs | 53 +++++ ...ed.JsonConverters.AssetFormatNullable.g.cs | 60 +++++ ...eAI.Generated.JsonConverters.Question.g.cs | 17 +- ...SystemonePostTypeSafeDangerZoneImages.g.cs | 53 +++++ ...ePostTypeSafeDangerZoneImagesNullable.g.cs | 60 +++++ ...monePostTypeSafeDangerZoneLongContext.g.cs | 53 +++++ ...TypeSafeDangerZoneLongContextNullable.g.cs | 60 +++++ ...afeAI.Generated.JsonSerializerContext.g.cs | 30 ++- ....Generated.JsonSerializerContextTypes.g.cs | 100 +++++--- .../TypeSafeAI.Generated.Models.Answer.g.cs | 91 +++++++- ...erated.Models.AnswerDiscriminatorType.g.cs | 6 + ...ypeSafeAI.Generated.Models.Asset.Json.g.cs | 218 ++++++++++++++++++ .../TypeSafeAI.Generated.Models.Asset.g.cs | 80 +++++++ ...peSafeAI.Generated.Models.AssetFormat.g.cs | 57 +++++ ...afeAI.Generated.Models.BoxAnswer.Json.g.cs | 218 ++++++++++++++++++ ...TypeSafeAI.Generated.Models.BoxAnswer.g.cs | 82 +++++++ ....Generated.Models.BoxCoordinates.Json.g.cs | 218 ++++++++++++++++++ ...afeAI.Generated.Models.BoxCoordinates.g.cs | 83 +++++++ ...eAI.Generated.Models.BoxQuestion.Json.g.cs | 218 ++++++++++++++++++ ...peSafeAI.Generated.Models.BoxQuestion.g.cs | 59 +++++ ...ed.Models.BoxQuestionInstruction.Json.g.cs | 218 ++++++++++++++++++ ...nerated.Models.BoxQuestionInstruction.g.cs | 19 ++ ...d.Models.BoxQuestionInstructions.Json.g.cs | 218 ++++++++++++++++++ ...erated.Models.BoxQuestionInstructions.g.cs | 19 ++ .../TypeSafeAI.Generated.Models.Question.g.cs | 91 +++++++- ...ated.Models.QuestionDiscriminatorType.g.cs | 6 + ...eAI.Generated.Models.SystemOneRequest.g.cs | 13 +- ...ed.Models.SystemOneRequestAssets.Json.g.cs | 218 ++++++++++++++++++ ...nerated.Models.SystemOneRequestAssets.g.cs | 19 ++ ....SystemoneV1SystemonePostRequest.Json.g.cs | 218 ++++++++++++++++++ ...odels.SystemoneV1SystemonePostRequest.g.cs | 47 ++++ ...oneV1SystemonePostRequestRequest.Json.g.cs | 218 ++++++++++++++++++ ...ystemoneV1SystemonePostRequestRequest.g.cs | 19 ++ ...SystemonePostTypeSafeDangerZoneImages.g.cs | 45 ++++ ...monePostTypeSafeDangerZoneLongContext.g.cs | 45 ++++ ...peSafeClient.SystemoneV1SystemonePost.g.cs | 39 ++++ .../Generated/autosdk.generated-examples.json | 2 +- src/libs/TypeSafeAI/openapi.yaml | 2 +- 40 files changed, 3259 insertions(+), 46 deletions(-) create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormat.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormatNullable.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullable.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextNullable.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AssetFormat.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.Json.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs create mode 100644 src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.IRawTypeSafeClient.SystemoneV1SystemonePost.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.IRawTypeSafeClient.SystemoneV1SystemonePost.g.cs index 0afeeb2..723d3ff 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.IRawTypeSafeClient.SystemoneV1SystemonePost.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.IRawTypeSafeClient.SystemoneV1SystemonePost.g.cs @@ -11,6 +11,8 @@ public partial interface IRawTypeSafeClient /// questions, so you can match each result to its question. The response also includes
/// the model used and token usage. /// + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -18,6 +20,8 @@ public partial interface IRawTypeSafeClient global::System.Threading.Tasks.Task SystemoneV1SystemonePostAsync( global::TypeSafeAI.Generated.SystemOneRequest request, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default, global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -27,6 +31,8 @@ public partial interface IRawTypeSafeClient /// questions, so you can match each result to its question. The response also includes
/// the model used and token usage. ///
+ /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -34,6 +40,8 @@ public partial interface IRawTypeSafeClient global::System.Threading.Tasks.Task> SystemoneV1SystemonePostAsResponseAsync( global::TypeSafeAI.Generated.SystemOneRequest request, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default, global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); /// @@ -43,6 +51,8 @@ public partial interface IRawTypeSafeClient /// questions, so you can match each result to its question. The response also includes
/// the model used and token usage. ///
+ /// + /// /// /// Name or alias of the model to use. Available names are returned by GET /v1/models. /// @@ -52,6 +62,9 @@ public partial interface IRawTypeSafeClient /// /// Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers. /// + /// + /// Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -59,6 +72,9 @@ public partial interface IRawTypeSafeClient string model, global::TypeSafeAI.Generated.AnyOf> state, global::System.Collections.Generic.Dictionary questions, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default, + global::System.Collections.Generic.Dictionary? assets = default, global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Answer.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Answer.g.cs index c484574..ddd8eba 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Answer.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Answer.g.cs @@ -42,6 +42,13 @@ public class AnswerJsonConverter : global::System.Text.Json.Serialization.JsonCo throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::TypeSafeAI.Generated.ScoreAnswer)}"); score = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::TypeSafeAI.Generated.BoxAnswer? box = default; + if (discriminator?.Type == global::TypeSafeAI.Generated.AnswerDiscriminatorType.Box) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::TypeSafeAI.Generated.BoxAnswer), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::TypeSafeAI.Generated.BoxAnswer)}"); + box = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } var __value = new global::TypeSafeAI.Generated.Answer( discriminator?.Type, @@ -49,7 +56,9 @@ public class AnswerJsonConverter : global::System.Text.Json.Serialization.JsonCo choice, - score + score, + + box ); return __value; @@ -82,6 +91,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::TypeSafeAI.Generated.ScoreAnswer).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickScore(), typeInfo); } + else if (value.IsBox) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::TypeSafeAI.Generated.BoxAnswer), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::TypeSafeAI.Generated.BoxAnswer).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickBox(), typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormat.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormat.g.cs new file mode 100644 index 0000000..244328c --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormat.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace TypeSafeAI.Generated.JsonConverters +{ + /// + public sealed class AssetFormatJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::TypeSafeAI.Generated.AssetFormat 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::TypeSafeAI.Generated.AssetFormatExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::TypeSafeAI.Generated.AssetFormat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::TypeSafeAI.Generated.AssetFormat); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::TypeSafeAI.Generated.AssetFormat value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::TypeSafeAI.Generated.AssetFormatExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormatNullable.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormatNullable.g.cs new file mode 100644 index 0000000..083d581 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.AssetFormatNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace TypeSafeAI.Generated.JsonConverters +{ + /// + public sealed class AssetFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::TypeSafeAI.Generated.AssetFormat? 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::TypeSafeAI.Generated.AssetFormatExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::TypeSafeAI.Generated.AssetFormat)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::TypeSafeAI.Generated.AssetFormat?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::TypeSafeAI.Generated.AssetFormat? 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::TypeSafeAI.Generated.AssetFormatExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Question.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Question.g.cs index dedab25..1db2a75 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Question.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.Question.g.cs @@ -42,6 +42,13 @@ public class QuestionJsonConverter : global::System.Text.Json.Serialization.Json throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::TypeSafeAI.Generated.ScoreQuestion)}"); score = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); } + global::TypeSafeAI.Generated.BoxQuestion? box = default; + if (discriminator?.Type == global::TypeSafeAI.Generated.QuestionDiscriminatorType.Box) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::TypeSafeAI.Generated.BoxQuestion), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {nameof(global::TypeSafeAI.Generated.BoxQuestion)}"); + box = global::System.Text.Json.JsonSerializer.Deserialize(ref reader, typeInfo); + } var __value = new global::TypeSafeAI.Generated.Question( discriminator?.Type, @@ -49,7 +56,9 @@ public class QuestionJsonConverter : global::System.Text.Json.Serialization.Json choice, - score + score, + + box ); return __value; @@ -82,6 +91,12 @@ public override void Write( throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::TypeSafeAI.Generated.ScoreQuestion).Name}"); global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickScore(), typeInfo); } + else if (value.IsBox) + { + var typeInfo = typeInfoResolver.GetTypeInfo(typeof(global::TypeSafeAI.Generated.BoxQuestion), options) as global::System.Text.Json.Serialization.Metadata.JsonTypeInfo ?? + throw new global::System.InvalidOperationException($"Cannot get type info for {typeof(global::TypeSafeAI.Generated.BoxQuestion).Name}"); + global::System.Text.Json.JsonSerializer.Serialize(writer, value.PickBox(), typeInfo); + } } } } \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs new file mode 100644 index 0000000..6efd5cf --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace TypeSafeAI.Generated.JsonConverters +{ + /// + public sealed class SystemoneV1SystemonePostTypeSafeDangerZoneImagesJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages 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::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImagesExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImagesExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullable.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullable.g.cs new file mode 100644 index 0000000..c12ba3e --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace TypeSafeAI.Generated.JsonConverters +{ + /// + public sealed class SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? 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::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImagesExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? 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::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImagesExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs new file mode 100644 index 0000000..7a3ff9c --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs @@ -0,0 +1,53 @@ +#nullable enable + +namespace TypeSafeAI.Generated.JsonConverters +{ + /// + public sealed class SystemoneV1SystemonePostTypeSafeDangerZoneLongContextJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext 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::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextExtensions.ToEnum(stringValue) ?? default; + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext value, + global::System.Text.Json.JsonSerializerOptions options) + { + writer = writer ?? throw new global::System.ArgumentNullException(nameof(writer)); + + writer.WriteStringValue(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextExtensions.ToValueString(value)); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextNullable.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextNullable.g.cs new file mode 100644 index 0000000..70dabe3 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextNullable.g.cs @@ -0,0 +1,60 @@ +#nullable enable + +namespace TypeSafeAI.Generated.JsonConverters +{ + /// + public sealed class SystemoneV1SystemonePostTypeSafeDangerZoneLongContextNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + /// + public override global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? 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::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextExtensions.ToEnum(stringValue); + } + + break; + } + case global::System.Text.Json.JsonTokenType.Number: + { + var numValue = reader.GetInt32(); + return (global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext)numValue; + } + case global::System.Text.Json.JsonTokenType.Null: + { + return default(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext?); + } + default: + throw new global::System.ArgumentOutOfRangeException(nameof(reader)); + } + + return default; + } + + /// + public override void Write( + global::System.Text.Json.Utf8JsonWriter writer, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? 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::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextExtensions.ToValueString(value.Value)); + } + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs index 6c821ba..22a8453 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContext.g.cs @@ -15,10 +15,22 @@ namespace TypeSafeAI.Generated typeof(global::TypeSafeAI.Generated.JsonConverters.AnswerDiscriminatorTypeNullableJsonConverter), + typeof(global::TypeSafeAI.Generated.JsonConverters.AssetFormatJsonConverter), + + typeof(global::TypeSafeAI.Generated.JsonConverters.AssetFormatNullableJsonConverter), + typeof(global::TypeSafeAI.Generated.JsonConverters.QuestionDiscriminatorTypeJsonConverter), typeof(global::TypeSafeAI.Generated.JsonConverters.QuestionDiscriminatorTypeNullableJsonConverter), + typeof(global::TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImagesJsonConverter), + + typeof(global::TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullableJsonConverter), + + typeof(global::TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextJsonConverter), + + typeof(global::TypeSafeAI.Generated.JsonConverters.SystemoneV1SystemonePostTypeSafeDangerZoneLongContextNullableJsonConverter), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnswerJsonConverter), typeof(global::TypeSafeAI.Generated.JsonConverters.QuestionJsonConverter), @@ -41,6 +53,8 @@ namespace TypeSafeAI.Generated typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>), + typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter), typeof(global::TypeSafeAI.Generated.JsonConverters.UnixTimestampJsonConverter), @@ -52,15 +66,20 @@ namespace TypeSafeAI.Generated [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.NoulAnswer))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ChoiceAnswer))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ScoreAnswer))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.BoxAnswer))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnswerDiscriminator))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnswerDiscriminatorType), TypeInfoPropertyName = "AnswerDiscriminatorType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.Asset))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AssetFormat), TypeInfoPropertyName = "AssetFormat2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.BoxCoordinates))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ChoiceQuestion))] - [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>), TypeInfoPropertyName = "AnyOfStringObjectIListObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.BoxQuestion))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>), TypeInfoPropertyName = "AnyOfStringObjectIListObject2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ChoiceQuestion))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.HTTPValidationError))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.ValidationError))] @@ -76,12 +95,17 @@ namespace TypeSafeAI.Generated [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.SystemOneRequest))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.SystemOneResponse))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.Usage))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf), TypeInfoPropertyName = "AnyOfStringInt322")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(byte[]))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages), TypeInfoPropertyName = "SystemoneV1SystemonePostTypeSafeDangerZoneImages2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext), TypeInfoPropertyName = "SystemoneV1SystemonePostTypeSafeDangerZoneLongContext2")] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::TypeSafeAI.Generated.AnyOf>))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs index dd03172..e34c138 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.JsonSerializerContextTypes.g.cs @@ -49,123 +49,163 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::TypeSafeAI.Generated.AnswerDiscriminator? Type4 { get; set; } + public global::TypeSafeAI.Generated.BoxAnswer? Type4 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.AnswerDiscriminatorType? Type5 { get; set; } + public global::TypeSafeAI.Generated.AnswerDiscriminator? Type5 { get; set; } /// /// /// - public string? Type6 { get; set; } + public global::TypeSafeAI.Generated.AnswerDiscriminatorType? Type6 { get; set; } /// /// /// - public double? Type7 { get; set; } + public global::TypeSafeAI.Generated.Asset? Type7 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type8 { get; set; } + public string? Type8 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.ChoiceQuestion? Type9 { get; set; } + public global::TypeSafeAI.Generated.AssetFormat? Type9 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.AnyOf>? Type10 { get; set; } + public global::TypeSafeAI.Generated.BoxCoordinates? Type10 { get; set; } /// /// /// - public object? Type11 { get; set; } + public double? Type11 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type12 { get; set; } + public object? Type12 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.HTTPValidationError? Type13 { get; set; } + public global::TypeSafeAI.Generated.BoxQuestion? Type13 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type14 { get; set; } + public global::TypeSafeAI.Generated.AnyOf>? Type14 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.ValidationError? Type15 { get; set; } + public global::System.Collections.Generic.IList? Type15 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.ModelMetadata? Type16 { get; set; } + public global::System.Collections.Generic.Dictionary? Type16 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.ModelMetadataList? Type17 { get; set; } + public global::TypeSafeAI.Generated.ChoiceQuestion? Type17 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type18 { get; set; } + public global::TypeSafeAI.Generated.HTTPValidationError? Type18 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.NoulCriteria? Type19 { get; set; } + public global::System.Collections.Generic.IList? Type19 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.NoulQuestion? Type20 { get; set; } + public global::TypeSafeAI.Generated.ValidationError? Type20 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.Question? Type21 { get; set; } + public global::TypeSafeAI.Generated.ModelMetadata? Type21 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.ScoreQuestion? Type22 { get; set; } + public global::TypeSafeAI.Generated.ModelMetadataList? Type22 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.QuestionDiscriminator? Type23 { get; set; } + public global::System.Collections.Generic.IList? Type23 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.QuestionDiscriminatorType? Type24 { get; set; } + public global::TypeSafeAI.Generated.NoulCriteria? Type24 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>>? Type25 { get; set; } + public global::TypeSafeAI.Generated.NoulQuestion? Type25 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.SystemOneRequest? Type26 { get; set; } + public global::TypeSafeAI.Generated.Question? Type26 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type27 { get; set; } + public global::TypeSafeAI.Generated.ScoreQuestion? Type27 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.SystemOneResponse? Type28 { get; set; } + public global::TypeSafeAI.Generated.QuestionDiscriminator? Type28 { get; set; } /// /// /// - public global::System.Collections.Generic.Dictionary? Type29 { get; set; } + public global::TypeSafeAI.Generated.QuestionDiscriminatorType? Type29 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.Usage? Type30 { get; set; } + public global::System.Collections.Generic.IList>>? Type30 { get; set; } /// /// /// - public int? Type31 { get; set; } + public global::TypeSafeAI.Generated.SystemOneRequest? Type31 { get; set; } /// /// /// - public global::System.Collections.Generic.IList>? Type32 { get; set; } + public global::System.Collections.Generic.Dictionary? Type32 { get; set; } /// /// /// - public global::TypeSafeAI.Generated.AnyOf? Type33 { get; set; } + public global::System.Collections.Generic.Dictionary? Type33 { get; set; } + /// + /// + /// + public global::TypeSafeAI.Generated.SystemOneResponse? Type34 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.Dictionary? Type35 { get; set; } + /// + /// + /// + public global::TypeSafeAI.Generated.Usage? Type36 { get; set; } + /// + /// + /// + public int? Type37 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList>? Type38 { get; set; } + /// + /// + /// + public global::TypeSafeAI.Generated.AnyOf? Type39 { get; set; } + /// + /// + /// + public global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? Type40 { get; set; } + /// + /// + /// + public byte[]? Type41 { get; set; } + /// + /// + /// + public global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? Type42 { get; set; } + /// + /// + /// + public global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? Type43 { get; set; } /// /// diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Answer.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Answer.g.cs index f618e6e..48a53c9 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Answer.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Answer.g.cs @@ -124,6 +124,43 @@ public bool TryPickScore( public global::TypeSafeAI.Generated.ScoreAnswer PickScore() => Score is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'Score' but the value was {ToString()}."); + + /// + /// A located box with normalized edge coordinates and confidence. + /// +#if NET6_0_OR_GREATER + public global::TypeSafeAI.Generated.BoxAnswer? Box { get; init; } +#else + public global::TypeSafeAI.Generated.BoxAnswer? Box { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Box))] +#endif + public bool IsBox => Box != null; + + /// + /// + /// + public bool TryPickBox( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::TypeSafeAI.Generated.BoxAnswer? value) + { + value = Box; + return IsBox; + } + + /// + /// + /// + public global::TypeSafeAI.Generated.BoxAnswer PickBox() => Box is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Box' but the value was {ToString()}."); /// /// /// @@ -193,6 +230,29 @@ public Answer(global::TypeSafeAI.Generated.ScoreAnswer? value) /// public static Answer FromScore(global::TypeSafeAI.Generated.ScoreAnswer? value) => new Answer(value); + /// + /// + /// + public static implicit operator Answer(global::TypeSafeAI.Generated.BoxAnswer value) => new Answer((global::TypeSafeAI.Generated.BoxAnswer?)value); + + /// + /// + /// + public static implicit operator global::TypeSafeAI.Generated.BoxAnswer?(Answer @this) => @this.Box; + + /// + /// + /// + public Answer(global::TypeSafeAI.Generated.BoxAnswer? value) + { + Box = value; + } + + /// + /// + /// + public static Answer FromBox(global::TypeSafeAI.Generated.BoxAnswer? value) => new Answer(value); + /// /// /// @@ -200,7 +260,8 @@ public Answer( global::TypeSafeAI.Generated.AnswerDiscriminatorType? type, global::TypeSafeAI.Generated.NoulAnswer? noul, global::TypeSafeAI.Generated.ChoiceAnswer? choice, - global::TypeSafeAI.Generated.ScoreAnswer? score + global::TypeSafeAI.Generated.ScoreAnswer? score, + global::TypeSafeAI.Generated.BoxAnswer? box ) { Type = type; @@ -208,12 +269,14 @@ public Answer( Noul = noul; Choice = choice; Score = score; + Box = box; } /// /// /// public object? Object => + Box as object ?? Score as object ?? Choice as object ?? Noul as object @@ -225,7 +288,8 @@ Noul as object public override string? ToString() => Noul?.ToString() ?? Choice?.ToString() ?? - Score?.ToString() + Score?.ToString() ?? + Box?.ToString() ; /// @@ -233,7 +297,7 @@ Noul as object /// public bool Validate() { - return IsNoul && !IsChoice && !IsScore || !IsNoul && IsChoice && !IsScore || !IsNoul && !IsChoice && IsScore; + return IsNoul && !IsChoice && !IsScore && !IsBox || !IsNoul && IsChoice && !IsScore && !IsBox || !IsNoul && !IsChoice && IsScore && !IsBox || !IsNoul && !IsChoice && !IsScore && IsBox; } /// @@ -243,6 +307,7 @@ public bool Validate() global::System.Func? noul = null, global::System.Func? choice = null, global::System.Func? score = null, + global::System.Func? box = null, bool validate = true) { if (validate) @@ -262,6 +327,10 @@ public bool Validate() { return score(__value2); } + else if (Box is { } __value3 && box != null) + { + return box(__value3); + } return default(TResult); } @@ -275,6 +344,8 @@ public void Match( global::System.Action? choice = null, global::System.Action? score = null, + + global::System.Action? box = null, bool validate = true) { if (validate) @@ -294,6 +365,10 @@ public void Match( { score?.Invoke(__value2); } + else if (Box is { } __value3) + { + box?.Invoke(__value3); + } } /// @@ -303,6 +378,7 @@ public void Switch( global::System.Action? noul = null, global::System.Action? choice = null, global::System.Action? score = null, + global::System.Action? box = null, bool validate = true) { if (validate) @@ -322,6 +398,10 @@ public void Switch( { score?.Invoke(__value2); } + else if (Box is { } __value3) + { + box?.Invoke(__value3); + } } /// @@ -337,6 +417,8 @@ public override int GetHashCode() typeof(global::TypeSafeAI.Generated.ChoiceAnswer), Score, typeof(global::TypeSafeAI.Generated.ScoreAnswer), + Box, + typeof(global::TypeSafeAI.Generated.BoxAnswer), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -355,7 +437,8 @@ public bool Equals(Answer other) return global::System.Collections.Generic.EqualityComparer.Default.Equals(Noul, other.Noul) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Choice, other.Choice) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Score, other.Score) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Score, other.Score) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Box, other.Box) ; } diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AnswerDiscriminatorType.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AnswerDiscriminatorType.g.cs index 29f7a73..1e81f59 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AnswerDiscriminatorType.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AnswerDiscriminatorType.g.cs @@ -8,6 +8,10 @@ namespace TypeSafeAI.Generated /// public enum AnswerDiscriminatorType { + /// + /// + /// + Box, /// /// /// @@ -34,6 +38,7 @@ public static string ToValueString(this AnswerDiscriminatorType value) { return value switch { + AnswerDiscriminatorType.Box => "box", AnswerDiscriminatorType.Choice => "choice", AnswerDiscriminatorType.Noul => "noul", AnswerDiscriminatorType.Score => "score", @@ -47,6 +52,7 @@ public static string ToValueString(this AnswerDiscriminatorType value) { return value switch { + "box" => AnswerDiscriminatorType.Box, "choice" => AnswerDiscriminatorType.Choice, "noul" => AnswerDiscriminatorType.Noul, "score" => AnswerDiscriminatorType.Score, diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.Json.g.cs new file mode 100644 index 0000000..892ab7b --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class Asset + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.Asset? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.Asset), + jsonSerializerContext) as global::TypeSafeAI.Generated.Asset; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.Asset? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.Asset? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.Asset), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.Asset; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.Asset? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.Asset? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.Asset? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.g.cs new file mode 100644 index 0000000..8015f11 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Asset.g.cs @@ -0,0 +1,80 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// An image that replaces its placeholder: its bytes in data_base64 with their format, or, in a multipart request, the name of the image part that holds them. Requests with images must send the header TypeSafe-Danger-Zone-Images: true. + /// + public sealed partial class Asset + { + /// + /// Identifies an image asset. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string? Type { get; set; } + + /// + /// The image format, required with data_base64. The actual format is detected from the bytes. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("format")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AssetFormatJsonConverter))] + public global::TypeSafeAI.Generated.AssetFormat? Format { get; set; } + + /// + /// Base64-encoded image data. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("data_base64")] + public string? DataBase64 { get; set; } + + /// + /// In a multipart request, the name of the image part this asset uses. With part, data_base64 is ignored. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("part")] + public string? Part { get; set; } + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Identifies an image asset. + /// + /// + /// The image format, required with data_base64. The actual format is detected from the bytes. + /// + /// + /// Base64-encoded image data. + /// + /// + /// In a multipart request, the name of the image part this asset uses. With part, data_base64 is ignored. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public Asset( + string? type, + global::TypeSafeAI.Generated.AssetFormat? format, + string? dataBase64, + string? part) + { + this.Type = type; + this.Format = format; + this.DataBase64 = dataBase64; + this.Part = part; + } + + /// + /// Initializes a new instance of the class. + /// + public Asset() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AssetFormat.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AssetFormat.g.cs new file mode 100644 index 0000000..66bf016 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.AssetFormat.g.cs @@ -0,0 +1,57 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// The image format, required with data_base64. The actual format is detected from the bytes. + /// + public enum AssetFormat + { + /// + /// + /// + Jpeg, + /// + /// + /// + Jpg, + /// + /// + /// + Png, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class AssetFormatExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this AssetFormat value) + { + return value switch + { + AssetFormat.Jpeg => "jpeg", + AssetFormat.Jpg => "jpg", + AssetFormat.Png => "png", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static AssetFormat? ToEnum(string value) + { + return value switch + { + "jpeg" => AssetFormat.Jpeg, + "jpg" => AssetFormat.Jpg, + "png" => AssetFormat.Png, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.Json.g.cs new file mode 100644 index 0000000..de84e0d --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class BoxAnswer + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxAnswer? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.BoxAnswer), + jsonSerializerContext) as global::TypeSafeAI.Generated.BoxAnswer; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxAnswer? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxAnswer? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.BoxAnswer), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.BoxAnswer; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.BoxAnswer? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxAnswer? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxAnswer? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.g.cs new file mode 100644 index 0000000..7fd3db2 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxAnswer.g.cs @@ -0,0 +1,82 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// A located box with normalized edge coordinates and confidence. + /// + public sealed partial class BoxAnswer + { + /// + /// Identifies a box answer. + /// + /// "box" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = "box"; + + /// + /// The box's edges as fractions of image height and width, from 0 to 1. Each coordinate is the expected value of its edge's predicted position. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("box")] + [global::System.Text.Json.Serialization.JsonRequired] + public required global::TypeSafeAI.Generated.BoxCoordinates Box { get; set; } + + /// + /// Confidence for the given box, from 0 to 1, with 1 being more confident. Null when the model does not provide confidence. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("confidence")] + public double? Confidence { get; set; } + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The box's edges as fractions of image height and width, from 0 to 1. Each coordinate is the expected value of its edge's predicted position. + /// + /// + /// Confidence for the given box, from 0 to 1, with 1 being more confident. Null when the model does not provide confidence. + /// + /// + /// Identifies a box answer. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BoxAnswer( + global::TypeSafeAI.Generated.BoxCoordinates box, + double? confidence, + string type = "box") + { + this.Type = type; + this.Box = box ?? throw new global::System.ArgumentNullException(nameof(box)); + this.Confidence = confidence; + } + + /// + /// Initializes a new instance of the class. + /// + public BoxAnswer() + { + } + + /// + /// Creates a new from its single non-const required field, + /// hardcoding any const discriminator fields. + /// + public static BoxAnswer FromBox(global::TypeSafeAI.Generated.BoxCoordinates box) + { + return new BoxAnswer + { + Box = box, + }; + } + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.Json.g.cs new file mode 100644 index 0000000..a469112 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class BoxCoordinates + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxCoordinates? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.BoxCoordinates), + jsonSerializerContext) as global::TypeSafeAI.Generated.BoxCoordinates; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxCoordinates? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxCoordinates? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.BoxCoordinates), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.BoxCoordinates; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.BoxCoordinates? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxCoordinates? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxCoordinates? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.g.cs new file mode 100644 index 0000000..d051d73 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxCoordinates.g.cs @@ -0,0 +1,83 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// Normalized box edges. Vertical coordinates are measured from the top of the image; horizontal coordinates are measured from the left. + /// + public sealed partial class BoxCoordinates + { + /// + /// Top edge of the box, as a fraction of image height from the top (0-1). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("top")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Top { get; set; } + + /// + /// Bottom edge of the box, as a fraction of image height from the top (0-1). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("bottom")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Bottom { get; set; } + + /// + /// Left edge of the box, as a fraction of image width from the left (0-1). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("left")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Left { get; set; } + + /// + /// Right edge of the box, as a fraction of image width from the left (0-1). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("right")] + [global::System.Text.Json.Serialization.JsonRequired] + public required double Right { get; set; } + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// Top edge of the box, as a fraction of image height from the top (0-1). + /// + /// + /// Bottom edge of the box, as a fraction of image height from the top (0-1). + /// + /// + /// Left edge of the box, as a fraction of image width from the left (0-1). + /// + /// + /// Right edge of the box, as a fraction of image width from the left (0-1). + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BoxCoordinates( + double top, + double bottom, + double left, + double right) + { + this.Top = top; + this.Bottom = bottom; + this.Left = left; + this.Right = right; + } + + /// + /// Initializes a new instance of the class. + /// + public BoxCoordinates() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.Json.g.cs new file mode 100644 index 0000000..1c63d06 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class BoxQuestion + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestion? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.BoxQuestion), + jsonSerializerContext) as global::TypeSafeAI.Generated.BoxQuestion; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestion? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxQuestion? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.BoxQuestion), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.BoxQuestion; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.BoxQuestion? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestion? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxQuestion? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.g.cs new file mode 100644 index 0000000..4a924cc --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestion.g.cs @@ -0,0 +1,59 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// A question that locates what its instructions describe in the request's image. Requests with box questions must send the header TypeSafe-Danger-Zone-Images: true. + /// + public sealed partial class BoxQuestion + { + /// + /// Identifies a box question. + /// + /// "box" + [global::System.Text.Json.Serialization.JsonPropertyName("type")] + public string Type { get; set; } = "box"; + + /// + /// What to locate in the image. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("instructions")] + [global::System.Text.Json.Serialization.JsonConverter(typeof(global::TypeSafeAI.Generated.JsonConverters.AnyOfJsonConverter>))] + public global::TypeSafeAI.Generated.AnyOf>? Instructions { get; set; } + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// What to locate in the image. + /// + /// + /// Identifies a box question. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public BoxQuestion( + global::TypeSafeAI.Generated.AnyOf>? instructions, + string type = "box") + { + this.Type = type; + this.Instructions = instructions; + } + + /// + /// Initializes a new instance of the class. + /// + public BoxQuestion() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.Json.g.cs new file mode 100644 index 0000000..416ce54 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class BoxQuestionInstruction + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstruction? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.BoxQuestionInstruction), + jsonSerializerContext) as global::TypeSafeAI.Generated.BoxQuestionInstruction; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstruction? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxQuestionInstruction? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.BoxQuestionInstruction), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.BoxQuestionInstruction; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstruction? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstruction? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxQuestionInstruction? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.g.cs new file mode 100644 index 0000000..4516845 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstruction.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// + /// + public sealed partial class BoxQuestionInstruction + { + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.Json.g.cs new file mode 100644 index 0000000..6645672 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class BoxQuestionInstructions + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstructions? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.BoxQuestionInstructions), + jsonSerializerContext) as global::TypeSafeAI.Generated.BoxQuestionInstructions; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstructions? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxQuestionInstructions? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.BoxQuestionInstructions), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.BoxQuestionInstructions; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstructions? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.BoxQuestionInstructions? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.BoxQuestionInstructions? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.g.cs new file mode 100644 index 0000000..60d2b11 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.BoxQuestionInstructions.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// + /// + public sealed partial class BoxQuestionInstructions + { + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Question.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Question.g.cs index 375f0d3..f0677a3 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Question.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.Question.g.cs @@ -124,6 +124,43 @@ public bool TryPickScore( public global::TypeSafeAI.Generated.ScoreQuestion PickScore() => Score is { } value ? value : throw new global::System.InvalidOperationException($"Expected union variant 'Score' but the value was {ToString()}."); + + /// + /// A question that locates what its instructions describe in the request's image. Requests with box questions must send the header TypeSafe-Danger-Zone-Images: true. + /// +#if NET6_0_OR_GREATER + public global::TypeSafeAI.Generated.BoxQuestion? Box { get; init; } +#else + public global::TypeSafeAI.Generated.BoxQuestion? Box { get; } +#endif + + /// + /// + /// +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof(Box))] +#endif + public bool IsBox => Box != null; + + /// + /// + /// + public bool TryPickBox( +#if NET6_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out global::TypeSafeAI.Generated.BoxQuestion? value) + { + value = Box; + return IsBox; + } + + /// + /// + /// + public global::TypeSafeAI.Generated.BoxQuestion PickBox() => Box is { } value + ? value + : throw new global::System.InvalidOperationException($"Expected union variant 'Box' but the value was {ToString()}."); /// /// /// @@ -193,6 +230,29 @@ public Question(global::TypeSafeAI.Generated.ScoreQuestion? value) /// public static Question FromScore(global::TypeSafeAI.Generated.ScoreQuestion? value) => new Question(value); + /// + /// + /// + public static implicit operator Question(global::TypeSafeAI.Generated.BoxQuestion value) => new Question((global::TypeSafeAI.Generated.BoxQuestion?)value); + + /// + /// + /// + public static implicit operator global::TypeSafeAI.Generated.BoxQuestion?(Question @this) => @this.Box; + + /// + /// + /// + public Question(global::TypeSafeAI.Generated.BoxQuestion? value) + { + Box = value; + } + + /// + /// + /// + public static Question FromBox(global::TypeSafeAI.Generated.BoxQuestion? value) => new Question(value); + /// /// /// @@ -200,7 +260,8 @@ public Question( global::TypeSafeAI.Generated.QuestionDiscriminatorType? type, global::TypeSafeAI.Generated.NoulQuestion? noul, global::TypeSafeAI.Generated.ChoiceQuestion? choice, - global::TypeSafeAI.Generated.ScoreQuestion? score + global::TypeSafeAI.Generated.ScoreQuestion? score, + global::TypeSafeAI.Generated.BoxQuestion? box ) { Type = type; @@ -208,12 +269,14 @@ public Question( Noul = noul; Choice = choice; Score = score; + Box = box; } /// /// /// public object? Object => + Box as object ?? Score as object ?? Choice as object ?? Noul as object @@ -225,7 +288,8 @@ Noul as object public override string? ToString() => Noul?.ToString() ?? Choice?.ToString() ?? - Score?.ToString() + Score?.ToString() ?? + Box?.ToString() ; /// @@ -233,7 +297,7 @@ Noul as object /// public bool Validate() { - return IsNoul && !IsChoice && !IsScore || !IsNoul && IsChoice && !IsScore || !IsNoul && !IsChoice && IsScore; + return IsNoul && !IsChoice && !IsScore && !IsBox || !IsNoul && IsChoice && !IsScore && !IsBox || !IsNoul && !IsChoice && IsScore && !IsBox || !IsNoul && !IsChoice && !IsScore && IsBox; } /// @@ -243,6 +307,7 @@ public bool Validate() global::System.Func? noul = null, global::System.Func? choice = null, global::System.Func? score = null, + global::System.Func? box = null, bool validate = true) { if (validate) @@ -262,6 +327,10 @@ public bool Validate() { return score(__value2); } + else if (Box is { } __value3 && box != null) + { + return box(__value3); + } return default(TResult); } @@ -275,6 +344,8 @@ public void Match( global::System.Action? choice = null, global::System.Action? score = null, + + global::System.Action? box = null, bool validate = true) { if (validate) @@ -294,6 +365,10 @@ public void Match( { score?.Invoke(__value2); } + else if (Box is { } __value3) + { + box?.Invoke(__value3); + } } /// @@ -303,6 +378,7 @@ public void Switch( global::System.Action? noul = null, global::System.Action? choice = null, global::System.Action? score = null, + global::System.Action? box = null, bool validate = true) { if (validate) @@ -322,6 +398,10 @@ public void Switch( { score?.Invoke(__value2); } + else if (Box is { } __value3) + { + box?.Invoke(__value3); + } } /// @@ -337,6 +417,8 @@ public override int GetHashCode() typeof(global::TypeSafeAI.Generated.ChoiceQuestion), Score, typeof(global::TypeSafeAI.Generated.ScoreQuestion), + Box, + typeof(global::TypeSafeAI.Generated.BoxQuestion), }; const int offset = unchecked((int)2166136261); const int prime = 16777619; @@ -355,7 +437,8 @@ public bool Equals(Question other) return global::System.Collections.Generic.EqualityComparer.Default.Equals(Noul, other.Noul) && global::System.Collections.Generic.EqualityComparer.Default.Equals(Choice, other.Choice) && - global::System.Collections.Generic.EqualityComparer.Default.Equals(Score, other.Score) + global::System.Collections.Generic.EqualityComparer.Default.Equals(Score, other.Score) && + global::System.Collections.Generic.EqualityComparer.Default.Equals(Box, other.Box) ; } diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.QuestionDiscriminatorType.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.QuestionDiscriminatorType.g.cs index eb227c2..78c5d1e 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.QuestionDiscriminatorType.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.QuestionDiscriminatorType.g.cs @@ -8,6 +8,10 @@ namespace TypeSafeAI.Generated /// public enum QuestionDiscriminatorType { + /// + /// + /// + Box, /// /// /// @@ -34,6 +38,7 @@ public static string ToValueString(this QuestionDiscriminatorType value) { return value switch { + QuestionDiscriminatorType.Box => "box", QuestionDiscriminatorType.Choice => "choice", QuestionDiscriminatorType.Noul => "noul", QuestionDiscriminatorType.Score => "score", @@ -47,6 +52,7 @@ public static string ToValueString(this QuestionDiscriminatorType value) { return value switch { + "box" => QuestionDiscriminatorType.Box, "choice" => QuestionDiscriminatorType.Choice, "noul" => QuestionDiscriminatorType.Noul, "score" => QuestionDiscriminatorType.Score, diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequest.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequest.g.cs index 2a31826..7ef6bdf 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequest.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequest.g.cs @@ -30,6 +30,12 @@ public sealed partial class SystemOneRequest [global::System.Text.Json.Serialization.JsonRequired] public required global::System.Collections.Generic.Dictionary Questions { get; set; } + /// + /// Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("assets")] + public global::System.Collections.Generic.Dictionary? Assets { get; set; } + /// /// Raw JSON properties that are not explicitly defined in the schema /// @@ -48,17 +54,22 @@ public sealed partial class SystemOneRequest /// /// Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers. /// + /// + /// Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public SystemOneRequest( string model, global::TypeSafeAI.Generated.AnyOf> state, - global::System.Collections.Generic.Dictionary questions) + global::System.Collections.Generic.Dictionary questions, + global::System.Collections.Generic.Dictionary? assets) { this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.State = state; this.Questions = questions ?? throw new global::System.ArgumentNullException(nameof(questions)); + this.Assets = assets; } /// diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.Json.g.cs new file mode 100644 index 0000000..5c9d2a3 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class SystemOneRequestAssets + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemOneRequestAssets? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.SystemOneRequestAssets), + jsonSerializerContext) as global::TypeSafeAI.Generated.SystemOneRequestAssets; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemOneRequestAssets? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.SystemOneRequestAssets? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.SystemOneRequestAssets), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.SystemOneRequestAssets; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.SystemOneRequestAssets? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemOneRequestAssets? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.SystemOneRequestAssets? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.g.cs new file mode 100644 index 0000000..1900155 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemOneRequestAssets.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model. + /// + public sealed partial class SystemOneRequestAssets + { + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.Json.g.cs new file mode 100644 index 0000000..5bc3cc9 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class SystemoneV1SystemonePostRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest), + jsonSerializerContext) as global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequest? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.g.cs new file mode 100644 index 0000000..e418b99 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequest.g.cs @@ -0,0 +1,47 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// The JSON request as the first part, named request, then each image as its own part. Every image part needs a unique, non-empty name and must be used by exactly one asset's part. + /// + public sealed partial class SystemoneV1SystemonePostRequest + { + /// + /// The JSON request, as the first part. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("request")] + [global::System.Text.Json.Serialization.JsonRequired] + public required object Request { get; set; } + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The JSON request, as the first part. + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SystemoneV1SystemonePostRequest( + object request) + { + this.Request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + } + + /// + /// Initializes a new instance of the class. + /// + public SystemoneV1SystemonePostRequest() + { + } + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.Json.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.Json.g.cs new file mode 100644 index 0000000..afdaf8a --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.Json.g.cs @@ -0,0 +1,218 @@ +#nullable enable + +namespace TypeSafeAI.Generated +{ + public sealed partial class SystemoneV1SystemonePostRequestRequest + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the generated default JsonSerializerContext. + /// + public string ToJson() + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest), + jsonSerializerContext) as global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest; + } + + /// + /// Deserializes a JSON string using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest? FromJson( + string json) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJson( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest; + } + + /// + /// Deserializes a JSON stream using the generated default JsonSerializerContext. + /// + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromJsonStreamAsync( + jsonStream, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerContext. + /// + public string ToRawJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return ToJson(jsonSerializerContext); + } + + /// + /// Serializes the current instance to raw JSON using the generated default JsonSerializerContext. + /// + public string ToRawJson() + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Serializes the current instance to raw JSON using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToRawJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return ToRawJson(global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return ToJson(jsonSerializerOptions); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest? FromRawUnchecked( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return FromJson(json, jsonSerializerContext); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties using the generated default JsonSerializerContext. + /// + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest? FromRawUnchecked( + string json) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + /// + /// Deserializes raw JSON while preserving unknown JSON properties. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::TypeSafeAI.Generated.SystemoneV1SystemonePostRequestRequest? FromRawUnchecked( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + if (jsonSerializerOptions is null) + { + return FromRawUnchecked( + json, + global::TypeSafeAI.Generated.SourceGenerationContext.Default); + } + + return FromJson(json, jsonSerializerOptions); + } + } +} diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.g.cs new file mode 100644 index 0000000..422577a --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostRequestRequest.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// The JSON request, as the first part. + /// + public sealed partial class SystemoneV1SystemonePostRequestRequest + { + + /// + /// Raw JSON properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs new file mode 100644 index 0000000..8438bf0 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneImages.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// + /// + public enum SystemoneV1SystemonePostTypeSafeDangerZoneImages + { + /// + /// + /// + True, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SystemoneV1SystemonePostTypeSafeDangerZoneImagesExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SystemoneV1SystemonePostTypeSafeDangerZoneImages value) + { + return value switch + { + SystemoneV1SystemonePostTypeSafeDangerZoneImages.True => "true", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SystemoneV1SystemonePostTypeSafeDangerZoneImages? ToEnum(string value) + { + return value switch + { + "true" => SystemoneV1SystemonePostTypeSafeDangerZoneImages.True, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs new file mode 100644 index 0000000..34d0d31 --- /dev/null +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.Models.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.g.cs @@ -0,0 +1,45 @@ + +#nullable enable + +namespace TypeSafeAI.Generated +{ + /// + /// + /// + public enum SystemoneV1SystemonePostTypeSafeDangerZoneLongContext + { + /// + /// + /// + True, + } + + /// + /// Enum extensions to do fast conversions without the reflection. + /// + public static class SystemoneV1SystemonePostTypeSafeDangerZoneLongContextExtensions + { + /// + /// Converts an enum to a string. + /// + public static string ToValueString(this SystemoneV1SystemonePostTypeSafeDangerZoneLongContext value) + { + return value switch + { + SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.True => "true", + _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null), + }; + } + /// + /// Converts an string to a enum. + /// + public static SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? ToEnum(string value) + { + return value switch + { + "true" => SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.True, + _ => null, + }; + } + } +} \ No newline at end of file diff --git a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.RawTypeSafeClient.SystemoneV1SystemonePost.g.cs b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.RawTypeSafeClient.SystemoneV1SystemonePost.g.cs index 0bc2a65..0aa8f0b 100644 --- a/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.RawTypeSafeClient.SystemoneV1SystemonePost.g.cs +++ b/src/libs/TypeSafeAI/Generated/TypeSafeAI.Generated.RawTypeSafeClient.SystemoneV1SystemonePost.g.cs @@ -27,10 +27,14 @@ public partial class RawTypeSafeClient }; partial void PrepareSystemoneV1SystemonePostArguments( global::System.Net.Http.HttpClient httpClient, + ref global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages, + ref global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext, global::TypeSafeAI.Generated.SystemOneRequest request); partial void PrepareSystemoneV1SystemonePostRequest( global::System.Net.Http.HttpClient httpClient, global::System.Net.Http.HttpRequestMessage httpRequestMessage, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext, global::TypeSafeAI.Generated.SystemOneRequest request); partial void ProcessSystemoneV1SystemonePostResponse( global::System.Net.Http.HttpClient httpClient, @@ -48,6 +52,8 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( /// questions, so you can match each result to its question. The response also includes
/// the model used and token usage. ///
+ /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -55,12 +61,16 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( public async global::System.Threading.Tasks.Task SystemoneV1SystemonePostAsync( global::TypeSafeAI.Generated.SystemOneRequest request, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default, global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { var __response = await SystemoneV1SystemonePostAsResponseAsync( request: request, + typeSafeDangerZoneImages: typeSafeDangerZoneImages, + typeSafeDangerZoneLongContext: typeSafeDangerZoneLongContext, requestOptions: requestOptions, cancellationToken: cancellationToken ).ConfigureAwait(false); @@ -74,6 +84,8 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( /// questions, so you can match each result to its question. The response also includes
/// the model used and token usage. ///
+ /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with @@ -81,6 +93,8 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( public async global::System.Threading.Tasks.Task> SystemoneV1SystemonePostAsResponseAsync( global::TypeSafeAI.Generated.SystemOneRequest request, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default, global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -90,6 +104,8 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( client: HttpClient); PrepareSystemoneV1SystemonePostArguments( httpClient: HttpClient, + typeSafeDangerZoneImages: ref typeSafeDangerZoneImages, + typeSafeDangerZoneLongContext: ref typeSafeDangerZoneLongContext, request: request); @@ -147,6 +163,16 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + + if (typeSafeDangerZoneImages != default) + { + __httpRequest.Headers.TryAddWithoutValidation("TypeSafe-Danger-Zone-Images", typeSafeDangerZoneImages?.ToValueString() ?? string.Empty); + } + if (typeSafeDangerZoneLongContext != default) + { + __httpRequest.Headers.TryAddWithoutValidation("TypeSafe-Danger-Zone-Long-Context", typeSafeDangerZoneLongContext?.ToValueString() ?? string.Empty); + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); var __httpRequestContent = new global::System.Net.Http.StringContent( content: __httpRequestContentBody, @@ -164,6 +190,8 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( PrepareSystemoneV1SystemonePostRequest( httpClient: HttpClient, httpRequestMessage: __httpRequest, + typeSafeDangerZoneImages: typeSafeDangerZoneImages, + typeSafeDangerZoneLongContext: typeSafeDangerZoneLongContext, request: request); return __httpRequest; @@ -483,6 +511,8 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( /// questions, so you can match each result to its question. The response also includes
/// the model used and token usage. ///
+ /// + /// /// /// Name or alias of the model to use. Available names are returned by GET /v1/models. /// @@ -492,6 +522,9 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( /// /// Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers. /// + /// + /// Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -499,6 +532,9 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( string model, global::TypeSafeAI.Generated.AnyOf> state, global::System.Collections.Generic.Dictionary questions, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default, + global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default, + global::System.Collections.Generic.Dictionary? assets = default, global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -507,9 +543,12 @@ partial void ProcessSystemoneV1SystemonePostResponseContent( Model = model, State = state, Questions = questions, + Assets = assets, }; return await SystemoneV1SystemonePostAsync( + typeSafeDangerZoneImages: typeSafeDangerZoneImages, + typeSafeDangerZoneLongContext: typeSafeDangerZoneLongContext, request: __request, requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); diff --git a/src/libs/TypeSafeAI/Generated/autosdk.generated-examples.json b/src/libs/TypeSafeAI/Generated/autosdk.generated-examples.json index 58800ac..f18cd68 100644 --- a/src/libs/TypeSafeAI/Generated/autosdk.generated-examples.json +++ b/src/libs/TypeSafeAI/Generated/autosdk.generated-examples.json @@ -6,7 +6,7 @@ "Slug": "systemone-v1-systemone-post", "Description": "Answer one or more questions about the content supplied in \u0060state\u0060.\n\nYou can mix question types in one request. Answers use the same names as the\nquestions, so you can match each result to its question. The response also includes\nthe model used and token usage.", "Language": "csharp", - "Code": "using var client = RawTypeSafeClient.CreateFromEnvironment();\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::TypeSafeAI.Generated.SystemOneRequest\u003E(\n @\u0022{\n \u0022\u0022model\u0022\u0022: \u0022\u0022jev-latest\u0022\u0022,\n \u0022\u0022state\u0022\u0022: \u0022\u0022I was charged twice for my subscription this month. Please refund the extra charge.\u0022\u0022,\n \u0022\u0022questions\u0022\u0022: {\n \u0022\u0022tone\u0022\u0022: {\n \u0022\u0022type\u0022\u0022: \u0022\u0022choice\u0022\u0022,\n \u0022\u0022instructions\u0022\u0022: \u0022\u0022What is the tone of this message?\u0022\u0022,\n \u0022\u0022criteria\u0022\u0022: {\n \u0022\u0022angry\u0022\u0022: \u0022\u0022An upset or hostile message\u0022\u0022,\n \u0022\u0022calm\u0022\u0022: \u0022\u0022A neutral or polite message\u0022\u0022,\n \u0022\u0022excited\u0022\u0022: \u0022\u0022An enthusiastic or eager message\u0022\u0022\n }\n }\n }\n}\u0022)!;\n\nvar response = await client.SystemoneV1SystemonePostAsync(\n request: request\n);\n\n// Example response:\n// {\n// \u0022model\u0022: \u0022jev-latest\u0022,\n// \u0022answers\u0022: {\n// \u0022tone\u0022: {\n// \u0022type\u0022: \u0022choice\u0022,\n// \u0022choice\u0022: \u0022calm\u0022,\n// \u0022confidence\u0022: 0.7,\n// \u0022probabilities\u0022: {\n// \u0022angry\u0022: 0.15,\n// \u0022calm\u0022: 0.8,\n// \u0022excited\u0022: 0.05\n// }\n// }\n// },\n// \u0022usage\u0022: {\n// \u0022input_tokens\u0022: 120,\n// \u0022output_tokens\u0022: 12\n// }\n// }", + "Code": "using var client = RawTypeSafeClient.CreateFromEnvironment();\n\nvar request = global::System.Text.Json.JsonSerializer.Deserialize\u003Cglobal::TypeSafeAI.Generated.SystemOneRequest\u003E(\n @\u0022{\n \u0022\u0022model\u0022\u0022: \u0022\u0022v14_hot_mode\u0022\u0022,\n \u0022\u0022state\u0022\u0022: \u0022\u0022photo\u0022\u0022,\n \u0022\u0022questions\u0022\u0022: {\n \u0022\u0022red_rectangle\u0022\u0022: {\n \u0022\u0022type\u0022\u0022: \u0022\u0022box\u0022\u0022,\n \u0022\u0022instructions\u0022\u0022: \u0022\u0022Locate the red rectangle.\u0022\u0022\n }\n },\n \u0022\u0022assets\u0022\u0022: {\n \u0022\u0022photo\u0022\u0022: {\n \u0022\u0022type\u0022\u0022: \u0022\u0022image\u0022\u0022,\n \u0022\u0022format\u0022\u0022: \u0022\u0022png\u0022\u0022,\n \u0022\u0022data_base64\u0022\u0022: \u0022\u0022iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAHElEQVR4nGP4TyJgoKcGBgbsaFQDfTUQB4aDBgDAen2fpitsVAAAAABJRU5ErkJggg==\u0022\u0022\n }\n }\n}\u0022)!;\n\nvar response = await client.SystemoneV1SystemonePostAsync(\n request: request,\n typeSafeDangerZoneImages: global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages.True,\n typeSafeDangerZoneLongContext: global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext.True\n);\n\n// Example response:\n// {\n// \u0022model\u0022: \u0022v14_hot_mode\u0022,\n// \u0022answers\u0022: {\n// \u0022red_rectangle\u0022: {\n// \u0022type\u0022: \u0022box\u0022,\n// \u0022box\u0022: {\n// \u0022top\u0022: 0.2,\n// \u0022bottom\u0022: 0.66,\n// \u0022left\u0022: 0.19,\n// \u0022right\u0022: 0.68\n// },\n// \u0022confidence\u0022: null\n// }\n// },\n// \u0022usage\u0022: {\n// \u0022input_tokens\u0022: 285,\n// \u0022output_tokens\u0022: 20\n// }\n// }", "Format": "sdk", "OperationId": "systemone_v1_systemone_post", "Setup": "This example assumes \u0060using TypeSafeAI.Generated;\u0060 is in scope and a configured credential environment variable is set: \u0060TYPESAFE_API_KEY\u0060." diff --git a/src/libs/TypeSafeAI/openapi.yaml b/src/libs/TypeSafeAI/openapi.yaml index 72c4c61..ec188f1 100644 --- a/src/libs/TypeSafeAI/openapi.yaml +++ b/src/libs/TypeSafeAI/openapi.yaml @@ -1 +1 @@ -{"openapi":"3.1.0","info":{"title":"TypeSafe","description":"Ask yes/no questions, evaluate statements, select choices, or assign ratings to your content. Send your API key in the Authorization header as `Bearer `. Use GET /v1/models to discover available model names.","version":"0.2.0"},"servers":[{"url":"https://api.typesafe.ai"}],"paths":{"/v1/models":{"get":{"summary":"List models","description":"List the models and aliases available to the authenticated account.\n\nPass a returned model name as `model` in a POST /v1/systemone request.","operationId":"models_v1_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetadataList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/systemone":{"post":{"summary":"System One","description":"Answer one or more questions about the content supplied in `state`.\n\nYou can mix question types in one request. Answers use the same names as the\nquestions, so you can match each result to its question. The response also includes\nthe model used and token usage.","operationId":"systemone_v1_systemone_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemOneRequest"},"examples":{"noul":{"summary":"Noul","value":{"model":"jev-latest","state":"I was charged twice for my subscription this month. Please refund the extra charge.","questions":{"billing":{"type":"noul","instructions":"Is this message about billing?"}}}},"choice":{"summary":"Choice","value":{"model":"jev-latest","state":"I was charged twice for my subscription this month. Please refund the extra charge.","questions":{"tone":{"type":"choice","instructions":"What is the tone of this message?","criteria":{"angry":"An upset or hostile message","calm":"A neutral or polite message","excited":"An enthusiastic or eager message"}}}}},"score":{"summary":"Score","value":{"model":"jev-latest","state":"I was charged twice for my subscription this month. Please refund the extra charge.","questions":{"urgency":{"type":"score","instructions":"How urgent is this message?","criteria":["Can wait","Needs attention this week","Needs attention today"]}}}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemOneResponse"},"examples":{"noul":{"summary":"Noul","value":{"model":"jev-latest","answers":{"billing":{"type":"noul","noul":0.98}},"usage":{"input_tokens":120,"output_tokens":12}}},"choice":{"summary":"Choice","value":{"model":"jev-latest","answers":{"tone":{"type":"choice","choice":"calm","confidence":0.7,"probabilities":{"angry":0.15,"calm":0.8,"excited":0.05}}},"usage":{"input_tokens":120,"output_tokens":12}}},"score":{"summary":"Score","value":{"model":"jev-latest","answers":{"urgency":{"type":"score","score":1.7,"confidence":0.55,"legend":{"0":"Can wait","1":"Needs attention this week","2":"Needs attention today"},"probabilities":{"0":0.1,"1":0.1,"2":0.8}}},"usage":{"input_tokens":120,"output_tokens":12}}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"Answer":{"oneOf":[{"$ref":"#/components/schemas/NoulAnswer","title":"Noul"},{"$ref":"#/components/schemas/ChoiceAnswer","title":"Choice"},{"$ref":"#/components/schemas/ScoreAnswer","title":"Score"}],"discriminator":{"propertyName":"type","mapping":{"noul":"#/components/schemas/NoulAnswer","choice":"#/components/schemas/ChoiceAnswer","score":"#/components/schemas/ScoreAnswer"}},"description":"An answer whose type matches the corresponding question."},"ChoiceAnswer":{"properties":{"type":{"type":"string","const":"choice","title":"Type","description":"Identifies a selection from the requested choices.","examples":["choice"]},"choice":{"type":"string","title":"Choice","description":"The name of the choice with the highest probability among the question's criteria.","examples":["angry"]},"confidence":{"type":"number","title":"Confidence","description":"Confidence in the selected choice, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain selections for review.","examples":[0.9]},"probabilities":{"additionalProperties":{"type":"number"},"type":"object","title":"Probabilities","description":"Probability of each choice in criteria, keyed by choice name, from 0 to 1. Shows how likely the alternatives are; values sum to approximately 1.","examples":[{"angry":0.8,"calm":0.1,"excited":0.1}]}},"type":"object","required":["type","choice","confidence","probabilities"],"title":"ChoiceAnswer","description":"The selected choice, confidence, and probabilities for a choice question."},"ChoiceQuestion":{"properties":{"type":{"type":"string","const":"choice","title":"Type","description":"Identifies a question that selects one of the choices in criteria.","examples":["choice"]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"What the model should decide when choosing an option.","examples":["What is the tone of this message?"]},"criteria":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array"},"type":"object","title":"Criteria","description":"Choice names and descriptions of when each applies. A choice without a description is interpreted by its name alone.","examples":[{"angry":"An upset or hostile message","calm":"A neutral or polite message","excited":"An enthusiastic or eager message"}]}},"type":"object","required":["type","criteria"],"title":"ChoiceQuestion","description":"A question that selects one option from the choices you define."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail","description":"Validation errors describing which request values are missing or invalid.","examples":[[{"loc":["body","state"],"msg":"Field required","type":"missing"}]]}},"type":"object","title":"HTTPValidationError","description":"Request validation failures returned with HTTP status 422."},"ModelMetadata":{"properties":{"name":{"type":"string","title":"Name","description":"Model name or alias accepted by the request's model field.","examples":["jev-latest"]},"description":{"type":"string","title":"Description","description":"Human-readable description of the model and its capabilities.","examples":["General-purpose system one model."]},"release_date":{"type":"string","title":"Release Date","description":"Model release date, formatted as YYYY-MM-DD.","examples":["2026-09-15"]}},"type":"object","required":["name","description","release_date"],"title":"ModelMetadata","description":"A model or model alias available to the authenticated account."},"ModelMetadataList":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ModelMetadata"},"type":"array","title":"Models","description":"Available models and aliases. Use a model's name in POST /v1/systemone requests.","examples":[[{"description":"General-purpose system one model.","name":"jev-latest","release_date":"2026-09-15"}]]}},"type":"object","required":["models"],"title":"ModelMetadataList","description":"Models and aliases available to the authenticated account."},"NoulAnswer":{"properties":{"type":{"type":"string","const":"noul","title":"Type","description":"Identifies a yes/no answer.","examples":["noul"]},"noul":{"type":"number","title":"Noul","description":"Probability of a yes answer or a true statement, from 0 to 1. Values near 1 favor yes or true, values near 0 favor no or false, and values near 0.5 indicate uncertainty.","examples":[0.98]}},"type":"object","required":["type","noul"],"title":"NoulAnswer","description":"The probability of a yes answer or a true statement."},"NoulCriteria":{"properties":{"true":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"True","description":"What counts as a yes answer.","examples":["The message is unsolicited advertising."]},"false":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"False","description":"What counts as a no answer.","examples":["The message is a legitimate conversation."]}},"type":"object","title":"NoulCriteria","description":"Criteria defining what counts as a yes or no answer."},"NoulQuestion":{"properties":{"type":{"type":"string","const":"noul","title":"Type","description":"Identifies a yes/no question or statement.","examples":["noul"]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"The yes/no question or statement to evaluate.","examples":["Is this message spam?","This message contains unsolicited advertising.",{"task":"Identify unsolicited advertising."}]},"criteria":{"anyOf":[{"$ref":"#/components/schemas/NoulCriteria"},{"type":"null"}],"description":"Criteria clarifying what counts as a yes or no answer.","examples":[{"false":"A legitimate conversation","true":"Unsolicited advertising"}]}},"type":"object","required":["type"],"title":"NoulQuestion","description":"A yes/no question or statement, answered with the probability of yes or true."},"Question":{"oneOf":[{"$ref":"#/components/schemas/NoulQuestion","title":"Noul"},{"$ref":"#/components/schemas/ChoiceQuestion","title":"Choice"},{"$ref":"#/components/schemas/ScoreQuestion","title":"Score"}],"discriminator":{"propertyName":"type","mapping":{"noul":"#/components/schemas/NoulQuestion","choice":"#/components/schemas/ChoiceQuestion","score":"#/components/schemas/ScoreQuestion"}},"description":"A question about the supplied content."},"ScoreAnswer":{"properties":{"type":{"type":"string","const":"score","title":"Type","description":"Identifies a rating against the requested score levels.","examples":["score"]},"score":{"type":"number","title":"Score","description":"Expected score: the probability-weighted average of the rubric levels. May fall between integer levels.","examples":[1.7]},"confidence":{"type":"number","title":"Confidence","description":"Confidence in the score, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain ratings for review.","examples":[0.9]},"legend":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"x-accepts":"string | object | array"},"type":"object","title":"Legend","description":"The requested criteria mapped to their score levels, so you can interpret the score.","examples":[{"0":"Can wait","1":"Needs attention this week","2":"Needs attention today"}]},"probabilities":{"additionalProperties":{"type":"number"},"type":"object","title":"Probabilities","description":"Probability of each score level, from 0 to 1, using the same keys as legend. Shows how likely the alternatives are; values sum to approximately 1.","examples":[{"0":0.1,"1":0.1,"2":0.8}]}},"type":"object","required":["type","score","confidence","legend","probabilities"],"title":"ScoreAnswer","description":"An expected score with its rubric, confidence, and score-level probabilities."},"ScoreQuestion":{"properties":{"type":{"type":"string","const":"score","title":"Type","description":"Identifies a question that rates the content using the levels in criteria.","examples":["score"]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"What the model should rate.","examples":["How urgent is this message?"]},"criteria":{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"x-accepts":"string | object | array"},"type":"array","minItems":1,"title":"Criteria","description":"Ordered descriptions of the score levels. Each description's position determines its score, starting at zero.","examples":[["Can wait","Needs attention this week","Needs attention today"]]}},"type":"object","required":["type","criteria"],"title":"ScoreQuestion","description":"A question that assigns a score using an ordered rubric."},"SystemOneRequest":{"properties":{"model":{"type":"string","title":"Model","description":"Name or alias of the model to use. Available names are returned by GET /v1/models.","examples":["jev-latest"]},"state":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"x-accepts":"string | object | array","title":"State","description":"The content all questions in this request refer to.","examples":["I was charged twice. Please help.",{"message":"Please help.","subject":"Duplicate charge"}]},"questions":{"additionalProperties":{"$ref":"#/components/schemas/Question"},"type":"object","minProperties":1,"title":"Questions","description":"Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers.","examples":[{"billing":{"instructions":"Is this message about billing?","type":"noul"}}]}},"type":"object","required":["model","state","questions"],"title":"SystemOneRequest","description":"Content and named questions to evaluate together using a TypeSafe model."},"SystemOneResponse":{"properties":{"model":{"type":"string","title":"Model","description":"Name of the model that answered the questions. May differ from the alias supplied in the request.","examples":["jev-latest"]},"answers":{"additionalProperties":{"$ref":"#/components/schemas/Answer"},"type":"object","minProperties":1,"title":"Answers","description":"Answers keyed by the question names supplied in the request. Each answer's type matches its question's type.","examples":[{"billing":{"noul":0.98,"type":"noul"}}]},"usage":{"$ref":"#/components/schemas/Usage","description":"Input and output token counts for this evaluation.","examples":[{"input_tokens":120,"output_tokens":12}]}},"type":"object","required":["model","answers","usage"],"title":"SystemOneResponse","description":"Answers grouped by question name, with the model used and token usage."},"Usage":{"properties":{"input_tokens":{"type":"integer","title":"Input Tokens","description":"Number of billable input tokens used to evaluate the request.","examples":[120]},"output_tokens":{"type":"integer","title":"Output Tokens","description":"Number of output tokens used to answer the questions. Output tokens are currently free of charge.","examples":[12]}},"type":"object","required":["input_tokens","output_tokens"],"title":"Usage","description":"Token usage for the request."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location","description":"Path to the invalid value: the request location followed by field names and array indices.","examples":[["body","questions","urgency","score","criteria"]]},"msg":{"type":"string","title":"Message","description":"Human-readable explanation of the validation failure.","examples":["Field required"]},"type":{"type":"string","title":"Error Type","description":"Machine-readable validation error code.","examples":["missing"]},"input":{"title":"Input","description":"The input value that failed validation.","examples":[{"type":"score"}]},"ctx":{"type":"object","title":"Context","description":"Additional context used to explain the validation failure.","examples":[{"min_length":1}]}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","description":"A request validation error at a specific field or array element."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}} \ No newline at end of file +{"openapi":"3.1.0","info":{"title":"TypeSafe","description":"Ask yes/no questions, evaluate statements, select choices, or assign ratings to your content. Send your API key in the Authorization header as `Bearer `. Use GET /v1/models to discover available model names.","version":"0.2.0"},"servers":[{"url":"https://api.typesafe.ai"}],"paths":{"/v1/models":{"get":{"summary":"List models","description":"List the models and aliases available to the authenticated account.\n\nPass a returned model name as `model` in a POST /v1/systemone request.","operationId":"models_v1_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelMetadataList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/v1/systemone":{"post":{"summary":"System One","description":"Answer one or more questions about the content supplied in `state`.\n\nYou can mix question types in one request. Answers use the same names as the\nquestions, so you can match each result to its question. The response also includes\nthe model used and token usage.","operationId":"systemone_v1_systemone_post","parameters":[{"name":"TypeSafe-Danger-Zone-Images","in":"header","description":"Set to true to use assets or box questions.","schema":{"type":"string","enum":["true"]},"example":"true"},{"name":"TypeSafe-Danger-Zone-Long-Context","in":"header","description":"Set to true to use long context.","schema":{"type":"string","enum":["true"]},"example":"true"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemOneRequest"},"examples":{"noul":{"summary":"Noul","value":{"model":"jev-latest","state":"I was charged twice for my subscription this month. Please refund the extra charge.","questions":{"billing":{"type":"noul","instructions":"Is this message about billing?"}}}},"choice":{"summary":"Choice","value":{"model":"jev-latest","state":"I was charged twice for my subscription this month. Please refund the extra charge.","questions":{"tone":{"type":"choice","instructions":"What is the tone of this message?","criteria":{"angry":"An upset or hostile message","calm":"A neutral or polite message","excited":"An enthusiastic or eager message"}}}}},"score":{"summary":"Score","value":{"model":"jev-latest","state":"I was charged twice for my subscription this month. Please refund the extra charge.","questions":{"urgency":{"type":"score","instructions":"How urgent is this message?","criteria":["Can wait","Needs attention this week","Needs attention today"]}}}},"box":{"summary":"Box (requires TypeSafe-Danger-Zone-Images: true)","value":{"model":"v14_hot_mode","state":"photo","questions":{"red_rectangle":{"type":"box","instructions":"Locate the red rectangle."}},"assets":{"photo":{"type":"image","format":"png","data_base64":"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAHElEQVR4nGP4TyJgoKcGBgbsaFQDfTUQB4aDBgDAen2fpitsVAAAAABJRU5ErkJggg=="}}}}}},"multipart/form-data":{"schema":{"type":"object","description":"The JSON request as the first part, named request, then each image as its own part. Every image part needs a unique, non-empty name and must be used by exactly one asset's part.","properties":{"request":{"description":"The JSON request, as the first part.","contentMediaType":"application/json","contentSchema":{"$ref":"#/components/schemas/SystemOneRequest"}}},"required":["request"],"additionalProperties":{"type":"string","description":"An image, named by the asset part that uses it.","contentMediaType":"image/*"}},"encoding":{"request":{"contentType":"application/json"}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemOneResponse"},"examples":{"noul":{"summary":"Noul","value":{"model":"jev-latest","answers":{"billing":{"type":"noul","noul":0.98}},"usage":{"input_tokens":120,"output_tokens":12}}},"choice":{"summary":"Choice","value":{"model":"jev-latest","answers":{"tone":{"type":"choice","choice":"calm","confidence":0.7,"probabilities":{"angry":0.15,"calm":0.8,"excited":0.05}}},"usage":{"input_tokens":120,"output_tokens":12}}},"score":{"summary":"Score","value":{"model":"jev-latest","answers":{"urgency":{"type":"score","score":1.7,"confidence":0.55,"legend":{"0":"Can wait","1":"Needs attention this week","2":"Needs attention today"},"probabilities":{"0":0.1,"1":0.1,"2":0.8}}},"usage":{"input_tokens":120,"output_tokens":12}}},"box":{"summary":"Box","value":{"model":"v14_hot_mode","answers":{"red_rectangle":{"type":"box","box":{"top":0.2,"bottom":0.66,"left":0.19,"right":0.68},"confidence":null}},"usage":{"input_tokens":285,"output_tokens":20}}}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"Answer":{"oneOf":[{"$ref":"#/components/schemas/NoulAnswer","title":"Noul"},{"$ref":"#/components/schemas/ChoiceAnswer","title":"Choice"},{"$ref":"#/components/schemas/ScoreAnswer","title":"Score"},{"$ref":"#/components/schemas/BoxAnswer","title":"Box"}],"discriminator":{"propertyName":"type","mapping":{"noul":"#/components/schemas/NoulAnswer","choice":"#/components/schemas/ChoiceAnswer","score":"#/components/schemas/ScoreAnswer","box":"#/components/schemas/BoxAnswer"}},"description":"An answer whose type matches the corresponding question."},"Asset":{"properties":{"type":{"type":"string","const":"image","title":"Type","description":"Identifies an image asset."},"format":{"type":"string","enum":["png","jpg","jpeg"],"title":"Format","description":"The image format, required with data_base64. The actual format is detected from the bytes."},"data_base64":{"type":"string","title":"Data Base64","description":"Base64-encoded image data."},"part":{"type":"string","title":"Part","description":"In a multipart request, the name of the image part this asset uses. With part, data_base64 is ignored."}},"type":"object","title":"Asset","description":"An image that replaces its placeholder: its bytes in data_base64 with their format, or, in a multipart request, the name of the image part that holds them. Requests with images must send the header TypeSafe-Danger-Zone-Images: true."},"BoxAnswer":{"properties":{"type":{"type":"string","const":"box","title":"Type","description":"Identifies a box answer.","examples":["box"]},"box":{"$ref":"#/components/schemas/BoxCoordinates","description":"The box's edges as fractions of image height and width, from 0 to 1. Each coordinate is the expected value of its edge's predicted position.","examples":[{"bottom":0.66,"left":0.19,"right":0.68,"top":0.2}]},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","description":"Confidence for the given box, from 0 to 1, with 1 being more confident. Null when the model does not provide confidence.","examples":[null,0.9]}},"type":"object","required":["type","box","confidence"],"title":"BoxAnswer","description":"A located box with normalized edge coordinates and confidence."},"BoxCoordinates":{"properties":{"top":{"type":"number","title":"Top","description":"Top edge of the box, as a fraction of image height from the top (0-1).","examples":[0.2]},"bottom":{"type":"number","title":"Bottom","description":"Bottom edge of the box, as a fraction of image height from the top (0-1).","examples":[0.66]},"left":{"type":"number","title":"Left","description":"Left edge of the box, as a fraction of image width from the left (0-1).","examples":[0.19]},"right":{"type":"number","title":"Right","description":"Right edge of the box, as a fraction of image width from the left (0-1).","examples":[0.68]}},"type":"object","required":["top","bottom","left","right"],"title":"BoxCoordinates","description":"Normalized box edges. Vertical coordinates are measured from the top of the image; horizontal coordinates are measured from the left."},"BoxQuestion":{"properties":{"type":{"type":"string","const":"box","title":"Type","description":"Identifies a box question."},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"What to locate in the image."}},"type":"object","required":["type"],"title":"BoxQuestion","description":"A question that locates what its instructions describe in the request's image. Requests with box questions must send the header TypeSafe-Danger-Zone-Images: true."},"ChoiceAnswer":{"properties":{"type":{"type":"string","const":"choice","title":"Type","description":"Identifies a selection from the requested choices.","examples":["choice"]},"choice":{"type":"string","title":"Choice","description":"The name of the choice with the highest probability among the question's criteria.","examples":["angry"]},"confidence":{"type":"number","title":"Confidence","description":"Confidence in the selected choice, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain selections for review.","examples":[0.9]},"probabilities":{"additionalProperties":{"type":"number"},"type":"object","title":"Probabilities","description":"Probability of each choice in criteria, keyed by choice name, from 0 to 1. Shows how likely the alternatives are; values sum to approximately 1.","examples":[{"angry":0.8,"calm":0.1,"excited":0.1}]}},"type":"object","required":["type","choice","confidence","probabilities"],"title":"ChoiceAnswer","description":"The selected choice, confidence, and probabilities for a choice question."},"ChoiceQuestion":{"properties":{"type":{"type":"string","const":"choice","title":"Type","description":"Identifies a question that selects one of the choices in criteria.","examples":["choice"]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"What the model should decide when choosing an option.","examples":["What is the tone of this message?"]},"criteria":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array"},"type":"object","title":"Criteria","description":"Choice names and descriptions of when each applies. A choice without a description is interpreted by its name alone.","examples":[{"angry":"An upset or hostile message","calm":"A neutral or polite message","excited":"An enthusiastic or eager message"}]}},"type":"object","required":["type","criteria"],"title":"ChoiceQuestion","description":"A question that selects one option from the choices you define."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail","description":"Validation errors describing which request values are missing or invalid.","examples":[[{"loc":["body","state"],"msg":"Field required","type":"missing"}]]}},"type":"object","title":"HTTPValidationError","description":"Request validation failures returned with HTTP status 422."},"ModelMetadata":{"properties":{"name":{"type":"string","title":"Name","description":"Model name or alias accepted by the request's model field.","examples":["jev-latest"]},"description":{"type":"string","title":"Description","description":"Human-readable description of the model and its capabilities.","examples":["General-purpose system one model."]},"release_date":{"type":"string","title":"Release Date","description":"Model release date, formatted as YYYY-MM-DD.","examples":["2026-09-15"]}},"type":"object","required":["name","description","release_date"],"title":"ModelMetadata","description":"A model or model alias available to the authenticated account."},"ModelMetadataList":{"properties":{"models":{"items":{"$ref":"#/components/schemas/ModelMetadata"},"type":"array","title":"Models","description":"Available models and aliases. Use a model's name in POST /v1/systemone requests.","examples":[[{"description":"General-purpose system one model.","name":"jev-latest","release_date":"2026-09-15"}]]}},"type":"object","required":["models"],"title":"ModelMetadataList","description":"Models and aliases available to the authenticated account."},"NoulAnswer":{"properties":{"type":{"type":"string","const":"noul","title":"Type","description":"Identifies a yes/no answer.","examples":["noul"]},"noul":{"type":"number","title":"Noul","description":"Probability of a yes answer or a true statement, from 0 to 1. Values near 1 favor yes or true, values near 0 favor no or false, and values near 0.5 indicate uncertainty.","examples":[0.98]}},"type":"object","required":["type","noul"],"title":"NoulAnswer","description":"The probability of a yes answer or a true statement."},"NoulCriteria":{"properties":{"true":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"True","description":"What counts as a yes answer.","examples":["The message is unsolicited advertising."]},"false":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"False","description":"What counts as a no answer.","examples":["The message is a legitimate conversation."]}},"type":"object","title":"NoulCriteria","description":"Criteria defining what counts as a yes or no answer."},"NoulQuestion":{"properties":{"type":{"type":"string","const":"noul","title":"Type","description":"Identifies a yes/no question or statement.","examples":["noul"]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"The yes/no question or statement to evaluate.","examples":["Is this message spam?","This message contains unsolicited advertising.",{"task":"Identify unsolicited advertising."}]},"criteria":{"anyOf":[{"$ref":"#/components/schemas/NoulCriteria"},{"type":"null"}],"description":"Criteria clarifying what counts as a yes or no answer.","examples":[{"false":"A legitimate conversation","true":"Unsolicited advertising"}]}},"type":"object","required":["type"],"title":"NoulQuestion","description":"A yes/no question or statement, answered with the probability of yes or true."},"Question":{"oneOf":[{"$ref":"#/components/schemas/NoulQuestion","title":"Noul"},{"$ref":"#/components/schemas/ChoiceQuestion","title":"Choice"},{"$ref":"#/components/schemas/ScoreQuestion","title":"Score"},{"$ref":"#/components/schemas/BoxQuestion","title":"Box"}],"discriminator":{"propertyName":"type","mapping":{"noul":"#/components/schemas/NoulQuestion","choice":"#/components/schemas/ChoiceQuestion","score":"#/components/schemas/ScoreQuestion","box":"#/components/schemas/BoxQuestion"}},"description":"A question about the supplied content."},"ScoreAnswer":{"properties":{"type":{"type":"string","const":"score","title":"Type","description":"Identifies a rating against the requested score levels.","examples":["score"]},"score":{"type":"number","title":"Score","description":"Expected score: the probability-weighted average of the rubric levels. May fall between integer levels.","examples":[1.7]},"confidence":{"type":"number","title":"Confidence","description":"Confidence in the score, from 0 to 1. Higher values indicate greater certainty; use lower values to flag uncertain ratings for review.","examples":[0.9]},"legend":{"additionalProperties":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"x-accepts":"string | object | array"},"type":"object","title":"Legend","description":"The requested criteria mapped to their score levels, so you can interpret the score.","examples":[{"0":"Can wait","1":"Needs attention this week","2":"Needs attention today"}]},"probabilities":{"additionalProperties":{"type":"number"},"type":"object","title":"Probabilities","description":"Probability of each score level, from 0 to 1, using the same keys as legend. Shows how likely the alternatives are; values sum to approximately 1.","examples":[{"0":0.1,"1":0.1,"2":0.8}]}},"type":"object","required":["type","score","confidence","legend","probabilities"],"title":"ScoreAnswer","description":"An expected score with its rubric, confidence, and score-level probabilities."},"ScoreQuestion":{"properties":{"type":{"type":"string","const":"score","title":"Type","description":"Identifies a question that rates the content using the levels in criteria.","examples":["score"]},"instructions":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"null"}],"x-accepts":"string | object | array","title":"Instructions","description":"What the model should rate.","examples":["How urgent is this message?"]},"criteria":{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"x-accepts":"string | object | array"},"type":"array","minItems":1,"title":"Criteria","description":"Ordered descriptions of the score levels. Each description's position determines its score, starting at zero.","examples":[["Can wait","Needs attention this week","Needs attention today"]]}},"type":"object","required":["type","criteria"],"title":"ScoreQuestion","description":"A question that assigns a score using an ordered rubric."},"SystemOneRequest":{"properties":{"model":{"type":"string","title":"Model","description":"Name or alias of the model to use. Available names are returned by GET /v1/models.","examples":["jev-latest"]},"state":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"x-accepts":"string | object | array","title":"State","description":"The content all questions in this request refer to.","examples":["I was charged twice. Please help.",{"message":"Please help.","subject":"Duplicate charge"}]},"questions":{"additionalProperties":{"$ref":"#/components/schemas/Question"},"type":"object","minProperties":1,"title":"Questions","description":"Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers.","examples":[{"billing":{"instructions":"Is this message about billing?","type":"noul"}}]},"assets":{"additionalProperties":{"$ref":"#/components/schemas/Asset"},"type":"object","minProperties":1,"title":"Assets","description":"Media assets keyed by an opaque placeholder (recommend a per-image UUID). Each placeholder, wherever it appears as or inside a string in state, question instructions, or criteria, is replaced with the asset. Image assets require a vision-language model."}},"type":"object","required":["model","state","questions"],"title":"SystemOneRequest","description":"Content and named questions to evaluate together using a TypeSafe model."},"SystemOneResponse":{"properties":{"model":{"type":"string","title":"Model","description":"Name of the model that answered the questions. May differ from the alias supplied in the request.","examples":["jev-latest"]},"answers":{"additionalProperties":{"$ref":"#/components/schemas/Answer"},"type":"object","minProperties":1,"title":"Answers","description":"Answers keyed by the question names supplied in the request. Each answer's type matches its question's type.","examples":[{"billing":{"noul":0.98,"type":"noul"}}]},"usage":{"$ref":"#/components/schemas/Usage","description":"Input and output token counts for this evaluation.","examples":[{"input_tokens":120,"output_tokens":12}]}},"type":"object","required":["model","answers","usage"],"title":"SystemOneResponse","description":"Answers grouped by question name, with the model used and token usage."},"Usage":{"properties":{"input_tokens":{"type":"integer","title":"Input Tokens","description":"Number of billable input tokens used to evaluate the request.","examples":[120]},"output_tokens":{"type":"integer","title":"Output Tokens","description":"Number of output tokens used to answer the questions. Output tokens are currently free of charge.","examples":[12]}},"type":"object","required":["input_tokens","output_tokens"],"title":"Usage","description":"Token usage for the request."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location","description":"Path to the invalid value: the request location followed by field names and array indices.","examples":[["body","questions","urgency","score","criteria"]]},"msg":{"type":"string","title":"Message","description":"Human-readable explanation of the validation failure.","examples":["Field required"]},"type":{"type":"string","title":"Error Type","description":"Machine-readable validation error code.","examples":["missing"]},"input":{"title":"Input","description":"The input value that failed validation.","examples":[{"type":"score"}]},"ctx":{"type":"object","title":"Context","description":"Additional context used to explain the validation failure.","examples":[{"min_length":1}]}},"type":"object","required":["loc","msg","type"],"title":"ValidationError","description":"A request validation error at a specific field or array element."}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}} \ No newline at end of file