diff --git a/src/anthropic/lib/bedrock/_auth.py b/src/anthropic/lib/bedrock/_auth.py index 0a8b2109d..77e74aa68 100644 --- a/src/anthropic/lib/bedrock/_auth.py +++ b/src/anthropic/lib/bedrock/_auth.py @@ -56,8 +56,9 @@ def get_auth_headers( # The connection header may be stripped by a proxy somewhere, so the receiver # of this message may not see this header, so we remove it from the set of headers # that are signed. + # Note: HTTP/2 requests don't have a Connection header, so we safely remove it only if present. headers = headers.copy() - del headers["connection"] + headers.pop("connection", None) request = AWSRequest(method=method.upper(), url=url, headers=headers, data=data) credentials = session.get_credentials() diff --git a/src/anthropic/lib/tools/_beta_runner.py b/src/anthropic/lib/tools/_beta_runner.py index f466c1534..562e3cf6f 100644 --- a/src/anthropic/lib/tools/_beta_runner.py +++ b/src/anthropic/lib/tools/_beta_runner.py @@ -88,6 +88,8 @@ def set_messages_params( if callable(params): params = params(self._params) self._params = params + self._cached_tool_call_response = None + self._messages_modified = True def append_messages(self, *messages: BetaMessageParam | BetaMessage) -> None: """Add one or more messages to the conversation history.