parent
fbb5628ec6
commit
6c46e1129d
11 changed files with 16 additions and 16 deletions
|
@ -1419,7 +1419,7 @@ impl Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
request.tools = available_tools;
|
request.tools = available_tools;
|
||||||
request.mode = if model.supports_max_mode() {
|
request.mode = if model.supports_burn_mode() {
|
||||||
Some(self.completion_mode.into())
|
Some(self.completion_mode.into())
|
||||||
} else {
|
} else {
|
||||||
Some(CompletionMode::Normal.into())
|
Some(CompletionMode::Normal.into())
|
||||||
|
|
|
@ -2656,7 +2656,7 @@ impl AgentPanel {
|
||||||
this.continue_conversation(window, cx);
|
this.continue_conversation(window, cx);
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.when(model.supports_max_mode(), |this| {
|
.when(model.supports_burn_mode(), |this| {
|
||||||
this.child(
|
this.child(
|
||||||
Button::new("continue-burn-mode", "Continue with Burn Mode")
|
Button::new("continue-burn-mode", "Continue with Burn Mode")
|
||||||
.style(ButtonStyle::Filled)
|
.style(ButtonStyle::Filled)
|
||||||
|
|
|
@ -4,6 +4,7 @@ mod agent_diff;
|
||||||
mod agent_model_selector;
|
mod agent_model_selector;
|
||||||
mod agent_panel;
|
mod agent_panel;
|
||||||
mod buffer_codegen;
|
mod buffer_codegen;
|
||||||
|
mod burn_mode_tooltip;
|
||||||
mod context_picker;
|
mod context_picker;
|
||||||
mod context_server_configuration;
|
mod context_server_configuration;
|
||||||
mod context_strip;
|
mod context_strip;
|
||||||
|
@ -11,7 +12,6 @@ mod debug;
|
||||||
mod inline_assistant;
|
mod inline_assistant;
|
||||||
mod inline_prompt_editor;
|
mod inline_prompt_editor;
|
||||||
mod language_model_selector;
|
mod language_model_selector;
|
||||||
mod max_mode_tooltip;
|
|
||||||
mod message_editor;
|
mod message_editor;
|
||||||
mod profile_selector;
|
mod profile_selector;
|
||||||
mod slash_command;
|
mod slash_command;
|
||||||
|
|
|
@ -575,7 +575,7 @@ impl MessageEditor {
|
||||||
fn render_burn_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
|
fn render_burn_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
|
||||||
let thread = self.thread.read(cx);
|
let thread = self.thread.read(cx);
|
||||||
let model = thread.configured_model();
|
let model = thread.configured_model();
|
||||||
if !model?.model.supports_max_mode() {
|
if !model?.model.supports_burn_mode() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
|
burn_mode_tooltip::MaxModeTooltip,
|
||||||
language_model_selector::{
|
language_model_selector::{
|
||||||
LanguageModelSelector, ToggleModelSelector, language_model_selector,
|
LanguageModelSelector, ToggleModelSelector, language_model_selector,
|
||||||
},
|
},
|
||||||
max_mode_tooltip::MaxModeTooltip,
|
|
||||||
};
|
};
|
||||||
use agent_settings::{AgentSettings, CompletionMode};
|
use agent_settings::{AgentSettings, CompletionMode};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
@ -2075,12 +2075,12 @@ impl TextThreadEditor {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_max_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
|
fn render_burn_mode_toggle(&self, cx: &mut Context<Self>) -> Option<AnyElement> {
|
||||||
let context = self.context().read(cx);
|
let context = self.context().read(cx);
|
||||||
let active_model = LanguageModelRegistry::read_global(cx)
|
let active_model = LanguageModelRegistry::read_global(cx)
|
||||||
.default_model()
|
.default_model()
|
||||||
.map(|default| default.model)?;
|
.map(|default| default.model)?;
|
||||||
if !active_model.supports_max_mode() {
|
if !active_model.supports_burn_mode() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2575,7 +2575,7 @@ impl Render for TextThreadEditor {
|
||||||
};
|
};
|
||||||
|
|
||||||
let language_model_selector = self.language_model_selector_menu_handle.clone();
|
let language_model_selector = self.language_model_selector_menu_handle.clone();
|
||||||
let max_mode_toggle = self.render_max_mode_toggle(cx);
|
let burn_mode_toggle = self.render_burn_mode_toggle(cx);
|
||||||
|
|
||||||
v_flex()
|
v_flex()
|
||||||
.key_context("ContextEditor")
|
.key_context("ContextEditor")
|
||||||
|
@ -2630,7 +2630,7 @@ impl Render for TextThreadEditor {
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_0p5()
|
.gap_0p5()
|
||||||
.child(self.render_inject_context_menu(cx))
|
.child(self.render_inject_context_menu(cx))
|
||||||
.when_some(max_mode_toggle, |this, element| this.child(element)),
|
.when_some(burn_mode_toggle, |this, element| this.child(element)),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
mod agent_notification;
|
mod agent_notification;
|
||||||
mod animated_label;
|
mod animated_label;
|
||||||
|
mod burn_mode_tooltip;
|
||||||
mod context_pill;
|
mod context_pill;
|
||||||
mod max_mode_tooltip;
|
|
||||||
mod onboarding_modal;
|
mod onboarding_modal;
|
||||||
pub mod preview;
|
pub mod preview;
|
||||||
mod upsell;
|
mod upsell;
|
||||||
|
|
||||||
pub use agent_notification::*;
|
pub use agent_notification::*;
|
||||||
pub use animated_label::*;
|
pub use animated_label::*;
|
||||||
|
pub use burn_mode_tooltip::*;
|
||||||
pub use context_pill::*;
|
pub use context_pill::*;
|
||||||
pub use max_mode_tooltip::*;
|
|
||||||
pub use onboarding_modal::*;
|
pub use onboarding_modal::*;
|
||||||
|
|
|
@ -2346,13 +2346,13 @@ impl AssistantContext {
|
||||||
completion_request.messages.push(request_message);
|
completion_request.messages.push(request_message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let supports_max_mode = if let Some(model) = model {
|
let supports_burn_mode = if let Some(model) = model {
|
||||||
model.supports_max_mode()
|
model.supports_burn_mode()
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
if supports_max_mode {
|
if supports_burn_mode {
|
||||||
completion_request.mode = Some(self.completion_mode.into());
|
completion_request.mode = Some(self.completion_mode.into());
|
||||||
}
|
}
|
||||||
completion_request
|
completion_request
|
||||||
|
|
|
@ -294,7 +294,7 @@ pub trait LanguageModel: Send + Sync {
|
||||||
fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool;
|
fn supports_tool_choice(&self, choice: LanguageModelToolChoice) -> bool;
|
||||||
|
|
||||||
/// Returns whether this model supports "burn mode";
|
/// Returns whether this model supports "burn mode";
|
||||||
fn supports_max_mode(&self) -> bool {
|
fn supports_burn_mode(&self) -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -695,7 +695,7 @@ impl LanguageModel for CloudLanguageModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn supports_max_mode(&self) -> bool {
|
fn supports_burn_mode(&self) -> bool {
|
||||||
self.model.supports_max_mode
|
self.model.supports_max_mode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue