From dbc4f5f777982ad28b724e9e19362f65d2a60d31 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 13 Sep 2026 17:52:54 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- ...umanloop.Agents.JsonSerializerContext.g.cs | 232 +++++++++++++++++ .../tryAGI.Humanloop.AgentsClient.g.cs | 2 +- ...anloop.Datasets.JsonSerializerContext.g.cs | 219 ++++++++++++++++ .../tryAGI.Humanloop.DatasetsClient.g.cs | 2 +- ...oop.Directories.JsonSerializerContext.g.cs | 133 ++++++++++ .../tryAGI.Humanloop.DirectoriesClient.g.cs | 2 +- ...oop.Evaluations.JsonSerializerContext.g.cs | 238 ++++++++++++++++++ .../tryAGI.Humanloop.EvaluationsClient.g.cs | 2 +- ...loop.Evaluators.JsonSerializerContext.g.cs | 229 +++++++++++++++++ .../tryAGI.Humanloop.EvaluatorsClient.g.cs | 2 +- ...Humanloop.Files.JsonSerializerContext.g.cs | 181 +++++++++++++ .../tryAGI.Humanloop.FilesClient.g.cs | 2 +- ...Humanloop.Flows.JsonSerializerContext.g.cs | 202 +++++++++++++++ .../tryAGI.Humanloop.FlowsClient.g.cs | 2 +- ....Humanloop.Logs.JsonSerializerContext.g.cs | 175 +++++++++++++ .../tryAGI.Humanloop.LogsClient.g.cs | 2 +- ...Humanloop.Tools.JsonSerializerContext.g.cs | 232 +++++++++++++++++ .../tryAGI.Humanloop.ToolsClient.g.cs | 2 +- 18 files changed, 1850 insertions(+), 9 deletions(-) create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Agents.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Datasets.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Directories.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluations.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluators.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Files.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Flows.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Logs.JsonSerializerContext.g.cs create mode 100644 src/libs/Humanloop/Generated/tryAGI.Humanloop.Tools.JsonSerializerContext.g.cs diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Agents.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Agents.JsonSerializerContext.g.cs new file mode 100644 index 0000000..7be8d24 --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Agents.JsonSerializerContext.g.cs @@ -0,0 +1,232 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UserResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EnvironmentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole), TypeInfoPropertyName = "ChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponseFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.AgentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.AgentResponseType), TypeInfoPropertyName = "AgentResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.AgentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedAgentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.AgentCallRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.AgentCallResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MoveRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.SetDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestActivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestDeactivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.LogAgentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CreateLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListAgentsOrder), TypeInfoPropertyName = "ListAgentsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole?), TypeInfoPropertyName = "NullableChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.AgentResponseType?), TypeInfoPropertyName = "NullableAgentResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListAgentsOrder?), TypeInfoPropertyName = "NullableListAgentsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class AgentsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class AgentsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static AgentsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private AgentsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.AgentResponseType) + + || typeToConvert == typeof(global::tryAGI.Humanloop.AgentResponseType?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListAgentsOrder) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListAgentsOrder?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.AgentResponseType)) + { + return new global::tryAGI.Humanloop.JsonConverters.AgentResponseTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.AgentResponseType?)) + { + return new global::tryAGI.Humanloop.JsonConverters.AgentResponseTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListAgentsOrder)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListAgentsOrderJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListAgentsOrder?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListAgentsOrderNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new AgentsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.AgentsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.AgentsClient.g.cs index 982561e..ff0fa53 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.AgentsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.AgentsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class AgentsClient : global::tryAGI.Humanloop.IAgentsClien /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.AgentsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Datasets.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Datasets.JsonSerializerContext.g.cs new file mode 100644 index 0000000..ff497fc --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Datasets.JsonSerializerContext.g.cs @@ -0,0 +1,219 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UserResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EnvironmentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole), TypeInfoPropertyName = "ChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponseFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.DatapointResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.DatasetResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.DatasetResponseType), TypeInfoPropertyName = "DatasetResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.DatasetRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedDatasetResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MoveRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.SetDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListDatasetsOrder), TypeInfoPropertyName = "ListDatasetsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole?), TypeInfoPropertyName = "NullableChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.DatasetResponseType?), TypeInfoPropertyName = "NullableDatasetResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListDatasetsOrder?), TypeInfoPropertyName = "NullableListDatasetsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class DatasetsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class DatasetsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static DatasetsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private DatasetsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.DatasetResponseType) + + || typeToConvert == typeof(global::tryAGI.Humanloop.DatasetResponseType?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListDatasetsOrder) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListDatasetsOrder?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.DatasetResponseType)) + { + return new global::tryAGI.Humanloop.JsonConverters.DatasetResponseTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.DatasetResponseType?)) + { + return new global::tryAGI.Humanloop.JsonConverters.DatasetResponseTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListDatasetsOrder)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListDatasetsOrderJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListDatasetsOrder?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListDatasetsOrderNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new DatasetsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.DatasetsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.DatasetsClient.g.cs index fcf7641..bee2e08 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.DatasetsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.DatasetsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class DatasetsClient : global::tryAGI.Humanloop.IDatasetsC /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.DatasetsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Directories.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Directories.JsonSerializerContext.g.cs new file mode 100644 index 0000000..d906c66 --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Directories.JsonSerializerContext.g.cs @@ -0,0 +1,133 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.DirectoryResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CreateDirectoryRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateDirectoryRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class DirectoriesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class DirectoriesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static DirectoriesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private DirectoriesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new DirectoriesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.DirectoriesClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.DirectoriesClient.g.cs index fb5309c..2c721fe 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.DirectoriesClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.DirectoriesClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class DirectoriesClient : global::tryAGI.Humanloop.IDirect /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.DirectoriesSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluations.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluations.JsonSerializerContext.g.cs new file mode 100644 index 0000000..ea0cf34 --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluations.JsonSerializerContext.g.cs @@ -0,0 +1,238 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UserResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole), TypeInfoPropertyName = "ChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponseFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [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::tryAGI.Humanloop.EvaluationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationEvaluatorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationResponseStatus), TypeInfoPropertyName = "EvaluationResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedEvaluationResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PromptLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequestStatus), TypeInfoPropertyName = "UpdateEvaluationStatusRequestStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationRunResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationRunResponseStatus), TypeInfoPropertyName = "EvaluationRunResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole?), TypeInfoPropertyName = "NullableChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationResponseStatus?), TypeInfoPropertyName = "NullableEvaluationResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequestStatus?), TypeInfoPropertyName = "NullableUpdateEvaluationStatusRequestStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluationRunResponseStatus?), TypeInfoPropertyName = "NullableEvaluationRunResponseStatus2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class EvaluationsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class EvaluationsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static EvaluationsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private EvaluationsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationResponseStatus) + + || typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationResponseStatus?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequestStatus) + + || typeToConvert == typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequestStatus?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationRunResponseStatus) + + || typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationRunResponseStatus?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationResponseStatus)) + { + return new global::tryAGI.Humanloop.JsonConverters.EvaluationResponseStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationResponseStatus?)) + { + return new global::tryAGI.Humanloop.JsonConverters.EvaluationResponseStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequestStatus)) + { + return new global::tryAGI.Humanloop.JsonConverters.UpdateEvaluationStatusRequestStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.UpdateEvaluationStatusRequestStatus?)) + { + return new global::tryAGI.Humanloop.JsonConverters.UpdateEvaluationStatusRequestStatusNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationRunResponseStatus)) + { + return new global::tryAGI.Humanloop.JsonConverters.EvaluationRunResponseStatusJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.EvaluationRunResponseStatus?)) + { + return new global::tryAGI.Humanloop.JsonConverters.EvaluationRunResponseStatusNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new EvaluationsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluationsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluationsClient.g.cs index 1a0debc..cb8dcf3 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluationsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluationsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class EvaluationsClient : global::tryAGI.Humanloop.IEvalua /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.EvaluationsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluators.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluators.JsonSerializerContext.g.cs new file mode 100644 index 0000000..401b561 --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Evaluators.JsonSerializerContext.g.cs @@ -0,0 +1,229 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UserResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EnvironmentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.InputResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState), TypeInfoPropertyName = "MonitoringEvaluatorResponseState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluatorAggregate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluatorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluatorResponseType), TypeInfoPropertyName = "EvaluatorResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluatorRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedEvaluatorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MoveRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.SetDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestActivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestDeactivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.LogEvaluatorRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CreateLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListEvaluatorsOrder), TypeInfoPropertyName = "ListEvaluatorsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState?), TypeInfoPropertyName = "NullableMonitoringEvaluatorResponseState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluatorResponseType?), TypeInfoPropertyName = "NullableEvaluatorResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListEvaluatorsOrder?), TypeInfoPropertyName = "NullableListEvaluatorsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class EvaluatorsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class EvaluatorsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static EvaluatorsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private EvaluatorsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState) + + || typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.EvaluatorResponseType) + + || typeToConvert == typeof(global::tryAGI.Humanloop.EvaluatorResponseType?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListEvaluatorsOrder) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListEvaluatorsOrder?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState)) + { + return new global::tryAGI.Humanloop.JsonConverters.MonitoringEvaluatorResponseStateJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState?)) + { + return new global::tryAGI.Humanloop.JsonConverters.MonitoringEvaluatorResponseStateNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.EvaluatorResponseType)) + { + return new global::tryAGI.Humanloop.JsonConverters.EvaluatorResponseTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.EvaluatorResponseType?)) + { + return new global::tryAGI.Humanloop.JsonConverters.EvaluatorResponseTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListEvaluatorsOrder)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListEvaluatorsOrderJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListEvaluatorsOrder?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListEvaluatorsOrderNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new EvaluatorsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluatorsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluatorsClient.g.cs index 36e988c..3bd8bf6 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluatorsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.EvaluatorsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class EvaluatorsClient : global::tryAGI.Humanloop.IEvaluat /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.EvaluatorsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Files.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Files.JsonSerializerContext.g.cs new file mode 100644 index 0000000..9b77a52 --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Files.JsonSerializerContext.g.cs @@ -0,0 +1,181 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.FileResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedFileResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListFilesType), TypeInfoPropertyName = "ListFilesType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListFilesOrder), TypeInfoPropertyName = "ListFilesOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListFilesType?), TypeInfoPropertyName = "NullableListFilesType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListFilesOrder?), TypeInfoPropertyName = "NullableListFilesOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class FilesSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class FilesSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static FilesSourceGenerationContext Default { get; } = new(DefaultOptions); + + private FilesSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesType) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesType?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesOrder) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesOrder?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesType)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListFilesTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesType?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListFilesTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesOrder)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListFilesOrderJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListFilesOrder?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListFilesOrderNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new FilesSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.FilesClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.FilesClient.g.cs index f3167db..b858405 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.FilesClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.FilesClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class FilesClient : global::tryAGI.Humanloop.IFilesClient, /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.FilesSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Flows.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Flows.JsonSerializerContext.g.cs new file mode 100644 index 0000000..3eaf9cb --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Flows.JsonSerializerContext.g.cs @@ -0,0 +1,202 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UserResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EnvironmentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.FlowResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.FlowResponseType), TypeInfoPropertyName = "FlowResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.FlowRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedFlowResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MoveRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.SetDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestActivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestDeactivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.LogFlowRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CreateLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListFlowsOrder), TypeInfoPropertyName = "ListFlowsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.FlowResponseType?), TypeInfoPropertyName = "NullableFlowResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListFlowsOrder?), TypeInfoPropertyName = "NullableListFlowsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class FlowsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class FlowsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static FlowsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private FlowsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.FlowResponseType) + + || typeToConvert == typeof(global::tryAGI.Humanloop.FlowResponseType?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListFlowsOrder) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListFlowsOrder?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.FlowResponseType)) + { + return new global::tryAGI.Humanloop.JsonConverters.FlowResponseTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.FlowResponseType?)) + { + return new global::tryAGI.Humanloop.JsonConverters.FlowResponseTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListFlowsOrder)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListFlowsOrderJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListFlowsOrder?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListFlowsOrderNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new FlowsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.FlowsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.FlowsClient.g.cs index 48839cb..a06fa05 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.FlowsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.FlowsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class FlowsClient : global::tryAGI.Humanloop.IFlowsClient, /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.FlowsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Logs.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Logs.JsonSerializerContext.g.cs new file mode 100644 index 0000000..d55bafa --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Logs.JsonSerializerContext.g.cs @@ -0,0 +1,175 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessage))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole), TypeInfoPropertyName = "ChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolCallResponseFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PromptLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ChatMessageRole?), TypeInfoPropertyName = "NullableChatMessageRole2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class LogsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class LogsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static LogsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private LogsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ChatMessageRole?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ChatMessageRoleNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new LogsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.LogsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.LogsClient.g.cs index 9e9d541..14e697c 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.LogsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.LogsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class LogsClient : global::tryAGI.Humanloop.ILogsClient, g /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.LogsSourceGenerationContext.Default); /// /// diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.Tools.JsonSerializerContext.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Tools.JsonSerializerContext.g.cs new file mode 100644 index 0000000..1da7626 --- /dev/null +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.Tools.JsonSerializerContext.g.cs @@ -0,0 +1,232 @@ + +#nullable enable + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant + +namespace tryAGI.Humanloop +{ + /// + /// + /// + [global::System.Text.Json.Serialization.JsonSourceGenerationOptions( + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + Converters = new global::System.Type[] + { + })] + [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::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UserResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EnvironmentResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.InputResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState), TypeInfoPropertyName = "MonitoringEvaluatorResponseState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.EvaluatorAggregate))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolFunction))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(object))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] + [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::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolResponseType), TypeInfoPropertyName = "ToolResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.PaginatedToolResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MoveRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.SetDeploymentRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestActivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.UpdateMonitoringRequestDeactivateItem))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.LogToolRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CallToolRequest))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CreateLogResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.CallToolResponse))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListToolsOrder), TypeInfoPropertyName = "ListToolsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.DateTime?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState?), TypeInfoPropertyName = "NullableMonitoringEvaluatorResponseState2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(double?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(int?))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ToolResponseType?), TypeInfoPropertyName = "NullableToolResponseType2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::tryAGI.Humanloop.ListToolsOrder?), TypeInfoPropertyName = "NullableListToolsOrder2")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List))] + internal sealed partial class ToolsSourceGenerationContextChunk0 : global::System.Text.Json.Serialization.JsonSerializerContext + { + } + /// + /// + /// + public sealed partial class ToolsSourceGenerationContext : global::System.Text.Json.Serialization.JsonSerializerContext + { + private static readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver Resolver = new LazyChunkResolver(); + + + private static readonly global::System.Text.Json.JsonSerializerOptions DefaultOptions = CreateDefaultOptions(); + + /// + /// + /// + public static ToolsSourceGenerationContext Default { get; } = new(DefaultOptions); + + private ToolsSourceGenerationContext(global::System.Text.Json.JsonSerializerOptions options) + : base(options) + { + } + + /// + protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions => DefaultOptions; + + /// + public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type) + { + return Resolver.GetTypeInfo(type, Options); + } + + /// + /// Adds this package's converters to . + /// + /// + /// A converter has to be on the options a chained resolver builds its JsonTypeInfo against, + /// and a context resolves types from every package below it. Each package contributes only + /// what it owns and calls down the chain for the rest, so the family's converter table is + /// written once rather than copied into all of them. + /// + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public static void AddConverters(global::System.Text.Json.JsonSerializerOptions options) + { + options.Converters.Add(new global::tryAGI.Humanloop.JsonConverters.UnixTimestampJsonConverter()); + options.Converters.Add(new LazyEnumJsonConverterFactory()); + } + + private static global::System.Text.Json.JsonSerializerOptions CreateDefaultOptions() + { + var options = new global::System.Text.Json.JsonSerializerOptions + { + DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + TypeInfoResolver = Resolver, + }; + AddConverters(options); + + return options; + } + + + private sealed class LazyEnumJsonConverterFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public override bool CanConvert(global::System.Type typeToConvert) + { + return + typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState) + + || typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ToolResponseType) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ToolResponseType?) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListToolsOrder) + + || typeToConvert == typeof(global::tryAGI.Humanloop.ListToolsOrder?); + } + + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter( + global::System.Type typeToConvert, + global::System.Text.Json.JsonSerializerOptions options) + { + if (typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState)) + { + return new global::tryAGI.Humanloop.JsonConverters.MonitoringEvaluatorResponseStateJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.MonitoringEvaluatorResponseState?)) + { + return new global::tryAGI.Humanloop.JsonConverters.MonitoringEvaluatorResponseStateNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ToolResponseType)) + { + return new global::tryAGI.Humanloop.JsonConverters.ToolResponseTypeJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ToolResponseType?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ToolResponseTypeNullableJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListToolsOrder)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListToolsOrderJsonConverter(); + } + + if (typeToConvert == typeof(global::tryAGI.Humanloop.ListToolsOrder?)) + { + return new global::tryAGI.Humanloop.JsonConverters.ListToolsOrderNullableJsonConverter(); + } + throw new global::System.NotSupportedException($"No generated enum converter is registered for '{typeToConvert}'."); + } + } + + private sealed class LazyChunkResolver : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver + { + private readonly object _gate = new(); + private readonly global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[] _resolvers = new global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver?[1]; + + public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo( + global::System.Type type, + global::System.Text.Json.JsonSerializerOptions options) + { + for (var index = 0; index < _resolvers.Length; index++) + { + var typeInfo = GetResolver(index).GetTypeInfo(type, options); + if (typeInfo is not null) + { + return typeInfo; + } + } + + return null; + } + + private global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver GetResolver(int index) + { + var resolver = global::System.Threading.Volatile.Read(ref _resolvers[index]); + if (resolver is not null) + { + return resolver; + } + + lock (_gate) + { + return _resolvers[index] ??= CreateResolver(index); + } + } + + private static global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver CreateResolver(int index) + { + return index switch + { + 0 => new ToolsSourceGenerationContextChunk0(new global::System.Text.Json.JsonSerializerOptions()), + _ => throw new global::System.ArgumentOutOfRangeException(nameof(index)), + }; + } + } + } +} \ No newline at end of file diff --git a/src/libs/Humanloop/Generated/tryAGI.Humanloop.ToolsClient.g.cs b/src/libs/Humanloop/Generated/tryAGI.Humanloop.ToolsClient.g.cs index d024d69..cfcf657 100644 --- a/src/libs/Humanloop/Generated/tryAGI.Humanloop.ToolsClient.g.cs +++ b/src/libs/Humanloop/Generated/tryAGI.Humanloop.ToolsClient.g.cs @@ -34,7 +34,7 @@ public sealed partial class ToolsClient : global::tryAGI.Humanloop.IToolsClient, /// public global::tryAGI.Humanloop.AutoSDKClientOptions Options { get; } - internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.SourceGenerationContext.Default); + internal global::System.Lazy JsonSerializerContextProvider { get; set; } = new(() => global::tryAGI.Humanloop.ToolsSourceGenerationContext.Default); /// ///