The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
fix: update some links (#33686)
Mason Daugherty09102a634a0c
diff --git a/libs/core/langchain_core/agents.py b/libs/core/langchain_core/agents.pyindex fc4e3eaa12..a4038d1d3f 100644--- a/libs/core/langchain_core/agents.py+++ b/libs/core/langchain_core/agents.py@@ -5,12 +5,10 @@!!! warningNew agents should be built using the- [langgraph library](https://github.com/langchain-ai/langgraph), which provides a+ [`langchain` library](https://pypi.org/project/langchain/), which provides asimpler and more flexible way to define agents.- Please see the- [migration guide](https://python.langchain.com/docs/how_to/migrate_agent/) for- information on how to migrate existing agents to modern langgraph agents.+ See docs on [building agents](https://docs.langchain.com/oss/python/langchain/agents).Agents use language models to choose a sequence of actions to take.diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.pyindex af2438524e..9ca9321965 100644--- a/libs/core/langchain_core/runnables/base.py+++ b/libs/core/langchain_core/runnables/base.py@@ -147,11 +147,11 @@ class Runnable(ABC, Generic[Input, Output]):the `input_schema` property, the `output_schema` property and `config_schema`method.- LCEL and Composition- ====================+ Composition+ ===========++ Runnable objects can be composed together to create chains in a declarative way.- The LangChain Expression Language (LCEL) is a declarative way to compose- `Runnable` objectsinto chains.Any chain constructed this way will automatically have sync, async, batch, andstreaming support.@@ -235,21 +235,21 @@ class Runnable(ABC, Generic[Input, Output]):You can set the global debug flag to True to enable debug output for all chains:- ```python- from langchain_core.globals import set_debug+ ```python+ from langchain_core.globals import set_debug- set_debug(True)- ```+ set_debug(True)+ ```Alternatively, you can pass existing or custom callbacks to any given chain:- ```python- from langchain_core.tracers import ConsoleCallbackHandler+ ```python+ from langchain_core.tracers import ConsoleCallbackHandler- chain.invoke(..., config={"callbacks": [ConsoleCallbackHandler()]})- ```+ chain.invoke(..., config={"callbacks": [ConsoleCallbackHandler()]})+ ```- For a UI (and much more) checkout [LangSmith](https://docs.smith.langchain.com/).+ For a UI (and much more) checkout [LangSmith](https://docs.langchain.com/langsmith/home)."""@@ -3500,7 +3500,7 @@ class RunnableParallel(RunnableSerializable[Input, dict[str, Any]]):Returns a mapping of their outputs.- `RunnableParallel` is one of the two main composition primitives for the LCEL,+ `RunnableParallel` is one of the two main composition primitives,alongside `RunnableSequence`. It invokes `Runnable`s concurrently, providing thesame input to each.diff --git a/libs/core/langchain_core/runnables/configurable.py b/libs/core/langchain_core/runnables/configurable.pyindex 0e877684b6..693c68b7f3 100644--- a/libs/core/langchain_core/runnables/configurable.py+++ b/libs/core/langchain_core/runnables/configurable.py@@ -475,11 +475,11 @@ _enums_for_spec_lock = threading.Lock()class RunnableConfigurableAlternatives(DynamicRunnable[Input, Output]):"""Runnable that can be dynamically configured.- A RunnableConfigurableAlternatives should be initiated using the+ A `RunnableConfigurableAlternatives` should be initiated using the`configurable_alternatives` method of a Runnable or can beinitiated directly as well.- Here is an example of using a RunnableConfigurableAlternatives that uses+ Here is an example of using a `RunnableConfigurableAlternatives` that usesalternative prompts to illustrate its functionality:```python@@ -506,7 +506,7 @@ class RunnableConfigurableAlternatives(DynamicRunnable[Input, Output]):chain.with_config(configurable={"prompt": "poem"}).invoke({"topic": "bears"})```- Equivalently, you can initialize RunnableConfigurableAlternatives directly+ Equivalently, you can initialize `RunnableConfigurableAlternatives` directlyand use in LCEL in the same way:```pythondiff --git a/libs/langchain/langchain_classic/agents/agent_types.py b/libs/langchain/langchain_classic/agents/agent_types.pyindex 073cb62cd3..5bff78f305 100644--- a/libs/langchain/langchain_classic/agents/agent_types.py+++ b/libs/langchain/langchain_classic/agents/agent_types.py@@ -13,10 +13,7 @@ from langchain_classic._api.deprecation import AGENT_DEPRECATION_WARNINGremoval="1.0",)class AgentType(str, Enum):- """An enum for agent types.-- See documentation: https://python.langchain.com/api_reference/langchain/agents/langchain.agents.agent_types.AgentType.html- """+ """An enum for agent types."""ZERO_SHOT_REACT_DESCRIPTION = "zero-shot-react-description""""A zero shot agent that does a reasoning step before acting."""diff --git a/libs/langchain/langchain_classic/chains/openai_functions/extraction.py b/libs/langchain/langchain_classic/chains/openai_functions/extraction.pyindex ce60f7c6b7..5f22248d70 100644--- a/libs/langchain/langchain_classic/chains/openai_functions/extraction.py+++ b/libs/langchain/langchain_classic/chains/openai_functions/extraction.py@@ -50,7 +50,7 @@ Passage:"LangChain has introduced a method called `with_structured_output` that""is available on ChatModels capable of tool calling.""You can read more about the method here: "- "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>. ""Please follow our extraction use case documentation for more guidelines""on how to do information extraction with LLMs.""<https://python.langchain.com/docs/use_cases/extraction/>. "@@ -119,7 +119,7 @@ def create_extraction_chain("LangChain has introduced a method called `with_structured_output` that""is available on ChatModels capable of tool calling.""You can read more about the method here: "- "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>. ""Please follow our extraction use case documentation for more guidelines""on how to do information extraction with LLMs.""<https://python.langchain.com/docs/use_cases/extraction/>. "diff --git a/libs/langchain/langchain_classic/chains/openai_functions/tagging.py b/libs/langchain/langchain_classic/chains/openai_functions/tagging.pyindex 06b286d738..99f84546a9 100644--- a/libs/langchain/langchain_classic/chains/openai_functions/tagging.py+++ b/libs/langchain/langchain_classic/chains/openai_functions/tagging.py@@ -41,7 +41,7 @@ Passage:"See API reference for this function for replacement: <""https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.tagging.create_tagging_chain.html""> You can read more about `with_structured_output` here: "- "<https://python.langchain.com/docs/how_to/structured_output/>. "+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>. ""If you notice other issues, please provide ""feedback here: ""<https://github.com/langchain-ai/langchain/discussions/18154>"@@ -84,7 +84,7 @@ def create_tagging_chain()```- Read more here: https://python.langchain.com/docs/how_to/structured_output/+ Read more here: https://docs.langchain.com/oss/python/langchain/models#structured-outputsArgs:schema: The schema of the entities to extract.@@ -117,7 +117,7 @@ def create_tagging_chain("See API reference for this function for replacement: <""https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic.html""> You can read more about `with_structured_output` here: "- "<https://python.langchain.com/docs/how_to/structured_output/>. "+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>. ""If you notice other issues, please provide ""feedback here: ""<https://github.com/langchain-ai/langchain/discussions/18154>"@@ -160,7 +160,7 @@ def create_tagging_chain_pydantic()```- Read more here: https://python.langchain.com/docs/how_to/structured_output/+ Read more here: https://docs.langchain.com/oss/python/langchain/models#structured-outputsArgs:pydantic_schema: The Pydantic schema of the entities to extract.diff --git a/libs/langchain/langchain_classic/chains/openai_tools/extraction.py b/libs/langchain/langchain_classic/chains/openai_tools/extraction.pyindex d9cc0870dc..cad4467675 100644--- a/libs/langchain/langchain_classic/chains/openai_tools/extraction.py+++ b/libs/langchain/langchain_classic/chains/openai_tools/extraction.py@@ -20,7 +20,7 @@ If a property is not present and is not required in the function parameters, do"LangChain has introduced a method called `with_structured_output` that""is available on ChatModels capable of tool calling.""You can read more about the method here: "- "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>. ""Please follow our extraction use case documentation for more guidelines""on how to do information extraction with LLMs.""<https://python.langchain.com/docs/use_cases/extraction/>. "diff --git a/libs/langchain/langchain_classic/chains/structured_output/base.py b/libs/langchain/langchain_classic/chains/structured_output/base.pyindex 4b72a631ca..69f3ffd00c 100644--- a/libs/langchain/langchain_classic/chains/structured_output/base.py+++ b/libs/langchain/langchain_classic/chains/structured_output/base.py@@ -34,7 +34,7 @@ from pydantic import BaseModel"LangChain has introduced a method called `with_structured_output` that ""is available on ChatModels capable of tool calling. ""You can read more about the method here: "- "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>. "+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>. ""Please follow our extraction use case documentation for more guidelines ""on how to do information extraction with LLMs. ""<https://python.langchain.com/docs/use_cases/extraction/>. "@@ -153,7 +153,7 @@ def create_openai_fn_runnable("LangChain has introduced a method called `with_structured_output` that ""is available on ChatModels capable of tool calling. ""You can read more about the method here: "- "<https://python.langchain.com/docs/modules/model_io/chat/structured_output/>."+ "<https://docs.langchain.com/oss/python/langchain/models#structured-outputs>.""Please follow our extraction use case documentation for more guidelines ""on how to do information extraction with LLMs. ""<https://python.langchain.com/docs/use_cases/extraction/>. "diff --git a/libs/langchain/langchain_classic/smith/evaluation/__init__.py b/libs/langchain/langchain_classic/smith/evaluation/__init__.pyindex d10d6ef03b..755b3c14d1 100644--- a/libs/langchain/langchain_classic/smith/evaluation/__init__.py+++ b/libs/langchain/langchain_classic/smith/evaluation/__init__.py@@ -4,7 +4,7 @@ This module provides utilities for evaluating Chains and other language modelapplications using LangChain evaluators and LangSmith.For more information on the LangSmith API, see the-[LangSmith API documentation](https://docs.smith.langchain.com/docs/).+[LangSmith API documentation](https://docs.langchain.com/langsmith/home).**Example**diff --git a/libs/langchain/tests/unit_tests/agents/test_agent.py b/libs/langchain/tests/unit_tests/agents/test_agent.pyindex 072a3c7faf..8cbcb19856 100644--- a/libs/langchain/tests/unit_tests/agents/test_agent.py+++ b/libs/langchain/tests/unit_tests/agents/test_agent.py@@ -450,7 +450,7 @@ def test_agent_invalid_tool() -> None:async def test_runnable_agent() -> None:- """Simple test to verify that an agent built with LCEL works."""+ """Simple test to verify that an agent built via composition works."""# Will alternate between responding with hello and goodbyeinfinite_cycle = cycle([AIMessage(content="hello world!")])# When streaming GenericFakeChatModel breaks AIMessage into chunks based on spaces