Skip to content

Commit 3969dea

Browse files
SachaMorardclaude
andcommitted
chore: remove agentic compressor support
The agentic compression model and its per-request CompressionConfiguration (rate, semantic_preservation_threshold) are no longer offered by the gateway. Drop the struct, builder, body serialization, and example/test references so the SDK only exposes the supported compression models. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6a61bea commit 3969dea

3 files changed

Lines changed: 7 additions & 51 deletions

File tree

examples/compression.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! This example includes a large context in the user message to demonstrate meaningful
1010
//! compression savings.
1111
12-
use edgee::{CompressionConfiguration, Edgee, InputObject, Message};
12+
use edgee::{Edgee, InputObject, Message};
1313

1414
// Large context document to demonstrate input compression
1515
const LARGE_CONTEXT: &str = r#"
@@ -82,11 +82,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
8282

8383
// Create input with compression settings using builder pattern
8484
let input = InputObject::new(vec![Message::user(user_message)])
85-
.with_compression_model("agentic")
86-
.with_compression_configuration(CompressionConfiguration {
87-
rate: Some(0.5),
88-
semantic_preservation_threshold: None,
89-
});
85+
.with_compression_model("claude");
9086

9187
let response = client.send("anthropic/claude-haiku-4-5", input).await?;
9288

src/client.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ struct ParsedInput {
4848
tool_choice: Option<serde_json::Value>,
4949
tags: Option<Vec<String>>,
5050
compression_model: Option<String>,
51-
compression_configuration: Option<CompressionConfiguration>,
5251
}
5352

5453
/// Main client for interacting with the Edgee AI Gateway
@@ -122,9 +121,6 @@ impl Edgee {
122121
if let Some(compression_model) = &parsed.compression_model {
123122
body["compression_model"] = json!(compression_model);
124123
}
125-
if let Some(config) = &parsed.compression_configuration {
126-
body["compression_configuration"] = json!(config);
127-
}
128124

129125
let response = self
130126
.client
@@ -201,9 +197,6 @@ impl Edgee {
201197
if let Some(compression_model) = &parsed.compression_model {
202198
body["compression_model"] = json!(compression_model);
203199
}
204-
if let Some(config) = &parsed.compression_configuration {
205-
body["compression_configuration"] = json!(config);
206-
}
207200

208201
let response = self
209202
.client
@@ -285,15 +278,13 @@ impl Edgee {
285278
tool_choice: None,
286279
tags: None,
287280
compression_model: None,
288-
compression_configuration: None,
289281
},
290282
Input::Object(obj) => ParsedInput {
291283
messages: obj.messages,
292284
tools: obj.tools,
293285
tool_choice: obj.tool_choice,
294286
tags: obj.tags,
295287
compression_model: obj.compression_model,
296-
compression_configuration: obj.compression_configuration,
297288
},
298289
}
299290
}

src/models.rs

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -183,18 +183,6 @@ pub enum ToolChoice {
183183
},
184184
}
185185

186-
/// Configuration for the compression model.
187-
/// Only relevant for the `agentic` compression model.
188-
#[derive(Debug, Clone, Serialize, Deserialize)]
189-
pub struct CompressionConfiguration {
190-
/// Compression rate (0.0-1.0). Defaults to 0.8 when not specified.
191-
#[serde(skip_serializing_if = "Option::is_none")]
192-
pub rate: Option<f64>,
193-
/// Semantic preservation threshold (0-100).
194-
#[serde(skip_serializing_if = "Option::is_none")]
195-
pub semantic_preservation_threshold: Option<i32>,
196-
}
197-
198186
/// Input for the chat completion request
199187
#[derive(Debug, Clone, Serialize)]
200188
pub struct InputObject {
@@ -205,16 +193,11 @@ pub struct InputObject {
205193
pub tool_choice: Option<serde_json::Value>,
206194
#[serde(skip_serializing_if = "Option::is_none")]
207195
pub tags: Option<Vec<String>>,
208-
/// Compression model for this request (agentic, claude, opencode, cursor, or customer).
196+
/// Compression model for this request (claude, opencode, cursor, or customer).
209197
/// Only one compression model per request. Each model is a bundle of strategies.
210198
/// This is a gateway-internal field and is never sent to providers.
211199
#[serde(default, skip_serializing)]
212200
pub compression_model: Option<String>,
213-
/// Configuration for the compression model (rate, semantic preservation threshold).
214-
/// Only relevant for the `agentic` compression model.
215-
/// This is a gateway-internal field and is never sent to providers.
216-
#[serde(default, skip_serializing)]
217-
pub compression_configuration: Option<CompressionConfiguration>,
218201
}
219202

220203
impl InputObject {
@@ -226,7 +209,6 @@ impl InputObject {
226209
tool_choice: None,
227210
tags: None,
228211
compression_model: None,
229-
compression_configuration: None,
230212
}
231213
}
232214

@@ -248,17 +230,11 @@ impl InputObject {
248230
self
249231
}
250232

251-
/// Set the compression model for this request (agentic, claude, opencode, cursor, customer)
233+
/// Set the compression model for this request (claude, opencode, cursor, customer)
252234
pub fn with_compression_model(mut self, model: impl Into<String>) -> Self {
253235
self.compression_model = Some(model.into());
254236
self
255237
}
256-
257-
/// Set the compression configuration (only relevant for agentic model)
258-
pub fn with_compression_configuration(mut self, config: CompressionConfiguration) -> Self {
259-
self.compression_configuration = Some(config);
260-
self
261-
}
262238
}
263239

264240
/// Token usage information
@@ -438,15 +414,8 @@ mod tests {
438414
#[test]
439415
fn test_input_object_with_compression_builder() {
440416
let input = InputObject::new(vec![Message::user("Hello")])
441-
.with_compression_model("agentic")
442-
.with_compression_configuration(CompressionConfiguration {
443-
rate: Some(0.5),
444-
semantic_preservation_threshold: Some(60),
445-
});
446-
447-
assert_eq!(input.compression_model, Some("agentic".to_string()));
448-
let config = input.compression_configuration.unwrap();
449-
assert_eq!(config.rate, Some(0.5));
450-
assert_eq!(config.semantic_preservation_threshold, Some(60));
417+
.with_compression_model("claude");
418+
419+
assert_eq!(input.compression_model, Some("claude".to_string()));
451420
}
452421
}

0 commit comments

Comments
 (0)