diff --git a/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs index 6afbfa2c..e08b66f3 100644 --- a/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs @@ -100,6 +100,7 @@ partial void ProcessChatCompletionResponseContent( PromptMode = request.PromptMode, ReasoningEffort = request.ReasoningEffort, Guardrails = request.Guardrails, + PromptCacheKey = request.PromptCacheKey, SafePrompt = request.SafePrompt, }; PrepareArguments( @@ -562,6 +563,9 @@ partial void ProcessChatCompletionResponseContent( /// A list of guardrail configurations to apply to this request. Each guardrail specifies a moderation type, categories with thresholds to evaluate, and an action to take on violation.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// /// Whether to inject a safety prompt before all conversations.
/// Default Value: false @@ -589,6 +593,7 @@ partial void ProcessChatCompletionResponseContent( global::Mistral.MistralPromptMode? promptMode = default, global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default, global::System.Collections.Generic.IList? guardrails = default, + string? promptCacheKey = default, bool? safePrompt = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -615,6 +620,7 @@ partial void ProcessChatCompletionResponseContent( PromptMode = promptMode, ReasoningEffort = reasoningEffort, Guardrails = guardrails, + PromptCacheKey = promptCacheKey, SafePrompt = safePrompt, }; diff --git a/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs index 50720236..176b287d 100644 --- a/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs @@ -73,6 +73,7 @@ partial void ProcessChatCompletionAsStreamResponse( PromptMode = request.PromptMode, ReasoningEffort = request.ReasoningEffort, Guardrails = request.Guardrails, + PromptCacheKey = request.PromptCacheKey, SafePrompt = request.SafePrompt, }; PrepareArguments( @@ -467,6 +468,9 @@ partial void ProcessChatCompletionAsStreamResponse( /// A list of guardrail configurations to apply to this request. Each guardrail specifies a moderation type, categories with thresholds to evaluate, and an action to take on violation.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// /// Whether to inject a safety prompt before all conversations.
/// Default Value: false @@ -494,6 +498,7 @@ partial void ProcessChatCompletionAsStreamResponse( global::Mistral.MistralPromptMode? promptMode = default, global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default, global::System.Collections.Generic.IList? guardrails = default, + string? promptCacheKey = default, bool? safePrompt = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) @@ -520,6 +525,7 @@ partial void ProcessChatCompletionAsStreamResponse( PromptMode = promptMode, ReasoningEffort = reasoningEffort, Guardrails = guardrails, + PromptCacheKey = promptCacheKey, SafePrompt = safePrompt, }; diff --git a/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs index 23b1b382..87198fba 100644 --- a/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs @@ -93,6 +93,7 @@ partial void ProcessFimCompletionResponseContent( Prompt = request.Prompt, Suffix = request.Suffix, MinTokens = request.MinTokens, + PromptCacheKey = request.PromptCacheKey, }; PrepareArguments( client: HttpClient); @@ -523,6 +524,9 @@ partial void ProcessFimCompletionResponseContent( /// /// The minimum number of tokens to generate in the completion. /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -537,6 +541,7 @@ partial void ProcessFimCompletionResponseContent( object? metadata = default, string? suffix = default, int? minTokens = default, + string? promptCacheKey = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) { @@ -553,6 +558,7 @@ partial void ProcessFimCompletionResponseContent( Prompt = prompt, Suffix = suffix, MinTokens = minTokens, + PromptCacheKey = promptCacheKey, }; return await FimCompletionAsync( diff --git a/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs index aa0d1337..60b516c8 100644 --- a/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs @@ -65,6 +65,7 @@ partial void ProcessFimCompletionAsStreamResponse( Prompt = request.Prompt, Suffix = request.Suffix, MinTokens = request.MinTokens, + PromptCacheKey = request.PromptCacheKey, }; PrepareArguments( client: HttpClient); @@ -427,6 +428,9 @@ partial void ProcessFimCompletionAsStreamResponse( /// /// The minimum number of tokens to generate in the completion. /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -441,6 +445,7 @@ partial void ProcessFimCompletionAsStreamResponse( object? metadata = default, string? suffix = default, int? minTokens = default, + string? promptCacheKey = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default) { @@ -457,6 +462,7 @@ partial void ProcessFimCompletionAsStreamResponse( Prompt = prompt, Suffix = suffix, MinTokens = minTokens, + PromptCacheKey = promptCacheKey, }; var __enumerable = FimCompletionAsStreamAsync( diff --git a/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs index c46cec21..147d177f 100644 --- a/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs @@ -93,6 +93,9 @@ public partial interface IChatClient /// A list of guardrail configurations to apply to this request. Each guardrail specifies a moderation type, categories with thresholds to evaluate, and an action to take on violation.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// /// Whether to inject a safety prompt before all conversations.
/// Default Value: false @@ -120,6 +123,7 @@ public partial interface IChatClient global::Mistral.MistralPromptMode? promptMode = default, global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default, global::System.Collections.Generic.IList? guardrails = default, + string? promptCacheKey = default, bool? safePrompt = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletionAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletionAsStream.g.cs index 332f1da3..7b8c921e 100644 --- a/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletionAsStream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletionAsStream.g.cs @@ -81,6 +81,9 @@ public partial interface IChatClient /// A list of guardrail configurations to apply to this request. Each guardrail specifies a moderation type, categories with thresholds to evaluate, and an action to take on violation.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// /// Whether to inject a safety prompt before all conversations.
/// Default Value: false @@ -108,6 +111,7 @@ public partial interface IChatClient global::Mistral.MistralPromptMode? promptMode = default, global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default, global::System.Collections.Generic.IList? guardrails = default, + string? promptCacheKey = default, bool? safePrompt = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); diff --git a/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs index a0b0326e..a6eb624d 100644 --- a/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs @@ -64,6 +64,9 @@ public partial interface IFimClient /// /// The minimum number of tokens to generate in the completion. /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -78,6 +81,7 @@ public partial interface IFimClient object? metadata = default, string? suffix = default, int? minTokens = default, + string? promptCacheKey = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletionAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletionAsStream.g.cs index ddb7b6e1..40c59ac1 100644 --- a/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletionAsStream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletionAsStream.g.cs @@ -51,6 +51,9 @@ public partial interface IFimClient /// /// The minimum number of tokens to generate in the completion. /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// @@ -65,6 +68,7 @@ public partial interface IFimClient object? metadata = default, string? suffix = default, int? minTokens = default, + string? promptCacheKey = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); } diff --git a/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequest.g.cs b/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequest.g.cs index 423875a6..38a2cb83 100644 --- a/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequest.g.cs +++ b/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequest.g.cs @@ -112,6 +112,12 @@ public sealed partial class AgentsCompletionRequest [global::System.Text.Json.Serialization.JsonConverter(typeof(global::Mistral.JsonConverters.AgentsCompletionRequestReasoningEffortJsonConverter))] public global::Mistral.AgentsCompletionRequestReasoningEffort? ReasoningEffort { get; set; } + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")] + public string? PromptCacheKey { get; set; } + /// /// The ID of the agent to use for this completion. /// @@ -179,6 +185,9 @@ public sealed partial class AgentsCompletionRequest /// /// Controls the reasoning effort level for reasoning models. "high" enables comprehensive reasoning traces, "none" disables reasoning effort. /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -199,7 +208,8 @@ public AgentsCompletionRequest( global::Mistral.Prediction? prediction, bool? parallelToolCalls, global::Mistral.MistralPromptMode? promptMode, - global::Mistral.AgentsCompletionRequestReasoningEffort? reasoningEffort) + global::Mistral.AgentsCompletionRequestReasoningEffort? reasoningEffort, + string? promptCacheKey) { this.MaxTokens = maxTokens; this.Stream = stream; @@ -217,6 +227,7 @@ public AgentsCompletionRequest( this.ParallelToolCalls = parallelToolCalls; this.PromptMode = promptMode; this.ReasoningEffort = reasoningEffort; + this.PromptCacheKey = promptCacheKey; this.AgentId = agentId ?? throw new global::System.ArgumentNullException(nameof(agentId)); } diff --git a/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequestPromptCacheKey.Json.g.cs b/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequestPromptCacheKey.Json.g.cs new file mode 100644 index 00000000..89516424 --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequestPromptCacheKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Mistral +{ + public sealed partial class AgentsCompletionRequestPromptCacheKey + { + /// + /// 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::Mistral.AgentsCompletionRequestPromptCacheKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Mistral.AgentsCompletionRequestPromptCacheKey), + jsonSerializerContext) as global::Mistral.AgentsCompletionRequestPromptCacheKey; + } + + /// + /// 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::Mistral.AgentsCompletionRequestPromptCacheKey? 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::Mistral.AgentsCompletionRequestPromptCacheKey), + jsonSerializerContext).ConfigureAwait(false)) as global::Mistral.AgentsCompletionRequestPromptCacheKey; + } + + /// + /// 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/Mistral/Generated/Mistral.Models.AgentsCompletionRequestPromptCacheKey.g.cs b/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequestPromptCacheKey.g.cs new file mode 100644 index 00000000..d1d3cd32 --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.Models.AgentsCompletionRequestPromptCacheKey.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace Mistral +{ + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// + public sealed partial class AgentsCompletionRequestPromptCacheKey + { + + /// + /// 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/Mistral/Generated/Mistral.Models.ChatCompletionRequest.g.cs b/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequest.g.cs index d87a0def..c66eae81 100644 --- a/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequest.g.cs +++ b/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequest.g.cs @@ -141,6 +141,12 @@ public sealed partial class ChatCompletionRequest [global::System.Text.Json.Serialization.JsonPropertyName("guardrails")] public global::System.Collections.Generic.IList? Guardrails { get; set; } + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")] + public string? PromptCacheKey { get; set; } + /// /// Whether to inject a safety prompt before all conversations.
/// Default Value: false @@ -223,6 +229,9 @@ public sealed partial class ChatCompletionRequest /// A list of guardrail configurations to apply to this request. Each guardrail specifies a moderation type, categories with thresholds to evaluate, and an action to take on violation.
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464 /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// /// /// Whether to inject a safety prompt before all conversations.
/// Default Value: false @@ -251,6 +260,7 @@ public ChatCompletionRequest( global::Mistral.MistralPromptMode? promptMode, global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort, global::System.Collections.Generic.IList? guardrails, + string? promptCacheKey, bool? safePrompt) { this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); @@ -273,6 +283,7 @@ public ChatCompletionRequest( this.PromptMode = promptMode; this.ReasoningEffort = reasoningEffort; this.Guardrails = guardrails; + this.PromptCacheKey = promptCacheKey; this.SafePrompt = safePrompt; } diff --git a/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequestPromptCacheKey.Json.g.cs b/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequestPromptCacheKey.Json.g.cs new file mode 100644 index 00000000..1e61360a --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequestPromptCacheKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Mistral +{ + public sealed partial class ChatCompletionRequestPromptCacheKey + { + /// + /// 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::Mistral.ChatCompletionRequestPromptCacheKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Mistral.ChatCompletionRequestPromptCacheKey), + jsonSerializerContext) as global::Mistral.ChatCompletionRequestPromptCacheKey; + } + + /// + /// 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::Mistral.ChatCompletionRequestPromptCacheKey? 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::Mistral.ChatCompletionRequestPromptCacheKey), + jsonSerializerContext).ConfigureAwait(false)) as global::Mistral.ChatCompletionRequestPromptCacheKey; + } + + /// + /// 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/Mistral/Generated/Mistral.Models.ChatCompletionRequestPromptCacheKey.g.cs b/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequestPromptCacheKey.g.cs new file mode 100644 index 00000000..e5c8551e --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.Models.ChatCompletionRequestPromptCacheKey.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace Mistral +{ + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// + public sealed partial class ChatCompletionRequestPromptCacheKey + { + + /// + /// 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/Mistral/Generated/Mistral.Models.FIMCompletionRequest.g.cs b/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequest.g.cs index 2002ece3..03d48268 100644 --- a/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequest.g.cs +++ b/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequest.g.cs @@ -81,6 +81,12 @@ public sealed partial class FIMCompletionRequest [global::System.Text.Json.Serialization.JsonPropertyName("min_tokens")] public int? MinTokens { get; set; } + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")] + public string? PromptCacheKey { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -124,6 +130,9 @@ public sealed partial class FIMCompletionRequest /// /// The minimum number of tokens to generate in the completion. /// + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif @@ -138,7 +147,8 @@ public FIMCompletionRequest( int? randomSeed, object? metadata, string? suffix, - int? minTokens) + int? minTokens, + string? promptCacheKey) { this.Model = model ?? throw new global::System.ArgumentNullException(nameof(model)); this.Temperature = temperature; @@ -151,6 +161,7 @@ public FIMCompletionRequest( this.Prompt = prompt ?? throw new global::System.ArgumentNullException(nameof(prompt)); this.Suffix = suffix; this.MinTokens = minTokens; + this.PromptCacheKey = promptCacheKey; } /// diff --git a/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequestPromptCacheKey.Json.g.cs b/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequestPromptCacheKey.Json.g.cs new file mode 100644 index 00000000..cb8dc933 --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequestPromptCacheKey.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Mistral +{ + public sealed partial class FIMCompletionRequestPromptCacheKey + { + /// + /// 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::Mistral.FIMCompletionRequestPromptCacheKey? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Mistral.FIMCompletionRequestPromptCacheKey), + jsonSerializerContext) as global::Mistral.FIMCompletionRequestPromptCacheKey; + } + + /// + /// 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::Mistral.FIMCompletionRequestPromptCacheKey? 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::Mistral.FIMCompletionRequestPromptCacheKey), + jsonSerializerContext).ConfigureAwait(false)) as global::Mistral.FIMCompletionRequestPromptCacheKey; + } + + /// + /// 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/Mistral/Generated/Mistral.Models.FIMCompletionRequestPromptCacheKey.g.cs b/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequestPromptCacheKey.g.cs new file mode 100644 index 00000000..03175d6c --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.Models.FIMCompletionRequestPromptCacheKey.g.cs @@ -0,0 +1,18 @@ + +#nullable enable + +namespace Mistral +{ + /// + /// A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. + /// + public sealed partial class FIMCompletionRequestPromptCacheKey + { + + /// + /// 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/Mistral/Generated/autosdk.generated-examples.json b/src/libs/Mistral/Generated/autosdk.generated-examples.json index 107fa169..0b9fc564 100644 --- a/src/libs/Mistral/Generated/autosdk.generated-examples.json +++ b/src/libs/Mistral/Generated/autosdk.generated-examples.json @@ -105,7 +105,7 @@ "Slug": "fim-completion-v1-fim-completions-post", "Description": "FIM completion.", "Language": "http", - "Code": "### Fim Completion\n# @name fim_completion_v1_fim_completions_post\nPOST {{host}}/v1/fim/completions\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\n \u0022model\u0022: \u0022codestral-2404\u0022,\n \u0022temperature\u0022: 0,\n \u0022top_p\u0022: 1.0,\n \u0022max_tokens\u0022: 0,\n \u0022stream\u0022: false,\n \u0022stop\u0022: \u0022string\u0022,\n \u0022random_seed\u0022: 0,\n \u0022metadata\u0022: {},\n \u0022prompt\u0022: \u0022string\u0022,\n \u0022suffix\u0022: \u0022\u0022,\n \u0022min_tokens\u0022: 0\n}\n\n## Responses\n# 200\n# Description: Successful Response\n# Content-Type: application/json, text/event-stream\n# 422\n# Description: Validation Error\n# Content-Type: application/json", + "Code": "### Fim Completion\n# @name fim_completion_v1_fim_completions_post\nPOST {{host}}/v1/fim/completions\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\n \u0022model\u0022: \u0022codestral-2404\u0022,\n \u0022temperature\u0022: 0,\n \u0022top_p\u0022: 1.0,\n \u0022max_tokens\u0022: 0,\n \u0022stream\u0022: false,\n \u0022stop\u0022: \u0022string\u0022,\n \u0022random_seed\u0022: 0,\n \u0022metadata\u0022: {},\n \u0022prompt\u0022: \u0022string\u0022,\n \u0022suffix\u0022: \u0022\u0022,\n \u0022min_tokens\u0022: 0,\n \u0022prompt_cache_key\u0022: \u0022string\u0022\n}\n\n## Responses\n# 200\n# Description: Successful Response\n# Content-Type: application/json, text/event-stream\n# 422\n# Description: Validation Error\n# Content-Type: application/json", "Format": "http", "OperationId": "fim_completion_v1_fim_completions_post", "Setup": null diff --git a/src/libs/Mistral/openapi.yaml b/src/libs/Mistral/openapi.yaml index f70c95f5..2d3550d8 100644 --- a/src/libs/Mistral/openapi.yaml +++ b/src/libs/Mistral/openapi.yaml @@ -11435,6 +11435,12 @@ components: title: Guardrails description: A list of guardrail configurations to apply to this request. Each guardrail specifies a moderation type, categories with thresholds to evaluate, and an action to take on violation. default: null + prompt_cache_key: + anyOf: + - type: string + - type: 'null' + title: Prompt Cache Key + description: A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. safe_prompt: type: boolean description: Whether to inject a safety prompt before all conversations. @@ -11657,6 +11663,12 @@ components: - type: 'null' title: Min Tokens description: The minimum number of tokens to generate in the completion. + prompt_cache_key: + anyOf: + - type: string + - type: 'null' + title: Prompt Cache Key + description: A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. title: FIMCompletionRequest required: - prompt @@ -13057,6 +13069,12 @@ components: - high - none description: Controls the reasoning effort level for reasoning models. "high" enables comprehensive reasoning traces, "none" disables reasoning effort. + prompt_cache_key: + anyOf: + - type: string + - type: 'null' + title: Prompt Cache Key + description: A cache key to enable prompt caching. When provided, the API will attempt to reuse previously computed tokens for requests sharing the same prefix (e.g. multi-turn conversations or requests with a similar system prompt). Cached tokens are billed at 10% of the standard input token price. agent_id: type: string description: The ID of the agent to use for this completion.