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

Method _shrink

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

Source from the content-addressed store, hash-verified

159 self.max_tokens = max_tokens
160
161 def _shrink(self, request: APIRequest) -> APIRequest:
162 body = request.json
163 assert isinstance(body, dict)
164 return request.copy(body={**cast("dict[str, object]", body), "max_tokens": self.max_tokens})
165
166 @override
167 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