MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / _shrink

Method _shrink

tests/test_middleware.py:160–163  ·  view source on GitHub ↗
(self, request: APIRequest)

Source from the content-addressed store, hash-verified

158 self.max_tokens = max_tokens
159
160 def _shrink(self, request: APIRequest) -> APIRequest:
161 body = request.json
162 assert isinstance(body, dict)
163 return request.copy(body={**cast("dict[str, object]", body), "max_tokens": self.max_tokens})
164
165 @override
166 def handle(self, request: APIRequest, call_next: CallNext) -> Any:

Callers 2

handleMethod · 0.95
handle_asyncMethod · 0.95

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected