Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-langchain-core for 
openSUSE:Factory checked in at 2026-09-12 21:21:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-langchain-core (Old)
 and      /work/SRC/openSUSE:Factory/.python-langchain-core.new.1265 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-langchain-core"

Sat Sep 12 21:21:34 2026 rev:14 rq:1377485 version:1.6.3

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-langchain-core/python-langchain-core.changes  
    2026-09-08 16:54:06.058924255 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-langchain-core.new.1265/python-langchain-core.changes
    2026-09-12 21:25:21.409533875 +0200
@@ -1,0 +2,7 @@
+Sat Sep 12 07:14:19 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 1.6.3:
+  * Allow model name and provider tracing metadata override
+    based on gateway response
+
+-------------------------------------------------------------------

Old:
----
  langchain_core-1.6.2.tar.gz

New:
----
  langchain_core-1.6.3.tar.gz

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

Other differences:
------------------
++++++ python-langchain-core.spec ++++++
--- /var/tmp/diff_new_pack.wXWyt3/_old  2026-09-12 21:25:21.903554610 +0200
+++ /var/tmp/diff_new_pack.wXWyt3/_new  2026-09-12 21:25:21.904554652 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python-langchain-core
-Version:        1.6.2
+Version:        1.6.3
 Release:        0
 Summary:        Building applications with LLMs through composability
 License:        MIT

++++++ langchain_core-1.6.2.tar.gz -> langchain_core-1.6.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_core-1.6.2/PKG-INFO 
new/langchain_core-1.6.3/PKG-INFO
--- old/langchain_core-1.6.2/PKG-INFO   2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/PKG-INFO   2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.5
 Name: langchain-core
-Version: 1.6.2
+Version: 1.6.3
 Summary: Building applications with LLMs through composability
 Project-URL: Homepage, https://docs.langchain.com/
 Project-URL: Documentation, 
https://reference.langchain.com/python/langchain_core/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_core-1.6.2/langchain_core/callbacks/file.py 
new/langchain_core-1.6.3/langchain_core/callbacks/file.py
--- old/langchain_core-1.6.2/langchain_core/callbacks/file.py   2020-02-02 
01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/langchain_core/callbacks/file.py   2020-02-02 
01:00:00.000000000 +0100
@@ -135,7 +135,6 @@
             text: The text to write to the file.
             color: Optional color for the text. Defaults to `self.color`.
             end: String appended after the text.
-            file: Optional file to write to. Defaults to `self.file`.
 
         Raises:
             RuntimeError: If the file is closed or not available.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_core-1.6.2/langchain_core/outputs/chat_generation.py 
new/langchain_core-1.6.3/langchain_core/outputs/chat_generation.py
--- old/langchain_core-1.6.2/langchain_core/outputs/chat_generation.py  
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/langchain_core/outputs/chat_generation.py  
2020-02-02 01:00:00.000000000 +0100
@@ -43,17 +43,7 @@
 
     @model_validator(mode="after")
     def set_text(self) -> Self:
-        """Set the text attribute to be the contents of the message.
-
-        Args:
-            values: The values of the object.
-
-        Returns:
-            The values of the object with the text attribute set.
-
-        Raises:
-            ValueError: If the message is not a string or a list.
-        """
+        """Set the text attribute to be the contents of the message."""
         # Check for legacy blocks with "text" key but no "type" field.
         # Otherwise, delegate to `message.text`.
         if isinstance(self.message.content, list):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_core-1.6.2/langchain_core/tracers/core.py 
new/langchain_core-1.6.3/langchain_core/tracers/core.py
--- old/langchain_core-1.6.2/langchain_core/tracers/core.py     2020-02-02 
01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/langchain_core/tracers/core.py     2020-02-02 
01:00:00.000000000 +0100
@@ -356,6 +356,11 @@
             return
         metadata = run.extra.setdefault("metadata", {})
         metadata[_GATEWAY_RUN_METADATA_KEY] = gateway_metadata
+        # The resolved gateway identity takes precedence over request-time 
metadata.
+        for source, target in (("model", "ls_model_name"), ("provider", 
"ls_provider")):
+            value = gateway_metadata.get(source)
+            if isinstance(value, str) and (value := value.strip()):
+                metadata[target] = value
 
     def _errored_llm_run(
         self, error: BaseException, run_id: UUID, response: LLMResult | None = 
None
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_core-1.6.2/langchain_core/version.py 
new/langchain_core-1.6.3/langchain_core/version.py
--- old/langchain_core-1.6.2/langchain_core/version.py  2020-02-02 
01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/langchain_core/version.py  2020-02-02 
01:00:00.000000000 +0100
@@ -1,3 +1,3 @@
 """Version information for `langchain-core`."""
 
-VERSION = "1.6.2"
+VERSION = "1.6.3"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_core-1.6.2/pyproject.toml 
new/langchain_core-1.6.3/pyproject.toml
--- old/langchain_core-1.6.2/pyproject.toml     2020-02-02 01:00:00.000000000 
+0100
+++ new/langchain_core-1.6.3/pyproject.toml     2020-02-02 01:00:00.000000000 
+0100
@@ -21,7 +21,7 @@
     "Topic :: Software Development :: Libraries :: Python Modules",
 ]
 
-version = "1.6.2"
+version = "1.6.3"
 requires-python = ">=3.10.0,<4.0.0"
 dependencies = [
     "langsmith>=0.3.45,<1.0.0",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_core-1.6.2/tests/unit_tests/test_messages.py 
new/langchain_core-1.6.3/tests/unit_tests/test_messages.py
--- old/langchain_core-1.6.2/tests/unit_tests/test_messages.py  2020-02-02 
01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/tests/unit_tests/test_messages.py  2020-02-02 
01:00:00.000000000 +0100
@@ -3,6 +3,7 @@
 
 import pytest
 
+from langchain_core._api import LangChainDeprecationWarning
 from langchain_core.documents import Document
 from langchain_core.load import dumpd, load
 from langchain_core.messages import (
@@ -1395,34 +1396,40 @@
     )
 
 
+# Calling `.text()` as a method is the deprecated path under test here, so the
+# warning it emits is expected rather than something to fix.
[email protected](
+    r"ignore:Calling \.text\(\) as a method is deprecated:"
+    r"langchain_core._api.deprecation.LangChainDeprecationWarning"
+)
 def test_text_accessor() -> None:
     """Test that `message.text` property and `.text()` method return the same 
value."""
     human_msg = HumanMessage(content="Hello world")
     assert human_msg.text == "Hello world"
-    assert human_msg.text == "Hello world"
-    assert str(human_msg.text) == str(human_msg.text)
+    assert human_msg.text() == "Hello world"
+    assert str(human_msg.text) == str(human_msg.text())
 
     system_msg = SystemMessage(content="You are a helpful assistant")
     assert system_msg.text == "You are a helpful assistant"
-    assert system_msg.text == "You are a helpful assistant"
-    assert str(system_msg.text) == str(system_msg.text)
+    assert system_msg.text() == "You are a helpful assistant"
+    assert str(system_msg.text) == str(system_msg.text())
 
     ai_msg = AIMessage(content="I can help you with that")
     assert ai_msg.text == "I can help you with that"
-    assert ai_msg.text == "I can help you with that"
-    assert str(ai_msg.text) == str(ai_msg.text)
+    assert ai_msg.text() == "I can help you with that"
+    assert str(ai_msg.text) == str(ai_msg.text())
 
     tool_msg = ToolMessage(content="Task completed", tool_call_id="tool_1")
     assert tool_msg.text == "Task completed"
-    assert tool_msg.text == "Task completed"
-    assert str(tool_msg.text) == str(tool_msg.text)
+    assert tool_msg.text() == "Task completed"
+    assert str(tool_msg.text) == str(tool_msg.text())
 
     complex_msg = HumanMessage(
         content=[{"type": "text", "text": "Hello "}, {"type": "text", "text": 
"world"}]
     )
     assert complex_msg.text == "Hello world"
-    assert complex_msg.text == "Hello world"
-    assert str(complex_msg.text) == str(complex_msg.text)
+    assert complex_msg.text() == "Hello world"
+    assert str(complex_msg.text) == str(complex_msg.text())
 
     mixed_msg = AIMessage(
         content=[
@@ -1432,10 +1439,19 @@
         ]
     )
     assert mixed_msg.text == "The answer is 42"
-    assert mixed_msg.text == "The answer is 42"
-    assert str(mixed_msg.text) == str(mixed_msg.text)
+    assert mixed_msg.text() == "The answer is 42"
+    assert str(mixed_msg.text) == str(mixed_msg.text())
 
     empty_msg = HumanMessage(content=[])
     assert empty_msg.text == ""
-    assert empty_msg.text == ""
-    assert str(empty_msg.text) == str(empty_msg.text)
+    assert empty_msg.text() == ""
+    assert str(empty_msg.text) == str(empty_msg.text())
+
+
+def test_text_accessor_deprecation_warning() -> None:
+    """Test that calling `.text()` as a method emits a deprecation warning."""
+    with pytest.warns(
+        LangChainDeprecationWarning,
+        match=r"Calling \.text\(\) as a method is deprecated",
+    ):
+        HumanMessage(content="Hello world").text()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_core-1.6.2/tests/unit_tests/tracers/test_automatic_metadata.py 
new/langchain_core-1.6.3/tests/unit_tests/tracers/test_automatic_metadata.py
--- 
old/langchain_core-1.6.2/tests/unit_tests/tracers/test_automatic_metadata.py    
    2020-02-02 01:00:00.000000000 +0100
+++ 
new/langchain_core-1.6.3/tests/unit_tests/tracers/test_automatic_metadata.py    
    2020-02-02 01:00:00.000000000 +0100
@@ -4,6 +4,8 @@
 
 from unittest.mock import MagicMock
 
+import pytest
+
 from langchain_core.messages import AIMessage
 from langchain_core.messages.tool import ToolCall
 from langchain_core.outputs import ChatGeneration, LLMResult
@@ -189,7 +191,11 @@
 
     completed_run = tracer._complete_llm_run(response=response, run_id=run.id)
 
-    assert completed_run.extra["metadata"]["ls_gateway_info"] == gateway_info
+    assert completed_run.extra["metadata"] == {
+        "ls_gateway_info": gateway_info,
+        "ls_model_name": gateway_info["model"],
+        "ls_provider": gateway_info["provider"],
+    }
 
 
 def test_complete_llm_run_no_gateway_metadata() -> None:
@@ -230,3 +236,87 @@
     )
 
     assert errored_run.extra["metadata"]["ls_gateway_info"] == gateway_info
+
+
[email protected]("errored", [False, True])
[email protected](
+    ("gateway_info", "expected_identity"),
+    [
+        pytest.param(
+            {"model": "resolved-model", "provider": "amazon_bedrock"},
+            {"ls_model_name": "resolved-model", "ls_provider": 
"amazon_bedrock"},
+            id="resolved-identity",
+        ),
+        pytest.param(
+            {"model": "resolved-model", "selected_model": "configured-model"},
+            {"ls_model_name": "resolved-model"},
+            id="model-only",
+        ),
+        pytest.param(
+            {"provider": "amazon_bedrock"},
+            {"ls_provider": "amazon_bedrock"},
+            id="provider-only",
+        ),
+        pytest.param({}, {}, id="empty"),
+        pytest.param({"error": "rate_limit_exceeded"}, {}, id="error-only"),
+        pytest.param({"selected_model": "configured-model"}, {}, 
id="selected-only"),
+        pytest.param({"model": None, "provider": None}, {}, id="null"),
+        pytest.param({"model": "", "provider": ""}, {}, id="empty-strings"),
+        pytest.param({"model": " \t\n", "provider": "\n "}, {}, 
id="whitespace-only"),
+        pytest.param(
+            {"model": " resolved-model\n", "provider": "\tamazon_bedrock "},
+            {"ls_model_name": "resolved-model", "ls_provider": 
"amazon_bedrock"},
+            id="surrounding-whitespace",
+        ),
+        pytest.param({"model": 42, "provider": ["openai"]}, {}, 
id="invalid-types"),
+        pytest.param(
+            {"model": False, "provider": "amazon_bedrock"},
+            {"ls_provider": "amazon_bedrock"},
+            id="invalid-model-valid-provider",
+        ),
+        pytest.param(
+            {"model": "resolved-model", "provider": {}},
+            {"ls_model_name": "resolved-model"},
+            id="valid-model-invalid-provider",
+        ),
+    ],
+)
+def test_gateway_metadata_overrides_request_identity(
+    gateway_info: dict[str, object],
+    expected_identity: dict[str, str],
+    *,
+    errored: bool,
+) -> None:
+    """Only valid returned identity fields override request-time tracing 
metadata."""
+    tracer = MockTracerCore()
+    run = _make_run("test-gateway-identity-run-id")
+    original_metadata = {
+        "ls_model_name": "requested-model",
+        "ls_provider": "openai",
+        "custom": "preserved",
+    }
+    run.extra = {"metadata": original_metadata.copy()}
+    tracer.run_map[str(run.id)] = run
+    response = LLMResult(
+        generations=[
+            [
+                ChatGeneration(
+                    message=AIMessage(content="Test"),
+                    generation_info={GATEWAY_METADATA_RESPONSE_KEY: 
gateway_info},
+                )
+            ]
+        ]
+    )
+
+    if errored:
+        completed_run = tracer._errored_llm_run(
+            error=ValueError("boom"), run_id=run.id, response=response
+        )
+    else:
+        completed_run = tracer._complete_llm_run(response=response, 
run_id=run.id)
+
+    assert completed_run.extra["metadata"] == {
+        **original_metadata,
+        **expected_identity,
+        "ls_gateway_info": gateway_info,
+    }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_core-1.6.2/uv.lock 
new/langchain_core-1.6.3/uv.lock
--- old/langchain_core-1.6.2/uv.lock    2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_core-1.6.3/uv.lock    2020-02-02 01:00:00.000000000 +0100
@@ -1073,7 +1073,7 @@
 
 [[package]]
 name = "langchain-core"
-version = "1.6.2"
+version = "1.6.3"
 source = { editable = "." }
 dependencies = [
     { name = "httpx" },

Reply via email to