Skip to content

Conversation

@CLEMENTINATOR
Copy link
Member

Summary

  • Add optional enable_compression: Option<bool> field to InputObject
  • Add optional compression_rate: Option<f64> field to InputObject
  • Add builder methods with_enable_compression() and with_compression_rate()
  • Include fields in request body for both send() and stream() methods
  • Fields are gateway-internal and not serialized to providers (using #[serde(default, skip_serializing)])

Test plan

  • Verify compression fields are included in request body when provided
  • Verify compression fields are omitted when not provided
  • Test builder methods work correctly
  • Test with both send() and stream() methods

🤖 Generated with Claude Code

Add optional enable_compression and compression_rate fields to support
token compression configuration in the AI gateway.

- Add enable_compression (bool) and compression_rate (f64) to InputObject
- Add builder methods with_enable_compression() and with_compression_rate()
- Include fields in both send() and stream() request bodies
- Fields are gateway-internal and not serialized to providers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@CLEMENTINATOR CLEMENTINATOR requested a review from a team as a code owner February 3, 2026 16:40
@SachaMorard
Copy link
Member

@CLEMENTINATOR Do you want to add the compression response field in another PR?

}

/// Enable or disable token compression for this request
pub fn with_enable_compression(mut self, enable: bool) -> Self {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe is more logical to have with_compression instead of with_enable_compression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants