Add Codestral edit predictions provider (#34371)
Release Notes: - Added Codestral edit predictions provider which can be enabled by adding an API key in the Mistral section of agent settings.  ## Config Get API key from https://console.mistral.ai/codestral and add it in the Mistral section of the agent settings. ``` "features": { "edit_prediction_provider": "codestral" }, "edit_predictions": { "codestral": { "model": "codestral-latest", "max_tokens": 150 } }, ``` --------- Co-authored-by: Michael Sloan <michael@zed.dev>
This commit is contained in:
@@ -82,6 +82,7 @@ pub enum EditPredictionProvider {
|
||||
Copilot,
|
||||
Supermaven,
|
||||
Zed,
|
||||
Codestral,
|
||||
}
|
||||
|
||||
impl EditPredictionProvider {
|
||||
@@ -90,7 +91,8 @@ impl EditPredictionProvider {
|
||||
EditPredictionProvider::Zed => true,
|
||||
EditPredictionProvider::None
|
||||
| EditPredictionProvider::Copilot
|
||||
| EditPredictionProvider::Supermaven => false,
|
||||
| EditPredictionProvider::Supermaven
|
||||
| EditPredictionProvider::Codestral => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,6 +110,8 @@ pub struct EditPredictionSettingsContent {
|
||||
pub mode: Option<EditPredictionsMode>,
|
||||
/// Settings specific to GitHub Copilot.
|
||||
pub copilot: Option<CopilotSettingsContent>,
|
||||
/// Settings specific to Codestral.
|
||||
pub codestral: Option<CodestralSettingsContent>,
|
||||
/// Whether edit predictions are enabled in the assistant prompt editor.
|
||||
/// This has no effect if globally disabled.
|
||||
pub enabled_in_text_threads: Option<bool>,
|
||||
@@ -130,6 +134,20 @@ pub struct CopilotSettingsContent {
|
||||
pub enterprise_uri: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema, MergeFrom, PartialEq)]
|
||||
pub struct CodestralSettingsContent {
|
||||
/// Model to use for completions.
|
||||
///
|
||||
/// Default: "codestral-latest"
|
||||
#[serde(default)]
|
||||
pub model: Option<String>,
|
||||
/// Maximum tokens to generate.
|
||||
///
|
||||
/// Default: 150
|
||||
#[serde(default)]
|
||||
pub max_tokens: Option<u32>,
|
||||
}
|
||||
|
||||
/// The mode in which edit predictions should be displayed.
|
||||
#[derive(
|
||||
Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize, JsonSchema, MergeFrom,
|
||||
|
||||
Reference in New Issue
Block a user