Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
test(sdk): update the compress() type assertion for the per-call config option (#3796)
Shubham Srivastavaf88c10df6aa4
diff --git a/sdk/typescript/test/types.test-d.ts b/sdk/typescript/test/types.test-d.tsindex f3094bee0..8b7a47ccb 100644--- a/sdk/typescript/test/types.test-d.ts+++ b/sdk/typescript/test/types.test-d.ts@@ -16,6 +16,7 @@ import type {ProxyCompressResponse,ProxyErrorResponse,} from "../src/types.js";+import type { CompressRequestConfig } from "../src/types/config.js";import {HeadroomError,HeadroomConnectionError,@@ -176,7 +177,10 @@ describe("HeadroomClientInterface", () => {it("compress accepts messages and optional options", () => {expectTypeOf<HeadroomClientInterface["compress"]>().parameters.toEqualTypeOf<- [OpenAIMessage[], ({ model?: string; tokenBudget?: number } | undefined)?]+ [+ OpenAIMessage[],+ ({ model?: string; tokenBudget?: number; config?: CompressRequestConfig } | undefined)?,+ ]>();});});