agent: Add "max mode" toggle (#29549)
This PR adds a "max mode" toggle to the Agent panel, for models that support it. Only visible to folks in the `new-billing` feature flag. Icon is just a placeholder. Release Notes: - N/A
This commit is contained in:
parent
e3c987e2fb
commit
ce93961fe0
14 changed files with 87 additions and 1 deletions
|
@ -240,6 +240,26 @@ pub trait LanguageModel: Send + Sync {
|
|||
/// Whether this model supports tools.
|
||||
fn supports_tools(&self) -> bool;
|
||||
|
||||
/// Returns whether this model supports "max mode";
|
||||
fn supports_max_mode(&self) -> bool {
|
||||
if self.provider_id().0 != ZED_CLOUD_PROVIDER_ID {
|
||||
return false;
|
||||
}
|
||||
|
||||
const MAX_MODE_CAPABLE_MODELS: &[CloudModel] = &[
|
||||
CloudModel::Anthropic(anthropic::Model::Claude3_7Sonnet),
|
||||
CloudModel::Anthropic(anthropic::Model::Claude3_7SonnetThinking),
|
||||
];
|
||||
|
||||
for model in MAX_MODE_CAPABLE_MODELS {
|
||||
if self.id().0 == model.id() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
fn tool_input_format(&self) -> LanguageModelToolSchemaFormat {
|
||||
LanguageModelToolSchemaFormat::JsonSchema
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ use gpui::{
|
|||
use image::{DynamicImage, ImageDecoder, codecs::png::PngEncoder, imageops::resize};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use util::ResultExt;
|
||||
use zed_llm_client::CompletionMode;
|
||||
|
||||
#[derive(Clone, PartialEq, Eq, Serialize, Deserialize, Hash)]
|
||||
pub struct LanguageModelImage {
|
||||
|
@ -252,6 +253,7 @@ pub struct LanguageModelRequestTool {
|
|||
pub struct LanguageModelRequest {
|
||||
pub thread_id: Option<String>,
|
||||
pub prompt_id: Option<String>,
|
||||
pub mode: Option<CompletionMode>,
|
||||
pub messages: Vec<LanguageModelRequestMessage>,
|
||||
pub tools: Vec<LanguageModelRequestTool>,
|
||||
pub stop: Vec<String>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue