Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions crates/anthropic/src/anthropic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,10 @@ pub enum RequestContent {
#[serde(rename = "compaction")]
Compaction {
content: Option<Arc<str>>,
/// Opaque metadata from a prior compaction that must be round-tripped
/// verbatim for Anthropic to recognize the block.
#[serde(default, skip_serializing_if = "Option::is_none")]
encrypted_content: Option<Arc<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
cache_control: Option<CacheControl>,
},
Expand Down Expand Up @@ -679,7 +683,11 @@ pub enum ResponseContent {
input: serde_json::Value,
},
#[serde(rename = "compaction")]
Compaction { content: Option<Arc<str>> },
Compaction {
content: Option<Arc<str>>,
#[serde(default)]
encrypted_content: Option<Arc<str>>,
},
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down Expand Up @@ -932,7 +940,11 @@ pub enum ContentDelta {
#[serde(rename = "input_json_delta")]
InputJsonDelta { partial_json: String },
#[serde(rename = "compaction_delta")]
CompactionDelta { content: Option<Arc<str>> },
CompactionDelta {
content: Option<Arc<str>>,
#[serde(default)]
encrypted_content: Option<Arc<str>>,
},
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down
Loading
Loading