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

Method _append

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

Source from the content-addressed store, hash-verified

134
135class AppendBeta(Middleware):
136 def _append(self, request: APIRequest) -> APIRequest:
137 current = request.headers.get("anthropic-beta")
138 betas = f"{current},middleware-beta" if current else "middleware-beta"
139 return request.copy(headers={**request.headers, "anthropic-beta": betas})
140
141 @override
142 def handle(self, request: APIRequest, call_next: CallNext) -> Any:

Callers 2

handleMethod · 0.95
handle_asyncMethod · 0.95

Calls 2

getMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected