Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ public partial interface IRawTypeSafeClient
/// questions, so you can match each result to its question. The response also includes<br/>
/// the model used and token usage.
/// </summary>
/// <param name="typeSafeDangerZoneImages"></param>
/// <param name="typeSafeDangerZoneLongContext"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::TypeSafeAI.Generated.ApiException"></exception>
global::System.Threading.Tasks.Task<global::TypeSafeAI.Generated.SystemOneResponse> 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);
/// <summary>
Expand All @@ -27,13 +31,17 @@ public partial interface IRawTypeSafeClient
/// questions, so you can match each result to its question. The response also includes<br/>
/// the model used and token usage.
/// </summary>
/// <param name="typeSafeDangerZoneImages"></param>
/// <param name="typeSafeDangerZoneLongContext"></param>
/// <param name="request"></param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::TypeSafeAI.Generated.ApiException"></exception>
global::System.Threading.Tasks.Task<global::TypeSafeAI.Generated.AutoSDKHttpResponse<global::TypeSafeAI.Generated.SystemOneResponse>> 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);
/// <summary>
Expand All @@ -43,6 +51,8 @@ public partial interface IRawTypeSafeClient
/// questions, so you can match each result to its question. The response also includes<br/>
/// the model used and token usage.
/// </summary>
/// <param name="typeSafeDangerZoneImages"></param>
/// <param name="typeSafeDangerZoneLongContext"></param>
/// <param name="model">
/// Name or alias of the model to use. Available names are returned by GET /v1/models.
/// </param>
Expand All @@ -52,13 +62,19 @@ public partial interface IRawTypeSafeClient
/// <param name="questions">
/// Questions to ask about the content, each with a name you choose. The response uses those names to identify the answers.
/// </param>
/// <param name="assets">
/// 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.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::TypeSafeAI.Generated.SystemOneResponse> SystemoneV1SystemonePostAsync(
string model,
global::TypeSafeAI.Generated.AnyOf<string, object, global::System.Collections.Generic.IList<object>> state,
global::System.Collections.Generic.Dictionary<string, global::TypeSafeAI.Generated.Question> questions,
global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages? typeSafeDangerZoneImages = default,
global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneLongContext? typeSafeDangerZoneLongContext = default,
global::System.Collections.Generic.Dictionary<string, global::TypeSafeAI.Generated.Asset>? assets = default,
global::TypeSafeAI.Generated.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,23 @@ 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<global::TypeSafeAI.Generated.BoxAnswer> ??
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,
noul,

choice,

score
score,

box
);

return __value;
Expand Down Expand Up @@ -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<global::TypeSafeAI.Generated.BoxAnswer?> ??
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);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace TypeSafeAI.Generated.JsonConverters
{
/// <inheritdoc />
public sealed class AssetFormatJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::TypeSafeAI.Generated.AssetFormat>
{
/// <inheritdoc />
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;
}

/// <inheritdoc />
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));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace TypeSafeAI.Generated.JsonConverters
{
/// <inheritdoc />
public sealed class AssetFormatNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::TypeSafeAI.Generated.AssetFormat?>
{
/// <inheritdoc />
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;
}

/// <inheritdoc />
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));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,23 @@ 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<global::TypeSafeAI.Generated.BoxQuestion> ??
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,
noul,

choice,

score
score,

box
);

return __value;
Expand Down Expand Up @@ -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<global::TypeSafeAI.Generated.BoxQuestion?> ??
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);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#nullable enable

namespace TypeSafeAI.Generated.JsonConverters
{
/// <inheritdoc />
public sealed class SystemoneV1SystemonePostTypeSafeDangerZoneImagesJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages>
{
/// <inheritdoc />
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;
}

/// <inheritdoc />
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));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#nullable enable

namespace TypeSafeAI.Generated.JsonConverters
{
/// <inheritdoc />
public sealed class SystemoneV1SystemonePostTypeSafeDangerZoneImagesNullableJsonConverter : global::System.Text.Json.Serialization.JsonConverter<global::TypeSafeAI.Generated.SystemoneV1SystemonePostTypeSafeDangerZoneImages?>
{
/// <inheritdoc />
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;
}

/// <inheritdoc />
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));
}
}
}
}
Loading
Loading