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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ partial void ProcessChatCompletionResponseContent(
PromptMode = request.PromptMode,
ReasoningEffort = request.ReasoningEffort,
Guardrails = request.Guardrails,
PromptCacheKey = request.PromptCacheKey,
SafePrompt = request.SafePrompt,
};
PrepareArguments(
Expand Down Expand Up @@ -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.<br/>
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="safePrompt">
/// Whether to inject a safety prompt before all conversations.<br/>
/// Default Value: false
Expand Down Expand Up @@ -589,6 +593,7 @@ partial void ProcessChatCompletionResponseContent(
global::Mistral.MistralPromptMode? promptMode = default,
global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default,
global::System.Collections.Generic.IList<global::Mistral.GuardrailConfig>? guardrails = default,
string? promptCacheKey = default,
bool? safePrompt = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
Expand All @@ -615,6 +620,7 @@ partial void ProcessChatCompletionResponseContent(
PromptMode = promptMode,
ReasoningEffort = reasoningEffort,
Guardrails = guardrails,
PromptCacheKey = promptCacheKey,
SafePrompt = safePrompt,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ partial void ProcessChatCompletionAsStreamResponse(
PromptMode = request.PromptMode,
ReasoningEffort = request.ReasoningEffort,
Guardrails = request.Guardrails,
PromptCacheKey = request.PromptCacheKey,
SafePrompt = request.SafePrompt,
};
PrepareArguments(
Expand Down Expand Up @@ -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.<br/>
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="safePrompt">
/// Whether to inject a safety prompt before all conversations.<br/>
/// Default Value: false
Expand Down Expand Up @@ -494,6 +498,7 @@ partial void ProcessChatCompletionAsStreamResponse(
global::Mistral.MistralPromptMode? promptMode = default,
global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default,
global::System.Collections.Generic.IList<global::Mistral.GuardrailConfig>? guardrails = default,
string? promptCacheKey = default,
bool? safePrompt = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
[global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
Expand All @@ -520,6 +525,7 @@ partial void ProcessChatCompletionAsStreamResponse(
PromptMode = promptMode,
ReasoningEffort = reasoningEffort,
Guardrails = guardrails,
PromptCacheKey = promptCacheKey,
SafePrompt = safePrompt,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ partial void ProcessFimCompletionResponseContent(
Prompt = request.Prompt,
Suffix = request.Suffix,
MinTokens = request.MinTokens,
PromptCacheKey = request.PromptCacheKey,
};
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -523,6 +524,9 @@ partial void ProcessFimCompletionResponseContent(
/// <param name="minTokens">
/// The minimum number of tokens to generate in the completion.
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand All @@ -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)
{
Expand All @@ -553,6 +558,7 @@ partial void ProcessFimCompletionResponseContent(
Prompt = prompt,
Suffix = suffix,
MinTokens = minTokens,
PromptCacheKey = promptCacheKey,
};

return await FimCompletionAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ partial void ProcessFimCompletionAsStreamResponse(
Prompt = request.Prompt,
Suffix = request.Suffix,
MinTokens = request.MinTokens,
PromptCacheKey = request.PromptCacheKey,
};
PrepareArguments(
client: HttpClient);
Expand Down Expand Up @@ -427,6 +428,9 @@ partial void ProcessFimCompletionAsStreamResponse(
/// <param name="minTokens">
/// The minimum number of tokens to generate in the completion.
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand All @@ -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)
{
Expand All @@ -457,6 +462,7 @@ partial void ProcessFimCompletionAsStreamResponse(
Prompt = prompt,
Suffix = suffix,
MinTokens = minTokens,
PromptCacheKey = promptCacheKey,
};

var __enumerable = FimCompletionAsStreamAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br/>
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="safePrompt">
/// Whether to inject a safety prompt before all conversations.<br/>
/// Default Value: false
Expand Down Expand Up @@ -120,6 +123,7 @@ public partial interface IChatClient
global::Mistral.MistralPromptMode? promptMode = default,
global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default,
global::System.Collections.Generic.IList<global::Mistral.GuardrailConfig>? guardrails = default,
string? promptCacheKey = default,
bool? safePrompt = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br/>
/// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="safePrompt">
/// Whether to inject a safety prompt before all conversations.<br/>
/// Default Value: false
Expand Down Expand Up @@ -108,6 +111,7 @@ public partial interface IChatClient
global::Mistral.MistralPromptMode? promptMode = default,
global::Mistral.ChatCompletionRequestReasoningEffort? reasoningEffort = default,
global::System.Collections.Generic.IList<global::Mistral.GuardrailConfig>? guardrails = default,
string? promptCacheKey = default,
bool? safePrompt = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public partial interface IFimClient
/// <param name="minTokens">
/// The minimum number of tokens to generate in the completion.
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public partial interface IFimClient
/// <param name="minTokens">
/// The minimum number of tokens to generate in the completion.
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
/// <param name="requestOptions">Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.</param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
Expand All @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

/// <summary>
/// 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.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("prompt_cache_key")]
public string? PromptCacheKey { get; set; }

/// <summary>
/// The ID of the agent to use for this completion.
/// </summary>
Expand Down Expand Up @@ -179,6 +185,9 @@ public sealed partial class AgentsCompletionRequest
/// <param name="reasoningEffort">
/// Controls the reasoning effort level for reasoning models. "high" enables comprehensive reasoning traces, "none" disables reasoning effort.
/// </param>
/// <param name="promptCacheKey">
/// 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.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand All @@ -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;
Expand All @@ -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));
}

Expand Down
Loading