agent: Disable thinking when using inline assistant/edit file tool (#34141)
This introduces a new field `thinking_allowed` on `LanguageModelRequest` which lets us control whether thinking should be enabled if the model supports it. We permit thinking in the Inline Assistant, Edit File tool and the Git Commit message generator, this should make generation faster when using a thinking model, e.g. `claude-sonnet-4-thinking` Release Notes: - N/A
This commit is contained in:
parent
96ff6d86a3
commit
41fe2a2ab4
21 changed files with 37 additions and 8 deletions
|
@ -849,6 +849,7 @@ impl LanguageModel for CloudLanguageModel {
|
|||
let use_cloud = cx
|
||||
.update(|cx| cx.has_flag::<ZedCloudFeatureFlag>())
|
||||
.unwrap_or(false);
|
||||
let thinking_allowed = request.thinking_allowed;
|
||||
match self.model.provider {
|
||||
zed_llm_client::LanguageModelProvider::Anthropic => {
|
||||
let request = into_anthropic(
|
||||
|
@ -856,7 +857,7 @@ impl LanguageModel for CloudLanguageModel {
|
|||
self.model.id.to_string(),
|
||||
1.0,
|
||||
self.model.max_output_tokens as u64,
|
||||
if self.model.id.0.ends_with("-thinking") {
|
||||
if thinking_allowed && self.model.id.0.ends_with("-thinking") {
|
||||
AnthropicModelMode::Thinking {
|
||||
budget_tokens: Some(4_096),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue