mirror of https://github.com/hwchase17/langchain
cli[minor]: Add ipynb support, add text_splitters (#20963)
parent
5e0b6b3e75
commit
d781560722
@ -0,0 +1,110 @@
|
||||
[
|
||||
[
|
||||
"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"
|
||||
]
|
||||
]
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,82 @@
|
||||
[
|
||||
[
|
||||
"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"
|
||||
]
|
||||
]
|
@ -1,45 +1,55 @@
|
||||
from langchain._api import suppress_langchain_deprecation_warning as sup2
|
||||
from langchain_core._api import suppress_langchain_deprecation_warning as sup1
|
||||
|
||||
from langchain_cli.namespaces.migrate.generate.generic import (
|
||||
generate_simplified_migrations,
|
||||
generate_raw_migrations,
|
||||
)
|
||||
|
||||
|
||||
def test_create_json_agent_migration() -> None:
|
||||
"""Test the migration of create_json_agent from langchain to langchain_community."""
|
||||
raw_migrations = generate_simplified_migrations(
|
||||
from_package="langchain", to_package="langchain_community"
|
||||
)
|
||||
json_agent_migrations = [
|
||||
migration for migration in raw_migrations if "create_json_agent" in migration[0]
|
||||
]
|
||||
assert json_agent_migrations == [
|
||||
(
|
||||
"langchain.agents.create_json_agent",
|
||||
"langchain_community.agent_toolkits.create_json_agent",
|
||||
),
|
||||
(
|
||||
"langchain.agents.agent_toolkits.create_json_agent",
|
||||
"langchain_community.agent_toolkits.create_json_agent",
|
||||
),
|
||||
(
|
||||
"langchain.agents.agent_toolkits.json.base.create_json_agent",
|
||||
"langchain_community.agent_toolkits.create_json_agent",
|
||||
),
|
||||
]
|
||||
with sup1():
|
||||
with sup2():
|
||||
raw_migrations = generate_simplified_migrations(
|
||||
from_package="langchain", to_package="langchain_community"
|
||||
)
|
||||
json_agent_migrations = [
|
||||
migration
|
||||
for migration in raw_migrations
|
||||
if "create_json_agent" in migration[0]
|
||||
]
|
||||
assert json_agent_migrations == [
|
||||
(
|
||||
"langchain.agents.create_json_agent",
|
||||
"langchain_community.agent_toolkits.create_json_agent",
|
||||
),
|
||||
(
|
||||
"langchain.agents.agent_toolkits.create_json_agent",
|
||||
"langchain_community.agent_toolkits.create_json_agent",
|
||||
),
|
||||
(
|
||||
"langchain.agents.agent_toolkits.json.base.create_json_agent",
|
||||
"langchain_community.agent_toolkits.create_json_agent",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
def test_create_single_store_retriever_db() -> None:
|
||||
"""Test migration from langchain to langchain_core"""
|
||||
raw_migrations = generate_simplified_migrations(
|
||||
from_package="langchain", to_package="langchain_core"
|
||||
)
|
||||
# SingleStore was an old name for VectorStoreRetriever
|
||||
single_store_migration = [
|
||||
migration for migration in raw_migrations if "SingleStore" in migration[0]
|
||||
]
|
||||
assert single_store_migration == [
|
||||
(
|
||||
"langchain.vectorstores.singlestoredb.SingleStoreDBRetriever",
|
||||
"langchain_core.vectorstores.VectorStoreRetriever",
|
||||
),
|
||||
]
|
||||
with sup1():
|
||||
with sup2():
|
||||
raw_migrations = generate_simplified_migrations(
|
||||
from_package="langchain", to_package="langchain_core"
|
||||
)
|
||||
# SingleStore was an old name for VectorStoreRetriever
|
||||
single_store_migration = [
|
||||
migration
|
||||
for migration in raw_migrations
|
||||
if "SingleStore" in migration[0]
|
||||
]
|
||||
assert single_store_migration == [
|
||||
(
|
||||
"langchain.vectorstores.singlestoredb.SingleStoreDBRetriever",
|
||||
"langchain_core.vectorstores.VectorStoreRetriever",
|
||||
),
|
||||
]
|
||||
|
Loading…
Reference in New Issue