Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-langchain-anthropic for 
openSUSE:Factory checked in at 2026-11-27 19:42:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-langchain-anthropic (Old)
 and      /work/SRC/openSUSE:Factory/.python-langchain-anthropic.new.1340718 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-langchain-anthropic"

Fri Nov 27 19:42:07 2026 rev:21 rq:1400964 version:1.7.13

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-langchain-anthropic/python-langchain-anthropic.changes
    2026-11-21 21:49:35.389191923 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-langchain-anthropic.new.1340718/python-langchain-anthropic.changes
       2026-11-27 19:43:57.918188149 +0100
@@ -1,0 +2,11 @@
+Thu Nov 26 18:07:17 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 1.7.13:
+  * ChatAnthropic accepts custom HTTP clients (http_client,
+    http_async_client) and whole SDK clients (client,
+    async_client), e.g. AnthropicBedrock/Vertex variants; the
+    model never closes a passed-in client and conflicting
+    combinations raise an error
+  * Refresh model profile data
+
+-------------------------------------------------------------------

Old:
----
  langchain_anthropic-1.7.12.tar.gz

New:
----
  langchain_anthropic-1.7.13.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-langchain-anthropic.spec ++++++
--- /var/tmp/diff_new_pack.Qt4Ptm/_old  2026-11-27 19:43:58.906229536 +0100
+++ /var/tmp/diff_new_pack.Qt4Ptm/_new  2026-11-27 19:43:58.908229620 +0100
@@ -18,7 +18,7 @@
 
 %{?sle15_python_module_pythons}
 Name:           python-langchain-anthropic
-Version:        1.7.12
+Version:        1.7.13
 Release:        0
 Summary:        Integration package connecting Claude (Anthropic) APIs and 
LangChain
 License:        MIT
@@ -78,7 +78,7 @@
 # sends Authorization: Bearer instead.
 %pytest tests/unit_tests --ignore tests/unit_tests/test_standard.py --ignore 
tests/unit_tests/middleware --deselect 
tests/unit_tests/test_chat_models.py::test_anthropic_stream_events_v3_lifecycle 
--deselect 
tests/unit_tests/test_gateway_headers.py::test_gateway_credentials_survive_nested_revalidation
 
-%files %{python_files}
+%files %python_files
 %doc README.md
 %license LICENSE
 %{python_sitelib}/langchain_anthropic

++++++ langchain_anthropic-1.7.12.tar.gz -> langchain_anthropic-1.7.13.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_anthropic-1.7.12/PKG-INFO 
new/langchain_anthropic-1.7.13/PKG-INFO
--- old/langchain_anthropic-1.7.12/PKG-INFO     2020-02-02 01:00:00.000000000 
+0100
+++ new/langchain_anthropic-1.7.13/PKG-INFO     2020-02-02 01:00:00.000000000 
+0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.5
 Name: langchain-anthropic
-Version: 1.7.12
+Version: 1.7.13
 Summary: Integration package connecting Claude (Anthropic) APIs and LangChain
 Project-URL: Homepage, 
https://docs.langchain.com/oss/python/integrations/providers/anthropic
 Project-URL: Documentation, 
https://reference.langchain.com/python/integrations/langchain_anthropic/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_anthropic-1.7.12/langchain_anthropic/_version.py 
new/langchain_anthropic-1.7.13/langchain_anthropic/_version.py
--- old/langchain_anthropic-1.7.12/langchain_anthropic/_version.py      
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_anthropic-1.7.13/langchain_anthropic/_version.py      
2020-02-02 01:00:00.000000000 +0100
@@ -1,3 +1,3 @@
 """Version information for `langchain-anthropic`."""
 
-__version__ = "1.7.12"
+__version__ = "1.7.13"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_anthropic-1.7.12/langchain_anthropic/chat_models.py 
new/langchain_anthropic-1.7.13/langchain_anthropic/chat_models.py
--- old/langchain_anthropic-1.7.12/langchain_anthropic/chat_models.py   
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_anthropic-1.7.13/langchain_anthropic/chat_models.py   
2020-02-02 01:00:00.000000000 +0100
@@ -1407,6 +1407,33 @@
         )
         ```
 
+    Example: Custom HTTP or SDK clients
+        Pass an HTTP client to change how requests are sent (TLS, transports,
+        per-request auth) while the model keeps its own connection settings. 
Pass
+        an SDK client to take over the connection entirely, for example to call
+        Claude on Bedrock or Vertex AI.
+
+        ```python
+        import anthropic
+        from langchain_anthropic import ChatAnthropic
+
+        # HTTP layer only: base URL, key, timeout and retries still come from 
here.
+        # anthropic.Default(Async)HttpxClient always matches the HTTP library 
the
+        # installed SDK uses (httpx2 for anthropic>=1, httpx before).
+        model = ChatAnthropic(
+            model="claude-sonnet-5-5",
+            http_client=anthropic.DefaultHttpxClient(verify="/path/to/ca.pem"),
+            
http_async_client=anthropic.DefaultAsyncHttpxClient(verify="/path/to/ca.pem"),
+        )
+
+        # Whole SDK client: connection settings come from the client instead.
+        model = ChatAnthropic(
+            model="anthropic.claude-sonnet-5-5",
+            client=anthropic.AnthropicBedrock(aws_region="us-east-1"),
+            
async_client=anthropic.AsyncAnthropicBedrock(aws_region="us-east-1"),
+        )
+        ```
+
     Note:
         Any param which is not explicitly supported will be passed directly to
         
[`Anthropic.messages.create(...)`](https://platform.claude.com/docs/en/api/python/messages/create)
@@ -1477,6 +1504,76 @@
     default_headers: Mapping[str, str] | None = None
     """Headers to pass to the Anthropic clients, will be used for every API 
call."""
 
+    http_client: Any | None = Field(default=None, exclude=True)
+    """HTTP client for sync invocations, passed to the Anthropic SDK as is.
+
+    Use it for custom TLS (`verify=`, CA bundles, mTLS), transports, connection
+    limits, or per-request auth through httpx's `auth=` hook. The model's base 
URL,
+    timeout, retries and headers still apply on top of it.
+
+    The client must come from the HTTP library the installed `anthropic` SDK is
+    built on: `httpx2` for `anthropic>=1`, `httpx` before that. Passing the 
other
+    one raises a `TypeError` from the SDK. Build it with
+    `anthropic.DefaultHttpxClient(...)`, which always matches the installed SDK
+    and keeps its default connection limits:
+
+    ```python
+    import anthropic
+
+    model = ChatAnthropic(
+        model="claude-sonnet-5-5",
+        http_client=anthropic.DefaultHttpxClient(verify="/path/to/ca.pem"),
+    )
+    ```
+
+    Only used for sync invocations; set `http_async_client` for async ones. The
+    model does not close it. Cannot be combined with `anthropic_proxy` (set the
+    proxy on the client instead) or with `client`.
+    """
+
+    http_async_client: Any | None = Field(default=None, exclude=True)
+    """HTTP client for async invocations, passed to the Anthropic SDK as is.
+
+    Same rules as `http_client`. Build it with
+    `anthropic.DefaultAsyncHttpxClient(...)`. Only used for async invocations; 
set
+    `http_client` for sync ones. Cannot be combined with `anthropic_proxy` or 
with
+    `async_client`.
+    """
+
+    client: Any | None = Field(default=None, exclude=True)
+    """Anthropic SDK client for sync invocations, used as is.
+
+    For when the HTTP layer isn't enough: another platform (`AnthropicBedrock`,
+    `AnthropicBedrockMantle`, `AnthropicVertex`, `AnthropicFoundry`), 
credentials
+    the SDK resolves itself, or a client shared with other code. Pass any 
client
+    with the `anthropic.Anthropic` interface.
+
+    The model sends every request through this client, so its own connection
+    settings do not apply: `api_key`, `base_url`, `default_headers`,
+    `default_request_timeout`, `max_retries` and `anthropic_proxy` are ignored,
+    as are the LangSmith gateway headers. Configure those on the client.
+
+    ```python
+    from anthropic import AnthropicBedrock
+
+    model = ChatAnthropic(
+        model="anthropic.claude-sonnet-5-5",
+        client=AnthropicBedrock(aws_region="us-east-1"),
+    )
+    ```
+
+    Only used for sync invocations; set `async_client` for async ones. The 
model
+    does not close it. Cannot be combined with `http_client`.
+    """
+
+    async_client: Any | None = Field(default=None, exclude=True)
+    """Anthropic SDK client for async invocations, used as is.
+
+    Same rules as `client`, for an `anthropic.AsyncAnthropic`-compatible client
+    such as `AsyncAnthropicBedrock`. Only used for async invocations; set 
`client`
+    for sync ones. Cannot be combined with `http_async_client`.
+    """
+
     _langsmith_gateway_headers: dict[str, str] | None = 
PrivateAttr(default=None)
     """Headers from `langsmith_gateway`, sent by the client but never 
serialized."""
 
@@ -1744,6 +1841,34 @@
         return self
 
     @model_validator(mode="after")
+    def _check_custom_clients(self) -> Self:
+        """Reject settings a custom client would silently override."""
+        for sdk_field, http_field in (
+            ("client", "http_client"),
+            ("async_client", "http_async_client"),
+        ):
+            if getattr(self, sdk_field) is not None and (
+                getattr(self, http_field) is not None
+            ):
+                msg = (
+                    f"Cannot specify both '{sdk_field}' and '{http_field}'. 
Pass the "
+                    f"HTTP client to the SDK client instead, e.g. "
+                    f"anthropic.Anthropic(http_client=...)."
+                )
+                raise ValueError(msg)
+        if self.anthropic_proxy and (self.http_client or 
self.http_async_client):
+            msg = (
+                "Cannot specify 'anthropic_proxy' if one of "
+                "'http_client'/'http_async_client' is already specified. 
Configure "
+                "the proxy on the client instead. Received:\n"
+                f"anthropic_proxy={self.anthropic_proxy!r}\n"
+                f"http_client={self.http_client!r}\n"
+                f"http_async_client={self.http_async_client!r}"
+            )
+            raise ValueError(msg)
+        return self
+
+    @model_validator(mode="after")
     def _set_langsmith_gateway_headers(self) -> Self:
         """Keep `langsmith_gateway` headers for the lazily built clients."""
         if self._langsmith_gateway_headers is None:
@@ -1815,7 +1940,11 @@
 
     @cached_property
     def _client(self) -> anthropic.Client:
+        if self.client is not None:
+            return self.client
         client_params = self._client_params
+        if self.http_client is not None:
+            return anthropic.Client(**client_params, 
http_client=self.http_client)
         http_client_params = {"base_url": client_params["base_url"]}
         if "timeout" in client_params:
             http_client_params["timeout"] = client_params["timeout"]
@@ -1830,7 +1959,13 @@
 
     @cached_property
     def _async_client(self) -> anthropic.AsyncClient:
+        if self.async_client is not None:
+            return self.async_client
         client_params = self._client_params
+        if self.http_async_client is not None:
+            return anthropic.AsyncClient(
+                **client_params, http_client=self.http_async_client
+            )
         http_client_params = {"base_url": client_params["base_url"]}
         if "timeout" in client_params:
             http_client_params["timeout"] = client_params["timeout"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_anthropic-1.7.12/langchain_anthropic/data/_profiles.py 
new/langchain_anthropic-1.7.13/langchain_anthropic/data/_profiles.py
--- old/langchain_anthropic-1.7.12/langchain_anthropic/data/_profiles.py        
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_anthropic-1.7.13/langchain_anthropic/data/_profiles.py        
2020-02-02 01:00:00.000000000 +0100
@@ -248,6 +248,7 @@
     },
     "claude-opus-4-5": {
         "name": "Claude Opus 4.5 (latest)",
+        "status": "deprecated",
         "release_date": "2025-11-24",
         "last_updated": "2025-11-24",
         "open_weights": False,
@@ -280,8 +281,9 @@
     },
     "claude-opus-4-5-20251101": {
         "name": "Claude Opus 4.5",
+        "status": "deprecated",
         "release_date": "2025-11-24",
-        "last_updated": "2025-11-01",
+        "last_updated": "2025-11-24",
         "open_weights": False,
         "max_input_tokens": 200000,
         "max_output_tokens": 64000,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_anthropic-1.7.12/pyproject.toml 
new/langchain_anthropic-1.7.13/pyproject.toml
--- old/langchain_anthropic-1.7.12/pyproject.toml       2020-02-02 
01:00:00.000000000 +0100
+++ new/langchain_anthropic-1.7.13/pyproject.toml       2020-02-02 
01:00:00.000000000 +0100
@@ -19,7 +19,7 @@
     "Topic :: Scientific/Engineering :: Artificial Intelligence",
 ]
 
-version = "1.7.12"
+version = "1.7.13"
 requires-python = ">=3.11.0,<4.0.0"
 dependencies = [
     "anthropic>=0.120.0",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_anthropic-1.7.12/tests/unit_tests/test_chat_models.py 
new/langchain_anthropic-1.7.13/tests/unit_tests/test_chat_models.py
--- old/langchain_anthropic-1.7.12/tests/unit_tests/test_chat_models.py 
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_anthropic-1.7.13/tests/unit_tests/test_chat_models.py 
2020-02-02 01:00:00.000000000 +0100
@@ -6808,3 +6808,174 @@
     assert chunk.response_metadata["finish_reason"] == "pause_turn"
     assert chunk.response_metadata["normalized_finish_reason"] == "other"
     assert chunk.response_metadata["finish_state"] == "suspended"
+
+
+# Annotated `Any`: `httpx` here is whichever library the installed SDK is 
built on.
+def _recording_handler(seen: list[Any]) -> Callable[[Any], Any]:
+    def handler(request: Any) -> Any:
+        seen.append(request)
+        return httpx.Response(200, json=_MESSAGE_RESPONSE)
+
+    return handler
+
+
+def _per_request_bearer() -> Callable[[Any], Any]:
+    """Auth that mints a new bearer token per request, like short-lived 
OAuth."""
+    calls = 0
+
+    def auth(request: Any) -> Any:
+        nonlocal calls
+        calls += 1
+        request.headers["Authorization"] = f"Bearer token-{calls}"
+        return request
+
+    return auth
+
+
+def test_http_client_is_used_for_sync_requests() -> None:
+    seen: list[Any] = []
+    llm = ChatAnthropic(
+        model=MODEL_NAME,
+        api_key="sk-placeholder",
+        base_url="https://gateway.example.com";,
+        default_headers={"X-Custom": "1"},
+        max_tokens=10,
+        http_client=httpx.Client(
+            transport=httpx.MockTransport(_recording_handler(seen)),
+            auth=_per_request_bearer(),
+        ),
+    )
+
+    llm.invoke("hi")
+    llm.invoke("hi again")
+
+    assert llm._client._client is llm.http_client
+    assert [r.headers["Authorization"] for r in seen] == [
+        "Bearer token-1",
+        "Bearer token-2",
+    ]
+    # The model's base URL and headers still apply over a custom client.
+    assert seen[0].url.host == "gateway.example.com"
+    assert seen[0].headers["X-Custom"] == "1"
+
+
+async def test_http_async_client_is_used_for_async_requests() -> None:
+    seen: list[Any] = []
+    llm = ChatAnthropic(
+        model=MODEL_NAME,
+        api_key="sk-placeholder",
+        max_tokens=10,
+        http_async_client=httpx.AsyncClient(
+            transport=httpx.MockTransport(_recording_handler(seen)),
+            auth=_per_request_bearer(),
+        ),
+    )
+
+    await llm.ainvoke("hi")
+    await llm.ainvoke("hi again")
+
+    assert llm._async_client._client is llm.http_async_client
+    assert [r.headers["Authorization"] for r in seen] == [
+        "Bearer token-1",
+        "Bearer token-2",
+    ]
+    # The sync path keeps building its own client.
+    assert llm._client._client is not llm.http_async_client
+
+
+def test_http_client_with_anthropic_proxy_raises() -> None:
+    with pytest.raises(ValueError, match="anthropic_proxy"):
+        ChatAnthropic(
+            model=MODEL_NAME,
+            anthropic_proxy="http://proxy.example.com:8080";,
+            http_async_client=httpx.AsyncClient(),
+        )
+
+
+def test_custom_clients_are_not_serialized() -> None:
+    llm = ChatAnthropic(
+        model=MODEL_NAME,
+        http_client=httpx.Client(),
+        http_async_client=httpx.AsyncClient(),
+    )
+    dumped = llm.model_dump()
+    assert "http_client" not in dumped
+    assert "http_async_client" not in dumped
+
+    llm = ChatAnthropic(
+        model=MODEL_NAME,
+        client=anthropic.Client(api_key="sk-placeholder"),
+        async_client=anthropic.AsyncClient(api_key="sk-placeholder"),
+    )
+    dumped = llm.model_dump()
+    assert "client" not in dumped
+    assert "async_client" not in dumped
+
+
+def test_sdk_client_is_used_as_is() -> None:
+    seen: list[Any] = []
+    client = anthropic.Client(
+        api_key="sk-placeholder",
+        base_url="https://bedrock-like.example.com";,
+        default_headers={"X-Client": "sdk"},
+        http_client=httpx.Client(
+            transport=httpx.MockTransport(_recording_handler(seen))
+        ),
+    )
+    llm = ChatAnthropic(
+        model=MODEL_NAME,
+        base_url="https://ignored.example.com";,
+        default_headers={"X-Client": "model"},
+        max_tokens=10,
+        client=client,
+    )
+
+    llm.invoke("hi")
+
+    assert llm._client is client
+    # The client's own connection settings win; the model's are not applied.
+    assert seen[0].url.host == "bedrock-like.example.com"
+    assert seen[0].headers["X-Client"] == "sdk"
+
+
+async def test_async_sdk_client_is_used_as_is() -> None:
+    seen: list[Any] = []
+    async_client = anthropic.AsyncClient(
+        api_key="sk-placeholder",
+        default_headers={"X-Client": "sdk"},
+        http_client=httpx.AsyncClient(
+            transport=httpx.MockTransport(_recording_handler(seen))
+        ),
+    )
+    llm = ChatAnthropic(
+        model=MODEL_NAME,
+        default_headers={"X-Client": "model"},
+        max_tokens=10,
+        async_client=async_client,
+    )
+
+    await llm.ainvoke("hi")
+
+    assert llm._async_client is async_client
+    assert seen[0].headers["X-Client"] == "sdk"
+    # The sync path keeps building its own client.
+    assert llm._client is not async_client
+
+
[email protected](
+    ("sdk_field", "http_field"),
+    [("client", "http_client"), ("async_client", "http_async_client")],
+)
+def test_sdk_client_with_http_client_raises(sdk_field: str, http_field: str) 
-> None:
+    http_client: Any = (
+        httpx.Client() if http_field == "http_client" else httpx.AsyncClient()
+    )
+    sdk_client: Any = (
+        anthropic.Client(api_key="sk-placeholder")
+        if sdk_field == "client"
+        else anthropic.AsyncClient(api_key="sk-placeholder")
+    )
+    with pytest.raises(ValueError, match=f"'{sdk_field}' and '{http_field}'"):
+        ChatAnthropic(
+            model=MODEL_NAME, **{sdk_field: sdk_client, http_field: 
http_client}
+        )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_anthropic-1.7.12/uv.lock 
new/langchain_anthropic-1.7.13/uv.lock
--- old/langchain_anthropic-1.7.12/uv.lock      2020-02-02 01:00:00.000000000 
+0100
+++ new/langchain_anthropic-1.7.13/uv.lock      2020-02-02 01:00:00.000000000 
+0100
@@ -591,7 +591,7 @@
 
 [[package]]
 name = "langchain-anthropic"
-version = "1.7.12"
+version = "1.7.13"
 source = { editable = "." }
 dependencies = [
     { name = "anthropic" },
@@ -742,7 +742,7 @@
 
 [[package]]
 name = "langchain-tests"
-version = "1.1.9"
+version = "1.2.0"
 source = { editable = "../../standard-tests" }
 dependencies = [
     { name = "httpx" },

Reply via email to