mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-04 20:46:45 +00:00
multiple: pydantic 2 compatibility, v0.3 (#26443)
Signed-off-by: ChengZi <chen.zhang@zilliz.com> Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com> Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> Co-authored-by: Dan O'Donovan <dan.odonovan@gmail.com> Co-authored-by: Tom Daniel Grande <tomdgrande@gmail.com> Co-authored-by: Grande <Tom.Daniel.Grande@statsbygg.no> Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: ccurme <chester.curme@gmail.com> Co-authored-by: Harrison Chase <hw.chase.17@gmail.com> Co-authored-by: Tomaz Bratanic <bratanic.tomaz@gmail.com> Co-authored-by: ZhangShenao <15201440436@163.com> Co-authored-by: Friso H. Kingma <fhkingma@gmail.com> Co-authored-by: ChengZi <chen.zhang@zilliz.com> Co-authored-by: Nuno Campos <nuno@langchain.dev> Co-authored-by: Morgante Pell <morgantep@google.com>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
from importlib import metadata
|
||||
from langchain_cli._version import __version__
|
||||
|
||||
try:
|
||||
__version__ = metadata.version(__package__)
|
||||
except metadata.PackageNotFoundError:
|
||||
# Case where package metadata is not available.
|
||||
__version__ = ""
|
||||
del metadata # optional, avoids polluting the results of dir(__package__)
|
||||
__all__ = [
|
||||
"__version__",
|
||||
]
|
||||
|
10
libs/cli/langchain_cli/_version.py
Normal file
10
libs/cli/langchain_cli/_version.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from importlib import metadata
|
||||
|
||||
try:
|
||||
__version__ = metadata.version(__package__)
|
||||
except metadata.PackageNotFoundError:
|
||||
# Case where package metadata is not available.
|
||||
__version__ = ""
|
||||
del metadata # optional, avoids polluting the results of dir(__package__)
|
||||
|
||||
__all__ = ["__version__"]
|
@@ -1,16 +1,15 @@
|
||||
import importlib
|
||||
from typing import Optional
|
||||
|
||||
import typer
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from langchain_cli._version import __version__
|
||||
from langchain_cli.namespaces import app as app_namespace
|
||||
from langchain_cli.namespaces import integration as integration_namespace
|
||||
from langchain_cli.namespaces import template as template_namespace
|
||||
from langchain_cli.namespaces.migrate import main as migrate_namespace
|
||||
from langchain_cli.utils.packages import get_langserve_export, get_package_root
|
||||
|
||||
__version__ = "0.0.22rc0"
|
||||
|
||||
app = typer.Typer(no_args_is_help=True, add_completion=False)
|
||||
app.add_typer(
|
||||
template_namespace.package_cli, name="template", help=template_namespace.__doc__
|
||||
@@ -22,12 +21,16 @@ app.add_typer(
|
||||
help=integration_namespace.__doc__,
|
||||
)
|
||||
|
||||
|
||||
# If libcst is installed, add the migrate namespace
|
||||
if importlib.util.find_spec("libcst"):
|
||||
from langchain_cli.namespaces.migrate import main as migrate_namespace
|
||||
|
||||
app.add_typer(migrate_namespace.app, name="migrate", help=migrate_namespace.__doc__)
|
||||
app.command(
|
||||
name="migrate",
|
||||
context_settings={
|
||||
# Let Grit handle the arguments
|
||||
"allow_extra_args": True,
|
||||
"ignore_unknown_options": True,
|
||||
},
|
||||
)(
|
||||
migrate_namespace.migrate,
|
||||
)
|
||||
|
||||
|
||||
def version_callback(show_version: bool) -> None:
|
||||
|
@@ -116,7 +116,7 @@ class Chat__ModuleName__(BaseChatModel):
|
||||
Tool calling:
|
||||
.. code-block:: python
|
||||
|
||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
class GetWeather(BaseModel):
|
||||
'''Get the current weather in a given location'''
|
||||
@@ -144,7 +144,7 @@ class Chat__ModuleName__(BaseChatModel):
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from langchain_core.pydantic_v1 import BaseModel, Field
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
class Joke(BaseModel):
|
||||
'''Joke to tell user.'''
|
||||
|
@@ -5,8 +5,8 @@ from typing import Optional, Type
|
||||
from langchain_core.callbacks import (
|
||||
CallbackManagerForToolRun,
|
||||
)
|
||||
from langchain_core.pydantic_v1 import BaseModel
|
||||
from langchain_core.tools import BaseTool
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class __ModuleName__Input(BaseModel):
|
||||
@@ -62,7 +62,7 @@ class __ModuleName__Tool(BaseTool):
|
||||
.. code-block:: python
|
||||
|
||||
# TODO: output of invocation
|
||||
""" # noqa: E501
|
||||
""" # noqa: E501
|
||||
|
||||
# TODO: Set tool name and description
|
||||
name: str = "TODO: Tool name"
|
||||
|
@@ -12,8 +12,8 @@ license = "MIT"
|
||||
"Release Notes" = "https://github.com/langchain-ai/langchain/releases?q=tag%3A%22__package_name_short__%3D%3D0%22&expanded=true"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8.1,<4.0"
|
||||
langchain-core = "^0.2.0"
|
||||
python = ">=3.9,<4.0"
|
||||
langchain-core = "^0.3.0.dev"
|
||||
|
||||
[tool.poetry.group.test]
|
||||
optional = true
|
||||
|
@@ -1,27 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script searches for lines starting with "import pydantic" or "from pydantic"
|
||||
# in tracked files within a Git repository.
|
||||
#
|
||||
# Usage: ./scripts/check_pydantic.sh /path/to/repository
|
||||
|
||||
# Check if a path argument is provided
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 /path/to/repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
repository_path="$1"
|
||||
|
||||
# Search for lines matching the pattern within the specified repository
|
||||
result=$(git -C "$repository_path" grep -E '^import pydantic|^from pydantic')
|
||||
|
||||
# Check if any matching lines were found
|
||||
if [ -n "$result" ]; then
|
||||
echo "ERROR: The following lines need to be updated:"
|
||||
echo "$result"
|
||||
echo "Please replace the code with an import from langchain_core.pydantic_v1."
|
||||
echo "For example, replace 'from pydantic import BaseModel'"
|
||||
echo "with 'from langchain_core.pydantic_v1 import BaseModel'"
|
||||
exit 1
|
||||
fi
|
2
libs/cli/langchain_cli/namespaces/migrate/.grit/.gitignore
vendored
Normal file
2
libs/cli/langchain_cli/namespaces/migrate/.grit/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.gritmodules*
|
||||
*.log
|
@@ -0,0 +1,3 @@
|
||||
version: 0.0.1
|
||||
patterns:
|
||||
- name: github.com/getgrit/stdlib#*
|
@@ -0,0 +1,56 @@
|
||||
# Testing the replace_imports migration
|
||||
|
||||
This runs the v0.2 migration with a desired set of rules.
|
||||
|
||||
```grit
|
||||
language python
|
||||
|
||||
langchain_all_migrations()
|
||||
```
|
||||
|
||||
## Single import
|
||||
|
||||
Before:
|
||||
|
||||
```python
|
||||
from langchain.chat_models import ChatOpenAI
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```python
|
||||
from langchain_community.chat_models import ChatOpenAI
|
||||
```
|
||||
|
||||
## Community to partner
|
||||
|
||||
```python
|
||||
from langchain_community.chat_models import ChatOpenAI
|
||||
```
|
||||
|
||||
```python
|
||||
from langchain_openai import ChatOpenAI
|
||||
```
|
||||
|
||||
## Noop
|
||||
|
||||
This file should not match at all.
|
||||
|
||||
```python
|
||||
from foo import ChatOpenAI
|
||||
```
|
||||
|
||||
## Mixed imports
|
||||
|
||||
```python
|
||||
from langchain_community.chat_models import ChatOpenAI, ChatAnthropic, foo
|
||||
```
|
||||
|
||||
```python
|
||||
from langchain_community.chat_models import foo
|
||||
|
||||
from langchain_openai import ChatOpenAI
|
||||
|
||||
from langchain_anthropic import ChatAnthropic
|
||||
|
||||
```
|
@@ -0,0 +1,15 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_anthropic() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain_community.chat_models.anthropic`, `ChatAnthropic`, `langchain_anthropic`, `ChatAnthropic`],
|
||||
[`langchain_community.llms.anthropic`, `Anthropic`, `langchain_anthropic`, `Anthropic`],
|
||||
[`langchain_community.chat_models`, `ChatAnthropic`, `langchain_anthropic`, `ChatAnthropic`],
|
||||
[`langchain_community.llms`, `Anthropic`, `langchain_anthropic`, `Anthropic`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_anthropic()
|
@@ -0,0 +1,67 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_astradb() {
|
||||
find_replace_imports(list=[
|
||||
|
||||
[
|
||||
`langchain_community.vectorstores.astradb`,
|
||||
`AstraDB`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBVectorStore`
|
||||
]
|
||||
,
|
||||
|
||||
[
|
||||
`langchain_community.storage.astradb`,
|
||||
`AstraDBByteStore`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBByteStore`
|
||||
]
|
||||
,
|
||||
|
||||
[
|
||||
`langchain_community.storage.astradb`,
|
||||
`AstraDBStore`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBStore`
|
||||
]
|
||||
,
|
||||
|
||||
[
|
||||
`langchain_community.cache`,
|
||||
`AstraDBCache`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBCache`
|
||||
]
|
||||
,
|
||||
|
||||
[
|
||||
`langchain_community.cache`,
|
||||
`AstraDBSemanticCache`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBSemanticCache`
|
||||
]
|
||||
,
|
||||
|
||||
[
|
||||
`langchain_community.chat_message_histories.astradb`,
|
||||
`AstraDBChatMessageHistory`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBChatMessageHistory`
|
||||
]
|
||||
,
|
||||
|
||||
[
|
||||
`langchain_community.document_loaders.astradb`,
|
||||
`AstraDBLoader`,
|
||||
`langchain_astradb`,
|
||||
`AstraDBLoader`
|
||||
]
|
||||
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_astradb()
|
@@ -0,0 +1,38 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_community_to_core() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain_community.callbacks.tracers`, `ConsoleCallbackHandler`, `langchain_core.tracers`, `ConsoleCallbackHandler`],
|
||||
[`langchain_community.callbacks.tracers`, `FunctionCallbackHandler`, `langchain_core.tracers.stdout`, `FunctionCallbackHandler`],
|
||||
[`langchain_community.callbacks.tracers`, `LangChainTracer`, `langchain_core.tracers`, `LangChainTracer`],
|
||||
[`langchain_community.callbacks.tracers`, `LangChainTracerV1`, `langchain_core.tracers.langchain_v1`, `LangChainTracerV1`],
|
||||
[`langchain_community.docstore.document`, `Document`, `langchain_core.documents`, `Document`],
|
||||
[`langchain_community.document_loaders`, `Blob`, `langchain_core.document_loaders`, `Blob`],
|
||||
[`langchain_community.document_loaders`, `BlobLoader`, `langchain_core.document_loaders`, `BlobLoader`],
|
||||
[`langchain_community.document_loaders.base`, `BaseBlobParser`, `langchain_core.document_loaders`, `BaseBlobParser`],
|
||||
[`langchain_community.document_loaders.base`, `BaseLoader`, `langchain_core.document_loaders`, `BaseLoader`],
|
||||
[`langchain_community.document_loaders.blob_loaders`, `Blob`, `langchain_core.document_loaders`, `Blob`],
|
||||
[`langchain_community.document_loaders.blob_loaders`, `BlobLoader`, `langchain_core.document_loaders`, `BlobLoader`],
|
||||
[`langchain_community.document_loaders.blob_loaders.schema`, `Blob`, `langchain_core.document_loaders`, `Blob`],
|
||||
[`langchain_community.document_loaders.blob_loaders.schema`, `BlobLoader`, `langchain_core.document_loaders`, `BlobLoader`],
|
||||
[`langchain_community.tools`, `BaseTool`, `langchain_core.tools`, `BaseTool`],
|
||||
[`langchain_community.tools`, `StructuredTool`, `langchain_core.tools`, `StructuredTool`],
|
||||
[`langchain_community.tools`, `Tool`, `langchain_core.tools`, `Tool`],
|
||||
[`langchain_community.tools`, `format_tool_to_openai_function`, `langchain_core.utils.function_calling`, `format_tool_to_openai_function`],
|
||||
[`langchain_community.tools`, `tool`, `langchain_core.tools`, `tool`],
|
||||
[`langchain_community.tools.convert_to_openai`, `format_tool_to_openai_function`, `langchain_core.utils.function_calling`, `format_tool_to_openai_function`],
|
||||
[`langchain_community.tools.convert_to_openai`, `format_tool_to_openai_tool`, `langchain_core.utils.function_calling`, `format_tool_to_openai_tool`],
|
||||
[`langchain_community.tools.render`, `format_tool_to_openai_function`, `langchain_core.utils.function_calling`, `format_tool_to_openai_function`],
|
||||
[`langchain_community.tools.render`, `format_tool_to_openai_tool`, `langchain_core.utils.function_calling`, `format_tool_to_openai_tool`],
|
||||
[`langchain_community.utils.openai_functions`, `FunctionDescription`, `langchain_core.utils.function_calling`, `FunctionDescription`],
|
||||
[`langchain_community.utils.openai_functions`, `ToolDescription`, `langchain_core.utils.function_calling`, `ToolDescription`],
|
||||
[`langchain_community.utils.openai_functions`, `convert_pydantic_to_openai_function`, `langchain_core.utils.function_calling`, `convert_pydantic_to_openai_function`],
|
||||
[`langchain_community.utils.openai_functions`, `convert_pydantic_to_openai_tool`, `langchain_core.utils.function_calling`, `convert_pydantic_to_openai_tool`],
|
||||
[`langchain_community.vectorstores`, `VectorStore`, `langchain_core.vectorstores`, `VectorStore`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_community_to_core()
|
@@ -51,26 +51,17 @@
|
||||
"langchain_community.document_loaders.blob_loaders.schema.BlobLoader",
|
||||
"langchain_core.document_loaders.BlobLoader"
|
||||
],
|
||||
[
|
||||
"langchain_community.tools.BaseTool",
|
||||
"langchain_core.tools.BaseTool"
|
||||
],
|
||||
["langchain_community.tools.BaseTool", "langchain_core.tools.BaseTool"],
|
||||
[
|
||||
"langchain_community.tools.StructuredTool",
|
||||
"langchain_core.tools.StructuredTool"
|
||||
],
|
||||
[
|
||||
"langchain_community.tools.Tool",
|
||||
"langchain_core.tools.Tool"
|
||||
],
|
||||
["langchain_community.tools.Tool", "langchain_core.tools.Tool"],
|
||||
[
|
||||
"langchain_community.tools.format_tool_to_openai_function",
|
||||
"langchain_core.utils.function_calling.format_tool_to_openai_function"
|
||||
],
|
||||
[
|
||||
"langchain_community.tools.tool",
|
||||
"langchain_core.tools.tool"
|
||||
],
|
||||
["langchain_community.tools.tool", "langchain_core.tools.tool"],
|
||||
[
|
||||
"langchain_community.tools.convert_to_openai.format_tool_to_openai_function",
|
||||
"langchain_core.utils.function_calling.format_tool_to_openai_function"
|
||||
@@ -107,4 +98,4 @@
|
||||
"langchain_community.vectorstores.VectorStore",
|
||||
"langchain_core.vectorstores.VectorStore"
|
||||
]
|
||||
]
|
||||
]
|
@@ -0,0 +1,18 @@
|
||||
language python
|
||||
|
||||
pattern langchain_all_migrations() {
|
||||
any {
|
||||
langchain_migrate_community_to_core(),
|
||||
langchain_migrate_fireworks(),
|
||||
langchain_migrate_ibm(),
|
||||
langchain_migrate_langchain_to_core(),
|
||||
langchain_migrate_langchain_to_langchain_community(),
|
||||
langchain_migrate_langchain_to_textsplitters(),
|
||||
langchain_migrate_openai(),
|
||||
langchain_migrate_pinecone(),
|
||||
langchain_migrate_anthropic(),
|
||||
replace_pydantic_v1_shim()
|
||||
}
|
||||
}
|
||||
|
||||
langchain_all_migrations()
|
@@ -0,0 +1,15 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_fireworks() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain_community.chat_models.fireworks`, `ChatFireworks`, `langchain_fireworks`, `ChatFireworks`],
|
||||
[`langchain_community.llms.fireworks`, `Fireworks`, `langchain_fireworks`, `Fireworks`],
|
||||
[`langchain_community.chat_models`, `ChatFireworks`, `langchain_fireworks`, `ChatFireworks`],
|
||||
[`langchain_community.llms`, `Fireworks`, `langchain_fireworks`, `Fireworks`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_fireworks()
|
@@ -0,0 +1,13 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_ibm() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain_community.llms.watsonxllm`, `WatsonxLLM`, `langchain_ibm`, `WatsonxLLM`],
|
||||
[`langchain_community.llms`, `WatsonxLLM`, `langchain_ibm`, `WatsonxLLM`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_ibm()
|
@@ -0,0 +1,542 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_langchain_to_core() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain._api`, `deprecated`, `langchain_core._api`, `deprecated`],
|
||||
[`langchain._api`, `LangChainDeprecationWarning`, `langchain_core._api`, `LangChainDeprecationWarning`],
|
||||
[`langchain._api`, `suppress_langchain_deprecation_warning`, `langchain_core._api`, `suppress_langchain_deprecation_warning`],
|
||||
[`langchain._api`, `surface_langchain_deprecation_warnings`, `langchain_core._api`, `surface_langchain_deprecation_warnings`],
|
||||
[`langchain._api`, `warn_deprecated`, `langchain_core._api`, `warn_deprecated`],
|
||||
[`langchain._api.deprecation`, `LangChainDeprecationWarning`, `langchain_core._api`, `LangChainDeprecationWarning`],
|
||||
[`langchain._api.deprecation`, `LangChainPendingDeprecationWarning`, `langchain_core._api.deprecation`, `LangChainPendingDeprecationWarning`],
|
||||
[`langchain._api.deprecation`, `deprecated`, `langchain_core._api`, `deprecated`],
|
||||
[`langchain._api.deprecation`, `suppress_langchain_deprecation_warning`, `langchain_core._api`, `suppress_langchain_deprecation_warning`],
|
||||
[`langchain._api.deprecation`, `warn_deprecated`, `langchain_core._api`, `warn_deprecated`],
|
||||
[`langchain._api.deprecation`, `surface_langchain_deprecation_warnings`, `langchain_core._api`, `surface_langchain_deprecation_warnings`],
|
||||
[`langchain._api.path`, `get_relative_path`, `langchain_core._api`, `get_relative_path`],
|
||||
[`langchain._api.path`, `as_import_path`, `langchain_core._api`, `as_import_path`],
|
||||
[`langchain.agents`, `Tool`, `langchain_core.tools`, `Tool`],
|
||||
[`langchain.agents`, `tool`, `langchain_core.tools`, `tool`],
|
||||
[`langchain.agents.tools`, `BaseTool`, `langchain_core.tools`, `BaseTool`],
|
||||
[`langchain.agents.tools`, `tool`, `langchain_core.tools`, `tool`],
|
||||
[`langchain.agents.tools`, `Tool`, `langchain_core.tools`, `Tool`],
|
||||
[`langchain.base_language`, `BaseLanguageModel`, `langchain_core.language_models`, `BaseLanguageModel`],
|
||||
[`langchain.callbacks`, `StdOutCallbackHandler`, `langchain_core.callbacks`, `StdOutCallbackHandler`],
|
||||
[`langchain.callbacks`, `StreamingStdOutCallbackHandler`, `langchain_core.callbacks`, `StreamingStdOutCallbackHandler`],
|
||||
[`langchain.callbacks`, `LangChainTracer`, `langchain_core.tracers`, `LangChainTracer`],
|
||||
[`langchain.callbacks`, `tracing_enabled`, `langchain_core.tracers.context`, `tracing_enabled`],
|
||||
[`langchain.callbacks`, `tracing_v2_enabled`, `langchain_core.tracers.context`, `tracing_v2_enabled`],
|
||||
[`langchain.callbacks`, `collect_runs`, `langchain_core.tracers.context`, `collect_runs`],
|
||||
[`langchain.callbacks.base`, `RetrieverManagerMixin`, `langchain_core.callbacks`, `RetrieverManagerMixin`],
|
||||
[`langchain.callbacks.base`, `LLMManagerMixin`, `langchain_core.callbacks`, `LLMManagerMixin`],
|
||||
[`langchain.callbacks.base`, `ChainManagerMixin`, `langchain_core.callbacks`, `ChainManagerMixin`],
|
||||
[`langchain.callbacks.base`, `ToolManagerMixin`, `langchain_core.callbacks`, `ToolManagerMixin`],
|
||||
[`langchain.callbacks.base`, `CallbackManagerMixin`, `langchain_core.callbacks`, `CallbackManagerMixin`],
|
||||
[`langchain.callbacks.base`, `RunManagerMixin`, `langchain_core.callbacks`, `RunManagerMixin`],
|
||||
[`langchain.callbacks.base`, `BaseCallbackHandler`, `langchain_core.callbacks`, `BaseCallbackHandler`],
|
||||
[`langchain.callbacks.base`, `AsyncCallbackHandler`, `langchain_core.callbacks`, `AsyncCallbackHandler`],
|
||||
[`langchain.callbacks.base`, `BaseCallbackManager`, `langchain_core.callbacks`, `BaseCallbackManager`],
|
||||
[`langchain.callbacks.manager`, `BaseRunManager`, `langchain_core.callbacks`, `BaseRunManager`],
|
||||
[`langchain.callbacks.manager`, `RunManager`, `langchain_core.callbacks`, `RunManager`],
|
||||
[`langchain.callbacks.manager`, `ParentRunManager`, `langchain_core.callbacks`, `ParentRunManager`],
|
||||
[`langchain.callbacks.manager`, `AsyncRunManager`, `langchain_core.callbacks`, `AsyncRunManager`],
|
||||
[`langchain.callbacks.manager`, `AsyncParentRunManager`, `langchain_core.callbacks`, `AsyncParentRunManager`],
|
||||
[`langchain.callbacks.manager`, `CallbackManagerForLLMRun`, `langchain_core.callbacks`, `CallbackManagerForLLMRun`],
|
||||
[`langchain.callbacks.manager`, `AsyncCallbackManagerForLLMRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForLLMRun`],
|
||||
[`langchain.callbacks.manager`, `CallbackManagerForChainRun`, `langchain_core.callbacks`, `CallbackManagerForChainRun`],
|
||||
[`langchain.callbacks.manager`, `AsyncCallbackManagerForChainRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForChainRun`],
|
||||
[`langchain.callbacks.manager`, `CallbackManagerForToolRun`, `langchain_core.callbacks`, `CallbackManagerForToolRun`],
|
||||
[`langchain.callbacks.manager`, `AsyncCallbackManagerForToolRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForToolRun`],
|
||||
[`langchain.callbacks.manager`, `CallbackManagerForRetrieverRun`, `langchain_core.callbacks`, `CallbackManagerForRetrieverRun`],
|
||||
[`langchain.callbacks.manager`, `AsyncCallbackManagerForRetrieverRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForRetrieverRun`],
|
||||
[`langchain.callbacks.manager`, `CallbackManager`, `langchain_core.callbacks`, `CallbackManager`],
|
||||
[`langchain.callbacks.manager`, `CallbackManagerForChainGroup`, `langchain_core.callbacks`, `CallbackManagerForChainGroup`],
|
||||
[`langchain.callbacks.manager`, `AsyncCallbackManager`, `langchain_core.callbacks`, `AsyncCallbackManager`],
|
||||
[`langchain.callbacks.manager`, `AsyncCallbackManagerForChainGroup`, `langchain_core.callbacks`, `AsyncCallbackManagerForChainGroup`],
|
||||
[`langchain.callbacks.manager`, `tracing_enabled`, `langchain_core.tracers.context`, `tracing_enabled`],
|
||||
[`langchain.callbacks.manager`, `tracing_v2_enabled`, `langchain_core.tracers.context`, `tracing_v2_enabled`],
|
||||
[`langchain.callbacks.manager`, `collect_runs`, `langchain_core.tracers.context`, `collect_runs`],
|
||||
[`langchain.callbacks.manager`, `atrace_as_chain_group`, `langchain_core.callbacks.manager`, `atrace_as_chain_group`],
|
||||
[`langchain.callbacks.manager`, `trace_as_chain_group`, `langchain_core.callbacks.manager`, `trace_as_chain_group`],
|
||||
[`langchain.callbacks.manager`, `handle_event`, `langchain_core.callbacks.manager`, `handle_event`],
|
||||
[`langchain.callbacks.manager`, `ahandle_event`, `langchain_core.callbacks.manager`, `ahandle_event`],
|
||||
[`langchain.callbacks.manager`, `env_var_is_set`, `langchain_core.utils.env`, `env_var_is_set`],
|
||||
[`langchain.callbacks.stdout`, `StdOutCallbackHandler`, `langchain_core.callbacks`, `StdOutCallbackHandler`],
|
||||
[`langchain.callbacks.streaming_stdout`, `StreamingStdOutCallbackHandler`, `langchain_core.callbacks`, `StreamingStdOutCallbackHandler`],
|
||||
[`langchain.callbacks.tracers`, `ConsoleCallbackHandler`, `langchain_core.tracers`, `ConsoleCallbackHandler`],
|
||||
[`langchain.callbacks.tracers`, `FunctionCallbackHandler`, `langchain_core.tracers.stdout`, `FunctionCallbackHandler`],
|
||||
[`langchain.callbacks.tracers`, `LangChainTracer`, `langchain_core.tracers`, `LangChainTracer`],
|
||||
[`langchain.callbacks.tracers`, `LangChainTracerV1`, `langchain_core.tracers.langchain_v1`, `LangChainTracerV1`],
|
||||
[`langchain.callbacks.tracers.base`, `BaseTracer`, `langchain_core.tracers`, `BaseTracer`],
|
||||
[`langchain.callbacks.tracers.base`, `TracerException`, `langchain_core.exceptions`, `TracerException`],
|
||||
[`langchain.callbacks.tracers.evaluation`, `wait_for_all_evaluators`, `langchain_core.tracers.evaluation`, `wait_for_all_evaluators`],
|
||||
[`langchain.callbacks.tracers.evaluation`, `EvaluatorCallbackHandler`, `langchain_core.tracers`, `EvaluatorCallbackHandler`],
|
||||
[`langchain.callbacks.tracers.langchain`, `LangChainTracer`, `langchain_core.tracers`, `LangChainTracer`],
|
||||
[`langchain.callbacks.tracers.langchain`, `wait_for_all_tracers`, `langchain_core.tracers.langchain`, `wait_for_all_tracers`],
|
||||
[`langchain.callbacks.tracers.langchain_v1`, `LangChainTracerV1`, `langchain_core.tracers.langchain_v1`, `LangChainTracerV1`],
|
||||
[`langchain.callbacks.tracers.log_stream`, `LogEntry`, `langchain_core.tracers.log_stream`, `LogEntry`],
|
||||
[`langchain.callbacks.tracers.log_stream`, `RunState`, `langchain_core.tracers.log_stream`, `RunState`],
|
||||
[`langchain.callbacks.tracers.log_stream`, `RunLog`, `langchain_core.tracers`, `RunLog`],
|
||||
[`langchain.callbacks.tracers.log_stream`, `RunLogPatch`, `langchain_core.tracers`, `RunLogPatch`],
|
||||
[`langchain.callbacks.tracers.log_stream`, `LogStreamCallbackHandler`, `langchain_core.tracers`, `LogStreamCallbackHandler`],
|
||||
[`langchain.callbacks.tracers.root_listeners`, `RootListenersTracer`, `langchain_core.tracers.root_listeners`, `RootListenersTracer`],
|
||||
[`langchain.callbacks.tracers.run_collector`, `RunCollectorCallbackHandler`, `langchain_core.tracers.run_collector`, `RunCollectorCallbackHandler`],
|
||||
[`langchain.callbacks.tracers.schemas`, `BaseRun`, `langchain_core.tracers.schemas`, `BaseRun`],
|
||||
[`langchain.callbacks.tracers.schemas`, `ChainRun`, `langchain_core.tracers.schemas`, `ChainRun`],
|
||||
[`langchain.callbacks.tracers.schemas`, `LLMRun`, `langchain_core.tracers.schemas`, `LLMRun`],
|
||||
[`langchain.callbacks.tracers.schemas`, `Run`, `langchain_core.tracers`, `Run`],
|
||||
[`langchain.callbacks.tracers.schemas`, `RunTypeEnum`, `langchain_core.tracers.schemas`, `RunTypeEnum`],
|
||||
[`langchain.callbacks.tracers.schemas`, `ToolRun`, `langchain_core.tracers.schemas`, `ToolRun`],
|
||||
[`langchain.callbacks.tracers.schemas`, `TracerSession`, `langchain_core.tracers.schemas`, `TracerSession`],
|
||||
[`langchain.callbacks.tracers.schemas`, `TracerSessionBase`, `langchain_core.tracers.schemas`, `TracerSessionBase`],
|
||||
[`langchain.callbacks.tracers.schemas`, `TracerSessionV1`, `langchain_core.tracers.schemas`, `TracerSessionV1`],
|
||||
[`langchain.callbacks.tracers.schemas`, `TracerSessionV1Base`, `langchain_core.tracers.schemas`, `TracerSessionV1Base`],
|
||||
[`langchain.callbacks.tracers.schemas`, `TracerSessionV1Create`, `langchain_core.tracers.schemas`, `TracerSessionV1Create`],
|
||||
[`langchain.callbacks.tracers.stdout`, `FunctionCallbackHandler`, `langchain_core.tracers.stdout`, `FunctionCallbackHandler`],
|
||||
[`langchain.callbacks.tracers.stdout`, `ConsoleCallbackHandler`, `langchain_core.tracers`, `ConsoleCallbackHandler`],
|
||||
[`langchain.chains.openai_functions`, `convert_to_openai_function`, `langchain_core.utils.function_calling`, `convert_to_openai_function`],
|
||||
[`langchain.chains.openai_functions.base`, `convert_to_openai_function`, `langchain_core.utils.function_calling`, `convert_to_openai_function`],
|
||||
[`langchain.chat_models.base`, `BaseChatModel`, `langchain_core.language_models`, `BaseChatModel`],
|
||||
[`langchain.chat_models.base`, `SimpleChatModel`, `langchain_core.language_models`, `SimpleChatModel`],
|
||||
[`langchain.chat_models.base`, `generate_from_stream`, `langchain_core.language_models.chat_models`, `generate_from_stream`],
|
||||
[`langchain.chat_models.base`, `agenerate_from_stream`, `langchain_core.language_models.chat_models`, `agenerate_from_stream`],
|
||||
[`langchain.docstore.document`, `Document`, `langchain_core.documents`, `Document`],
|
||||
[`langchain.document_loaders`, `Blob`, `langchain_core.document_loaders`, `Blob`],
|
||||
[`langchain.document_loaders`, `BlobLoader`, `langchain_core.document_loaders`, `BlobLoader`],
|
||||
[`langchain.document_loaders.base`, `BaseLoader`, `langchain_core.document_loaders`, `BaseLoader`],
|
||||
[`langchain.document_loaders.base`, `BaseBlobParser`, `langchain_core.document_loaders`, `BaseBlobParser`],
|
||||
[`langchain.document_loaders.blob_loaders`, `BlobLoader`, `langchain_core.document_loaders`, `BlobLoader`],
|
||||
[`langchain.document_loaders.blob_loaders`, `Blob`, `langchain_core.document_loaders`, `Blob`],
|
||||
[`langchain.document_loaders.blob_loaders.schema`, `Blob`, `langchain_core.document_loaders`, `Blob`],
|
||||
[`langchain.document_loaders.blob_loaders.schema`, `BlobLoader`, `langchain_core.document_loaders`, `BlobLoader`],
|
||||
[`langchain.embeddings.base`, `Embeddings`, `langchain_core.embeddings`, `Embeddings`],
|
||||
[`langchain.formatting`, `StrictFormatter`, `langchain_core.utils`, `StrictFormatter`],
|
||||
[`langchain.input`, `get_bolded_text`, `langchain_core.utils`, `get_bolded_text`],
|
||||
[`langchain.input`, `get_color_mapping`, `langchain_core.utils`, `get_color_mapping`],
|
||||
[`langchain.input`, `get_colored_text`, `langchain_core.utils`, `get_colored_text`],
|
||||
[`langchain.input`, `print_text`, `langchain_core.utils`, `print_text`],
|
||||
[`langchain.llms.base`, `BaseLanguageModel`, `langchain_core.language_models`, `BaseLanguageModel`],
|
||||
[`langchain.llms.base`, `BaseLLM`, `langchain_core.language_models`, `BaseLLM`],
|
||||
[`langchain.llms.base`, `LLM`, `langchain_core.language_models`, `LLM`],
|
||||
[`langchain.load`, `dumpd`, `langchain_core.load`, `dumpd`],
|
||||
[`langchain.load`, `dumps`, `langchain_core.load`, `dumps`],
|
||||
[`langchain.load`, `load`, `langchain_core.load`, `load`],
|
||||
[`langchain.load`, `loads`, `langchain_core.load`, `loads`],
|
||||
[`langchain.load.dump`, `default`, `langchain_core.load.dump`, `default`],
|
||||
[`langchain.load.dump`, `dumps`, `langchain_core.load`, `dumps`],
|
||||
[`langchain.load.dump`, `dumpd`, `langchain_core.load`, `dumpd`],
|
||||
[`langchain.load.load`, `Reviver`, `langchain_core.load.load`, `Reviver`],
|
||||
[`langchain.load.load`, `loads`, `langchain_core.load`, `loads`],
|
||||
[`langchain.load.load`, `load`, `langchain_core.load`, `load`],
|
||||
[`langchain.load.serializable`, `BaseSerialized`, `langchain_core.load.serializable`, `BaseSerialized`],
|
||||
[`langchain.load.serializable`, `SerializedConstructor`, `langchain_core.load.serializable`, `SerializedConstructor`],
|
||||
[`langchain.load.serializable`, `SerializedSecret`, `langchain_core.load.serializable`, `SerializedSecret`],
|
||||
[`langchain.load.serializable`, `SerializedNotImplemented`, `langchain_core.load.serializable`, `SerializedNotImplemented`],
|
||||
[`langchain.load.serializable`, `try_neq_default`, `langchain_core.load.serializable`, `try_neq_default`],
|
||||
[`langchain.load.serializable`, `Serializable`, `langchain_core.load`, `Serializable`],
|
||||
[`langchain.load.serializable`, `to_json_not_implemented`, `langchain_core.load.serializable`, `to_json_not_implemented`],
|
||||
[`langchain.output_parsers`, `CommaSeparatedListOutputParser`, `langchain_core.output_parsers`, `CommaSeparatedListOutputParser`],
|
||||
[`langchain.output_parsers`, `ListOutputParser`, `langchain_core.output_parsers`, `ListOutputParser`],
|
||||
[`langchain.output_parsers`, `MarkdownListOutputParser`, `langchain_core.output_parsers`, `MarkdownListOutputParser`],
|
||||
[`langchain.output_parsers`, `NumberedListOutputParser`, `langchain_core.output_parsers`, `NumberedListOutputParser`],
|
||||
[`langchain.output_parsers`, `PydanticOutputParser`, `langchain_core.output_parsers`, `PydanticOutputParser`],
|
||||
[`langchain.output_parsers`, `XMLOutputParser`, `langchain_core.output_parsers`, `XMLOutputParser`],
|
||||
[`langchain.output_parsers`, `JsonOutputToolsParser`, `langchain_core.output_parsers.openai_tools`, `JsonOutputToolsParser`],
|
||||
[`langchain.output_parsers`, `PydanticToolsParser`, `langchain_core.output_parsers.openai_tools`, `PydanticToolsParser`],
|
||||
[`langchain.output_parsers`, `JsonOutputKeyToolsParser`, `langchain_core.output_parsers.openai_tools`, `JsonOutputKeyToolsParser`],
|
||||
[`langchain.output_parsers.json`, `SimpleJsonOutputParser`, `langchain_core.output_parsers`, `JsonOutputParser`],
|
||||
[`langchain.output_parsers.json`, `parse_partial_json`, `langchain_core.utils.json`, `parse_partial_json`],
|
||||
[`langchain.output_parsers.json`, `parse_json_markdown`, `langchain_core.utils.json`, `parse_json_markdown`],
|
||||
[`langchain.output_parsers.json`, `parse_and_check_json_markdown`, `langchain_core.utils.json`, `parse_and_check_json_markdown`],
|
||||
[`langchain.output_parsers.list`, `ListOutputParser`, `langchain_core.output_parsers`, `ListOutputParser`],
|
||||
[`langchain.output_parsers.list`, `CommaSeparatedListOutputParser`, `langchain_core.output_parsers`, `CommaSeparatedListOutputParser`],
|
||||
[`langchain.output_parsers.list`, `NumberedListOutputParser`, `langchain_core.output_parsers`, `NumberedListOutputParser`],
|
||||
[`langchain.output_parsers.list`, `MarkdownListOutputParser`, `langchain_core.output_parsers`, `MarkdownListOutputParser`],
|
||||
[`langchain.output_parsers.openai_functions`, `PydanticOutputFunctionsParser`, `langchain_core.output_parsers.openai_functions`, `PydanticOutputFunctionsParser`],
|
||||
[`langchain.output_parsers.openai_functions`, `PydanticAttrOutputFunctionsParser`, `langchain_core.output_parsers.openai_functions`, `PydanticAttrOutputFunctionsParser`],
|
||||
[`langchain.output_parsers.openai_functions`, `JsonOutputFunctionsParser`, `langchain_core.output_parsers.openai_functions`, `JsonOutputFunctionsParser`],
|
||||
[`langchain.output_parsers.openai_functions`, `JsonKeyOutputFunctionsParser`, `langchain_core.output_parsers.openai_functions`, `JsonKeyOutputFunctionsParser`],
|
||||
[`langchain.output_parsers.openai_tools`, `PydanticToolsParser`, `langchain_core.output_parsers.openai_tools`, `PydanticToolsParser`],
|
||||
[`langchain.output_parsers.openai_tools`, `JsonOutputToolsParser`, `langchain_core.output_parsers.openai_tools`, `JsonOutputToolsParser`],
|
||||
[`langchain.output_parsers.openai_tools`, `JsonOutputKeyToolsParser`, `langchain_core.output_parsers.openai_tools`, `JsonOutputKeyToolsParser`],
|
||||
[`langchain.output_parsers.pydantic`, `PydanticOutputParser`, `langchain_core.output_parsers`, `PydanticOutputParser`],
|
||||
[`langchain.output_parsers.xml`, `XMLOutputParser`, `langchain_core.output_parsers`, `XMLOutputParser`],
|
||||
[`langchain.prompts`, `AIMessagePromptTemplate`, `langchain_core.prompts`, `AIMessagePromptTemplate`],
|
||||
[`langchain.prompts`, `BaseChatPromptTemplate`, `langchain_core.prompts`, `BaseChatPromptTemplate`],
|
||||
[`langchain.prompts`, `BasePromptTemplate`, `langchain_core.prompts`, `BasePromptTemplate`],
|
||||
[`langchain.prompts`, `ChatMessagePromptTemplate`, `langchain_core.prompts`, `ChatMessagePromptTemplate`],
|
||||
[`langchain.prompts`, `ChatPromptTemplate`, `langchain_core.prompts`, `ChatPromptTemplate`],
|
||||
[`langchain.prompts`, `FewShotPromptTemplate`, `langchain_core.prompts`, `FewShotPromptTemplate`],
|
||||
[`langchain.prompts`, `FewShotPromptWithTemplates`, `langchain_core.prompts`, `FewShotPromptWithTemplates`],
|
||||
[`langchain.prompts`, `HumanMessagePromptTemplate`, `langchain_core.prompts`, `HumanMessagePromptTemplate`],
|
||||
[`langchain.prompts`, `LengthBasedExampleSelector`, `langchain_core.example_selectors`, `LengthBasedExampleSelector`],
|
||||
[`langchain.prompts`, `MaxMarginalRelevanceExampleSelector`, `langchain_core.example_selectors`, `MaxMarginalRelevanceExampleSelector`],
|
||||
[`langchain.prompts`, `MessagesPlaceholder`, `langchain_core.prompts`, `MessagesPlaceholder`],
|
||||
[`langchain.prompts`, `PipelinePromptTemplate`, `langchain_core.prompts`, `PipelinePromptTemplate`],
|
||||
[`langchain.prompts`, `PromptTemplate`, `langchain_core.prompts`, `PromptTemplate`],
|
||||
[`langchain.prompts`, `SemanticSimilarityExampleSelector`, `langchain_core.example_selectors`, `SemanticSimilarityExampleSelector`],
|
||||
[`langchain.prompts`, `StringPromptTemplate`, `langchain_core.prompts`, `StringPromptTemplate`],
|
||||
[`langchain.prompts`, `SystemMessagePromptTemplate`, `langchain_core.prompts`, `SystemMessagePromptTemplate`],
|
||||
[`langchain.prompts`, `load_prompt`, `langchain_core.prompts`, `load_prompt`],
|
||||
[`langchain.prompts`, `FewShotChatMessagePromptTemplate`, `langchain_core.prompts`, `FewShotChatMessagePromptTemplate`],
|
||||
[`langchain.prompts`, `Prompt`, `langchain_core.prompts`, `PromptTemplate`],
|
||||
[`langchain.prompts.base`, `jinja2_formatter`, `langchain_core.prompts`, `jinja2_formatter`],
|
||||
[`langchain.prompts.base`, `validate_jinja2`, `langchain_core.prompts`, `validate_jinja2`],
|
||||
[`langchain.prompts.base`, `check_valid_template`, `langchain_core.prompts`, `check_valid_template`],
|
||||
[`langchain.prompts.base`, `get_template_variables`, `langchain_core.prompts`, `get_template_variables`],
|
||||
[`langchain.prompts.base`, `StringPromptTemplate`, `langchain_core.prompts`, `StringPromptTemplate`],
|
||||
[`langchain.prompts.base`, `BasePromptTemplate`, `langchain_core.prompts`, `BasePromptTemplate`],
|
||||
[`langchain.prompts.base`, `StringPromptValue`, `langchain_core.prompt_values`, `StringPromptValue`],
|
||||
[`langchain.prompts.base`, `_get_jinja2_variables_from_template`, `langchain_core.prompts.string`, `_get_jinja2_variables_from_template`],
|
||||
[`langchain.prompts.chat`, `BaseMessagePromptTemplate`, `langchain_core.prompts.chat`, `BaseMessagePromptTemplate`],
|
||||
[`langchain.prompts.chat`, `MessagesPlaceholder`, `langchain_core.prompts`, `MessagesPlaceholder`],
|
||||
[`langchain.prompts.chat`, `BaseStringMessagePromptTemplate`, `langchain_core.prompts.chat`, `BaseStringMessagePromptTemplate`],
|
||||
[`langchain.prompts.chat`, `ChatMessagePromptTemplate`, `langchain_core.prompts`, `ChatMessagePromptTemplate`],
|
||||
[`langchain.prompts.chat`, `HumanMessagePromptTemplate`, `langchain_core.prompts`, `HumanMessagePromptTemplate`],
|
||||
[`langchain.prompts.chat`, `AIMessagePromptTemplate`, `langchain_core.prompts`, `AIMessagePromptTemplate`],
|
||||
[`langchain.prompts.chat`, `SystemMessagePromptTemplate`, `langchain_core.prompts`, `SystemMessagePromptTemplate`],
|
||||
[`langchain.prompts.chat`, `BaseChatPromptTemplate`, `langchain_core.prompts`, `BaseChatPromptTemplate`],
|
||||
[`langchain.prompts.chat`, `ChatPromptTemplate`, `langchain_core.prompts`, `ChatPromptTemplate`],
|
||||
[`langchain.prompts.chat`, `ChatPromptValue`, `langchain_core.prompt_values`, `ChatPromptValue`],
|
||||
[`langchain.prompts.chat`, `ChatPromptValueConcrete`, `langchain_core.prompt_values`, `ChatPromptValueConcrete`],
|
||||
[`langchain.prompts.chat`, `_convert_to_message`, `langchain_core.prompts.chat`, `_convert_to_message`],
|
||||
[`langchain.prompts.chat`, `_create_template_from_message_type`, `langchain_core.prompts.chat`, `_create_template_from_message_type`],
|
||||
[`langchain.prompts.example_selector`, `LengthBasedExampleSelector`, `langchain_core.example_selectors`, `LengthBasedExampleSelector`],
|
||||
[`langchain.prompts.example_selector`, `MaxMarginalRelevanceExampleSelector`, `langchain_core.example_selectors`, `MaxMarginalRelevanceExampleSelector`],
|
||||
[`langchain.prompts.example_selector`, `SemanticSimilarityExampleSelector`, `langchain_core.example_selectors`, `SemanticSimilarityExampleSelector`],
|
||||
[`langchain.prompts.example_selector.base`, `BaseExampleSelector`, `langchain_core.example_selectors`, `BaseExampleSelector`],
|
||||
[`langchain.prompts.example_selector.length_based`, `LengthBasedExampleSelector`, `langchain_core.example_selectors`, `LengthBasedExampleSelector`],
|
||||
[`langchain.prompts.example_selector.semantic_similarity`, `sorted_values`, `langchain_core.example_selectors`, `sorted_values`],
|
||||
[`langchain.prompts.example_selector.semantic_similarity`, `SemanticSimilarityExampleSelector`, `langchain_core.example_selectors`, `SemanticSimilarityExampleSelector`],
|
||||
[`langchain.prompts.example_selector.semantic_similarity`, `MaxMarginalRelevanceExampleSelector`, `langchain_core.example_selectors`, `MaxMarginalRelevanceExampleSelector`],
|
||||
[`langchain.prompts.few_shot`, `FewShotPromptTemplate`, `langchain_core.prompts`, `FewShotPromptTemplate`],
|
||||
[`langchain.prompts.few_shot`, `FewShotChatMessagePromptTemplate`, `langchain_core.prompts`, `FewShotChatMessagePromptTemplate`],
|
||||
[`langchain.prompts.few_shot`, `_FewShotPromptTemplateMixin`, `langchain_core.prompts.few_shot`, `_FewShotPromptTemplateMixin`],
|
||||
[`langchain.prompts.few_shot_with_templates`, `FewShotPromptWithTemplates`, `langchain_core.prompts`, `FewShotPromptWithTemplates`],
|
||||
[`langchain.prompts.loading`, `load_prompt_from_config`, `langchain_core.prompts.loading`, `load_prompt_from_config`],
|
||||
[`langchain.prompts.loading`, `load_prompt`, `langchain_core.prompts`, `load_prompt`],
|
||||
[`langchain.prompts.loading`, `try_load_from_hub`, `langchain_core.utils`, `try_load_from_hub`],
|
||||
[`langchain.prompts.loading`, `_load_examples`, `langchain_core.prompts.loading`, `_load_examples`],
|
||||
[`langchain.prompts.loading`, `_load_few_shot_prompt`, `langchain_core.prompts.loading`, `_load_few_shot_prompt`],
|
||||
[`langchain.prompts.loading`, `_load_output_parser`, `langchain_core.prompts.loading`, `_load_output_parser`],
|
||||
[`langchain.prompts.loading`, `_load_prompt`, `langchain_core.prompts.loading`, `_load_prompt`],
|
||||
[`langchain.prompts.loading`, `_load_prompt_from_file`, `langchain_core.prompts.loading`, `_load_prompt_from_file`],
|
||||
[`langchain.prompts.loading`, `_load_template`, `langchain_core.prompts.loading`, `_load_template`],
|
||||
[`langchain.prompts.pipeline`, `PipelinePromptTemplate`, `langchain_core.prompts`, `PipelinePromptTemplate`],
|
||||
[`langchain.prompts.pipeline`, `_get_inputs`, `langchain_core.prompts.pipeline`, `_get_inputs`],
|
||||
[`langchain.prompts.prompt`, `PromptTemplate`, `langchain_core.prompts`, `PromptTemplate`],
|
||||
[`langchain.prompts.prompt`, `Prompt`, `langchain_core.prompts`, `PromptTemplate`],
|
||||
[`langchain.schema`, `BaseCache`, `langchain_core.caches`, `BaseCache`],
|
||||
[`langchain.schema`, `BaseMemory`, `langchain_core.memory`, `BaseMemory`],
|
||||
[`langchain.schema`, `BaseStore`, `langchain_core.stores`, `BaseStore`],
|
||||
[`langchain.schema`, `AgentFinish`, `langchain_core.agents`, `AgentFinish`],
|
||||
[`langchain.schema`, `AgentAction`, `langchain_core.agents`, `AgentAction`],
|
||||
[`langchain.schema`, `Document`, `langchain_core.documents`, `Document`],
|
||||
[`langchain.schema`, `BaseChatMessageHistory`, `langchain_core.chat_history`, `BaseChatMessageHistory`],
|
||||
[`langchain.schema`, `BaseDocumentTransformer`, `langchain_core.documents`, `BaseDocumentTransformer`],
|
||||
[`langchain.schema`, `BaseMessage`, `langchain_core.messages`, `BaseMessage`],
|
||||
[`langchain.schema`, `ChatMessage`, `langchain_core.messages`, `ChatMessage`],
|
||||
[`langchain.schema`, `FunctionMessage`, `langchain_core.messages`, `FunctionMessage`],
|
||||
[`langchain.schema`, `HumanMessage`, `langchain_core.messages`, `HumanMessage`],
|
||||
[`langchain.schema`, `AIMessage`, `langchain_core.messages`, `AIMessage`],
|
||||
[`langchain.schema`, `SystemMessage`, `langchain_core.messages`, `SystemMessage`],
|
||||
[`langchain.schema`, `messages_from_dict`, `langchain_core.messages`, `messages_from_dict`],
|
||||
[`langchain.schema`, `messages_to_dict`, `langchain_core.messages`, `messages_to_dict`],
|
||||
[`langchain.schema`, `message_to_dict`, `langchain_core.messages`, `message_to_dict`],
|
||||
[`langchain.schema`, `_message_to_dict`, `langchain_core.messages`, `message_to_dict`],
|
||||
[`langchain.schema`, `_message_from_dict`, `langchain_core.messages`, `_message_from_dict`],
|
||||
[`langchain.schema`, `get_buffer_string`, `langchain_core.messages`, `get_buffer_string`],
|
||||
[`langchain.schema`, `RunInfo`, `langchain_core.outputs`, `RunInfo`],
|
||||
[`langchain.schema`, `LLMResult`, `langchain_core.outputs`, `LLMResult`],
|
||||
[`langchain.schema`, `ChatResult`, `langchain_core.outputs`, `ChatResult`],
|
||||
[`langchain.schema`, `ChatGeneration`, `langchain_core.outputs`, `ChatGeneration`],
|
||||
[`langchain.schema`, `Generation`, `langchain_core.outputs`, `Generation`],
|
||||
[`langchain.schema`, `PromptValue`, `langchain_core.prompt_values`, `PromptValue`],
|
||||
[`langchain.schema`, `LangChainException`, `langchain_core.exceptions`, `LangChainException`],
|
||||
[`langchain.schema`, `BaseRetriever`, `langchain_core.retrievers`, `BaseRetriever`],
|
||||
[`langchain.schema`, `Memory`, `langchain_core.memory`, `BaseMemory`],
|
||||
[`langchain.schema`, `OutputParserException`, `langchain_core.exceptions`, `OutputParserException`],
|
||||
[`langchain.schema`, `StrOutputParser`, `langchain_core.output_parsers`, `StrOutputParser`],
|
||||
[`langchain.schema`, `BaseOutputParser`, `langchain_core.output_parsers`, `BaseOutputParser`],
|
||||
[`langchain.schema`, `BaseLLMOutputParser`, `langchain_core.output_parsers`, `BaseLLMOutputParser`],
|
||||
[`langchain.schema`, `BasePromptTemplate`, `langchain_core.prompts`, `BasePromptTemplate`],
|
||||
[`langchain.schema`, `format_document`, `langchain_core.prompts`, `format_document`],
|
||||
[`langchain.schema.agent`, `AgentAction`, `langchain_core.agents`, `AgentAction`],
|
||||
[`langchain.schema.agent`, `AgentActionMessageLog`, `langchain_core.agents`, `AgentActionMessageLog`],
|
||||
[`langchain.schema.agent`, `AgentFinish`, `langchain_core.agents`, `AgentFinish`],
|
||||
[`langchain.schema.cache`, `BaseCache`, `langchain_core.caches`, `BaseCache`],
|
||||
[`langchain.schema.callbacks.base`, `RetrieverManagerMixin`, `langchain_core.callbacks`, `RetrieverManagerMixin`],
|
||||
[`langchain.schema.callbacks.base`, `LLMManagerMixin`, `langchain_core.callbacks`, `LLMManagerMixin`],
|
||||
[`langchain.schema.callbacks.base`, `ChainManagerMixin`, `langchain_core.callbacks`, `ChainManagerMixin`],
|
||||
[`langchain.schema.callbacks.base`, `ToolManagerMixin`, `langchain_core.callbacks`, `ToolManagerMixin`],
|
||||
[`langchain.schema.callbacks.base`, `CallbackManagerMixin`, `langchain_core.callbacks`, `CallbackManagerMixin`],
|
||||
[`langchain.schema.callbacks.base`, `RunManagerMixin`, `langchain_core.callbacks`, `RunManagerMixin`],
|
||||
[`langchain.schema.callbacks.base`, `BaseCallbackHandler`, `langchain_core.callbacks`, `BaseCallbackHandler`],
|
||||
[`langchain.schema.callbacks.base`, `AsyncCallbackHandler`, `langchain_core.callbacks`, `AsyncCallbackHandler`],
|
||||
[`langchain.schema.callbacks.base`, `BaseCallbackManager`, `langchain_core.callbacks`, `BaseCallbackManager`],
|
||||
[`langchain.schema.callbacks.manager`, `tracing_enabled`, `langchain_core.tracers.context`, `tracing_enabled`],
|
||||
[`langchain.schema.callbacks.manager`, `tracing_v2_enabled`, `langchain_core.tracers.context`, `tracing_v2_enabled`],
|
||||
[`langchain.schema.callbacks.manager`, `collect_runs`, `langchain_core.tracers.context`, `collect_runs`],
|
||||
[`langchain.schema.callbacks.manager`, `trace_as_chain_group`, `langchain_core.callbacks.manager`, `trace_as_chain_group`],
|
||||
[`langchain.schema.callbacks.manager`, `handle_event`, `langchain_core.callbacks.manager`, `handle_event`],
|
||||
[`langchain.schema.callbacks.manager`, `BaseRunManager`, `langchain_core.callbacks`, `BaseRunManager`],
|
||||
[`langchain.schema.callbacks.manager`, `RunManager`, `langchain_core.callbacks`, `RunManager`],
|
||||
[`langchain.schema.callbacks.manager`, `ParentRunManager`, `langchain_core.callbacks`, `ParentRunManager`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncRunManager`, `langchain_core.callbacks`, `AsyncRunManager`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncParentRunManager`, `langchain_core.callbacks`, `AsyncParentRunManager`],
|
||||
[`langchain.schema.callbacks.manager`, `CallbackManagerForLLMRun`, `langchain_core.callbacks`, `CallbackManagerForLLMRun`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncCallbackManagerForLLMRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForLLMRun`],
|
||||
[`langchain.schema.callbacks.manager`, `CallbackManagerForChainRun`, `langchain_core.callbacks`, `CallbackManagerForChainRun`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncCallbackManagerForChainRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForChainRun`],
|
||||
[`langchain.schema.callbacks.manager`, `CallbackManagerForToolRun`, `langchain_core.callbacks`, `CallbackManagerForToolRun`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncCallbackManagerForToolRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForToolRun`],
|
||||
[`langchain.schema.callbacks.manager`, `CallbackManagerForRetrieverRun`, `langchain_core.callbacks`, `CallbackManagerForRetrieverRun`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncCallbackManagerForRetrieverRun`, `langchain_core.callbacks`, `AsyncCallbackManagerForRetrieverRun`],
|
||||
[`langchain.schema.callbacks.manager`, `CallbackManager`, `langchain_core.callbacks`, `CallbackManager`],
|
||||
[`langchain.schema.callbacks.manager`, `CallbackManagerForChainGroup`, `langchain_core.callbacks`, `CallbackManagerForChainGroup`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncCallbackManager`, `langchain_core.callbacks`, `AsyncCallbackManager`],
|
||||
[`langchain.schema.callbacks.manager`, `AsyncCallbackManagerForChainGroup`, `langchain_core.callbacks`, `AsyncCallbackManagerForChainGroup`],
|
||||
[`langchain.schema.callbacks.manager`, `register_configure_hook`, `langchain_core.tracers.context`, `register_configure_hook`],
|
||||
[`langchain.schema.callbacks.manager`, `env_var_is_set`, `langchain_core.utils.env`, `env_var_is_set`],
|
||||
[`langchain.schema.callbacks.stdout`, `StdOutCallbackHandler`, `langchain_core.callbacks`, `StdOutCallbackHandler`],
|
||||
[`langchain.schema.callbacks.streaming_stdout`, `StreamingStdOutCallbackHandler`, `langchain_core.callbacks`, `StreamingStdOutCallbackHandler`],
|
||||
[`langchain.schema.callbacks.tracers.base`, `TracerException`, `langchain_core.exceptions`, `TracerException`],
|
||||
[`langchain.schema.callbacks.tracers.base`, `BaseTracer`, `langchain_core.tracers`, `BaseTracer`],
|
||||
[`langchain.schema.callbacks.tracers.evaluation`, `wait_for_all_evaluators`, `langchain_core.tracers.evaluation`, `wait_for_all_evaluators`],
|
||||
[`langchain.schema.callbacks.tracers.evaluation`, `EvaluatorCallbackHandler`, `langchain_core.tracers`, `EvaluatorCallbackHandler`],
|
||||
[`langchain.schema.callbacks.tracers.langchain`, `log_error_once`, `langchain_core.tracers.langchain`, `log_error_once`],
|
||||
[`langchain.schema.callbacks.tracers.langchain`, `wait_for_all_tracers`, `langchain_core.tracers.langchain`, `wait_for_all_tracers`],
|
||||
[`langchain.schema.callbacks.tracers.langchain`, `get_client`, `langchain_core.tracers.langchain`, `get_client`],
|
||||
[`langchain.schema.callbacks.tracers.langchain`, `LangChainTracer`, `langchain_core.tracers`, `LangChainTracer`],
|
||||
[`langchain.schema.callbacks.tracers.langchain_v1`, `get_headers`, `langchain_core.tracers.langchain_v1`, `get_headers`],
|
||||
[`langchain.schema.callbacks.tracers.langchain_v1`, `LangChainTracerV1`, `langchain_core.tracers.langchain_v1`, `LangChainTracerV1`],
|
||||
[`langchain.schema.callbacks.tracers.log_stream`, `LogEntry`, `langchain_core.tracers.log_stream`, `LogEntry`],
|
||||
[`langchain.schema.callbacks.tracers.log_stream`, `RunState`, `langchain_core.tracers.log_stream`, `RunState`],
|
||||
[`langchain.schema.callbacks.tracers.log_stream`, `RunLogPatch`, `langchain_core.tracers`, `RunLogPatch`],
|
||||
[`langchain.schema.callbacks.tracers.log_stream`, `RunLog`, `langchain_core.tracers`, `RunLog`],
|
||||
[`langchain.schema.callbacks.tracers.log_stream`, `LogStreamCallbackHandler`, `langchain_core.tracers`, `LogStreamCallbackHandler`],
|
||||
[`langchain.schema.callbacks.tracers.root_listeners`, `RootListenersTracer`, `langchain_core.tracers.root_listeners`, `RootListenersTracer`],
|
||||
[`langchain.schema.callbacks.tracers.run_collector`, `RunCollectorCallbackHandler`, `langchain_core.tracers.run_collector`, `RunCollectorCallbackHandler`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `RunTypeEnum`, `langchain_core.tracers.schemas`, `RunTypeEnum`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `TracerSessionV1Base`, `langchain_core.tracers.schemas`, `TracerSessionV1Base`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `TracerSessionV1Create`, `langchain_core.tracers.schemas`, `TracerSessionV1Create`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `TracerSessionV1`, `langchain_core.tracers.schemas`, `TracerSessionV1`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `TracerSessionBase`, `langchain_core.tracers.schemas`, `TracerSessionBase`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `TracerSession`, `langchain_core.tracers.schemas`, `TracerSession`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `BaseRun`, `langchain_core.tracers.schemas`, `BaseRun`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `LLMRun`, `langchain_core.tracers.schemas`, `LLMRun`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `ChainRun`, `langchain_core.tracers.schemas`, `ChainRun`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `ToolRun`, `langchain_core.tracers.schemas`, `ToolRun`],
|
||||
[`langchain.schema.callbacks.tracers.schemas`, `Run`, `langchain_core.tracers`, `Run`],
|
||||
[`langchain.schema.callbacks.tracers.stdout`, `try_json_stringify`, `langchain_core.tracers.stdout`, `try_json_stringify`],
|
||||
[`langchain.schema.callbacks.tracers.stdout`, `elapsed`, `langchain_core.tracers.stdout`, `elapsed`],
|
||||
[`langchain.schema.callbacks.tracers.stdout`, `FunctionCallbackHandler`, `langchain_core.tracers.stdout`, `FunctionCallbackHandler`],
|
||||
[`langchain.schema.callbacks.tracers.stdout`, `ConsoleCallbackHandler`, `langchain_core.tracers`, `ConsoleCallbackHandler`],
|
||||
[`langchain.schema.chat`, `ChatSession`, `langchain_core.chat_sessions`, `ChatSession`],
|
||||
[`langchain.schema.chat_history`, `BaseChatMessageHistory`, `langchain_core.chat_history`, `BaseChatMessageHistory`],
|
||||
[`langchain.schema.document`, `Document`, `langchain_core.documents`, `Document`],
|
||||
[`langchain.schema.document`, `BaseDocumentTransformer`, `langchain_core.documents`, `BaseDocumentTransformer`],
|
||||
[`langchain.schema.embeddings`, `Embeddings`, `langchain_core.embeddings`, `Embeddings`],
|
||||
[`langchain.schema.exceptions`, `LangChainException`, `langchain_core.exceptions`, `LangChainException`],
|
||||
[`langchain.schema.language_model`, `BaseLanguageModel`, `langchain_core.language_models`, `BaseLanguageModel`],
|
||||
[`langchain.schema.language_model`, `_get_token_ids_default_method`, `langchain_core.language_models.base`, `_get_token_ids_default_method`],
|
||||
[`langchain.schema.memory`, `BaseMemory`, `langchain_core.memory`, `BaseMemory`],
|
||||
[`langchain.schema.messages`, `get_buffer_string`, `langchain_core.messages`, `get_buffer_string`],
|
||||
[`langchain.schema.messages`, `BaseMessage`, `langchain_core.messages`, `BaseMessage`],
|
||||
[`langchain.schema.messages`, `merge_content`, `langchain_core.messages`, `merge_content`],
|
||||
[`langchain.schema.messages`, `BaseMessageChunk`, `langchain_core.messages`, `BaseMessageChunk`],
|
||||
[`langchain.schema.messages`, `HumanMessage`, `langchain_core.messages`, `HumanMessage`],
|
||||
[`langchain.schema.messages`, `HumanMessageChunk`, `langchain_core.messages`, `HumanMessageChunk`],
|
||||
[`langchain.schema.messages`, `AIMessage`, `langchain_core.messages`, `AIMessage`],
|
||||
[`langchain.schema.messages`, `AIMessageChunk`, `langchain_core.messages`, `AIMessageChunk`],
|
||||
[`langchain.schema.messages`, `SystemMessage`, `langchain_core.messages`, `SystemMessage`],
|
||||
[`langchain.schema.messages`, `SystemMessageChunk`, `langchain_core.messages`, `SystemMessageChunk`],
|
||||
[`langchain.schema.messages`, `FunctionMessage`, `langchain_core.messages`, `FunctionMessage`],
|
||||
[`langchain.schema.messages`, `FunctionMessageChunk`, `langchain_core.messages`, `FunctionMessageChunk`],
|
||||
[`langchain.schema.messages`, `ToolMessage`, `langchain_core.messages`, `ToolMessage`],
|
||||
[`langchain.schema.messages`, `ToolMessageChunk`, `langchain_core.messages`, `ToolMessageChunk`],
|
||||
[`langchain.schema.messages`, `ChatMessage`, `langchain_core.messages`, `ChatMessage`],
|
||||
[`langchain.schema.messages`, `ChatMessageChunk`, `langchain_core.messages`, `ChatMessageChunk`],
|
||||
[`langchain.schema.messages`, `messages_to_dict`, `langchain_core.messages`, `messages_to_dict`],
|
||||
[`langchain.schema.messages`, `messages_from_dict`, `langchain_core.messages`, `messages_from_dict`],
|
||||
[`langchain.schema.messages`, `_message_to_dict`, `langchain_core.messages`, `message_to_dict`],
|
||||
[`langchain.schema.messages`, `_message_from_dict`, `langchain_core.messages`, `_message_from_dict`],
|
||||
[`langchain.schema.messages`, `message_to_dict`, `langchain_core.messages`, `message_to_dict`],
|
||||
[`langchain.schema.output`, `Generation`, `langchain_core.outputs`, `Generation`],
|
||||
[`langchain.schema.output`, `GenerationChunk`, `langchain_core.outputs`, `GenerationChunk`],
|
||||
[`langchain.schema.output`, `ChatGeneration`, `langchain_core.outputs`, `ChatGeneration`],
|
||||
[`langchain.schema.output`, `ChatGenerationChunk`, `langchain_core.outputs`, `ChatGenerationChunk`],
|
||||
[`langchain.schema.output`, `RunInfo`, `langchain_core.outputs`, `RunInfo`],
|
||||
[`langchain.schema.output`, `ChatResult`, `langchain_core.outputs`, `ChatResult`],
|
||||
[`langchain.schema.output`, `LLMResult`, `langchain_core.outputs`, `LLMResult`],
|
||||
[`langchain.schema.output_parser`, `BaseLLMOutputParser`, `langchain_core.output_parsers`, `BaseLLMOutputParser`],
|
||||
[`langchain.schema.output_parser`, `BaseGenerationOutputParser`, `langchain_core.output_parsers`, `BaseGenerationOutputParser`],
|
||||
[`langchain.schema.output_parser`, `BaseOutputParser`, `langchain_core.output_parsers`, `BaseOutputParser`],
|
||||
[`langchain.schema.output_parser`, `BaseTransformOutputParser`, `langchain_core.output_parsers`, `BaseTransformOutputParser`],
|
||||
[`langchain.schema.output_parser`, `BaseCumulativeTransformOutputParser`, `langchain_core.output_parsers`, `BaseCumulativeTransformOutputParser`],
|
||||
[`langchain.schema.output_parser`, `NoOpOutputParser`, `langchain_core.output_parsers`, `StrOutputParser`],
|
||||
[`langchain.schema.output_parser`, `StrOutputParser`, `langchain_core.output_parsers`, `StrOutputParser`],
|
||||
[`langchain.schema.output_parser`, `OutputParserException`, `langchain_core.exceptions`, `OutputParserException`],
|
||||
[`langchain.schema.prompt`, `PromptValue`, `langchain_core.prompt_values`, `PromptValue`],
|
||||
[`langchain.schema.prompt_template`, `BasePromptTemplate`, `langchain_core.prompts`, `BasePromptTemplate`],
|
||||
[`langchain.schema.prompt_template`, `format_document`, `langchain_core.prompts`, `format_document`],
|
||||
[`langchain.schema.retriever`, `BaseRetriever`, `langchain_core.retrievers`, `BaseRetriever`],
|
||||
[`langchain.schema.runnable`, `ConfigurableField`, `langchain_core.runnables`, `ConfigurableField`],
|
||||
[`langchain.schema.runnable`, `ConfigurableFieldSingleOption`, `langchain_core.runnables`, `ConfigurableFieldSingleOption`],
|
||||
[`langchain.schema.runnable`, `ConfigurableFieldMultiOption`, `langchain_core.runnables`, `ConfigurableFieldMultiOption`],
|
||||
[`langchain.schema.runnable`, `patch_config`, `langchain_core.runnables`, `patch_config`],
|
||||
[`langchain.schema.runnable`, `RouterInput`, `langchain_core.runnables`, `RouterInput`],
|
||||
[`langchain.schema.runnable`, `RouterRunnable`, `langchain_core.runnables`, `RouterRunnable`],
|
||||
[`langchain.schema.runnable`, `Runnable`, `langchain_core.runnables`, `Runnable`],
|
||||
[`langchain.schema.runnable`, `RunnableSerializable`, `langchain_core.runnables`, `RunnableSerializable`],
|
||||
[`langchain.schema.runnable`, `RunnableBinding`, `langchain_core.runnables`, `RunnableBinding`],
|
||||
[`langchain.schema.runnable`, `RunnableBranch`, `langchain_core.runnables`, `RunnableBranch`],
|
||||
[`langchain.schema.runnable`, `RunnableConfig`, `langchain_core.runnables`, `RunnableConfig`],
|
||||
[`langchain.schema.runnable`, `RunnableGenerator`, `langchain_core.runnables`, `RunnableGenerator`],
|
||||
[`langchain.schema.runnable`, `RunnableLambda`, `langchain_core.runnables`, `RunnableLambda`],
|
||||
[`langchain.schema.runnable`, `RunnableMap`, `langchain_core.runnables`, `RunnableMap`],
|
||||
[`langchain.schema.runnable`, `RunnableParallel`, `langchain_core.runnables`, `RunnableParallel`],
|
||||
[`langchain.schema.runnable`, `RunnablePassthrough`, `langchain_core.runnables`, `RunnablePassthrough`],
|
||||
[`langchain.schema.runnable`, `RunnableSequence`, `langchain_core.runnables`, `RunnableSequence`],
|
||||
[`langchain.schema.runnable`, `RunnableWithFallbacks`, `langchain_core.runnables`, `RunnableWithFallbacks`],
|
||||
[`langchain.schema.runnable.base`, `Runnable`, `langchain_core.runnables`, `Runnable`],
|
||||
[`langchain.schema.runnable.base`, `RunnableSerializable`, `langchain_core.runnables`, `RunnableSerializable`],
|
||||
[`langchain.schema.runnable.base`, `RunnableSequence`, `langchain_core.runnables`, `RunnableSequence`],
|
||||
[`langchain.schema.runnable.base`, `RunnableParallel`, `langchain_core.runnables`, `RunnableParallel`],
|
||||
[`langchain.schema.runnable.base`, `RunnableGenerator`, `langchain_core.runnables`, `RunnableGenerator`],
|
||||
[`langchain.schema.runnable.base`, `RunnableLambda`, `langchain_core.runnables`, `RunnableLambda`],
|
||||
[`langchain.schema.runnable.base`, `RunnableEachBase`, `langchain_core.runnables.base`, `RunnableEachBase`],
|
||||
[`langchain.schema.runnable.base`, `RunnableEach`, `langchain_core.runnables.base`, `RunnableEach`],
|
||||
[`langchain.schema.runnable.base`, `RunnableBindingBase`, `langchain_core.runnables.base`, `RunnableBindingBase`],
|
||||
[`langchain.schema.runnable.base`, `RunnableBinding`, `langchain_core.runnables`, `RunnableBinding`],
|
||||
[`langchain.schema.runnable.base`, `RunnableMap`, `langchain_core.runnables`, `RunnableMap`],
|
||||
[`langchain.schema.runnable.base`, `coerce_to_runnable`, `langchain_core.runnables.base`, `coerce_to_runnable`],
|
||||
[`langchain.schema.runnable.branch`, `RunnableBranch`, `langchain_core.runnables`, `RunnableBranch`],
|
||||
[`langchain.schema.runnable.config`, `EmptyDict`, `langchain_core.runnables.config`, `EmptyDict`],
|
||||
[`langchain.schema.runnable.config`, `RunnableConfig`, `langchain_core.runnables`, `RunnableConfig`],
|
||||
[`langchain.schema.runnable.config`, `ensure_config`, `langchain_core.runnables`, `ensure_config`],
|
||||
[`langchain.schema.runnable.config`, `get_config_list`, `langchain_core.runnables`, `get_config_list`],
|
||||
[`langchain.schema.runnable.config`, `patch_config`, `langchain_core.runnables`, `patch_config`],
|
||||
[`langchain.schema.runnable.config`, `merge_configs`, `langchain_core.runnables.config`, `merge_configs`],
|
||||
[`langchain.schema.runnable.config`, `acall_func_with_variable_args`, `langchain_core.runnables.config`, `acall_func_with_variable_args`],
|
||||
[`langchain.schema.runnable.config`, `call_func_with_variable_args`, `langchain_core.runnables.config`, `call_func_with_variable_args`],
|
||||
[`langchain.schema.runnable.config`, `get_callback_manager_for_config`, `langchain_core.runnables.config`, `get_callback_manager_for_config`],
|
||||
[`langchain.schema.runnable.config`, `get_async_callback_manager_for_config`, `langchain_core.runnables.config`, `get_async_callback_manager_for_config`],
|
||||
[`langchain.schema.runnable.config`, `get_executor_for_config`, `langchain_core.runnables.config`, `get_executor_for_config`],
|
||||
[`langchain.schema.runnable.configurable`, `DynamicRunnable`, `langchain_core.runnables.configurable`, `DynamicRunnable`],
|
||||
[`langchain.schema.runnable.configurable`, `RunnableConfigurableFields`, `langchain_core.runnables.configurable`, `RunnableConfigurableFields`],
|
||||
[`langchain.schema.runnable.configurable`, `StrEnum`, `langchain_core.runnables.configurable`, `StrEnum`],
|
||||
[`langchain.schema.runnable.configurable`, `RunnableConfigurableAlternatives`, `langchain_core.runnables.configurable`, `RunnableConfigurableAlternatives`],
|
||||
[`langchain.schema.runnable.configurable`, `make_options_spec`, `langchain_core.runnables.configurable`, `make_options_spec`],
|
||||
[`langchain.schema.runnable.fallbacks`, `RunnableWithFallbacks`, `langchain_core.runnables`, `RunnableWithFallbacks`],
|
||||
[`langchain.schema.runnable.history`, `RunnableWithMessageHistory`, `langchain_core.runnables.history`, `RunnableWithMessageHistory`],
|
||||
[`langchain.schema.runnable.passthrough`, `aidentity`, `langchain_core.runnables.passthrough`, `aidentity`],
|
||||
[`langchain.schema.runnable.passthrough`, `identity`, `langchain_core.runnables.passthrough`, `identity`],
|
||||
[`langchain.schema.runnable.passthrough`, `RunnablePassthrough`, `langchain_core.runnables`, `RunnablePassthrough`],
|
||||
[`langchain.schema.runnable.passthrough`, `RunnableAssign`, `langchain_core.runnables`, `RunnableAssign`],
|
||||
[`langchain.schema.runnable.retry`, `RunnableRetry`, `langchain_core.runnables.retry`, `RunnableRetry`],
|
||||
[`langchain.schema.runnable.router`, `RouterInput`, `langchain_core.runnables`, `RouterInput`],
|
||||
[`langchain.schema.runnable.router`, `RouterRunnable`, `langchain_core.runnables`, `RouterRunnable`],
|
||||
[`langchain.schema.runnable.utils`, `accepts_run_manager`, `langchain_core.runnables.utils`, `accepts_run_manager`],
|
||||
[`langchain.schema.runnable.utils`, `accepts_config`, `langchain_core.runnables.utils`, `accepts_config`],
|
||||
[`langchain.schema.runnable.utils`, `IsLocalDict`, `langchain_core.runnables.utils`, `IsLocalDict`],
|
||||
[`langchain.schema.runnable.utils`, `IsFunctionArgDict`, `langchain_core.runnables.utils`, `IsFunctionArgDict`],
|
||||
[`langchain.schema.runnable.utils`, `GetLambdaSource`, `langchain_core.runnables.utils`, `GetLambdaSource`],
|
||||
[`langchain.schema.runnable.utils`, `get_function_first_arg_dict_keys`, `langchain_core.runnables.utils`, `get_function_first_arg_dict_keys`],
|
||||
[`langchain.schema.runnable.utils`, `get_lambda_source`, `langchain_core.runnables.utils`, `get_lambda_source`],
|
||||
[`langchain.schema.runnable.utils`, `indent_lines_after_first`, `langchain_core.runnables.utils`, `indent_lines_after_first`],
|
||||
[`langchain.schema.runnable.utils`, `AddableDict`, `langchain_core.runnables`, `AddableDict`],
|
||||
[`langchain.schema.runnable.utils`, `SupportsAdd`, `langchain_core.runnables.utils`, `SupportsAdd`],
|
||||
[`langchain.schema.runnable.utils`, `add`, `langchain_core.runnables`, `add`],
|
||||
[`langchain.schema.runnable.utils`, `ConfigurableField`, `langchain_core.runnables`, `ConfigurableField`],
|
||||
[`langchain.schema.runnable.utils`, `ConfigurableFieldSingleOption`, `langchain_core.runnables`, `ConfigurableFieldSingleOption`],
|
||||
[`langchain.schema.runnable.utils`, `ConfigurableFieldMultiOption`, `langchain_core.runnables`, `ConfigurableFieldMultiOption`],
|
||||
[`langchain.schema.runnable.utils`, `ConfigurableFieldSpec`, `langchain_core.runnables`, `ConfigurableFieldSpec`],
|
||||
[`langchain.schema.runnable.utils`, `get_unique_config_specs`, `langchain_core.runnables.utils`, `get_unique_config_specs`],
|
||||
[`langchain.schema.runnable.utils`, `aadd`, `langchain_core.runnables`, `aadd`],
|
||||
[`langchain.schema.runnable.utils`, `gated_coro`, `langchain_core.runnables.utils`, `gated_coro`],
|
||||
[`langchain.schema.runnable.utils`, `gather_with_concurrency`, `langchain_core.runnables.utils`, `gather_with_concurrency`],
|
||||
[`langchain.schema.storage`, `BaseStore`, `langchain_core.stores`, `BaseStore`],
|
||||
[`langchain.schema.vectorstore`, `VectorStore`, `langchain_core.vectorstores`, `VectorStore`],
|
||||
[`langchain.schema.vectorstore`, `VectorStoreRetriever`, `langchain_core.vectorstores`, `VectorStoreRetriever`],
|
||||
[`langchain.tools`, `BaseTool`, `langchain_core.tools`, `BaseTool`],
|
||||
[`langchain.tools`, `StructuredTool`, `langchain_core.tools`, `StructuredTool`],
|
||||
[`langchain.tools`, `Tool`, `langchain_core.tools`, `Tool`],
|
||||
[`langchain.tools`, `format_tool_to_openai_function`, `langchain_core.utils.function_calling`, `format_tool_to_openai_function`],
|
||||
[`langchain.tools`, `tool`, `langchain_core.tools`, `tool`],
|
||||
[`langchain.tools.base`, `SchemaAnnotationError`, `langchain_core.tools`, `SchemaAnnotationError`],
|
||||
[`langchain.tools.base`, `create_schema_from_function`, `langchain_core.tools`, `create_schema_from_function`],
|
||||
[`langchain.tools.base`, `ToolException`, `langchain_core.tools`, `ToolException`],
|
||||
[`langchain.tools.base`, `BaseTool`, `langchain_core.tools`, `BaseTool`],
|
||||
[`langchain.tools.base`, `Tool`, `langchain_core.tools`, `Tool`],
|
||||
[`langchain.tools.base`, `StructuredTool`, `langchain_core.tools`, `StructuredTool`],
|
||||
[`langchain.tools.base`, `tool`, `langchain_core.tools`, `tool`],
|
||||
[`langchain.tools.convert_to_openai`, `format_tool_to_openai_function`, `langchain_core.utils.function_calling`, `format_tool_to_openai_function`],
|
||||
[`langchain.tools.render`, `format_tool_to_openai_tool`, `langchain_core.utils.function_calling`, `format_tool_to_openai_tool`],
|
||||
[`langchain.tools.render`, `format_tool_to_openai_function`, `langchain_core.utils.function_calling`, `format_tool_to_openai_function`],
|
||||
[`langchain.utilities.loading`, `try_load_from_hub`, `langchain_core.utils`, `try_load_from_hub`],
|
||||
[`langchain.utils`, `StrictFormatter`, `langchain_core.utils`, `StrictFormatter`],
|
||||
[`langchain.utils`, `check_package_version`, `langchain_core.utils`, `check_package_version`],
|
||||
[`langchain.utils`, `comma_list`, `langchain_core.utils`, `comma_list`],
|
||||
[`langchain.utils`, `convert_to_secret_str`, `langchain_core.utils`, `convert_to_secret_str`],
|
||||
[`langchain.utils`, `get_bolded_text`, `langchain_core.utils`, `get_bolded_text`],
|
||||
[`langchain.utils`, `get_color_mapping`, `langchain_core.utils`, `get_color_mapping`],
|
||||
[`langchain.utils`, `get_colored_text`, `langchain_core.utils`, `get_colored_text`],
|
||||
[`langchain.utils`, `get_from_dict_or_env`, `langchain_core.utils`, `get_from_dict_or_env`],
|
||||
[`langchain.utils`, `get_from_env`, `langchain_core.utils`, `get_from_env`],
|
||||
[`langchain.utils`, `get_pydantic_field_names`, `langchain_core.utils`, `get_pydantic_field_names`],
|
||||
[`langchain.utils`, `guard_import`, `langchain_core.utils`, `guard_import`],
|
||||
[`langchain.utils`, `mock_now`, `langchain_core.utils`, `mock_now`],
|
||||
[`langchain.utils`, `print_text`, `langchain_core.utils`, `print_text`],
|
||||
[`langchain.utils`, `raise_for_status_with_text`, `langchain_core.utils`, `raise_for_status_with_text`],
|
||||
[`langchain.utils`, `stringify_dict`, `langchain_core.utils`, `stringify_dict`],
|
||||
[`langchain.utils`, `stringify_value`, `langchain_core.utils`, `stringify_value`],
|
||||
[`langchain.utils`, `xor_args`, `langchain_core.utils`, `xor_args`],
|
||||
[`langchain.utils.aiter`, `py_anext`, `langchain_core.utils.aiter`, `py_anext`],
|
||||
[`langchain.utils.aiter`, `NoLock`, `langchain_core.utils.aiter`, `NoLock`],
|
||||
[`langchain.utils.aiter`, `Tee`, `langchain_core.utils.aiter`, `Tee`],
|
||||
[`langchain.utils.env`, `get_from_dict_or_env`, `langchain_core.utils`, `get_from_dict_or_env`],
|
||||
[`langchain.utils.env`, `get_from_env`, `langchain_core.utils`, `get_from_env`],
|
||||
[`langchain.utils.formatting`, `StrictFormatter`, `langchain_core.utils`, `StrictFormatter`],
|
||||
[`langchain.utils.html`, `find_all_links`, `langchain_core.utils.html`, `find_all_links`],
|
||||
[`langchain.utils.html`, `extract_sub_links`, `langchain_core.utils.html`, `extract_sub_links`],
|
||||
[`langchain.utils.input`, `get_color_mapping`, `langchain_core.utils`, `get_color_mapping`],
|
||||
[`langchain.utils.input`, `get_colored_text`, `langchain_core.utils`, `get_colored_text`],
|
||||
[`langchain.utils.input`, `get_bolded_text`, `langchain_core.utils`, `get_bolded_text`],
|
||||
[`langchain.utils.input`, `print_text`, `langchain_core.utils`, `print_text`],
|
||||
[`langchain.utils.iter`, `NoLock`, `langchain_core.utils.iter`, `NoLock`],
|
||||
[`langchain.utils.iter`, `tee_peer`, `langchain_core.utils.iter`, `tee_peer`],
|
||||
[`langchain.utils.iter`, `Tee`, `langchain_core.utils.iter`, `Tee`],
|
||||
[`langchain.utils.iter`, `batch_iterate`, `langchain_core.utils.iter`, `batch_iterate`],
|
||||
[`langchain.utils.json_schema`, `_retrieve_ref`, `langchain_core.utils.json_schema`, `_retrieve_ref`],
|
||||
[`langchain.utils.json_schema`, `_dereference_refs_helper`, `langchain_core.utils.json_schema`, `_dereference_refs_helper`],
|
||||
[`langchain.utils.json_schema`, `_infer_skip_keys`, `langchain_core.utils.json_schema`, `_infer_skip_keys`],
|
||||
[`langchain.utils.json_schema`, `dereference_refs`, `langchain_core.utils.json_schema`, `dereference_refs`],
|
||||
[`langchain.utils.loading`, `try_load_from_hub`, `langchain_core.utils`, `try_load_from_hub`],
|
||||
[`langchain.utils.openai_functions`, `FunctionDescription`, `langchain_core.utils.function_calling`, `FunctionDescription`],
|
||||
[`langchain.utils.openai_functions`, `ToolDescription`, `langchain_core.utils.function_calling`, `ToolDescription`],
|
||||
[`langchain.utils.openai_functions`, `convert_pydantic_to_openai_function`, `langchain_core.utils.function_calling`, `convert_pydantic_to_openai_function`],
|
||||
[`langchain.utils.openai_functions`, `convert_pydantic_to_openai_tool`, `langchain_core.utils.function_calling`, `convert_pydantic_to_openai_tool`],
|
||||
[`langchain.utils.pydantic`, `get_pydantic_major_version`, `langchain_core.utils.pydantic`, `get_pydantic_major_version`],
|
||||
[`langchain.utils.strings`, `stringify_value`, `langchain_core.utils`, `stringify_value`],
|
||||
[`langchain.utils.strings`, `stringify_dict`, `langchain_core.utils`, `stringify_dict`],
|
||||
[`langchain.utils.strings`, `comma_list`, `langchain_core.utils`, `comma_list`],
|
||||
[`langchain.utils.utils`, `xor_args`, `langchain_core.utils`, `xor_args`],
|
||||
[`langchain.utils.utils`, `raise_for_status_with_text`, `langchain_core.utils`, `raise_for_status_with_text`],
|
||||
[`langchain.utils.utils`, `mock_now`, `langchain_core.utils`, `mock_now`],
|
||||
[`langchain.utils.utils`, `guard_import`, `langchain_core.utils`, `guard_import`],
|
||||
[`langchain.utils.utils`, `check_package_version`, `langchain_core.utils`, `check_package_version`],
|
||||
[`langchain.utils.utils`, `get_pydantic_field_names`, `langchain_core.utils`, `get_pydantic_field_names`],
|
||||
[`langchain.utils.utils`, `build_extra_kwargs`, `langchain_core.utils`, `build_extra_kwargs`],
|
||||
[`langchain.utils.utils`, `convert_to_secret_str`, `langchain_core.utils`, `convert_to_secret_str`],
|
||||
[`langchain.vectorstores`, `VectorStore`, `langchain_core.vectorstores`, `VectorStore`],
|
||||
[`langchain.vectorstores.base`, `VectorStore`, `langchain_core.vectorstores`, `VectorStore`],
|
||||
[`langchain.vectorstores.base`, `VectorStoreRetriever`, `langchain_core.vectorstores`, `VectorStoreRetriever`],
|
||||
[`langchain.vectorstores.singlestoredb`, `SingleStoreDBRetriever`, `langchain_core.vectorstores`, `VectorStoreRetriever`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_langchain_to_core()
|
@@ -1,8 +1,5 @@
|
||||
[
|
||||
[
|
||||
"langchain._api.deprecated",
|
||||
"langchain_core._api.deprecated"
|
||||
],
|
||||
["langchain._api.deprecated", "langchain_core._api.deprecated"],
|
||||
[
|
||||
"langchain._api.LangChainDeprecationWarning",
|
||||
"langchain_core._api.LangChainDeprecationWarning"
|
||||
@@ -15,10 +12,7 @@
|
||||
"langchain._api.surface_langchain_deprecation_warnings",
|
||||
"langchain_core._api.surface_langchain_deprecation_warnings"
|
||||
],
|
||||
[
|
||||
"langchain._api.warn_deprecated",
|
||||
"langchain_core._api.warn_deprecated"
|
||||
],
|
||||
["langchain._api.warn_deprecated", "langchain_core._api.warn_deprecated"],
|
||||
[
|
||||
"langchain._api.deprecation.LangChainDeprecationWarning",
|
||||
"langchain_core._api.LangChainDeprecationWarning"
|
||||
@@ -27,10 +21,7 @@
|
||||
"langchain._api.deprecation.LangChainPendingDeprecationWarning",
|
||||
"langchain_core._api.deprecation.LangChainPendingDeprecationWarning"
|
||||
],
|
||||
[
|
||||
"langchain._api.deprecation.deprecated",
|
||||
"langchain_core._api.deprecated"
|
||||
],
|
||||
["langchain._api.deprecation.deprecated", "langchain_core._api.deprecated"],
|
||||
[
|
||||
"langchain._api.deprecation.suppress_langchain_deprecation_warning",
|
||||
"langchain_core._api.suppress_langchain_deprecation_warning"
|
||||
@@ -47,30 +38,12 @@
|
||||
"langchain._api.path.get_relative_path",
|
||||
"langchain_core._api.get_relative_path"
|
||||
],
|
||||
[
|
||||
"langchain._api.path.as_import_path",
|
||||
"langchain_core._api.as_import_path"
|
||||
],
|
||||
[
|
||||
"langchain.agents.Tool",
|
||||
"langchain_core.tools.Tool"
|
||||
],
|
||||
[
|
||||
"langchain.agents.tool",
|
||||
"langchain_core.tools.tool"
|
||||
],
|
||||
[
|
||||
"langchain.agents.tools.BaseTool",
|
||||
"langchain_core.tools.BaseTool"
|
||||
],
|
||||
[
|
||||
"langchain.agents.tools.tool",
|
||||
"langchain_core.tools.tool"
|
||||
],
|
||||
[
|
||||
"langchain.agents.tools.Tool",
|
||||
"langchain_core.tools.Tool"
|
||||
],
|
||||
["langchain._api.path.as_import_path", "langchain_core._api.as_import_path"],
|
||||
["langchain.agents.Tool", "langchain_core.tools.Tool"],
|
||||
["langchain.agents.tool", "langchain_core.tools.tool"],
|
||||
["langchain.agents.tools.BaseTool", "langchain_core.tools.BaseTool"],
|
||||
["langchain.agents.tools.tool", "langchain_core.tools.tool"],
|
||||
["langchain.agents.tools.Tool", "langchain_core.tools.Tool"],
|
||||
[
|
||||
"langchain.base_language.BaseLanguageModel",
|
||||
"langchain_core.language_models.BaseLanguageModel"
|
||||
@@ -327,10 +300,7 @@
|
||||
"langchain.callbacks.tracers.schemas.LLMRun",
|
||||
"langchain_core.tracers.schemas.LLMRun"
|
||||
],
|
||||
[
|
||||
"langchain.callbacks.tracers.schemas.Run",
|
||||
"langchain_core.tracers.Run"
|
||||
],
|
||||
["langchain.callbacks.tracers.schemas.Run", "langchain_core.tracers.Run"],
|
||||
[
|
||||
"langchain.callbacks.tracers.schemas.RunTypeEnum",
|
||||
"langchain_core.tracers.schemas.RunTypeEnum"
|
||||
@@ -391,14 +361,8 @@
|
||||
"langchain.chat_models.base.agenerate_from_stream",
|
||||
"langchain_core.language_models.chat_models.agenerate_from_stream"
|
||||
],
|
||||
[
|
||||
"langchain.docstore.document.Document",
|
||||
"langchain_core.documents.Document"
|
||||
],
|
||||
[
|
||||
"langchain.document_loaders.Blob",
|
||||
"langchain_core.document_loaders.Blob"
|
||||
],
|
||||
["langchain.docstore.document.Document", "langchain_core.documents.Document"],
|
||||
["langchain.document_loaders.Blob", "langchain_core.document_loaders.Blob"],
|
||||
[
|
||||
"langchain.document_loaders.BlobLoader",
|
||||
"langchain_core.document_loaders.BlobLoader"
|
||||
@@ -435,74 +399,29 @@
|
||||
"langchain.formatting.StrictFormatter",
|
||||
"langchain_core.utils.StrictFormatter"
|
||||
],
|
||||
[
|
||||
"langchain.input.get_bolded_text",
|
||||
"langchain_core.utils.get_bolded_text"
|
||||
],
|
||||
["langchain.input.get_bolded_text", "langchain_core.utils.get_bolded_text"],
|
||||
[
|
||||
"langchain.input.get_color_mapping",
|
||||
"langchain_core.utils.get_color_mapping"
|
||||
],
|
||||
[
|
||||
"langchain.input.get_colored_text",
|
||||
"langchain_core.utils.get_colored_text"
|
||||
],
|
||||
[
|
||||
"langchain.input.print_text",
|
||||
"langchain_core.utils.print_text"
|
||||
],
|
||||
["langchain.input.get_colored_text", "langchain_core.utils.get_colored_text"],
|
||||
["langchain.input.print_text", "langchain_core.utils.print_text"],
|
||||
[
|
||||
"langchain.llms.base.BaseLanguageModel",
|
||||
"langchain_core.language_models.BaseLanguageModel"
|
||||
],
|
||||
[
|
||||
"langchain.llms.base.BaseLLM",
|
||||
"langchain_core.language_models.BaseLLM"
|
||||
],
|
||||
[
|
||||
"langchain.llms.base.LLM",
|
||||
"langchain_core.language_models.LLM"
|
||||
],
|
||||
[
|
||||
"langchain.load.dumpd",
|
||||
"langchain_core.load.dumpd"
|
||||
],
|
||||
[
|
||||
"langchain.load.dumps",
|
||||
"langchain_core.load.dumps"
|
||||
],
|
||||
[
|
||||
"langchain.load.load",
|
||||
"langchain_core.load.load"
|
||||
],
|
||||
[
|
||||
"langchain.load.loads",
|
||||
"langchain_core.load.loads"
|
||||
],
|
||||
[
|
||||
"langchain.load.dump.default",
|
||||
"langchain_core.load.dump.default"
|
||||
],
|
||||
[
|
||||
"langchain.load.dump.dumps",
|
||||
"langchain_core.load.dumps"
|
||||
],
|
||||
[
|
||||
"langchain.load.dump.dumpd",
|
||||
"langchain_core.load.dumpd"
|
||||
],
|
||||
[
|
||||
"langchain.load.load.Reviver",
|
||||
"langchain_core.load.load.Reviver"
|
||||
],
|
||||
[
|
||||
"langchain.load.load.loads",
|
||||
"langchain_core.load.loads"
|
||||
],
|
||||
[
|
||||
"langchain.load.load.load",
|
||||
"langchain_core.load.load"
|
||||
],
|
||||
["langchain.llms.base.BaseLLM", "langchain_core.language_models.BaseLLM"],
|
||||
["langchain.llms.base.LLM", "langchain_core.language_models.LLM"],
|
||||
["langchain.load.dumpd", "langchain_core.load.dumpd"],
|
||||
["langchain.load.dumps", "langchain_core.load.dumps"],
|
||||
["langchain.load.load", "langchain_core.load.load"],
|
||||
["langchain.load.loads", "langchain_core.load.loads"],
|
||||
["langchain.load.dump.default", "langchain_core.load.dump.default"],
|
||||
["langchain.load.dump.dumps", "langchain_core.load.dumps"],
|
||||
["langchain.load.dump.dumpd", "langchain_core.load.dumpd"],
|
||||
["langchain.load.load.Reviver", "langchain_core.load.load.Reviver"],
|
||||
["langchain.load.load.loads", "langchain_core.load.loads"],
|
||||
["langchain.load.load.load", "langchain_core.load.load"],
|
||||
[
|
||||
"langchain.load.serializable.BaseSerialized",
|
||||
"langchain_core.load.serializable.BaseSerialized"
|
||||
@@ -683,10 +602,7 @@
|
||||
"langchain.prompts.PipelinePromptTemplate",
|
||||
"langchain_core.prompts.PipelinePromptTemplate"
|
||||
],
|
||||
[
|
||||
"langchain.prompts.PromptTemplate",
|
||||
"langchain_core.prompts.PromptTemplate"
|
||||
],
|
||||
["langchain.prompts.PromptTemplate", "langchain_core.prompts.PromptTemplate"],
|
||||
[
|
||||
"langchain.prompts.SemanticSimilarityExampleSelector",
|
||||
"langchain_core.example_selectors.SemanticSimilarityExampleSelector"
|
||||
@@ -699,18 +615,12 @@
|
||||
"langchain.prompts.SystemMessagePromptTemplate",
|
||||
"langchain_core.prompts.SystemMessagePromptTemplate"
|
||||
],
|
||||
[
|
||||
"langchain.prompts.load_prompt",
|
||||
"langchain_core.prompts.load_prompt"
|
||||
],
|
||||
["langchain.prompts.load_prompt", "langchain_core.prompts.load_prompt"],
|
||||
[
|
||||
"langchain.prompts.FewShotChatMessagePromptTemplate",
|
||||
"langchain_core.prompts.FewShotChatMessagePromptTemplate"
|
||||
],
|
||||
[
|
||||
"langchain.prompts.Prompt",
|
||||
"langchain_core.prompts.PromptTemplate"
|
||||
],
|
||||
["langchain.prompts.Prompt", "langchain_core.prompts.PromptTemplate"],
|
||||
[
|
||||
"langchain.prompts.base.jinja2_formatter",
|
||||
"langchain_core.prompts.jinja2_formatter"
|
||||
@@ -891,34 +801,13 @@
|
||||
"langchain.prompts.prompt.PromptTemplate",
|
||||
"langchain_core.prompts.PromptTemplate"
|
||||
],
|
||||
[
|
||||
"langchain.prompts.prompt.Prompt",
|
||||
"langchain_core.prompts.PromptTemplate"
|
||||
],
|
||||
[
|
||||
"langchain.schema.BaseCache",
|
||||
"langchain_core.caches.BaseCache"
|
||||
],
|
||||
[
|
||||
"langchain.schema.BaseMemory",
|
||||
"langchain_core.memory.BaseMemory"
|
||||
],
|
||||
[
|
||||
"langchain.schema.BaseStore",
|
||||
"langchain_core.stores.BaseStore"
|
||||
],
|
||||
[
|
||||
"langchain.schema.AgentFinish",
|
||||
"langchain_core.agents.AgentFinish"
|
||||
],
|
||||
[
|
||||
"langchain.schema.AgentAction",
|
||||
"langchain_core.agents.AgentAction"
|
||||
],
|
||||
[
|
||||
"langchain.schema.Document",
|
||||
"langchain_core.documents.Document"
|
||||
],
|
||||
["langchain.prompts.prompt.Prompt", "langchain_core.prompts.PromptTemplate"],
|
||||
["langchain.schema.BaseCache", "langchain_core.caches.BaseCache"],
|
||||
["langchain.schema.BaseMemory", "langchain_core.memory.BaseMemory"],
|
||||
["langchain.schema.BaseStore", "langchain_core.stores.BaseStore"],
|
||||
["langchain.schema.AgentFinish", "langchain_core.agents.AgentFinish"],
|
||||
["langchain.schema.AgentAction", "langchain_core.agents.AgentAction"],
|
||||
["langchain.schema.Document", "langchain_core.documents.Document"],
|
||||
[
|
||||
"langchain.schema.BaseChatMessageHistory",
|
||||
"langchain_core.chat_history.BaseChatMessageHistory"
|
||||
@@ -927,30 +816,15 @@
|
||||
"langchain.schema.BaseDocumentTransformer",
|
||||
"langchain_core.documents.BaseDocumentTransformer"
|
||||
],
|
||||
[
|
||||
"langchain.schema.BaseMessage",
|
||||
"langchain_core.messages.BaseMessage"
|
||||
],
|
||||
[
|
||||
"langchain.schema.ChatMessage",
|
||||
"langchain_core.messages.ChatMessage"
|
||||
],
|
||||
["langchain.schema.BaseMessage", "langchain_core.messages.BaseMessage"],
|
||||
["langchain.schema.ChatMessage", "langchain_core.messages.ChatMessage"],
|
||||
[
|
||||
"langchain.schema.FunctionMessage",
|
||||
"langchain_core.messages.FunctionMessage"
|
||||
],
|
||||
[
|
||||
"langchain.schema.HumanMessage",
|
||||
"langchain_core.messages.HumanMessage"
|
||||
],
|
||||
[
|
||||
"langchain.schema.AIMessage",
|
||||
"langchain_core.messages.AIMessage"
|
||||
],
|
||||
[
|
||||
"langchain.schema.SystemMessage",
|
||||
"langchain_core.messages.SystemMessage"
|
||||
],
|
||||
["langchain.schema.HumanMessage", "langchain_core.messages.HumanMessage"],
|
||||
["langchain.schema.AIMessage", "langchain_core.messages.AIMessage"],
|
||||
["langchain.schema.SystemMessage", "langchain_core.messages.SystemMessage"],
|
||||
[
|
||||
"langchain.schema.messages_from_dict",
|
||||
"langchain_core.messages.messages_from_dict"
|
||||
@@ -975,42 +849,18 @@
|
||||
"langchain.schema.get_buffer_string",
|
||||
"langchain_core.messages.get_buffer_string"
|
||||
],
|
||||
[
|
||||
"langchain.schema.RunInfo",
|
||||
"langchain_core.outputs.RunInfo"
|
||||
],
|
||||
[
|
||||
"langchain.schema.LLMResult",
|
||||
"langchain_core.outputs.LLMResult"
|
||||
],
|
||||
[
|
||||
"langchain.schema.ChatResult",
|
||||
"langchain_core.outputs.ChatResult"
|
||||
],
|
||||
[
|
||||
"langchain.schema.ChatGeneration",
|
||||
"langchain_core.outputs.ChatGeneration"
|
||||
],
|
||||
[
|
||||
"langchain.schema.Generation",
|
||||
"langchain_core.outputs.Generation"
|
||||
],
|
||||
[
|
||||
"langchain.schema.PromptValue",
|
||||
"langchain_core.prompt_values.PromptValue"
|
||||
],
|
||||
["langchain.schema.RunInfo", "langchain_core.outputs.RunInfo"],
|
||||
["langchain.schema.LLMResult", "langchain_core.outputs.LLMResult"],
|
||||
["langchain.schema.ChatResult", "langchain_core.outputs.ChatResult"],
|
||||
["langchain.schema.ChatGeneration", "langchain_core.outputs.ChatGeneration"],
|
||||
["langchain.schema.Generation", "langchain_core.outputs.Generation"],
|
||||
["langchain.schema.PromptValue", "langchain_core.prompt_values.PromptValue"],
|
||||
[
|
||||
"langchain.schema.LangChainException",
|
||||
"langchain_core.exceptions.LangChainException"
|
||||
],
|
||||
[
|
||||
"langchain.schema.BaseRetriever",
|
||||
"langchain_core.retrievers.BaseRetriever"
|
||||
],
|
||||
[
|
||||
"langchain.schema.Memory",
|
||||
"langchain_core.memory.BaseMemory"
|
||||
],
|
||||
["langchain.schema.BaseRetriever", "langchain_core.retrievers.BaseRetriever"],
|
||||
["langchain.schema.Memory", "langchain_core.memory.BaseMemory"],
|
||||
[
|
||||
"langchain.schema.OutputParserException",
|
||||
"langchain_core.exceptions.OutputParserException"
|
||||
@@ -1035,22 +885,13 @@
|
||||
"langchain.schema.format_document",
|
||||
"langchain_core.prompts.format_document"
|
||||
],
|
||||
[
|
||||
"langchain.schema.agent.AgentAction",
|
||||
"langchain_core.agents.AgentAction"
|
||||
],
|
||||
["langchain.schema.agent.AgentAction", "langchain_core.agents.AgentAction"],
|
||||
[
|
||||
"langchain.schema.agent.AgentActionMessageLog",
|
||||
"langchain_core.agents.AgentActionMessageLog"
|
||||
],
|
||||
[
|
||||
"langchain.schema.agent.AgentFinish",
|
||||
"langchain_core.agents.AgentFinish"
|
||||
],
|
||||
[
|
||||
"langchain.schema.cache.BaseCache",
|
||||
"langchain_core.caches.BaseCache"
|
||||
],
|
||||
["langchain.schema.agent.AgentFinish", "langchain_core.agents.AgentFinish"],
|
||||
["langchain.schema.cache.BaseCache", "langchain_core.caches.BaseCache"],
|
||||
[
|
||||
"langchain.schema.callbacks.base.RetrieverManagerMixin",
|
||||
"langchain_core.callbacks.RetrieverManagerMixin"
|
||||
@@ -1327,10 +1168,7 @@
|
||||
"langchain.schema.chat_history.BaseChatMessageHistory",
|
||||
"langchain_core.chat_history.BaseChatMessageHistory"
|
||||
],
|
||||
[
|
||||
"langchain.schema.document.Document",
|
||||
"langchain_core.documents.Document"
|
||||
],
|
||||
["langchain.schema.document.Document", "langchain_core.documents.Document"],
|
||||
[
|
||||
"langchain.schema.document.BaseDocumentTransformer",
|
||||
"langchain_core.documents.BaseDocumentTransformer"
|
||||
@@ -1351,10 +1189,7 @@
|
||||
"langchain.schema.language_model._get_token_ids_default_method",
|
||||
"langchain_core.language_models.base._get_token_ids_default_method"
|
||||
],
|
||||
[
|
||||
"langchain.schema.memory.BaseMemory",
|
||||
"langchain_core.memory.BaseMemory"
|
||||
],
|
||||
["langchain.schema.memory.BaseMemory", "langchain_core.memory.BaseMemory"],
|
||||
[
|
||||
"langchain.schema.messages.get_buffer_string",
|
||||
"langchain_core.messages.get_buffer_string"
|
||||
@@ -1379,10 +1214,7 @@
|
||||
"langchain.schema.messages.HumanMessageChunk",
|
||||
"langchain_core.messages.HumanMessageChunk"
|
||||
],
|
||||
[
|
||||
"langchain.schema.messages.AIMessage",
|
||||
"langchain_core.messages.AIMessage"
|
||||
],
|
||||
["langchain.schema.messages.AIMessage", "langchain_core.messages.AIMessage"],
|
||||
[
|
||||
"langchain.schema.messages.AIMessageChunk",
|
||||
"langchain_core.messages.AIMessageChunk"
|
||||
@@ -1439,10 +1271,7 @@
|
||||
"langchain.schema.messages.message_to_dict",
|
||||
"langchain_core.messages.message_to_dict"
|
||||
],
|
||||
[
|
||||
"langchain.schema.output.Generation",
|
||||
"langchain_core.outputs.Generation"
|
||||
],
|
||||
["langchain.schema.output.Generation", "langchain_core.outputs.Generation"],
|
||||
[
|
||||
"langchain.schema.output.GenerationChunk",
|
||||
"langchain_core.outputs.GenerationChunk"
|
||||
@@ -1455,18 +1284,9 @@
|
||||
"langchain.schema.output.ChatGenerationChunk",
|
||||
"langchain_core.outputs.ChatGenerationChunk"
|
||||
],
|
||||
[
|
||||
"langchain.schema.output.RunInfo",
|
||||
"langchain_core.outputs.RunInfo"
|
||||
],
|
||||
[
|
||||
"langchain.schema.output.ChatResult",
|
||||
"langchain_core.outputs.ChatResult"
|
||||
],
|
||||
[
|
||||
"langchain.schema.output.LLMResult",
|
||||
"langchain_core.outputs.LLMResult"
|
||||
],
|
||||
["langchain.schema.output.RunInfo", "langchain_core.outputs.RunInfo"],
|
||||
["langchain.schema.output.ChatResult", "langchain_core.outputs.ChatResult"],
|
||||
["langchain.schema.output.LLMResult", "langchain_core.outputs.LLMResult"],
|
||||
[
|
||||
"langchain.schema.output_parser.BaseLLMOutputParser",
|
||||
"langchain_core.output_parsers.BaseLLMOutputParser"
|
||||
@@ -1539,10 +1359,7 @@
|
||||
"langchain.schema.runnable.RouterRunnable",
|
||||
"langchain_core.runnables.RouterRunnable"
|
||||
],
|
||||
[
|
||||
"langchain.schema.runnable.Runnable",
|
||||
"langchain_core.runnables.Runnable"
|
||||
],
|
||||
["langchain.schema.runnable.Runnable", "langchain_core.runnables.Runnable"],
|
||||
[
|
||||
"langchain.schema.runnable.RunnableSerializable",
|
||||
"langchain_core.runnables.RunnableSerializable"
|
||||
@@ -1779,10 +1596,7 @@
|
||||
"langchain.schema.runnable.utils.SupportsAdd",
|
||||
"langchain_core.runnables.utils.SupportsAdd"
|
||||
],
|
||||
[
|
||||
"langchain.schema.runnable.utils.add",
|
||||
"langchain_core.runnables.add"
|
||||
],
|
||||
["langchain.schema.runnable.utils.add", "langchain_core.runnables.add"],
|
||||
[
|
||||
"langchain.schema.runnable.utils.ConfigurableField",
|
||||
"langchain_core.runnables.ConfigurableField"
|
||||
@@ -1803,10 +1617,7 @@
|
||||
"langchain.schema.runnable.utils.get_unique_config_specs",
|
||||
"langchain_core.runnables.utils.get_unique_config_specs"
|
||||
],
|
||||
[
|
||||
"langchain.schema.runnable.utils.aadd",
|
||||
"langchain_core.runnables.aadd"
|
||||
],
|
||||
["langchain.schema.runnable.utils.aadd", "langchain_core.runnables.aadd"],
|
||||
[
|
||||
"langchain.schema.runnable.utils.gated_coro",
|
||||
"langchain_core.runnables.utils.gated_coro"
|
||||
@@ -1815,10 +1626,7 @@
|
||||
"langchain.schema.runnable.utils.gather_with_concurrency",
|
||||
"langchain_core.runnables.utils.gather_with_concurrency"
|
||||
],
|
||||
[
|
||||
"langchain.schema.storage.BaseStore",
|
||||
"langchain_core.stores.BaseStore"
|
||||
],
|
||||
["langchain.schema.storage.BaseStore", "langchain_core.stores.BaseStore"],
|
||||
[
|
||||
"langchain.schema.vectorstore.VectorStore",
|
||||
"langchain_core.vectorstores.VectorStore"
|
||||
@@ -1827,26 +1635,14 @@
|
||||
"langchain.schema.vectorstore.VectorStoreRetriever",
|
||||
"langchain_core.vectorstores.VectorStoreRetriever"
|
||||
],
|
||||
[
|
||||
"langchain.tools.BaseTool",
|
||||
"langchain_core.tools.BaseTool"
|
||||
],
|
||||
[
|
||||
"langchain.tools.StructuredTool",
|
||||
"langchain_core.tools.StructuredTool"
|
||||
],
|
||||
[
|
||||
"langchain.tools.Tool",
|
||||
"langchain_core.tools.Tool"
|
||||
],
|
||||
["langchain.tools.BaseTool", "langchain_core.tools.BaseTool"],
|
||||
["langchain.tools.StructuredTool", "langchain_core.tools.StructuredTool"],
|
||||
["langchain.tools.Tool", "langchain_core.tools.Tool"],
|
||||
[
|
||||
"langchain.tools.format_tool_to_openai_function",
|
||||
"langchain_core.utils.function_calling.format_tool_to_openai_function"
|
||||
],
|
||||
[
|
||||
"langchain.tools.tool",
|
||||
"langchain_core.tools.tool"
|
||||
],
|
||||
["langchain.tools.tool", "langchain_core.tools.tool"],
|
||||
[
|
||||
"langchain.tools.base.SchemaAnnotationError",
|
||||
"langchain_core.tools.SchemaAnnotationError"
|
||||
@@ -1855,26 +1651,14 @@
|
||||
"langchain.tools.base.create_schema_from_function",
|
||||
"langchain_core.tools.create_schema_from_function"
|
||||
],
|
||||
[
|
||||
"langchain.tools.base.ToolException",
|
||||
"langchain_core.tools.ToolException"
|
||||
],
|
||||
[
|
||||
"langchain.tools.base.BaseTool",
|
||||
"langchain_core.tools.BaseTool"
|
||||
],
|
||||
[
|
||||
"langchain.tools.base.Tool",
|
||||
"langchain_core.tools.Tool"
|
||||
],
|
||||
["langchain.tools.base.ToolException", "langchain_core.tools.ToolException"],
|
||||
["langchain.tools.base.BaseTool", "langchain_core.tools.BaseTool"],
|
||||
["langchain.tools.base.Tool", "langchain_core.tools.Tool"],
|
||||
[
|
||||
"langchain.tools.base.StructuredTool",
|
||||
"langchain_core.tools.StructuredTool"
|
||||
],
|
||||
[
|
||||
"langchain.tools.base.tool",
|
||||
"langchain_core.tools.tool"
|
||||
],
|
||||
["langchain.tools.base.tool", "langchain_core.tools.tool"],
|
||||
[
|
||||
"langchain.tools.convert_to_openai.format_tool_to_openai_function",
|
||||
"langchain_core.utils.function_calling.format_tool_to_openai_function"
|
||||
@@ -1891,94 +1675,49 @@
|
||||
"langchain.utilities.loading.try_load_from_hub",
|
||||
"langchain_core.utils.try_load_from_hub"
|
||||
],
|
||||
[
|
||||
"langchain.utils.StrictFormatter",
|
||||
"langchain_core.utils.StrictFormatter"
|
||||
],
|
||||
["langchain.utils.StrictFormatter", "langchain_core.utils.StrictFormatter"],
|
||||
[
|
||||
"langchain.utils.check_package_version",
|
||||
"langchain_core.utils.check_package_version"
|
||||
],
|
||||
[
|
||||
"langchain.utils.comma_list",
|
||||
"langchain_core.utils.comma_list"
|
||||
],
|
||||
["langchain.utils.comma_list", "langchain_core.utils.comma_list"],
|
||||
[
|
||||
"langchain.utils.convert_to_secret_str",
|
||||
"langchain_core.utils.convert_to_secret_str"
|
||||
],
|
||||
[
|
||||
"langchain.utils.get_bolded_text",
|
||||
"langchain_core.utils.get_bolded_text"
|
||||
],
|
||||
["langchain.utils.get_bolded_text", "langchain_core.utils.get_bolded_text"],
|
||||
[
|
||||
"langchain.utils.get_color_mapping",
|
||||
"langchain_core.utils.get_color_mapping"
|
||||
],
|
||||
[
|
||||
"langchain.utils.get_colored_text",
|
||||
"langchain_core.utils.get_colored_text"
|
||||
],
|
||||
["langchain.utils.get_colored_text", "langchain_core.utils.get_colored_text"],
|
||||
[
|
||||
"langchain.utils.get_from_dict_or_env",
|
||||
"langchain_core.utils.get_from_dict_or_env"
|
||||
],
|
||||
[
|
||||
"langchain.utils.get_from_env",
|
||||
"langchain_core.utils.get_from_env"
|
||||
],
|
||||
["langchain.utils.get_from_env", "langchain_core.utils.get_from_env"],
|
||||
[
|
||||
"langchain.utils.get_pydantic_field_names",
|
||||
"langchain_core.utils.get_pydantic_field_names"
|
||||
],
|
||||
[
|
||||
"langchain.utils.guard_import",
|
||||
"langchain_core.utils.guard_import"
|
||||
],
|
||||
[
|
||||
"langchain.utils.mock_now",
|
||||
"langchain_core.utils.mock_now"
|
||||
],
|
||||
[
|
||||
"langchain.utils.print_text",
|
||||
"langchain_core.utils.print_text"
|
||||
],
|
||||
["langchain.utils.guard_import", "langchain_core.utils.guard_import"],
|
||||
["langchain.utils.mock_now", "langchain_core.utils.mock_now"],
|
||||
["langchain.utils.print_text", "langchain_core.utils.print_text"],
|
||||
[
|
||||
"langchain.utils.raise_for_status_with_text",
|
||||
"langchain_core.utils.raise_for_status_with_text"
|
||||
],
|
||||
[
|
||||
"langchain.utils.stringify_dict",
|
||||
"langchain_core.utils.stringify_dict"
|
||||
],
|
||||
[
|
||||
"langchain.utils.stringify_value",
|
||||
"langchain_core.utils.stringify_value"
|
||||
],
|
||||
[
|
||||
"langchain.utils.xor_args",
|
||||
"langchain_core.utils.xor_args"
|
||||
],
|
||||
[
|
||||
"langchain.utils.aiter.py_anext",
|
||||
"langchain_core.utils.aiter.py_anext"
|
||||
],
|
||||
[
|
||||
"langchain.utils.aiter.NoLock",
|
||||
"langchain_core.utils.aiter.NoLock"
|
||||
],
|
||||
[
|
||||
"langchain.utils.aiter.Tee",
|
||||
"langchain_core.utils.aiter.Tee"
|
||||
],
|
||||
["langchain.utils.stringify_dict", "langchain_core.utils.stringify_dict"],
|
||||
["langchain.utils.stringify_value", "langchain_core.utils.stringify_value"],
|
||||
["langchain.utils.xor_args", "langchain_core.utils.xor_args"],
|
||||
["langchain.utils.aiter.py_anext", "langchain_core.utils.aiter.py_anext"],
|
||||
["langchain.utils.aiter.NoLock", "langchain_core.utils.aiter.NoLock"],
|
||||
["langchain.utils.aiter.Tee", "langchain_core.utils.aiter.Tee"],
|
||||
[
|
||||
"langchain.utils.env.get_from_dict_or_env",
|
||||
"langchain_core.utils.get_from_dict_or_env"
|
||||
],
|
||||
[
|
||||
"langchain.utils.env.get_from_env",
|
||||
"langchain_core.utils.get_from_env"
|
||||
],
|
||||
["langchain.utils.env.get_from_env", "langchain_core.utils.get_from_env"],
|
||||
[
|
||||
"langchain.utils.formatting.StrictFormatter",
|
||||
"langchain_core.utils.StrictFormatter"
|
||||
@@ -2003,22 +1742,10 @@
|
||||
"langchain.utils.input.get_bolded_text",
|
||||
"langchain_core.utils.get_bolded_text"
|
||||
],
|
||||
[
|
||||
"langchain.utils.input.print_text",
|
||||
"langchain_core.utils.print_text"
|
||||
],
|
||||
[
|
||||
"langchain.utils.iter.NoLock",
|
||||
"langchain_core.utils.iter.NoLock"
|
||||
],
|
||||
[
|
||||
"langchain.utils.iter.tee_peer",
|
||||
"langchain_core.utils.iter.tee_peer"
|
||||
],
|
||||
[
|
||||
"langchain.utils.iter.Tee",
|
||||
"langchain_core.utils.iter.Tee"
|
||||
],
|
||||
["langchain.utils.input.print_text", "langchain_core.utils.print_text"],
|
||||
["langchain.utils.iter.NoLock", "langchain_core.utils.iter.NoLock"],
|
||||
["langchain.utils.iter.tee_peer", "langchain_core.utils.iter.tee_peer"],
|
||||
["langchain.utils.iter.Tee", "langchain_core.utils.iter.Tee"],
|
||||
[
|
||||
"langchain.utils.iter.batch_iterate",
|
||||
"langchain_core.utils.iter.batch_iterate"
|
||||
@@ -2071,26 +1798,14 @@
|
||||
"langchain.utils.strings.stringify_dict",
|
||||
"langchain_core.utils.stringify_dict"
|
||||
],
|
||||
[
|
||||
"langchain.utils.strings.comma_list",
|
||||
"langchain_core.utils.comma_list"
|
||||
],
|
||||
[
|
||||
"langchain.utils.utils.xor_args",
|
||||
"langchain_core.utils.xor_args"
|
||||
],
|
||||
["langchain.utils.strings.comma_list", "langchain_core.utils.comma_list"],
|
||||
["langchain.utils.utils.xor_args", "langchain_core.utils.xor_args"],
|
||||
[
|
||||
"langchain.utils.utils.raise_for_status_with_text",
|
||||
"langchain_core.utils.raise_for_status_with_text"
|
||||
],
|
||||
[
|
||||
"langchain.utils.utils.mock_now",
|
||||
"langchain_core.utils.mock_now"
|
||||
],
|
||||
[
|
||||
"langchain.utils.utils.guard_import",
|
||||
"langchain_core.utils.guard_import"
|
||||
],
|
||||
["langchain.utils.utils.mock_now", "langchain_core.utils.mock_now"],
|
||||
["langchain.utils.utils.guard_import", "langchain_core.utils.guard_import"],
|
||||
[
|
||||
"langchain.utils.utils.check_package_version",
|
||||
"langchain_core.utils.check_package_version"
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,31 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_langchain_to_textsplitters() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain.text_splitter`, `TokenTextSplitter`, `langchain_text_splitters`, `TokenTextSplitter`],
|
||||
[`langchain.text_splitter`, `TextSplitter`, `langchain_text_splitters`, `TextSplitter`],
|
||||
[`langchain.text_splitter`, `Tokenizer`, `langchain_text_splitters`, `Tokenizer`],
|
||||
[`langchain.text_splitter`, `Language`, `langchain_text_splitters`, `Language`],
|
||||
[`langchain.text_splitter`, `RecursiveCharacterTextSplitter`, `langchain_text_splitters`, `RecursiveCharacterTextSplitter`],
|
||||
[`langchain.text_splitter`, `RecursiveJsonSplitter`, `langchain_text_splitters`, `RecursiveJsonSplitter`],
|
||||
[`langchain.text_splitter`, `LatexTextSplitter`, `langchain_text_splitters`, `LatexTextSplitter`],
|
||||
[`langchain.text_splitter`, `PythonCodeTextSplitter`, `langchain_text_splitters`, `PythonCodeTextSplitter`],
|
||||
[`langchain.text_splitter`, `KonlpyTextSplitter`, `langchain_text_splitters`, `KonlpyTextSplitter`],
|
||||
[`langchain.text_splitter`, `SpacyTextSplitter`, `langchain_text_splitters`, `SpacyTextSplitter`],
|
||||
[`langchain.text_splitter`, `NLTKTextSplitter`, `langchain_text_splitters`, `NLTKTextSplitter`],
|
||||
[`langchain.text_splitter`, `split_text_on_tokens`, `langchain_text_splitters`, `split_text_on_tokens`],
|
||||
[`langchain.text_splitter`, `SentenceTransformersTokenTextSplitter`, `langchain_text_splitters`, `SentenceTransformersTokenTextSplitter`],
|
||||
[`langchain.text_splitter`, `ElementType`, `langchain_text_splitters`, `ElementType`],
|
||||
[`langchain.text_splitter`, `HeaderType`, `langchain_text_splitters`, `HeaderType`],
|
||||
[`langchain.text_splitter`, `LineType`, `langchain_text_splitters`, `LineType`],
|
||||
[`langchain.text_splitter`, `HTMLHeaderTextSplitter`, `langchain_text_splitters`, `HTMLHeaderTextSplitter`],
|
||||
[`langchain.text_splitter`, `MarkdownHeaderTextSplitter`, `langchain_text_splitters`, `MarkdownHeaderTextSplitter`],
|
||||
[`langchain.text_splitter`, `MarkdownTextSplitter`, `langchain_text_splitters`, `MarkdownTextSplitter`],
|
||||
[`langchain.text_splitter`, `CharacterTextSplitter`, `langchain_text_splitters`, `CharacterTextSplitter`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_langchain_to_textsplitters()
|
@@ -7,14 +7,8 @@
|
||||
"langchain.text_splitter.TextSplitter",
|
||||
"langchain_text_splitters.TextSplitter"
|
||||
],
|
||||
[
|
||||
"langchain.text_splitter.Tokenizer",
|
||||
"langchain_text_splitters.Tokenizer"
|
||||
],
|
||||
[
|
||||
"langchain.text_splitter.Language",
|
||||
"langchain_text_splitters.Language"
|
||||
],
|
||||
["langchain.text_splitter.Tokenizer", "langchain_text_splitters.Tokenizer"],
|
||||
["langchain.text_splitter.Language", "langchain_text_splitters.Language"],
|
||||
[
|
||||
"langchain.text_splitter.RecursiveCharacterTextSplitter",
|
||||
"langchain_text_splitters.RecursiveCharacterTextSplitter"
|
||||
@@ -55,14 +49,8 @@
|
||||
"langchain.text_splitter.ElementType",
|
||||
"langchain_text_splitters.ElementType"
|
||||
],
|
||||
[
|
||||
"langchain.text_splitter.HeaderType",
|
||||
"langchain_text_splitters.HeaderType"
|
||||
],
|
||||
[
|
||||
"langchain.text_splitter.LineType",
|
||||
"langchain_text_splitters.LineType"
|
||||
],
|
||||
["langchain.text_splitter.HeaderType", "langchain_text_splitters.HeaderType"],
|
||||
["langchain.text_splitter.LineType", "langchain_text_splitters.LineType"],
|
||||
[
|
||||
"langchain.text_splitter.HTMLHeaderTextSplitter",
|
||||
"langchain_text_splitters.HTMLHeaderTextSplitter"
|
||||
@@ -79,4 +67,4 @@
|
||||
"langchain.text_splitter.CharacterTextSplitter",
|
||||
"langchain_text_splitters.CharacterTextSplitter"
|
||||
]
|
||||
]
|
||||
]
|
@@ -0,0 +1,23 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_openai() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain_community.embeddings.openai`, `OpenAIEmbeddings`, `langchain_openai`, `OpenAIEmbeddings`],
|
||||
[`langchain_community.embeddings.azure_openai`, `AzureOpenAIEmbeddings`, `langchain_openai`, `AzureOpenAIEmbeddings`],
|
||||
[`langchain_community.chat_models.openai`, `ChatOpenAI`, `langchain_openai`, `ChatOpenAI`],
|
||||
[`langchain_community.chat_models.azure_openai`, `AzureChatOpenAI`, `langchain_openai`, `AzureChatOpenAI`],
|
||||
[`langchain_community.llms.openai`, `OpenAI`, `langchain_openai`, `OpenAI`],
|
||||
[`langchain_community.llms.openai`, `AzureOpenAI`, `langchain_openai`, `AzureOpenAI`],
|
||||
[`langchain_community.embeddings`, `AzureOpenAIEmbeddings`, `langchain_openai`, `AzureOpenAIEmbeddings`],
|
||||
[`langchain_community.embeddings`, `OpenAIEmbeddings`, `langchain_openai`, `OpenAIEmbeddings`],
|
||||
[`langchain_community.chat_models`, `AzureChatOpenAI`, `langchain_openai`, `AzureChatOpenAI`],
|
||||
[`langchain_community.chat_models`, `ChatOpenAI`, `langchain_openai`, `ChatOpenAI`],
|
||||
[`langchain_community.llms`, `AzureOpenAI`, `langchain_openai`, `AzureOpenAI`],
|
||||
[`langchain_community.llms`, `OpenAI`, `langchain_openai`, `OpenAI`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_openai()
|
@@ -0,0 +1,13 @@
|
||||
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern langchain_migrate_pinecone() {
|
||||
find_replace_imports(list=[
|
||||
[`langchain_community.vectorstores.pinecone`, `Pinecone`, `langchain_pinecone`, `Pinecone`],
|
||||
[`langchain_community.vectorstores`, `Pinecone`, `langchain_pinecone`, `Pinecone`]
|
||||
])
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
langchain_migrate_pinecone()
|
@@ -0,0 +1,36 @@
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern replace_pydantic_v1_shim() {
|
||||
`from $IMPORT import $...` where {
|
||||
or {
|
||||
and {
|
||||
$IMPORT <: or {
|
||||
"langchain_core.pydantic_v1",
|
||||
"langchain.pydantic_v1",
|
||||
"langserve.pydantic_v1",
|
||||
},
|
||||
$IMPORT => `pydantic`
|
||||
},
|
||||
and {
|
||||
$IMPORT <: or {
|
||||
"langchain_core.pydantic_v1.data_classes",
|
||||
"langchain.pydantic_v1.data_classes",
|
||||
"langserve.pydantic_v1.data_classes",
|
||||
},
|
||||
$IMPORT => `pydantic.data_classes`
|
||||
},
|
||||
and {
|
||||
$IMPORT <: or {
|
||||
"langchain_core.pydantic_v1.main",
|
||||
"langchain.pydantic_v1.main",
|
||||
"langserve.pydantic_v1.main",
|
||||
},
|
||||
$IMPORT => `pydantic.main`
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add this for invoking directly
|
||||
replace_pydantic_v1_shim()
|
@@ -1,45 +0,0 @@
|
||||
from enum import Enum
|
||||
from typing import List, Type
|
||||
|
||||
from libcst.codemod import ContextAwareTransformer
|
||||
from libcst.codemod.visitors import AddImportsVisitor, RemoveImportsVisitor
|
||||
|
||||
from langchain_cli.namespaces.migrate.codemods.replace_imports import (
|
||||
generate_import_replacer,
|
||||
)
|
||||
|
||||
|
||||
class Rule(str, Enum):
|
||||
langchain_to_community = "langchain_to_community"
|
||||
"""Replace deprecated langchain imports with current ones in community."""
|
||||
langchain_to_core = "langchain_to_core"
|
||||
"""Replace deprecated langchain imports with current ones in core."""
|
||||
langchain_to_text_splitters = "langchain_to_text_splitters"
|
||||
"""Replace deprecated langchain imports with current ones in text splitters."""
|
||||
community_to_core = "community_to_core"
|
||||
"""Replace deprecated community imports with current ones in core."""
|
||||
community_to_partner = "community_to_partner"
|
||||
"""Replace deprecated community imports with current ones in partner."""
|
||||
|
||||
|
||||
def gather_codemods(disabled: List[Rule]) -> List[Type[ContextAwareTransformer]]:
|
||||
"""Gather codemods based on the disabled rules."""
|
||||
codemods: List[Type[ContextAwareTransformer]] = []
|
||||
|
||||
# Import rules
|
||||
import_rules = {
|
||||
Rule.langchain_to_community,
|
||||
Rule.langchain_to_core,
|
||||
Rule.community_to_core,
|
||||
Rule.community_to_partner,
|
||||
Rule.langchain_to_text_splitters,
|
||||
}
|
||||
|
||||
# Find active import rules
|
||||
active_import_rules = import_rules - set(disabled)
|
||||
|
||||
if active_import_rules:
|
||||
codemods.append(generate_import_replacer(active_import_rules))
|
||||
# Those codemods need to be the last ones.
|
||||
codemods.extend([RemoveImportsVisitor, AddImportsVisitor])
|
||||
return codemods
|
@@ -1,18 +0,0 @@
|
||||
[
|
||||
[
|
||||
"langchain_community.llms.anthropic.Anthropic",
|
||||
"langchain_anthropic.Anthropic"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.anthropic.ChatAnthropic",
|
||||
"langchain_anthropic.ChatAnthropic"
|
||||
],
|
||||
[
|
||||
"langchain_community.llms.Anthropic",
|
||||
"langchain_anthropic.Anthropic"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.ChatAnthropic",
|
||||
"langchain_anthropic.ChatAnthropic"
|
||||
]
|
||||
]
|
@@ -1,30 +0,0 @@
|
||||
[
|
||||
[
|
||||
"langchain_community.vectorstores.astradb.AstraDB",
|
||||
"langchain_astradb.AstraDBVectorStore"
|
||||
],
|
||||
[
|
||||
"langchain_community.storage.astradb.AstraDBByteStore",
|
||||
"langchain_astradb.AstraDBByteStore"
|
||||
],
|
||||
[
|
||||
"langchain_community.storage.astradb.AstraDBStore",
|
||||
"langchain_astradb.AstraDBStore"
|
||||
],
|
||||
[
|
||||
"langchain_community.cache.AstraDBCache",
|
||||
"langchain_astradb.AstraDBCache"
|
||||
],
|
||||
[
|
||||
"langchain_community.cache.AstraDBSemanticCache",
|
||||
"langchain_astradb.AstraDBSemanticCache"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_message_histories.astradb.AstraDBChatMessageHistory",
|
||||
"langchain_astradb.AstraDBChatMessageHistory"
|
||||
],
|
||||
[
|
||||
"langchain_community.document_loaders.astradb.AstraDBLoader",
|
||||
"langchain_astradb.AstraDBLoader"
|
||||
]
|
||||
]
|
@@ -1,18 +0,0 @@
|
||||
[
|
||||
[
|
||||
"langchain_community.llms.fireworks.Fireworks",
|
||||
"langchain_fireworks.Fireworks"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.fireworks.ChatFireworks",
|
||||
"langchain_fireworks.ChatFireworks"
|
||||
],
|
||||
[
|
||||
"langchain_community.llms.Fireworks",
|
||||
"langchain_fireworks.Fireworks"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.ChatFireworks",
|
||||
"langchain_fireworks.ChatFireworks"
|
||||
]
|
||||
]
|
@@ -1,10 +0,0 @@
|
||||
[
|
||||
[
|
||||
"langchain_community.llms.watsonxllm.WatsonxLLM",
|
||||
"langchain_ibm.WatsonxLLM"
|
||||
],
|
||||
[
|
||||
"langchain_community.llms.WatsonxLLM",
|
||||
"langchain_ibm.WatsonxLLM"
|
||||
]
|
||||
]
|
File diff suppressed because it is too large
Load Diff
@@ -1,50 +0,0 @@
|
||||
[
|
||||
[
|
||||
"langchain_community.llms.openai.OpenAI",
|
||||
"langchain_openai.OpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.llms.openai.AzureOpenAI",
|
||||
"langchain_openai.AzureOpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.embeddings.openai.OpenAIEmbeddings",
|
||||
"langchain_openai.OpenAIEmbeddings"
|
||||
],
|
||||
[
|
||||
"langchain_community.embeddings.azure_openai.AzureOpenAIEmbeddings",
|
||||
"langchain_openai.AzureOpenAIEmbeddings"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.openai.ChatOpenAI",
|
||||
"langchain_openai.ChatOpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.azure_openai.AzureChatOpenAI",
|
||||
"langchain_openai.AzureChatOpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.llms.AzureOpenAI",
|
||||
"langchain_openai.AzureOpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.llms.OpenAI",
|
||||
"langchain_openai.OpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.embeddings.AzureOpenAIEmbeddings",
|
||||
"langchain_openai.AzureOpenAIEmbeddings"
|
||||
],
|
||||
[
|
||||
"langchain_community.embeddings.OpenAIEmbeddings",
|
||||
"langchain_openai.OpenAIEmbeddings"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.AzureChatOpenAI",
|
||||
"langchain_openai.AzureChatOpenAI"
|
||||
],
|
||||
[
|
||||
"langchain_community.chat_models.ChatOpenAI",
|
||||
"langchain_openai.ChatOpenAI"
|
||||
]
|
||||
]
|
@@ -1,10 +0,0 @@
|
||||
[
|
||||
[
|
||||
"langchain_community.vectorstores.pinecone.Pinecone",
|
||||
"langchain_pinecone.Pinecone"
|
||||
],
|
||||
[
|
||||
"langchain_community.vectorstores.Pinecone",
|
||||
"langchain_pinecone.Pinecone"
|
||||
]
|
||||
]
|
@@ -1,204 +0,0 @@
|
||||
"""
|
||||
# Adapted from bump-pydantic
|
||||
# https://github.com/pydantic/bump-pydantic
|
||||
|
||||
This codemod deals with the following cases:
|
||||
|
||||
1. `from pydantic import BaseSettings`
|
||||
2. `from pydantic.settings import BaseSettings`
|
||||
3. `from pydantic import BaseSettings as <name>`
|
||||
4. `from pydantic.settings import BaseSettings as <name>` # TODO: This is not working.
|
||||
5. `import pydantic` -> `pydantic.BaseSettings`
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
from dataclasses import dataclass
|
||||
from typing import Callable, Dict, Iterable, List, Sequence, Tuple, Type, TypeVar
|
||||
|
||||
import libcst as cst
|
||||
import libcst.matchers as m
|
||||
from libcst.codemod import VisitorBasedCodemodCommand
|
||||
from libcst.codemod.visitors import AddImportsVisitor
|
||||
|
||||
HERE = os.path.dirname(__file__)
|
||||
|
||||
|
||||
def _load_migrations_by_file(path: str):
|
||||
migrations_path = os.path.join(HERE, "migrations", path)
|
||||
with open(migrations_path, "r", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
|
||||
# new migrations
|
||||
new_migrations = []
|
||||
for migration in data:
|
||||
old = migration[0].split(".")[-1]
|
||||
new = migration[1].split(".")[-1]
|
||||
|
||||
if old == new:
|
||||
new_migrations.append(migration)
|
||||
|
||||
return new_migrations
|
||||
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
def _deduplicate_in_order(
|
||||
seq: Iterable[T], key: Callable[[T], str] = lambda x: x
|
||||
) -> List[T]:
|
||||
seen = set()
|
||||
seen_add = seen.add
|
||||
return [x for x in seq if not (key(x) in seen or seen_add(key(x)))]
|
||||
|
||||
|
||||
def _load_migrations_from_fixtures(paths: List[str]) -> List[Tuple[str, str]]:
|
||||
"""Load migrations from fixtures."""
|
||||
data = []
|
||||
for path in paths:
|
||||
data.extend(_load_migrations_by_file(path))
|
||||
data = _deduplicate_in_order(data, key=lambda x: x[0])
|
||||
return data
|
||||
|
||||
|
||||
def _load_migrations(paths: List[str]):
|
||||
"""Load the migrations from the JSON file."""
|
||||
# Later earlier ones have higher precedence.
|
||||
imports: Dict[str, Tuple[str, str]] = {}
|
||||
data = _load_migrations_from_fixtures(paths)
|
||||
|
||||
for old_path, new_path in data:
|
||||
# Parse the old parse which is of the format 'langchain.chat_models.ChatOpenAI'
|
||||
# into the module and class name.
|
||||
old_parts = old_path.split(".")
|
||||
old_module = ".".join(old_parts[:-1])
|
||||
old_class = old_parts[-1]
|
||||
old_path_str = f"{old_module}:{old_class}"
|
||||
|
||||
# Parse the new parse which is of the format 'langchain.chat_models.ChatOpenAI'
|
||||
# Into a 2-tuple of the module and class name.
|
||||
new_parts = new_path.split(".")
|
||||
new_module = ".".join(new_parts[:-1])
|
||||
new_class = new_parts[-1]
|
||||
new_path_str = (new_module, new_class)
|
||||
|
||||
imports[old_path_str] = new_path_str
|
||||
|
||||
return imports
|
||||
|
||||
|
||||
def resolve_module_parts(module_parts: list[str]) -> m.Attribute | m.Name:
|
||||
"""Converts a list of module parts to a `Name` or `Attribute` node."""
|
||||
if len(module_parts) == 1:
|
||||
return m.Name(module_parts[0])
|
||||
if len(module_parts) == 2:
|
||||
first, last = module_parts
|
||||
return m.Attribute(value=m.Name(first), attr=m.Name(last))
|
||||
last_name = module_parts.pop()
|
||||
attr = resolve_module_parts(module_parts)
|
||||
return m.Attribute(value=attr, attr=m.Name(last_name))
|
||||
|
||||
|
||||
def get_import_from_from_str(import_str: str) -> m.ImportFrom:
|
||||
"""Converts a string like `pydantic:BaseSettings` to Examples:
|
||||
>>> get_import_from_from_str("pydantic:BaseSettings")
|
||||
ImportFrom(
|
||||
module=Name("pydantic"),
|
||||
names=[ImportAlias(name=Name("BaseSettings"))],
|
||||
)
|
||||
>>> get_import_from_from_str("pydantic.settings:BaseSettings")
|
||||
ImportFrom(
|
||||
module=Attribute(value=Name("pydantic"), attr=Name("settings")),
|
||||
names=[ImportAlias(name=Name("BaseSettings"))],
|
||||
)
|
||||
>>> get_import_from_from_str("a.b.c:d")
|
||||
ImportFrom(
|
||||
module=Attribute(
|
||||
value=Attribute(value=Name("a"), attr=Name("b")), attr=Name("c")
|
||||
),
|
||||
names=[ImportAlias(name=Name("d"))],
|
||||
)
|
||||
"""
|
||||
module, name = import_str.split(":")
|
||||
module_parts = module.split(".")
|
||||
module_node = resolve_module_parts(module_parts)
|
||||
return m.ImportFrom(
|
||||
module=module_node,
|
||||
names=[m.ZeroOrMore(), m.ImportAlias(name=m.Name(value=name)), m.ZeroOrMore()],
|
||||
)
|
||||
|
||||
|
||||
@dataclass
|
||||
class ImportInfo:
|
||||
import_from: m.ImportFrom
|
||||
import_str: str
|
||||
to_import_str: tuple[str, str]
|
||||
|
||||
|
||||
RULE_TO_PATHS = {
|
||||
"langchain_to_community": ["langchain_to_community.json"],
|
||||
"langchain_to_core": ["langchain_to_core.json"],
|
||||
"community_to_core": ["community_to_core.json"],
|
||||
"langchain_to_text_splitters": ["langchain_to_text_splitters.json"],
|
||||
"community_to_partner": [
|
||||
"anthropic.json",
|
||||
"fireworks.json",
|
||||
"ibm.json",
|
||||
"openai.json",
|
||||
"pinecone.json",
|
||||
"astradb.json",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
def generate_import_replacer(rules: List[str]) -> Type[VisitorBasedCodemodCommand]:
|
||||
"""Generate a codemod to replace imports."""
|
||||
paths = []
|
||||
for rule in rules:
|
||||
if rule not in RULE_TO_PATHS:
|
||||
raise ValueError(f"Unknown rule: {rule}. Use one of {RULE_TO_PATHS.keys()}")
|
||||
|
||||
paths.extend(RULE_TO_PATHS[rule])
|
||||
|
||||
imports = _load_migrations(paths)
|
||||
|
||||
import_infos = [
|
||||
ImportInfo(
|
||||
import_from=get_import_from_from_str(import_str),
|
||||
import_str=import_str,
|
||||
to_import_str=to_import_str,
|
||||
)
|
||||
for import_str, to_import_str in imports.items()
|
||||
]
|
||||
import_match = m.OneOf(*[info.import_from for info in import_infos])
|
||||
|
||||
class ReplaceImportsCodemod(VisitorBasedCodemodCommand):
|
||||
@m.leave(import_match)
|
||||
def leave_replace_import(
|
||||
self, _: cst.ImportFrom, updated_node: cst.ImportFrom
|
||||
) -> cst.ImportFrom:
|
||||
for import_info in import_infos:
|
||||
if m.matches(updated_node, import_info.import_from):
|
||||
aliases: Sequence[cst.ImportAlias] = updated_node.names # type: ignore
|
||||
# If multiple objects are imported in a single import statement,
|
||||
# we need to remove only the one we're replacing.
|
||||
AddImportsVisitor.add_needed_import(
|
||||
self.context, *import_info.to_import_str
|
||||
)
|
||||
if len(updated_node.names) > 1: # type: ignore
|
||||
names = [
|
||||
alias
|
||||
for alias in aliases
|
||||
if alias.name.value != import_info.to_import_str[-1]
|
||||
]
|
||||
names[-1] = names[-1].with_changes(
|
||||
comma=cst.MaybeSentinel.DEFAULT
|
||||
)
|
||||
updated_node = updated_node.with_changes(names=names)
|
||||
else:
|
||||
return cst.RemoveFromParent() # type: ignore[return-value]
|
||||
return updated_node
|
||||
|
||||
return ReplaceImportsCodemod
|
40
libs/cli/langchain_cli/namespaces/migrate/generate/grit.py
Normal file
40
libs/cli/langchain_cli/namespaces/migrate/generate/grit.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from typing import List, Tuple
|
||||
|
||||
|
||||
def split_package(package: str) -> Tuple[str, str]:
|
||||
"""Split a package name into the containing package and the final name"""
|
||||
parts = package.split(".")
|
||||
return ".".join(parts[:-1]), parts[-1]
|
||||
|
||||
|
||||
def dump_migrations_as_grit(name: str, migration_pairs: List[Tuple[str, str]]):
|
||||
"""Dump the migration pairs as a Grit file."""
|
||||
output = "language python"
|
||||
remapped = ",\n".join(
|
||||
[
|
||||
f"""
|
||||
[
|
||||
`{split_package(from_module)[0]}`,
|
||||
`{split_package(from_module)[1]}`,
|
||||
`{split_package(to_module)[0]}`,
|
||||
`{split_package(to_module)[1]}`
|
||||
]
|
||||
"""
|
||||
for from_module, to_module in migration_pairs
|
||||
]
|
||||
)
|
||||
pattern_name = f"langchain_migrate_{name}"
|
||||
output = f"""
|
||||
language python
|
||||
|
||||
// This migration is generated automatically - do not manually edit this file
|
||||
pattern {pattern_name}() {{
|
||||
find_replace_imports(list=[
|
||||
{remapped}
|
||||
])
|
||||
}}
|
||||
|
||||
// Add this for invoking directly
|
||||
{pattern_name}()
|
||||
"""
|
||||
return output
|
@@ -1,52 +0,0 @@
|
||||
# Adapted from bump-pydantic
|
||||
# https://github.com/pydantic/bump-pydantic
|
||||
import fnmatch
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
MATCH_SEP = r"(?:/|\\)"
|
||||
MATCH_SEP_OR_END = r"(?:/|\\|\Z)"
|
||||
MATCH_NON_RECURSIVE = r"[^/\\]*"
|
||||
MATCH_RECURSIVE = r"(?:.*)"
|
||||
|
||||
|
||||
def glob_to_re(pattern: str) -> str:
|
||||
"""Translate a glob pattern to a regular expression for matching."""
|
||||
fragments: List[str] = []
|
||||
for segment in re.split(r"/|\\", pattern):
|
||||
if segment == "":
|
||||
continue
|
||||
if segment == "**":
|
||||
# Remove previous separator match, so the recursive match c
|
||||
# can match zero or more segments.
|
||||
if fragments and fragments[-1] == MATCH_SEP:
|
||||
fragments.pop()
|
||||
fragments.append(MATCH_RECURSIVE)
|
||||
elif "**" in segment:
|
||||
raise ValueError(
|
||||
"invalid pattern: '**' can only be an entire path component"
|
||||
)
|
||||
else:
|
||||
fragment = fnmatch.translate(segment)
|
||||
fragment = fragment.replace(r"(?s:", r"(?:")
|
||||
fragment = fragment.replace(r".*", MATCH_NON_RECURSIVE)
|
||||
fragment = fragment.replace(r"\Z", r"")
|
||||
fragments.append(fragment)
|
||||
fragments.append(MATCH_SEP)
|
||||
# Remove trailing MATCH_SEP, so it can be replaced with MATCH_SEP_OR_END.
|
||||
if fragments and fragments[-1] == MATCH_SEP:
|
||||
fragments.pop()
|
||||
fragments.append(MATCH_SEP_OR_END)
|
||||
return rf"(?s:{''.join(fragments)})"
|
||||
|
||||
|
||||
def match_glob(path: Path, pattern: str) -> bool:
|
||||
"""Check if a path matches a glob pattern.
|
||||
|
||||
If the pattern ends with a directory separator, the path must be a directory.
|
||||
"""
|
||||
match = bool(re.fullmatch(glob_to_re(pattern), str(path)))
|
||||
if pattern.endswith("/") or pattern.endswith("\\"):
|
||||
return match and path.is_dir()
|
||||
return match
|
@@ -1,306 +1,54 @@
|
||||
"""Migrate LangChain to the most recent version."""
|
||||
|
||||
# Adapted from bump-pydantic
|
||||
# https://github.com/pydantic/bump-pydantic
|
||||
import difflib
|
||||
import functools
|
||||
import multiprocessing
|
||||
import os
|
||||
import time
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Iterable, List, Optional, Tuple, Type, TypeVar, Union
|
||||
|
||||
import libcst as cst
|
||||
import rich
|
||||
import typer
|
||||
from libcst.codemod import CodemodContext, ContextAwareTransformer
|
||||
from libcst.helpers import calculate_module_and_package
|
||||
from libcst.metadata import FullRepoManager, FullyQualifiedNameProvider, ScopeProvider
|
||||
from rich.console import Console
|
||||
from rich.progress import Progress
|
||||
from typer import Argument, Exit, Option, Typer
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
from langchain_cli.namespaces.migrate.codemods import Rule, gather_codemods
|
||||
from langchain_cli.namespaces.migrate.glob_helpers import match_glob
|
||||
|
||||
app = Typer(invoke_without_command=True, add_completion=False)
|
||||
|
||||
P = ParamSpec("P")
|
||||
T = TypeVar("T")
|
||||
|
||||
DEFAULT_IGNORES = [".venv/**"]
|
||||
from gritql import run
|
||||
|
||||
|
||||
@app.callback()
|
||||
def main(
|
||||
path: Path = Argument(..., exists=True, dir_okay=True, allow_dash=False),
|
||||
disable: List[Rule] = Option(default=[], help="Disable a rule."),
|
||||
diff: bool = Option(False, help="Show diff instead of applying changes."),
|
||||
ignore: List[str] = Option(
|
||||
default=DEFAULT_IGNORES, help="Ignore a path glob pattern."
|
||||
),
|
||||
log_file: Path = Option("log.txt", help="Log errors to this file."),
|
||||
include_ipynb: bool = Option(
|
||||
False, help="Include Jupyter Notebook files in the migration."
|
||||
),
|
||||
):
|
||||
"""Migrate langchain to the most recent version."""
|
||||
if not diff:
|
||||
if not typer.confirm(
|
||||
"✈️ This script will help you migrate to a recent version LangChain. "
|
||||
"This migration script will attempt to replace old imports in the code "
|
||||
"with new ones.\n\n"
|
||||
"🔄 You will need to run the migration script TWICE to migrate (e.g., "
|
||||
"to update llms import from langchain, the script will first move them to "
|
||||
"corresponding imports from the community package, and on the second "
|
||||
"run will migrate from the community package to the partner package "
|
||||
"when possible). \n\n"
|
||||
"🔍 You can pre-view the changes by running with the --diff flag. \n\n"
|
||||
"🚫 You can disable specific import changes by using the --disable "
|
||||
"flag. \n\n"
|
||||
"📄 Update your pyproject.toml or requirements.txt file to "
|
||||
"reflect any imports from new packages. For example, if you see new "
|
||||
"imports from langchain_openai, langchain_anthropic or "
|
||||
"langchain_text_splitters you "
|
||||
"should them to your dependencies! \n\n"
|
||||
'⚠️ This script is a "best-effort", and is likely to make some '
|
||||
"mistakes.\n\n"
|
||||
"🛡️ Backup your code prior to running the migration script -- it will "
|
||||
"modify your files!\n\n"
|
||||
"❓ Do you want to continue?"
|
||||
):
|
||||
raise Exit()
|
||||
console = Console(log_time=True)
|
||||
console.log("Start langchain-cli migrate")
|
||||
# NOTE: LIBCST_PARSER_TYPE=native is required according to https://github.com/Instagram/LibCST/issues/487.
|
||||
os.environ["LIBCST_PARSER_TYPE"] = "native"
|
||||
|
||||
if os.path.isfile(path):
|
||||
package = path.parent
|
||||
all_files = [path]
|
||||
else:
|
||||
package = path
|
||||
all_files = sorted(package.glob("**/*.py"))
|
||||
if include_ipynb:
|
||||
all_files.extend(sorted(package.glob("**/*.ipynb")))
|
||||
|
||||
filtered_files = [
|
||||
file
|
||||
for file in all_files
|
||||
if not any(match_glob(file, pattern) for pattern in ignore)
|
||||
]
|
||||
files = [str(file.relative_to(".")) for file in filtered_files]
|
||||
|
||||
if len(files) == 1:
|
||||
console.log("Found 1 file to process.")
|
||||
elif len(files) > 1:
|
||||
console.log(f"Found {len(files)} files to process.")
|
||||
else:
|
||||
console.log("No files to process.")
|
||||
raise Exit()
|
||||
|
||||
providers = {FullyQualifiedNameProvider, ScopeProvider}
|
||||
metadata_manager = FullRepoManager(".", files, providers=providers) # type: ignore[arg-type]
|
||||
metadata_manager.resolve_cache()
|
||||
|
||||
scratch: dict[str, Any] = {}
|
||||
start_time = time.time()
|
||||
|
||||
log_fp = log_file.open("a+", encoding="utf8")
|
||||
partial_run_codemods = functools.partial(
|
||||
get_and_run_codemods, disable, metadata_manager, scratch, package, diff
|
||||
)
|
||||
with Progress(*Progress.get_default_columns(), transient=True) as progress:
|
||||
task = progress.add_task(description="Executing codemods...", total=len(files))
|
||||
count_errors = 0
|
||||
difflines: List[List[str]] = []
|
||||
with multiprocessing.Pool() as pool:
|
||||
for error, _difflines in pool.imap_unordered(partial_run_codemods, files):
|
||||
progress.advance(task)
|
||||
|
||||
if _difflines is not None:
|
||||
difflines.append(_difflines)
|
||||
|
||||
if error is not None:
|
||||
count_errors += 1
|
||||
log_fp.writelines(error)
|
||||
|
||||
modified = [Path(f) for f in files if os.stat(f).st_mtime > start_time]
|
||||
|
||||
if not diff:
|
||||
if modified:
|
||||
console.log(f"Refactored {len(modified)} files.")
|
||||
else:
|
||||
console.log("No files were modified.")
|
||||
|
||||
for _difflines in difflines:
|
||||
color_diff(console, _difflines)
|
||||
|
||||
if count_errors > 0:
|
||||
console.log(f"Found {count_errors} errors. Please check the {log_file} file.")
|
||||
else:
|
||||
console.log("Run successfully!")
|
||||
|
||||
if difflines:
|
||||
raise Exit(1)
|
||||
def get_gritdir_path() -> Path:
|
||||
"""Get the path to the grit directory."""
|
||||
script_dir = Path(__file__).parent
|
||||
return script_dir / ".grit"
|
||||
|
||||
|
||||
def get_and_run_codemods(
|
||||
disabled_rules: List[Rule],
|
||||
metadata_manager: FullRepoManager,
|
||||
scratch: Dict[str, Any],
|
||||
package: Path,
|
||||
diff: bool,
|
||||
filename: str,
|
||||
) -> Tuple[Union[str, None], Union[List[str], None]]:
|
||||
"""Run codemods from rules.
|
||||
def migrate(
|
||||
ctx: typer.Context,
|
||||
) -> None:
|
||||
"""Migrate langchain to the most recent version.
|
||||
|
||||
Wrapper around run_codemods to be used with multiprocessing.Pool.
|
||||
Any undocumented arguments will be passed to the Grit CLI.
|
||||
"""
|
||||
codemods = gather_codemods(disabled=disabled_rules)
|
||||
return run_codemods(codemods, metadata_manager, scratch, package, diff, filename)
|
||||
rich.print(
|
||||
"✈️ This script will help you migrate to a recent version LangChain. "
|
||||
"This migration script will attempt to replace old imports in the code "
|
||||
"with new ones.\n\n"
|
||||
"🔄 You will need to run the migration script TWICE to migrate (e.g., "
|
||||
"to update llms import from langchain, the script will first move them to "
|
||||
"corresponding imports from the community package, and on the second "
|
||||
"run will migrate from the community package to the partner package "
|
||||
"when possible). \n\n"
|
||||
"🔍 You can pre-view the changes by running with the --diff flag. \n\n"
|
||||
"🚫 You can disable specific import changes by using the --disable "
|
||||
"flag. \n\n"
|
||||
"📄 Update your pyproject.toml or requirements.txt file to "
|
||||
"reflect any imports from new packages. For example, if you see new "
|
||||
"imports from langchain_openai, langchain_anthropic or "
|
||||
"langchain_text_splitters you "
|
||||
"should them to your dependencies! \n\n"
|
||||
'⚠️ This script is a "best-effort", and is likely to make some '
|
||||
"mistakes.\n\n"
|
||||
"🛡️ Backup your code prior to running the migration script -- it will "
|
||||
"modify your files!\n\n"
|
||||
)
|
||||
rich.print("-" * 10)
|
||||
rich.print()
|
||||
|
||||
final_code = run.apply_pattern(
|
||||
"langchain_all_migrations()",
|
||||
ctx.args,
|
||||
grit_dir=get_gritdir_path(),
|
||||
)
|
||||
|
||||
def _rewrite_file(
|
||||
filename: str,
|
||||
codemods: List[Type[ContextAwareTransformer]],
|
||||
diff: bool,
|
||||
context: CodemodContext,
|
||||
) -> Tuple[Union[str, None], Union[List[str], None]]:
|
||||
file_path = Path(filename)
|
||||
with file_path.open("r+", encoding="utf-8") as fp:
|
||||
code = fp.read()
|
||||
fp.seek(0)
|
||||
|
||||
input_tree = cst.parse_module(code)
|
||||
|
||||
for codemod in codemods:
|
||||
transformer = codemod(context=context)
|
||||
output_tree = transformer.transform_module(input_tree)
|
||||
input_tree = output_tree
|
||||
|
||||
output_code = input_tree.code
|
||||
if code != output_code:
|
||||
if diff:
|
||||
lines = difflib.unified_diff(
|
||||
code.splitlines(keepends=True),
|
||||
output_code.splitlines(keepends=True),
|
||||
fromfile=filename,
|
||||
tofile=filename,
|
||||
)
|
||||
return None, list(lines)
|
||||
else:
|
||||
fp.write(output_code)
|
||||
fp.truncate()
|
||||
return None, None
|
||||
|
||||
|
||||
def _rewrite_notebook(
|
||||
filename: str,
|
||||
codemods: List[Type[ContextAwareTransformer]],
|
||||
diff: bool,
|
||||
context: CodemodContext,
|
||||
) -> Tuple[Optional[str], Optional[List[str]]]:
|
||||
"""Try to rewrite a Jupyter Notebook file."""
|
||||
import nbformat
|
||||
|
||||
file_path = Path(filename)
|
||||
if file_path.suffix != ".ipynb":
|
||||
raise ValueError("Only Jupyter Notebook files (.ipynb) are supported.")
|
||||
|
||||
with file_path.open("r", encoding="utf-8") as fp:
|
||||
notebook = nbformat.read(fp, as_version=4)
|
||||
|
||||
diffs = []
|
||||
|
||||
for cell in notebook.cells:
|
||||
if cell.cell_type == "code":
|
||||
code = "".join(cell.source)
|
||||
|
||||
# Skip code if any of the lines begin with a magic command or
|
||||
# a ! command.
|
||||
# We can try to handle later.
|
||||
if any(
|
||||
line.startswith("!") or line.startswith("%")
|
||||
for line in code.splitlines()
|
||||
):
|
||||
continue
|
||||
|
||||
input_tree = cst.parse_module(code)
|
||||
|
||||
# TODO(Team): Quick hack, need to figure out
|
||||
# how to handle this correctly.
|
||||
# This prevents the code from trying to re-insert the imports
|
||||
# for every cell in the notebook.
|
||||
local_context = CodemodContext()
|
||||
|
||||
for codemod in codemods:
|
||||
transformer = codemod(context=local_context)
|
||||
output_tree = transformer.transform_module(input_tree)
|
||||
input_tree = output_tree
|
||||
|
||||
output_code = input_tree.code
|
||||
if code != output_code:
|
||||
cell.source = output_code.splitlines(keepends=True)
|
||||
if diff:
|
||||
cell_diff = difflib.unified_diff(
|
||||
code.splitlines(keepends=True),
|
||||
output_code.splitlines(keepends=True),
|
||||
fromfile=filename,
|
||||
tofile=filename,
|
||||
)
|
||||
diffs.extend(list(cell_diff))
|
||||
|
||||
if diff:
|
||||
return None, diffs
|
||||
|
||||
with file_path.open("w", encoding="utf-8") as fp:
|
||||
nbformat.write(notebook, fp)
|
||||
|
||||
return None, None
|
||||
|
||||
|
||||
def run_codemods(
|
||||
codemods: List[Type[ContextAwareTransformer]],
|
||||
metadata_manager: FullRepoManager,
|
||||
scratch: Dict[str, Any],
|
||||
package: Path,
|
||||
diff: bool,
|
||||
filename: str,
|
||||
) -> Tuple[Union[str, None], Union[List[str], None]]:
|
||||
try:
|
||||
module_and_package = calculate_module_and_package(str(package), filename)
|
||||
context = CodemodContext(
|
||||
metadata_manager=metadata_manager,
|
||||
filename=filename,
|
||||
full_module_name=module_and_package.name,
|
||||
full_package_name=module_and_package.package,
|
||||
)
|
||||
context.scratch.update(scratch)
|
||||
|
||||
if filename.endswith(".ipynb"):
|
||||
return _rewrite_notebook(filename, codemods, diff, context)
|
||||
else:
|
||||
return _rewrite_file(filename, codemods, diff, context)
|
||||
except cst.ParserSyntaxError as exc:
|
||||
return (
|
||||
f"A syntax error happened on {filename}. This file cannot be "
|
||||
f"formatted.\n"
|
||||
f"{exc}"
|
||||
), None
|
||||
except Exception:
|
||||
return f"An error happened on {filename}.\n{traceback.format_exc()}", None
|
||||
|
||||
|
||||
def color_diff(console: Console, lines: Iterable[str]) -> None:
|
||||
for line in lines:
|
||||
line = line.rstrip("\n")
|
||||
if line.startswith("+"):
|
||||
console.print(line, style="green")
|
||||
elif line.startswith("-"):
|
||||
console.print(line, style="red")
|
||||
elif line.startswith("^"):
|
||||
console.print(line, style="blue")
|
||||
else:
|
||||
console.print(line, style="white")
|
||||
raise typer.Exit(code=final_code)
|
||||
|
@@ -6,8 +6,8 @@ authors = []
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.8.1,<4.0"
|
||||
langchain-core = ">=0.1.5,<0.3"
|
||||
python = ">=3.9,<4.0"
|
||||
langchain-core = "^0.3.0.dev"
|
||||
langchain-openai = ">=0.0.1"
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user