Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

bedrock: DeepSeek does not support receiving Reasoning Blocks (#33326)

Shardul Vaidya4396ac9dd630
diff --git a/crates/language_models/src/provider/bedrock.rs b/crates/language_models/src/provider/bedrock.rs
index e305569ce27..2b2527f1acc 100644
--- a/crates/language_models/src/provider/bedrock.rs
+++ b/crates/language_models/src/provider/bedrock.rs
@@ -631,6 +631,11 @@ pub fn into_bedrock(
}
}
MessageContent::Thinking { text, signature } => {
+ if model.contains(Model::DeepSeekR1.request_id()) {
+ // DeepSeekR1 doesn't support thinking blocks
+ // And the AWS API demands that you strip them
+ return None;
+ }
let thinking = BedrockThinkingTextBlock::builder()
.text(text)
.set_signature(signature)
@@ -643,6 +648,11 @@ pub fn into_bedrock(
))
}
MessageContent::RedactedThinking(blob) => {
+ if model.contains(Model::DeepSeekR1.request_id()) {
+ // DeepSeekR1 doesn't support thinking blocks
+ // And the AWS API demands that you strip them
+ return None;
+ }
let redacted =
BedrockThinkingBlock::RedactedContent(BedrockBlob::new(blob));