diff --git a/src/libs/OpenRouter/Generated/OpenRouter.ISubpackagePresetsClient.CreatePresetsMessages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackagePresetsClient.CreatePresetsMessages.g.cs new file mode 100644 index 0000000..5fbb4fb --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.ISubpackagePresetsClient.CreatePresetsMessages.g.cs @@ -0,0 +1,120 @@ +#nullable enable + +namespace OpenRouter +{ + public partial interface ISubpackagePresetsClient + { + /// + /// Create a preset from a messages request body
+ /// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreatePresetsMessagesAsync( + string slug, + + global::OpenRouter.MessagesRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a preset from a messages request body
+ /// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreatePresetsMessagesAsResponseAsync( + string slug, + + global::OpenRouter.MessagesRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a preset from a messages request body
+ /// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + ///
+ /// + /// + /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + /// + /// + /// + /// + /// + /// + /// + /// + /// Configuration for controlling output behavior. Supports the effort parameter and structured output format. + /// + /// + /// Plugins you want to enable for this request, including their settings. + /// + /// + /// When multiple model providers are available, optionally indicate your routing preference. + /// + /// + /// Any type + /// + /// + /// + /// A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + /// + /// + /// + /// + /// Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + /// + /// + /// A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CreatePresetsMessagesAsync( + string slug, + string model, + global::OpenRouter.AnthropicCacheControlDirective? cacheControl = default, + global::OpenRouter.OneOf? contextManagement = default, + int? maxTokens = default, + global::System.Collections.Generic.IList? messages = default, + global::OpenRouter.MessagesRequestMetadata? metadata = default, + global::System.Collections.Generic.IList? models = default, + global::OpenRouter.MessagesOutputConfig? outputConfig = default, + global::System.Collections.Generic.IList? plugins = default, + global::OpenRouter.ProviderPreferences? provider = default, + object? route = default, + string? serviceTier = default, + string? sessionId = default, + global::OpenRouter.AnthropicSpeed? speed = default, + global::System.Collections.Generic.IList? stopSequences = default, + global::System.Collections.Generic.IList? stopServerToolsWhen = default, + bool? stream = default, + global::OpenRouter.MessagesRequestSystem? system = default, + double? temperature = default, + global::OpenRouter.MessagesRequestThinking? thinking = default, + global::OpenRouter.MessagesRequestToolChoice? toolChoice = default, + global::System.Collections.Generic.IList? tools = default, + int? topK = default, + double? topP = default, + global::OpenRouter.TraceConfig? trace = default, + string? user = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.BYOKProviderSlug.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.BYOKProviderSlug.g.cs index 89b9392..d16a72b 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.BYOKProviderSlug.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.BYOKProviderSlug.g.cs @@ -103,6 +103,10 @@ public enum BYOKProviderSlug /// /// /// + Darkbloom, + /// + /// + /// Deepinfra, /// /// @@ -369,6 +373,7 @@ public static string ToValueString(this BYOKProviderSlug value) BYOKProviderSlug.Cloudflare => "cloudflare", BYOKProviderSlug.Cohere => "cohere", BYOKProviderSlug.Crusoe => "crusoe", + BYOKProviderSlug.Darkbloom => "darkbloom", BYOKProviderSlug.Deepinfra => "deepinfra", BYOKProviderSlug.Deepseek => "deepseek", BYOKProviderSlug.Dekallm => "dekallm", @@ -460,6 +465,7 @@ public static string ToValueString(this BYOKProviderSlug value) "cloudflare" => BYOKProviderSlug.Cloudflare, "cohere" => BYOKProviderSlug.Cohere, "crusoe" => BYOKProviderSlug.Crusoe, + "darkbloom" => BYOKProviderSlug.Darkbloom, "deepinfra" => BYOKProviderSlug.Deepinfra, "deepseek" => BYOKProviderSlug.Deepseek, "dekallm" => BYOKProviderSlug.Dekallm, diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ByokGetParametersProvider.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ByokGetParametersProvider.g.cs index b768dff..ff67237 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.ByokGetParametersProvider.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ByokGetParametersProvider.g.cs @@ -103,6 +103,10 @@ public enum ByokGetParametersProvider /// /// /// + Darkbloom, + /// + /// + /// Deepinfra, /// /// @@ -369,6 +373,7 @@ public static string ToValueString(this ByokGetParametersProvider value) ByokGetParametersProvider.Cloudflare => "cloudflare", ByokGetParametersProvider.Cohere => "cohere", ByokGetParametersProvider.Crusoe => "crusoe", + ByokGetParametersProvider.Darkbloom => "darkbloom", ByokGetParametersProvider.Deepinfra => "deepinfra", ByokGetParametersProvider.Deepseek => "deepseek", ByokGetParametersProvider.Dekallm => "dekallm", @@ -460,6 +465,7 @@ public static string ToValueString(this ByokGetParametersProvider value) "cloudflare" => ByokGetParametersProvider.Cloudflare, "cohere" => ByokGetParametersProvider.Cohere, "crusoe" => ByokGetParametersProvider.Crusoe, + "darkbloom" => ByokGetParametersProvider.Darkbloom, "deepinfra" => ByokGetParametersProvider.Deepinfra, "deepseek" => ByokGetParametersProvider.Deepseek, "dekallm" => ByokGetParametersProvider.Dekallm, diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderName.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderName.g.cs index 23f38db..0d38d5f 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderName.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderName.g.cs @@ -107,6 +107,10 @@ public enum ProviderName /// /// /// + Darkbloom, + /// + /// + /// DeepInfra, /// /// @@ -382,6 +386,7 @@ public static string ToValueString(this ProviderName value) ProviderName.Cohere => "Cohere", ProviderName.Crucible => "Crucible", ProviderName.Crusoe => "Crusoe", + ProviderName.Darkbloom => "Darkbloom", ProviderName.DeepInfra => "DeepInfra", ProviderName.DeepSeek => "DeepSeek", ProviderName.DekaLLM => "DekaLLM", @@ -476,6 +481,7 @@ public static string ToValueString(this ProviderName value) "Cohere" => ProviderName.Cohere, "Crucible" => ProviderName.Crucible, "Crusoe" => ProviderName.Crusoe, + "Darkbloom" => ProviderName.Darkbloom, "DeepInfra" => ProviderName.DeepInfra, "DeepSeek" => ProviderName.DeepSeek, "DekaLLM" => ProviderName.DekaLLM, diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptions.g.cs index 9cab1be..695f375 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptions.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptions.g.cs @@ -182,6 +182,12 @@ public sealed partial class ProviderOptions [global::System.Text.Json.Serialization.JsonPropertyName("crusoe")] public object? Crusoe { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("darkbloom")] + public object? Darkbloom { get; set; } + /// /// /// @@ -718,6 +724,7 @@ public sealed partial class ProviderOptions /// /// /// + /// /// /// /// @@ -834,6 +841,7 @@ public ProviderOptions( object? crofai, object? crucible, object? crusoe, + object? darkbloom, object? deepinfra, object? deepseek, object? dekallm, @@ -947,6 +955,7 @@ public ProviderOptions( this.Crofai = crofai; this.Crucible = crucible; this.Crusoe = crusoe; + this.Darkbloom = darkbloom; this.Deepinfra = deepinfra; this.Deepseek = deepseek; this.Dekallm = dekallm; diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom.Json.g.cs new file mode 100644 index 0000000..74cf2de --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class ProviderOptionsDarkbloom + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.ProviderOptionsDarkbloom? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.ProviderOptionsDarkbloom), + jsonSerializerContext) as global::OpenRouter.ProviderOptionsDarkbloom; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.ProviderOptionsDarkbloom? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.ProviderOptionsDarkbloom), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.ProviderOptionsDarkbloom; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom.g.cs new file mode 100644 index 0000000..7482a18 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class ProviderOptionsDarkbloom + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom2.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom2.Json.g.cs new file mode 100644 index 0000000..a4820a9 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class ProviderOptionsDarkbloom2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.ProviderOptionsDarkbloom2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.ProviderOptionsDarkbloom2), + jsonSerializerContext) as global::OpenRouter.ProviderOptionsDarkbloom2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.ProviderOptionsDarkbloom2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.ProviderOptionsDarkbloom2), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.ProviderOptionsDarkbloom2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom2.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom2.g.cs new file mode 100644 index 0000000..e837f71 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderOptionsDarkbloom2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// Any type + /// + public sealed partial class ProviderOptionsDarkbloom2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderResponseProviderName.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderResponseProviderName.g.cs index f991b70..2d5acc9 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderResponseProviderName.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.ProviderResponseProviderName.g.cs @@ -127,6 +127,10 @@ public enum ProviderResponseProviderName /// /// /// + Darkbloom, + /// + /// + /// DeepInfra, /// /// @@ -499,6 +503,7 @@ public static string ToValueString(this ProviderResponseProviderName value) ProviderResponseProviderName.CrofAI => "CrofAI", ProviderResponseProviderName.Crucible => "Crucible", ProviderResponseProviderName.Crusoe => "Crusoe", + ProviderResponseProviderName.Darkbloom => "Darkbloom", ProviderResponseProviderName.DeepInfra => "DeepInfra", ProviderResponseProviderName.DeepSeek => "DeepSeek", ProviderResponseProviderName.DekaLLM => "DekaLLM", @@ -621,6 +626,7 @@ public static string ToValueString(this ProviderResponseProviderName value) "CrofAI" => ProviderResponseProviderName.CrofAI, "Crucible" => ProviderResponseProviderName.Crucible, "Crusoe" => ProviderResponseProviderName.Crusoe, + "Darkbloom" => ProviderResponseProviderName.Darkbloom, "DeepInfra" => ProviderResponseProviderName.DeepInfra, "DeepSeek" => ProviderResponseProviderName.DeepSeek, "DekaLLM" => ProviderResponseProviderName.DekaLLM, diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptions.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptions.g.cs index ea7b00f..64110bf 100644 --- a/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptions.g.cs +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptions.g.cs @@ -182,6 +182,12 @@ public sealed partial class VideoGenerationRequestProviderOptions [global::System.Text.Json.Serialization.JsonPropertyName("crusoe")] public object? Crusoe { get; set; } + /// + /// + /// + [global::System.Text.Json.Serialization.JsonPropertyName("darkbloom")] + public object? Darkbloom { get; set; } + /// /// /// @@ -718,6 +724,7 @@ public sealed partial class VideoGenerationRequestProviderOptions /// /// /// + /// /// /// /// @@ -834,6 +841,7 @@ public VideoGenerationRequestProviderOptions( object? crofai, object? crucible, object? crusoe, + object? darkbloom, object? deepinfra, object? deepseek, object? dekallm, @@ -947,6 +955,7 @@ public VideoGenerationRequestProviderOptions( this.Crofai = crofai; this.Crucible = crucible; this.Crusoe = crusoe; + this.Darkbloom = darkbloom; this.Deepinfra = deepinfra; this.Deepseek = deepseek; this.Dekallm = dekallm; diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom.Json.g.cs new file mode 100644 index 0000000..fa21d35 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class VideoGenerationRequestProviderOptionsDarkbloom + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom), + jsonSerializerContext) as global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom.g.cs new file mode 100644 index 0000000..931e95f --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// + /// + public sealed partial class VideoGenerationRequestProviderOptionsDarkbloom + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom2.Json.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom2.Json.g.cs new file mode 100644 index 0000000..ca73a5b --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom2.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace OpenRouter +{ + public sealed partial class VideoGenerationRequestProviderOptionsDarkbloom2 + { + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerContext. + /// + public string ToJson( + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + this.GetType(), + jsonSerializerContext); + } + + /// + /// Serializes the current instance to a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public string ToJson( + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Serialize( + this, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerContext. + /// + public static global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom2? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom2), + jsonSerializerContext) as global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom2; + } + + /// + /// Deserializes a JSON string using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom2? FromJson( + string json, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + jsonSerializerOptions); + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerContext. + /// + public static async global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return (await global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + typeof(global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom2), + jsonSerializerContext).ConfigureAwait(false)) as global::OpenRouter.VideoGenerationRequestProviderOptionsDarkbloom2; + } + + /// + /// Deserializes a JSON stream using the provided JsonSerializerOptions. + /// +#if NET8_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")] + [global::System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")] +#endif + public static global::System.Threading.Tasks.ValueTask FromJsonStreamAsync( + global::System.IO.Stream jsonStream, + global::System.Text.Json.JsonSerializerOptions? jsonSerializerOptions = null) + { + return global::System.Text.Json.JsonSerializer.DeserializeAsync( + jsonStream, + jsonSerializerOptions); + } + } +} diff --git a/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom2.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom2.g.cs new file mode 100644 index 0000000..23dfd80 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.Models.VideoGenerationRequestProviderOptionsDarkbloom2.g.cs @@ -0,0 +1,19 @@ + +#nullable enable + +namespace OpenRouter +{ + /// + /// Any type + /// + public sealed partial class VideoGenerationRequestProviderOptionsDarkbloom2 + { + + /// + /// Additional properties that are not explicitly defined in the schema + /// + [global::System.Text.Json.Serialization.JsonExtensionData] + public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/Generated/OpenRouter.SubpackagePresetsClient.CreatePresetsMessages.g.cs b/src/libs/OpenRouter/Generated/OpenRouter.SubpackagePresetsClient.CreatePresetsMessages.g.cs new file mode 100644 index 0000000..18a7057 --- /dev/null +++ b/src/libs/OpenRouter/Generated/OpenRouter.SubpackagePresetsClient.CreatePresetsMessages.g.cs @@ -0,0 +1,787 @@ + +#nullable enable + +namespace OpenRouter +{ + public partial class SubpackagePresetsClient + { + + + private static readonly global::OpenRouter.EndPointSecurityRequirement s_CreatePresetsMessagesSecurityRequirement0 = + new global::OpenRouter.EndPointSecurityRequirement + { + Authorizations = new global::OpenRouter.EndPointAuthorizationRequirement[] + { new global::OpenRouter.EndPointAuthorizationRequirement + { + Type = "Http", + SchemeId = "Bearer", + Location = "Header", + Name = "Bearer", + FriendlyName = "Bearer", + }, + }, + }; + private static readonly global::OpenRouter.EndPointSecurityRequirement[] s_CreatePresetsMessagesSecurityRequirements = + new global::OpenRouter.EndPointSecurityRequirement[] + { s_CreatePresetsMessagesSecurityRequirement0, + }; + partial void PrepareCreatePresetsMessagesArguments( + global::System.Net.Http.HttpClient httpClient, + ref string slug, + global::OpenRouter.MessagesRequest request); + partial void PrepareCreatePresetsMessagesRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string slug, + global::OpenRouter.MessagesRequest request); + partial void ProcessCreatePresetsMessagesResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessCreatePresetsMessagesResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Create a preset from a messages request body
+ /// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreatePresetsMessagesAsync( + string slug, + + global::OpenRouter.MessagesRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreatePresetsMessagesAsResponseAsync( + slug: slug, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a preset from a messages request body
+ /// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> CreatePresetsMessagesAsResponseAsync( + string slug, + + global::OpenRouter.MessagesRequest request, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareCreatePresetsMessagesArguments( + httpClient: HttpClient, + slug: ref slug, + request: request); + + + var __authorizations = global::OpenRouter.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_CreatePresetsMessagesSecurityRequirements, + operationName: "CreatePresetsMessagesAsync"); + + using var __timeoutCancellationTokenSource = global::OpenRouter.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::OpenRouter.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::OpenRouter.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: false); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::OpenRouter.PathBuilder( + path: $"/presets/{slug}/messages", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + __path = global::OpenRouter.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Post, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + var __httpRequestContentBody = request.ToJson(JsonSerializerContext); + var __httpRequestContent = new global::System.Net.Http.StringContent( + content: __httpRequestContentBody, + encoding: global::System.Text.Encoding.UTF8, + mediaType: "application/json"); + __httpRequest.Content = __httpRequestContent; + global::OpenRouter.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareCreatePresetsMessagesRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + slug: slug!, + request: request); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePresetsMessages", + methodName: "CreatePresetsMessagesAsync", + pathTemplate: "$\"/presets/{slug}/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::OpenRouter.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePresetsMessages", + methodName: "CreatePresetsMessagesAsync", + pathTemplate: "$\"/presets/{slug}/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::OpenRouter.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::OpenRouter.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePresetsMessages", + methodName: "CreatePresetsMessagesAsync", + pathTemplate: "$\"/presets/{slug}/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::OpenRouter.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + using (__response) + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessCreatePresetsMessagesResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePresetsMessages", + methodName: "CreatePresetsMessagesAsync", + pathTemplate: "$\"/presets/{slug}/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::OpenRouter.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::OpenRouter.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "CreatePresetsMessages", + methodName: "CreatePresetsMessagesAsync", + pathTemplate: "$\"/presets/{slug}/messages\"", + httpMethod: "POST", + baseUri: BaseUri, + request: __httpRequest!, + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // Bad Request - Invalid request parameters or malformed input + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + global::OpenRouter.BadRequestResponse? __value_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_400 = global::OpenRouter.BadRequestResponse.FromJson(__content_400, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseObject: __value_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Unauthorized - Authentication required or invalid credentials + if ((int)__response.StatusCode == 401) + { + string? __content_401 = null; + global::System.Exception? __exception_401 = null; + global::OpenRouter.UnauthorizedResponse? __value_401 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + else + { + __content_401 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_401 = global::OpenRouter.UnauthorizedResponse.FromJson(__content_401, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_401 = __ex; + } + + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_401 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_401, + responseBody: __content_401, + responseObject: __value_401, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Forbidden - Authentication successful but insufficient permissions + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::OpenRouter.ForbiddenResponse? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::OpenRouter.ForbiddenResponse.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Not Found - Resource does not exist + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + global::OpenRouter.NotFoundResponse? __value_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_404 = global::OpenRouter.NotFoundResponse.FromJson(__content_404, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseObject: __value_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Conflict - Resource conflict or concurrent modification + if ((int)__response.StatusCode == 409) + { + string? __content_409 = null; + global::System.Exception? __exception_409 = null; + global::OpenRouter.ConflictResponse? __value_409 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_409 = global::OpenRouter.ConflictResponse.FromJson(__content_409, JsonSerializerContext); + } + else + { + __content_409 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_409 = global::OpenRouter.ConflictResponse.FromJson(__content_409, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_409 = __ex; + } + + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_409 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_409, + responseBody: __content_409, + responseObject: __value_409, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Internal Server Error - Unexpected server error + if ((int)__response.StatusCode == 500) + { + string? __content_500 = null; + global::System.Exception? __exception_500 = null; + global::OpenRouter.InternalServerResponse? __value_500 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + else + { + __content_500 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_500 = global::OpenRouter.InternalServerResponse.FromJson(__content_500, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_500 = __ex; + } + + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_500 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_500, + responseBody: __content_500, + responseObject: __value_500, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + if (__effectiveReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessCreatePresetsMessagesResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::OpenRouter.CreatePresetFromInferenceResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + return new global::OpenRouter.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::OpenRouter.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + else + { + try + { + __response.EnsureSuccessStatusCode(); + using var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + var __value = await global::OpenRouter.CreatePresetFromInferenceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + return new global::OpenRouter.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::OpenRouter.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: __value); + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::OpenRouter.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + } + + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Create a preset from a messages request body
+ /// Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored. + ///
+ /// + /// + /// Enable automatic prompt caching. When set at the top level, the system automatically applies cache breakpoints to the last cacheable block in the request. Currently supported for Anthropic Claude models. + /// + /// + /// + /// + /// + /// + /// + /// + /// Configuration for controlling output behavior. Supports the effort parameter and structured output format. + /// + /// + /// Plugins you want to enable for this request, including their settings. + /// + /// + /// When multiple model providers are available, optionally indicate your routing preference. + /// + /// + /// Any type + /// + /// + /// + /// A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 256 characters. + /// + /// + /// + /// + /// Stop conditions for the server-tool agent loop. Any condition firing halts the loop (OR logic). When set, this overrides `max_tool_calls`. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Metadata for observability and tracing. Known keys (trace_id, trace_name, span_name, generation_name, parent_span_id) have special handling. Additional keys are passed through as custom metadata to configured broadcast destinations. + /// + /// + /// A unique identifier representing your end-user, which helps distinguish between different users of your app. This allows your app to identify specific users in case of abuse reports, preventing your entire app from being affected by the actions of individual users. Maximum of 256 characters. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task CreatePresetsMessagesAsync( + string slug, + string model, + global::OpenRouter.AnthropicCacheControlDirective? cacheControl = default, + global::OpenRouter.OneOf? contextManagement = default, + int? maxTokens = default, + global::System.Collections.Generic.IList? messages = default, + global::OpenRouter.MessagesRequestMetadata? metadata = default, + global::System.Collections.Generic.IList? models = default, + global::OpenRouter.MessagesOutputConfig? outputConfig = default, + global::System.Collections.Generic.IList? plugins = default, + global::OpenRouter.ProviderPreferences? provider = default, + object? route = default, + string? serviceTier = default, + string? sessionId = default, + global::OpenRouter.AnthropicSpeed? speed = default, + global::System.Collections.Generic.IList? stopSequences = default, + global::System.Collections.Generic.IList? stopServerToolsWhen = default, + bool? stream = default, + global::OpenRouter.MessagesRequestSystem? system = default, + double? temperature = default, + global::OpenRouter.MessagesRequestThinking? thinking = default, + global::OpenRouter.MessagesRequestToolChoice? toolChoice = default, + global::System.Collections.Generic.IList? tools = default, + int? topK = default, + double? topP = default, + global::OpenRouter.TraceConfig? trace = default, + string? user = default, + global::OpenRouter.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::OpenRouter.MessagesRequest + { + CacheControl = cacheControl, + ContextManagement = contextManagement, + MaxTokens = maxTokens, + Messages = messages, + Metadata = metadata, + Model = model, + Models = models, + OutputConfig = outputConfig, + Plugins = plugins, + Provider = provider, + Route = route, + ServiceTier = serviceTier, + SessionId = sessionId, + Speed = speed, + StopSequences = stopSequences, + StopServerToolsWhen = stopServerToolsWhen, + Stream = stream, + System = system, + Temperature = temperature, + Thinking = thinking, + ToolChoice = toolChoice, + Tools = tools, + TopK = topK, + TopP = topP, + Trace = trace, + User = user, + }; + + return await CreatePresetsMessagesAsync( + slug: slug, + request: __request, + requestOptions: requestOptions, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/OpenRouter/openapi.yaml b/src/libs/OpenRouter/openapi.yaml index b465ce7..4f9ba38 100644 --- a/src/libs/OpenRouter/openapi.yaml +++ b/src/libs/OpenRouter/openapi.yaml @@ -4148,6 +4148,108 @@ } } }, + "/presets/{slug}/messages": { + "post": { + "operationId": "create-presets-messages", + "summary": "Create a preset from a messages request body", + "description": "Creates a preset (or a new version of an existing one) from an inference request body. Only fields that overlap with the preset config are persisted; other fields (e.g. `messages`, `stream`, `prompt`) are silently ignored.", + "tags": [ + "subpackage_presets" + ], + "parameters": [ + { + "name": "slug", + "in": "path", + "description": "URL-safe slug identifying the preset. Created if it does not exist.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Preset created or updated successfully.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePresetFromInferenceResponse" + } + } + } + }, + "400": { + "description": "Bad Request - Invalid request parameters or malformed input", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BadRequestResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - Authentication required or invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnauthorizedResponse" + } + } + } + }, + "403": { + "description": "Forbidden - Authentication successful but insufficient permissions", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ForbiddenResponse" + } + } + } + }, + "404": { + "description": "Not Found - Resource does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundResponse" + } + } + } + }, + "409": { + "description": "Conflict - Resource conflict or concurrent modification", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ConflictResponse" + } + } + } + }, + "500": { + "description": "Internal Server Error - Unexpected server error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InternalServerResponse" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MessagesRequest" + } + } + } + } + } + }, "/providers": { "get": { "operationId": "list-providers", @@ -8814,6 +8916,7 @@ "Cohere", "Crucible", "Crusoe", + "Darkbloom", "DeepInfra", "DeepSeek", "DekaLLM", @@ -15240,6 +15343,12 @@ "description": "Any type" } }, + "darkbloom": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, "deepinfra": { "type": "object", "additionalProperties": { @@ -16012,6 +16121,7 @@ "cloudflare", "cohere", "crusoe", + "darkbloom", "deepinfra", "deepseek", "dekallm", @@ -16100,6 +16210,7 @@ "cloudflare", "cohere", "crusoe", + "darkbloom", "deepinfra", "deepseek", "dekallm", @@ -20396,6 +20507,7 @@ "Cohere", "Crucible", "Crusoe", + "Darkbloom", "DeepInfra", "DeepSeek", "DekaLLM", @@ -35489,6 +35601,12 @@ "description": "Any type" } }, + "darkbloom": { + "type": "object", + "additionalProperties": { + "description": "Any type" + } + }, "deepinfra": { "type": "object", "additionalProperties": {