Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-langchain-openai for 
openSUSE:Factory checked in at 2026-10-15 12:21:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-langchain-openai (Old)
 and      /work/SRC/openSUSE:Factory/.python-langchain-openai.new.3698736 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-langchain-openai"

Thu Oct 15 12:21:59 2026 rev:17 rq:1384904 version:1.7.2

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-langchain-openai/python-langchain-openai.changes
  2026-10-09 21:45:30.640639372 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-langchain-openai.new.3698736/python-langchain-openai.changes
     2026-10-15 12:22:04.091908150 +0200
@@ -1,0 +2,12 @@
+Thu Oct 15 04:57:31 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 1.7.2:
+  * Follow the new langchain-core model-profile fields:
+    mid-conversation tool claims gated on the Responses API,
+    Azure profiles drop unverified tool claims, Codex chat
+    disables in-place system/tool support (instructions field)
+  * Fix Responses streaming: pin each item to its first
+    output_index so done events land on the right block
+  * Require langchain-core >= 1.6.10
+
+-------------------------------------------------------------------

Old:
----
  langchain_openai-1.7.0.tar.gz

New:
----
  langchain_openai-1.7.2.tar.gz

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

Other differences:
------------------
++++++ python-langchain-openai.spec ++++++
--- /var/tmp/diff_new_pack.hBfVdJ/_old  2026-10-15 12:22:04.757936019 +0200
+++ /var/tmp/diff_new_pack.hBfVdJ/_new  2026-10-15 12:22:04.759936103 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python-langchain-openai
-Version:        1.7.0
+Version:        1.7.2
 Release:        0
 Summary:        An integration package connecting OpenAI and LangChain
 License:        MIT
@@ -28,7 +28,7 @@
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 Requires:       python-certifi >= 2024.6.2
-Requires:       python-langchain-core >= 1.6.8
+Requires:       python-langchain-core >= 1.6.10
 Requires:       python-openai >= 2.45.0
 Requires:       python-tiktoken >= 0.7.0
 BuildArch:      noarch
@@ -36,7 +36,7 @@
 BuildRequires:  %{python_module certifi >= 2024.6.2}
 BuildRequires:  %{python_module httpx2}
 BuildRequires:  %{python_module httpx}
-BuildRequires:  %{python_module langchain-core >= 1.6.8}
+BuildRequires:  %{python_module langchain-core >= 1.6.10}
 BuildRequires:  %{python_module openai >= 2.45.0}
 BuildRequires:  %{python_module pytest-asyncio}
 BuildRequires:  %{python_module tiktoken >= 0.7.0}

++++++ langchain_openai-1.7.0.tar.gz -> langchain_openai-1.7.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_openai-1.7.0/PKG-INFO 
new/langchain_openai-1.7.2/PKG-INFO
--- old/langchain_openai-1.7.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/PKG-INFO 2020-02-02 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.5
 Name: langchain-openai
-Version: 1.7.0
+Version: 1.7.2
 Summary: An integration package connecting OpenAI and LangChain
 Project-URL: Homepage, 
https://docs.langchain.com/oss/python/integrations/providers/openai
 Project-URL: Documentation, 
https://reference.langchain.com/python/integrations/langchain_openai/
@@ -24,7 +24,7 @@
 Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
 Requires-Python: <4.0.0,>=3.10.0
 Requires-Dist: certifi>=2024.6.2
-Requires-Dist: langchain-core<2.0.0,>=1.6.8
+Requires-Dist: langchain-core<2.0.0,>=1.6.10
 Requires-Dist: openai<4.0.0,>=2.45.0
 Requires-Dist: tiktoken<1.0.0,>=0.7.0
 Provides-Extra: azure-identity
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_openai-1.7.0/langchain_openai/_version.py 
new/langchain_openai-1.7.2/langchain_openai/_version.py
--- old/langchain_openai-1.7.0/langchain_openai/_version.py     2020-02-02 
01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/langchain_openai/_version.py     2020-02-02 
01:00:00.000000000 +0100
@@ -1,3 +1,3 @@
 """Version information for `langchain-openai`."""
 
-__version__ = "1.7.0"
+__version__ = "1.7.2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/langchain_openai/chat_models/azure.py 
new/langchain_openai-1.7.2/langchain_openai/chat_models/azure.py
--- old/langchain_openai-1.7.0/langchain_openai/chat_models/azure.py    
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/langchain_openai/chat_models/azure.py    
2020-02-02 01:00:00.000000000 +0100
@@ -759,13 +759,16 @@
         return self
 
     def _resolve_model_profile(self) -> ModelProfile | None:
-        if (self.model_name is not None) and (
-            profile := _get_default_model_profile(self.model_name) or None
-        ):
-            return profile
-        if self.deployment_name is not None:
-            return _get_default_model_profile(self.deployment_name) or None
-        return None
+        profile: ModelProfile | None = None
+        if self.model_name is not None:
+            profile = _get_default_model_profile(self.model_name) or None
+        if profile is None and self.deployment_name is not None:
+            profile = _get_default_model_profile(self.deployment_name) or None
+        if profile is not None:
+            # The data describes OpenAI's API; `additional_tools` is unverified
+            # on Azure's, so make no claim either way.
+            profile.pop("mid_conversation_tools", None)
+        return profile
 
     @property
     def _identifying_params(self) -> dict[str, Any]:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/langchain_openai/chat_models/base.py 
new/langchain_openai-1.7.2/langchain_openai/chat_models/base.py
--- old/langchain_openai-1.7.0/langchain_openai/chat_models/base.py     
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/langchain_openai/chat_models/base.py     
2020-02-02 01:00:00.000000000 +0100
@@ -1545,7 +1545,16 @@
         return self
 
     def _resolve_model_profile(self) -> ModelProfile | None:
-        return _get_default_model_profile(self.model_name) or None
+        profile = _get_default_model_profile(self.model_name) or None
+        if (
+            profile is not None
+            and profile.get("mid_conversation_tools")
+            and not self._use_responses_api({})
+        ):
+            # Only the Responses API carries an `additional_tools` input item.
+            # Routing that depends on the request can't be claimed up front.
+            profile["mid_conversation_tools"] = False
+        return profile
 
     @property
     def _default_params(self) -> dict[str, Any]:
@@ -1718,6 +1727,7 @@
                 current_output_index = -1
                 current_sub_index = -1
                 has_reasoning = False
+                item_output_indices: dict[str, int] = {}
                 for chunk in response:
                     metadata = headers if is_first_chunk else {}
                     (
@@ -1734,6 +1744,7 @@
                         metadata=metadata,
                         has_reasoning=has_reasoning,
                         output_version=self.output_version,
+                        item_output_indices=item_output_indices,
                     )
                     if generation_chunk:
                         if is_first_chunk and base_generation_info:
@@ -1788,6 +1799,7 @@
                 current_output_index = -1
                 current_sub_index = -1
                 has_reasoning = False
+                item_output_indices: dict[str, int] = {}
                 async for chunk in _astream_with_chunk_timeout(
                     response,
                     self.stream_chunk_timeout,
@@ -1808,6 +1820,7 @@
                         metadata=metadata,
                         has_reasoning=has_reasoning,
                         output_version=self.output_version,
+                        item_output_indices=item_output_indices,
                     )
                     if generation_chunk:
                         if is_first_chunk and base_generation_info:
@@ -5363,7 +5376,21 @@
     metadata: dict | None = None,
     has_reasoning: bool = False,
     output_version: str | None = None,
+    item_output_indices: dict[str, int] | None = None,  # item id -> 
`output_index`
 ) -> tuple[int, int, int, ChatGenerationChunk | None]:
+    # After several built-in tool calls the API can report a later 
`output_index` on
+    # an item's `done` events than on its `added` event. Pin each item to the 
first
+    # `output_index` seen so its events keep landing on the same content block.
+    item_id = getattr(getattr(chunk, "item", None), "id", None) or getattr(
+        chunk, "item_id", None
+    )
+    if (
+        item_output_indices is not None
+        and item_id is not None
+        and (stream_output_index := getattr(chunk, "output_index", None)) is 
not None
+    ):
+        item_output_indices.setdefault(item_id, stream_output_index)
+
     def _advance(output_idx: int, sub_idx: int | None = None) -> None:
         """Advance indexes tracked during streaming.
 
@@ -5399,6 +5426,8 @@
         the current index accordingly.
         """
         nonlocal current_index, current_output_index, current_sub_index
+        if item_output_indices is not None and item_id in item_output_indices:
+            output_idx = item_output_indices[item_id]
         if sub_idx is None:
             if current_output_index != output_idx:
                 current_index += 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/langchain_openai/chat_models/codex.py 
new/langchain_openai-1.7.2/langchain_openai/chat_models/codex.py
--- old/langchain_openai-1.7.0/langchain_openai/chat_models/codex.py    
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/langchain_openai/chat_models/codex.py    
2020-02-02 01:00:00.000000000 +0100
@@ -37,7 +37,7 @@
     from collections.abc import AsyncIterator
 
     from langchain_core.callbacks import AsyncCallbackManagerForLLMRun
-    from langchain_core.language_models import LanguageModelInput
+    from langchain_core.language_models import LanguageModelInput, ModelProfile
     from langchain_core.outputs import ChatGenerationChunk, ChatResult
 
 
@@ -527,6 +527,15 @@
         params["ls_provider"] = "openai-codex"
         return params
 
+    def _resolve_model_profile(self) -> ModelProfile | None:
+        profile = super()._resolve_model_profile()
+        if profile is not None:
+            # System content is lifted into the string `instructions` field, so
+            # it can neither stay in place nor carry a tool definition.
+            profile["mid_conversation_system_messages"] = False
+            profile["mid_conversation_tools"] = False
+        return profile
+
     @property
     def _llm_type(self) -> str:
         return "openai-codex-chat"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/langchain_openai/data/_profiles.py 
new/langchain_openai-1.7.2/langchain_openai/data/_profiles.py
--- old/langchain_openai-1.7.0/langchain_openai/data/_profiles.py       
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/langchain_openai/data/_profiles.py       
2020-02-02 01:00:00.000000000 +0100
@@ -152,6 +152,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-4.1-mini": {
         "name": "GPT-4.1 mini",
@@ -179,6 +181,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-4.1-nano": {
         "name": "GPT-4.1 nano",
@@ -207,6 +211,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-4o": {
         "name": "GPT-4o",
@@ -376,6 +382,8 @@
             "medium",
             "high",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5-chat-latest": {
         "image_url_inputs": True,
@@ -392,6 +400,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5-codex": {
         "image_url_inputs": True,
@@ -408,6 +418,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5-mini": {
         "name": "GPT-5 Mini",
@@ -441,6 +453,8 @@
             "medium",
             "high",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5-nano": {
         "name": "GPT-5 Nano",
@@ -474,6 +488,8 @@
             "medium",
             "high",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5-pro": {
         "name": "GPT-5 Pro",
@@ -508,6 +524,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.1": {
         "name": "GPT-5.1",
@@ -541,6 +559,8 @@
             "medium",
             "high",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.1-chat-latest": {
         "image_url_inputs": True,
@@ -557,6 +577,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.1-codex": {
         "image_url_inputs": True,
@@ -573,6 +595,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.1-codex-max": {
         "image_url_inputs": True,
@@ -589,6 +613,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.1-codex-mini": {
         "image_url_inputs": True,
@@ -605,6 +631,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.2": {
         "name": "GPT-5.2",
@@ -639,6 +667,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.2-chat-latest": {
         "name": "GPT-5.2 Chat",
@@ -674,6 +704,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.2-codex": {
         "image_url_inputs": True,
@@ -689,6 +721,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.2-pro": {
         "name": "GPT-5.2 Pro",
@@ -723,6 +757,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.3-chat-latest": {
         "name": "GPT-5.3 Chat (latest)",
@@ -751,6 +787,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.3-codex": {
         "name": "GPT-5.3 Codex",
@@ -785,6 +823,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.3-codex-spark": {
         "name": "GPT-5.3 Codex Spark",
@@ -819,6 +859,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.4": {
         "name": "GPT-5.4",
@@ -853,6 +895,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.4-mini": {
         "name": "GPT-5.4 mini",
@@ -887,6 +931,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.4-nano": {
         "name": "GPT-5.4 nano",
@@ -921,6 +967,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.4-pro": {
         "name": "GPT-5.4 Pro",
@@ -955,6 +1003,8 @@
             "high",
             "xhigh",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.5": {
         "name": "GPT-5.5",
@@ -990,6 +1040,8 @@
             "xhigh",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.5-pro": {
         "name": "GPT-5.5 Pro",
@@ -1025,6 +1077,8 @@
             "xhigh",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.6": {
         "name": "GPT-5.6",
@@ -1061,6 +1115,8 @@
             "max",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.6-luna": {
         "name": "GPT-5.6 Luna",
@@ -1097,6 +1153,8 @@
             "max",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.6-sol": {
         "name": "GPT-5.6 Sol",
@@ -1133,6 +1191,8 @@
             "max",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-5.6-terra": {
         "name": "GPT-5.6 Terra",
@@ -1169,6 +1229,8 @@
             "max",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-6-astra": {
         "name": "GPT-6 Astra",
@@ -1203,6 +1265,8 @@
             "xhigh",
             "max",
         ],
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-6-luna": {
         "name": "GPT-6 Luna",
@@ -1239,6 +1303,8 @@
             "max",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-6-sol": {
         "name": "GPT-6 Sol",
@@ -1275,6 +1341,8 @@
             "max",
         ],
         "reasoning_effort_default": "medium",
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-6.1-sol": {
         "name": "GPT-6.1 Sol",
@@ -1302,6 +1370,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "gpt-daybreak-blue-latest": {
         "name": "Daybreak Blue",
@@ -1571,6 +1641,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "o3-mini": {
         "name": "o3-mini",
@@ -1599,6 +1671,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "o3-pro": {
         "name": "o3-pro",
@@ -1626,6 +1700,8 @@
         "image_tool_message": True,
         "tool_choice": True,
         "tool_call_streaming": True,
+        "mid_conversation_system_messages": True,
+        "mid_conversation_tools": True,
     },
     "o4-mini": {
         "name": "o4-mini",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/langchain_openai/data/profile_augmentations.toml 
new/langchain_openai-1.7.2/langchain_openai/data/profile_augmentations.toml
--- old/langchain_openai-1.7.0/langchain_openai/data/profile_augmentations.toml 
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/langchain_openai/data/profile_augmentations.toml 
2020-02-02 01:00:00.000000000 +0100
@@ -17,111 +17,203 @@
 [overrides."gpt-5.1-codex"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.2-pro"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.1-codex-mini"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.2-chat-latest"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.1"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5-nano"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["minimal", "low", "medium", "high"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5-codex"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5-mini"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["minimal", "low", "medium", "high"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.1-codex-max"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5-chat-latest"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["minimal", "low", "medium", "high"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5-pro"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.2"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.1-chat-latest"]
 max_input_tokens = 272000
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.2-codex"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.3-codex"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.3-codex-spark"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.4"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.4-mini"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.4-nano"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.4-pro"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.5"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.5-pro"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.6"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh", "max"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.6-luna"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh", "max"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.6-sol"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh", "max"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-5.6-terra"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh", "max"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-6-astra"]
 reasoning_effort_levels = ["low", "medium", "high", "xhigh", "max"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-6-sol"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh", "max"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
 
 [overrides."gpt-6-luna"]
 reasoning_effort_levels = ["none", "low", "medium", "high", "xhigh", "max"]
 reasoning_effort_default = "medium"
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."gpt-4.1"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."gpt-4.1-mini"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."gpt-4.1-nano"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."gpt-5.3-chat-latest"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."gpt-6.1-sol"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."o3"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."o3-mini"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
+
+[overrides."o3-pro"]
+mid_conversation_system_messages = true
+mid_conversation_tools = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_openai-1.7.0/pyproject.toml 
new/langchain_openai-1.7.2/pyproject.toml
--- old/langchain_openai-1.7.0/pyproject.toml   2020-02-02 01:00:00.000000000 
+0100
+++ new/langchain_openai-1.7.2/pyproject.toml   2020-02-02 01:00:00.000000000 
+0100
@@ -20,10 +20,10 @@
     "Topic :: Scientific/Engineering :: Artificial Intelligence",
 ]
 
-version = "1.7.0"
+version = "1.7.2"
 requires-python = ">=3.10.0,<4.0.0"
 dependencies = [
-    "langchain-core>=1.6.8,<2.0.0",
+    "langchain-core>=1.6.10,<2.0.0",
     "certifi>=2024.6.2",
     "openai>=2.45.0,<4.0.0",
     "tiktoken>=0.7.0,<1.0.0",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_azure.py 
new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_azure.py
--- old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_azure.py       
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_azure.py       
2020-02-02 01:00:00.000000000 +0100
@@ -203,6 +203,20 @@
     assert llm.profile["max_input_tokens"] == 
AZURE_PROFILE_TEST_MAX_INPUT_TOKENS
 
 
+def test_profile_does_not_claim_mid_conversation_tools() -> None:
+    """OpenAI's data doesn't cover Azure's Responses API, so no claim is 
made."""
+    llm = AzureChatOpenAI(
+        model=AZURE_PROFILE_TEST_MODEL,
+        azure_endpoint="my-base-url",
+        api_key=SecretStr("test"),
+        api_version="2023-05-15",
+        use_responses_api=True,
+    )
+
+    assert llm.profile
+    assert "mid_conversation_tools" not in llm.profile
+
+
 def test_profile_resolves_from_model_name_with_custom_deployment_alias() -> 
None:
     llm = AzureChatOpenAI(
         model=AZURE_PROFILE_TEST_MODEL,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_base.py 
new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_base.py
--- old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_base.py        
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_base.py        
2020-02-02 01:00:00.000000000 +0100
@@ -221,6 +221,28 @@
     assert "reasoning_effort_default" not in model.profile
 
 
[email protected](
+    ("kwargs", "expected"),
+    [
+        ({"use_responses_api": True}, True),
+        # Routes every request to the Responses API.
+        ({"reasoning": {"effort": "low"}}, True),
+        ({"use_responses_api": False}, False),
+        # Routing is decided per request, so it can't be claimed up front.
+        ({}, False),
+    ],
+)
+def test_profile_mid_conversation_tools_follow_responses_api(
+    kwargs: dict[str, Any], expected: bool
+) -> None:
+    """Only the Responses API carries an `additional_tools` input item."""
+    model = ChatOpenAI(model="gpt-5.6", **kwargs)
+
+    assert model.profile
+    assert model.profile["mid_conversation_tools"] is expected
+    assert model.profile["mid_conversation_system_messages"] is True
+
+
 def test_function_message_dict_to_function_message() -> None:
     content = json.dumps({"result": "Example #1"})
     name = "test_function"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_codex.py 
new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_codex.py
--- old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_codex.py       
2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_codex.py       
2020-02-02 01:00:00.000000000 +0100
@@ -669,6 +669,15 @@
     assert params["ls_provider"] == "openai-codex"
 
 
+def test_profile_declares_no_mid_conversation_capabilities() -> None:
+    """The Codex API takes system text only, as a string `instructions`."""
+    model = _build_model(model="gpt-5.6")
+
+    assert model.profile
+    assert model.profile["mid_conversation_system_messages"] is False
+    assert model.profile["mid_conversation_tools"] is False
+
+
 def test_is_not_serializable_due_to_live_token_provider() -> None:
     assert _ChatOpenAICodex.is_lc_serializable() is False
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_responses_stream.py
 
new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_responses_stream.py
--- 
old/langchain_openai-1.7.0/tests/unit_tests/chat_models/test_responses_stream.py
    2020-02-02 01:00:00.000000000 +0100
+++ 
new/langchain_openai-1.7.2/tests/unit_tests/chat_models/test_responses_stream.py
    2020-02-02 01:00:00.000000000 +0100
@@ -845,6 +845,105 @@
         )
 
 
+_OUTPUT_INDEX_DRIFT_TEXT = '{"news_items": []}'
+
+# `output_index` on the `done` events is one higher than on the `added` events.
+_output_index_drift_stream = [
+    ResponseOutputItemAddedEvent(
+        item=ResponseReasoningItem(
+            id="rs_123", summary=[], type="reasoning", status=None
+        ),
+        output_index=0,
+        sequence_number=1,
+        type="response.output_item.added",
+    ),
+    ResponseOutputItemDoneEvent(
+        item=ResponseReasoningItem(
+            id="rs_123",
+            summary=[],
+            type="reasoning",
+            encrypted_content="encrypted-content",
+            status=None,
+        ),
+        output_index=1,
+        sequence_number=2,
+        type="response.output_item.done",
+    ),
+    ResponseOutputItemAddedEvent(
+        item=ResponseOutputMessage(
+            id="msg_123",
+            content=[],
+            role="assistant",
+            status="in_progress",
+            type="message",
+        ),
+        output_index=1,
+        sequence_number=3,
+        type="response.output_item.added",
+    ),
+    ResponseTextDeltaEvent(
+        content_index=0,
+        delta=_OUTPUT_INDEX_DRIFT_TEXT,
+        item_id="msg_123",
+        output_index=1,
+        sequence_number=4,
+        logprobs=[],
+        type="response.output_text.delta",
+    ),
+    ResponseTextDoneEvent(
+        content_index=0,
+        item_id="msg_123",
+        output_index=2,
+        sequence_number=5,
+        text=_OUTPUT_INDEX_DRIFT_TEXT,
+        logprobs=[],
+        type="response.output_text.done",
+    ),
+]
+
+
+def test_responses_stream_output_index_drift() -> None:
+    llm = ChatOpenAI(model=MODEL, use_responses_api=True, 
output_version="responses/v1")
+    mock_client = MagicMock()
+
+    def mock_create(*args: Any, **kwargs: Any) -> MockSyncContextManager:
+        return MockSyncContextManager(_output_index_drift_stream)
+
+    mock_client.responses.create = mock_create
+
+    full: BaseMessageChunk | None = None
+    with patch.object(llm, "root_client", mock_client):
+        for chunk in llm.stream("test"):
+            full = chunk if full is None else full + chunk
+    assert isinstance(full, AIMessageChunk)
+    assert full.text == _OUTPUT_INDEX_DRIFT_TEXT
+    assert [(block["type"], block["index"]) for block in full.content] == [  # 
type: ignore[index]
+        ("reasoning", 0),
+        ("text", 1),
+    ]
+
+
+async def test_responses_astream_output_index_drift() -> None:
+    llm = ChatOpenAI(model=MODEL, use_responses_api=True, 
output_version="responses/v1")
+    mock_client = MagicMock()
+
+    async def mock_create(*args: Any, **kwargs: Any) -> 
MockAsyncContextManager:
+        return MockAsyncContextManager(_output_index_drift_stream)
+
+    mock_client.responses.create = mock_create
+
+    full: BaseMessageChunk | None = None
+    with patch.object(llm, "root_async_client", mock_client):
+        async for chunk in llm.astream("test"):
+            full = chunk if full is None else full + chunk
+    assert isinstance(full, AIMessageChunk)
+    assert full.text == _OUTPUT_INDEX_DRIFT_TEXT
+    assert [(block["type"], block["index"]) for block in full.content] == [  # 
type: ignore[index]
+        ("reasoning", 0),
+        ("text", 1),
+    ]
+
+
 def test_responses_stream_events_v3_emits_reasoning_lifecycle() -> None:
     """v3 streaming emits `content-block-finish` events for reasoning blocks.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/langchain_openai-1.7.0/uv.lock 
new/langchain_openai-1.7.2/uv.lock
--- old/langchain_openai-1.7.0/uv.lock  2020-02-02 01:00:00.000000000 +0100
+++ new/langchain_openai-1.7.2/uv.lock  2020-02-02 01:00:00.000000000 +0100
@@ -1018,7 +1018,7 @@
 
 [[package]]
 name = "langchain"
-version = "1.4.3"
+version = "1.4.5"
 source = { editable = "../../langchain_v1" }
 dependencies = [
     { name = "langchain-core" },
@@ -1086,7 +1086,7 @@
 
 [[package]]
 name = "langchain-core"
-version = "1.6.7"
+version = "1.6.10"
 source = { editable = "../../core" }
 dependencies = [
     { name = "httpx" },
@@ -1150,7 +1150,7 @@
 
 [[package]]
 name = "langchain-openai"
-version = "1.7.0"
+version = "1.7.2"
 source = { editable = "." }
 dependencies = [
     { name = "certifi" },

Reply via email to