Skip to content

feat: add per-request compression toggles - #18

Merged
KokaKiwi merged 1 commit into
mainfrom
edgee-1640-rework-per-request-compression-headers-brevity-tool-result
Sep 25, 2026
Merged

KokaKiwi merged 1 commit into
mainfrom
edgee-1640-rework-per-request-compression-headers-brevity-tool-result

Conversation

@KokaKiwi

Copy link
Copy Markdown
Member

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

Adds tool_result_trimming, tool_surface_reduction and output_brevity to InputObject (and the dict input), so a caller can switch each compression strategy on or off for one request.

  • Wire format: send, streaming included, sends each field that is set as its X-Edgee-Compression-* header. Unset fields send nothing, so the API key setting applies. With dict input, only real bool values count. None of them go into the request body.
  • Deprecation: setting compression_model now emits a DeprecationWarning. It still works, and the gateway reads any value as "trimming on".

example/compression.py now sends a tool call with a long ls -la result, since tool results are what trimming shortens.

Covered by pytest tests, and checked against a local gateway, where the provider's input token counts moved as expected for each toggle.

Related Issues

Related to EDGEE-1640

@KokaKiwi
KokaKiwi requested a review from a team as a code owner September 25, 2026 15:13
@KokaKiwi
KokaKiwi merged commit ca7ecbf into main Sep 25, 2026
1 check passed
@KokaKiwi
KokaKiwi deleted the edgee-1640-rework-per-request-compression-headers-brevity-tool-result branch September 25, 2026 16:13
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.

2 participants