diff --git a/libs/core/langchain_core/indexing/api.py b/libs/core/langchain_core/indexing/api.py index 860d34f33568b..65d0438163021 100644 --- a/libs/core/langchain_core/indexing/api.py +++ b/libs/core/langchain_core/indexing/api.py @@ -302,6 +302,7 @@ def index( are not able to specify the uid of the document. !!! warning "Behavior changed in `langchain-core` 0.3.25" + Added `scoped_full` cleanup mode. !!! warning @@ -640,6 +641,7 @@ async def aindex( are not able to specify the uid of the document. !!! warning "Behavior changed in `langchain-core` 0.3.25" + Added `scoped_full` cleanup mode. !!! warning diff --git a/libs/core/langchain_core/language_models/_utils.py b/libs/core/langchain_core/language_models/_utils.py index d777425dde6c3..c134e7cd84260 100644 --- a/libs/core/langchain_core/language_models/_utils.py +++ b/libs/core/langchain_core/language_models/_utils.py @@ -140,6 +140,7 @@ def _normalize_messages( - LangChain v0 standard content blocks for backward compatibility !!! warning "Behavior changed in `langchain-core` 1.0.0" + In previous versions, this function returned messages in LangChain v0 format. Now, it returns messages in LangChain v1 format, which upgraded chat models now expect to receive when passing back in message history. For backward diff --git a/libs/core/langchain_core/language_models/chat_models.py b/libs/core/langchain_core/language_models/chat_models.py index bfd37ea58835a..cc50e3cf2c911 100644 --- a/libs/core/langchain_core/language_models/chat_models.py +++ b/libs/core/langchain_core/language_models/chat_models.py @@ -1647,6 +1647,7 @@ class AnswerWithJustification(BaseModel): ``` !!! warning "Behavior changed in `langchain-core` 0.2.26" + Added support for `TypedDict` class. """ # noqa: E501 diff --git a/libs/core/langchain_core/messages/ai.py b/libs/core/langchain_core/messages/ai.py index fb85027b142d9..19b07a44af0b2 100644 --- a/libs/core/langchain_core/messages/ai.py +++ b/libs/core/langchain_core/messages/ai.py @@ -124,9 +124,11 @@ class UsageMetadata(TypedDict): ``` !!! warning "Behavior changed in `langchain-core` 0.3.9" + Added `input_token_details` and `output_token_details`. !!! note "LangSmith SDK" + The LangSmith SDK also has a `UsageMetadata` class. While the two share fields, LangSmith's `UsageMetadata` has additional fields to capture cost information used by the LangSmith platform. diff --git a/libs/core/langchain_core/utils/function_calling.py b/libs/core/langchain_core/utils/function_calling.py index 6fe3e35a61039..18373e3b3b81f 100644 --- a/libs/core/langchain_core/utils/function_calling.py +++ b/libs/core/langchain_core/utils/function_calling.py @@ -353,6 +353,7 @@ def convert_to_openai_function( ValueError: If function is not in a supported format. !!! warning "Behavior changed in `langchain-core` 0.3.16" + `description` and `parameters` keys are now optional. Only `name` is required and guaranteed to be part of the output. """ @@ -477,15 +478,18 @@ def convert_to_openai_tool( OpenAI tool-calling API. !!! warning "Behavior changed in `langchain-core` 0.3.16" + `description` and `parameters` keys are now optional. Only `name` is required and guaranteed to be part of the output. !!! warning "Behavior changed in `langchain-core` 0.3.44" + Return OpenAI Responses API-style tools unchanged. This includes any dict with `"type"` in `"file_search"`, `"function"`, `"computer_use_preview"`, `"web_search_preview"`. !!! warning "Behavior changed in `langchain-core` 0.3.63" + Added support for OpenAI's image generation built-in tool. """ # Import locally to prevent circular import diff --git a/libs/langchain/langchain_classic/chat_models/base.py b/libs/langchain/langchain_classic/chat_models/base.py index 03be5b2718b40..4541294bacbeb 100644 --- a/libs/langchain/langchain_classic/chat_models/base.py +++ b/libs/langchain/langchain_classic/chat_models/base.py @@ -319,9 +319,11 @@ class GetPopulation(BaseModel): ``` !!! warning "Behavior changed in `langchain` 0.2.8" + Support for `configurable_fields` and `config_prefix` added. !!! warning "Behavior changed in `langchain` 0.2.12" + Support for Ollama via langchain-ollama package added (`langchain_ollama.ChatOllama`). Previously, the now-deprecated langchain-community version of Ollama was imported @@ -331,9 +333,11 @@ class GetPopulation(BaseModel): (`model_provider="bedrock_converse"`). !!! warning "Behavior changed in `langchain` 0.3.5" + Out of beta. !!! warning "Behavior changed in `langchain` 0.3.19" + Support for Deepseek, IBM, Nvidia, and xAI models added. """ # noqa: E501 diff --git a/libs/partners/anthropic/langchain_anthropic/chat_models.py b/libs/partners/anthropic/langchain_anthropic/chat_models.py index c4fbd15c711cd..8d5d4e78aa138 100644 --- a/libs/partners/anthropic/langchain_anthropic/chat_models.py +++ b/libs/partners/anthropic/langchain_anthropic/chat_models.py @@ -2487,6 +2487,7 @@ def get_weather(location: str) -> str: ``` !!! warning "Behavior changed in `langchain-anthropic` 0.3.0" + Uses Anthropic's [token counting API](https://docs.claude.com/en/docs/build-with-claude/token-counting) to count tokens in messages. """ # noqa: D214,E501 diff --git a/libs/partners/fireworks/langchain_fireworks/chat_models.py b/libs/partners/fireworks/langchain_fireworks/chat_models.py index c8e3b18dfb2a9..a2fe90a9a0596 100644 --- a/libs/partners/fireworks/langchain_fireworks/chat_models.py +++ b/libs/partners/fireworks/langchain_fireworks/chat_models.py @@ -722,6 +722,7 @@ def with_structured_output( Uses Fireworks's [JSON mode feature](https://docs.fireworks.ai/structured-responses/structured-response-formatting). !!! warning "Behavior changed in `langchain-fireworks` 0.2.8" + Added support for `'json_schema'`. include_raw: diff --git a/libs/partners/groq/langchain_groq/chat_models.py b/libs/partners/groq/langchain_groq/chat_models.py index 9fd02f230b216..ec378629f9140 100644 --- a/libs/partners/groq/langchain_groq/chat_models.py +++ b/libs/partners/groq/langchain_groq/chat_models.py @@ -873,6 +873,7 @@ def with_structured_output( when specifying a Pydantic or `TypedDict` class. !!! warning "Behavior changed in `langchain-groq` 0.3.8" + Added support for Groq's dedicated structured output feature via `method="json_schema"`. diff --git a/libs/partners/mistralai/langchain_mistralai/chat_models.py b/libs/partners/mistralai/langchain_mistralai/chat_models.py index 660c38614c2e5..07f95a74e7996 100644 --- a/libs/partners/mistralai/langchain_mistralai/chat_models.py +++ b/libs/partners/mistralai/langchain_mistralai/chat_models.py @@ -847,6 +847,7 @@ def with_structured_output( desired schema into the model call. !!! warning "Behavior changed in `langchain-mistralai` 0.2.5" + Added method="json_schema" include_raw: diff --git a/libs/partners/ollama/langchain_ollama/chat_models.py b/libs/partners/ollama/langchain_ollama/chat_models.py index 21567e73eca86..fb8901fa8bdd1 100644 --- a/libs/partners/ollama/langchain_ollama/chat_models.py +++ b/libs/partners/ollama/langchain_ollama/chat_models.py @@ -1314,9 +1314,11 @@ def with_structured_output( - `'parsing_error'`: `BaseException | None` !!! warning "Behavior changed in `langchain-ollama` 0.2.2" + Added support for structured output API via `format` parameter. !!! warning "Behavior changed in `langchain-ollama` 0.3.0" + Updated default `method` to `'json_schema'`. ??? note "Example: `schema=Pydantic` class, `method='json_schema'`, `include_raw=False`" diff --git a/libs/partners/openai/langchain_openai/chat_models/azure.py b/libs/partners/openai/langchain_openai/chat_models/azure.py index 183e27fa6816b..7a11f41a3ca0c 100644 --- a/libs/partners/openai/langchain_openai/chat_models/azure.py +++ b/libs/partners/openai/langchain_openai/chat_models/azure.py @@ -960,12 +960,15 @@ def get_weather(location: str) -> str: - `'parsing_error'`: `BaseException | None` !!! warning "Behavior changed in `langchain-openai` 0.3.0" + `method` default changed from "function_calling" to "json_schema". !!! warning "Behavior changed in `langchain-openai` 0.3.12" + Support for `tools` added. !!! warning "Behavior changed in `langchain-openai` 0.3.21" + Pass `kwargs` through to the model. ??? note "Example: `schema=Pydantic` class, `method='json_schema'`, `include_raw=False`, `strict=True`" diff --git a/libs/partners/openai/langchain_openai/chat_models/base.py b/libs/partners/openai/langchain_openai/chat_models/base.py index 0dae21a19c3d4..a6d0fe88f9d11 100644 --- a/libs/partners/openai/langchain_openai/chat_models/base.py +++ b/libs/partners/openai/langchain_openai/chat_models/base.py @@ -560,6 +560,7 @@ async def get_api_key() -> str: !!! version-added "Added in `langchain-openai` 0.3.9" !!! warning "Behavior changed in `langchain-openai` 0.3.35" + Enabled for default base URL and client. """ @@ -790,6 +791,7 @@ async def get_api_key() -> str: - `'v1'`: v1 of LangChain cross-provider standard. !!! warning "Behavior changed in `langchain-openai` 1.0.0" + Default updated to `"responses/v1"`. """ @@ -1987,9 +1989,11 @@ def get_weather(location: str) -> str: - `'parsing_error'`: `BaseException | None` !!! warning "Behavior changed in `langchain-openai` 0.3.12" + Support for `tools` added. !!! warning "Behavior changed in `langchain-openai` 0.3.21" + Pass `kwargs` through to the model. """ if strict is not None and method == "json_mode": @@ -3109,12 +3113,15 @@ def get_weather(location: str) -> str: - `'parsing_error'`: `BaseException | None` !!! warning "Behavior changed in `langchain-openai` 0.3.0" + `method` default changed from `"function_calling"` to `"json_schema"`. !!! warning "Behavior changed in `langchain-openai` 0.3.12" + Support for `tools` added. !!! warning "Behavior changed in `langchain-openai` 0.3.21" + Pass `kwargs` through to the model. ??? note "Example: `schema=Pydantic` class, `method='json_schema'`, `include_raw=False`, `strict=True`" diff --git a/libs/standard-tests/langchain_tests/integration_tests/chat_models.py b/libs/standard-tests/langchain_tests/integration_tests/chat_models.py index fcd34e153a4b2..5b2cf22a2210b 100644 --- a/libs/standard-tests/langchain_tests/integration_tests/chat_models.py +++ b/libs/standard-tests/langchain_tests/integration_tests/chat_models.py @@ -1002,6 +1002,7 @@ def test_usage_metadata(self, model: BaseChatModel) -> None: usage metadata (see configuration below). !!! warning "Behavior changed in `langchain-tests` 0.3.17" + Additionally check for the presence of `model_name` in the response metadata, which is needed for usage tracking in callback handlers. @@ -1176,6 +1177,7 @@ def test_usage_metadata_streaming(self, model: BaseChatModel) -> None: Test to verify that the model returns correct usage metadata in streaming mode. !!! warning "Behavior changed in `langchain-tests` 0.3.17" + Additionally check for the presence of `model_name` in the response metadata, which is needed for usage tracking in callback handlers.