diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic-1.0.7.dist-info/licenses/LICENSE b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic-1.0.7.dist-info/licenses/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..3957738673765912ca83a0048f833e095d61e087
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic-1.0.7.dist-info/licenses/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) LangChain, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..161d770ebd52437f336e55062b6c0c224e672a38
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/base_language.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/base_language.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..11332b1347a3dd5b795155bbccc4d937cc212888
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/base_language.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/base_memory.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/base_memory.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e9c42bbc4f7724826424d2fa954d2119a7057a3c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/base_memory.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/cache.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/cache.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..32b29ab2ae1437cb5a1e82188ddcd9213aec9c35
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/cache.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/env.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/env.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f4de246d68e84d1201f09e3ef06ff3058d1bd062
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/env.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/example_generator.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/example_generator.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bef419606cc6d91a832d5d76bafca5a5b0ea2f97
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/example_generator.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/formatting.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/formatting.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bc6f0ef780b167524ba06af49a76152640e75ae5
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/formatting.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/globals.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/globals.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..21ae6c13507dd70e2092a7c95dc1036d081beab9
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/globals.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/hub.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/hub.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f05e79e4f37cd905cbd37db39e4532c73d88dd18
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/hub.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/input.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/input.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..32f529bb185908bf088e072f6240bf0627ddacfb
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/input.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/model_laboratory.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/model_laboratory.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..caf173562e19951a77e09c7fc9d8e7e5f3b82165
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/model_laboratory.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/python.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/python.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fe5e265b147d542dacf9b9407ba1349a10e913d0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/python.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/requests.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/requests.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4e360bac451ce9bcc45049184c25685f5c855ac3
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/requests.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/serpapi.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/serpapi.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e77a6142b6f60b566ffe06fc59baf972f0e37492
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/serpapi.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/sql_database.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/sql_database.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..964642c49045d241deb282044c0d8f1467c9d2e9
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/sql_database.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/text_splitter.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/text_splitter.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..505c5ba4c7493acdb4144d833f499fce5254ba28
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/__pycache__/text_splitter.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..b8c055e5ed3c4051118f5d47b8b489e69233cf5c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__init__.py
@@ -0,0 +1,28 @@
+"""Helper functions for managing the LangChain API.
+
+This module is only relevant for LangChain developers, not for users.
+
+!!! warning
+
+ This module and its submodules are for internal use only. Do not use them in your
+ own code. We may change the API at any time with no warning.
+
+"""
+
+from langchain_classic._api.deprecation import (
+ LangChainDeprecationWarning,
+ deprecated,
+ suppress_langchain_deprecation_warning,
+ surface_langchain_deprecation_warnings,
+ warn_deprecated,
+)
+from langchain_classic._api.module_import import create_importer
+
+__all__ = [
+ "LangChainDeprecationWarning",
+ "create_importer",
+ "deprecated",
+ "suppress_langchain_deprecation_warning",
+ "surface_langchain_deprecation_warnings",
+ "warn_deprecated",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..90bda21db2e28b64feeb3dd449bdacc8c25a1450
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/deprecation.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/deprecation.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..45bdcefb948a7bf3aaeba84a0c0672e3264cb2fa
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/deprecation.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/interactive_env.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/interactive_env.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d09bd5ee40860a20c57717dbfda6b00aac15ba0f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/interactive_env.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/module_import.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/module_import.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2a55a6cbce3a5e0973c693398d963f78be0fddae
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/module_import.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/path.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/path.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..306047fc1bfde0f4ae30e40ca6c34e3ebbeb39c3
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/__pycache__/path.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/deprecation.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/deprecation.py
new file mode 100644
index 0000000000000000000000000000000000000000..6be277dbf411f57d3b94fc8969f254be5775fed3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/deprecation.py
@@ -0,0 +1,27 @@
+from langchain_core._api.deprecation import (
+ LangChainDeprecationWarning,
+ LangChainPendingDeprecationWarning,
+ deprecated,
+ suppress_langchain_deprecation_warning,
+ surface_langchain_deprecation_warnings,
+ warn_deprecated,
+)
+
+AGENT_DEPRECATION_WARNING = (
+ "Use `langchain.agents.create_agent` for new applications. It provides a "
+ "more flexible agent factory with middleware support, structured output, "
+ "and integration with LangGraph for persistence, streaming, and "
+ "human-in-the-loop workflows. Migration guide: "
+ "https://docs.langchain.com/oss/python/migrate/langchain-v1"
+)
+
+
+__all__ = [
+ "AGENT_DEPRECATION_WARNING",
+ "LangChainDeprecationWarning",
+ "LangChainPendingDeprecationWarning",
+ "deprecated",
+ "suppress_langchain_deprecation_warning",
+ "surface_langchain_deprecation_warnings",
+ "warn_deprecated",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/interactive_env.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/interactive_env.py
new file mode 100644
index 0000000000000000000000000000000000000000..7752b6b403cc1df30c5803891f53c94512e5e704
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/interactive_env.py
@@ -0,0 +1,5 @@
+def is_interactive_env() -> bool:
+ """Determine if running within IPython or Jupyter."""
+ import sys
+
+ return hasattr(sys, "ps2")
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/module_import.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/module_import.py
new file mode 100644
index 0000000000000000000000000000000000000000..0f84a3a0c9222e5de9c952247e97d130c31c06f6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/module_import.py
@@ -0,0 +1,156 @@
+import importlib
+from collections.abc import Callable
+from typing import Any
+
+from langchain_core._api import internal, warn_deprecated
+
+from langchain_classic._api.interactive_env import is_interactive_env
+
+ALLOWED_TOP_LEVEL_PKGS = {
+ "langchain_community",
+ "langchain_core",
+ "langchain_classic",
+}
+
+
+def create_importer(
+ package: str,
+ *,
+ module_lookup: dict[str, str] | None = None,
+ deprecated_lookups: dict[str, str] | None = None,
+ fallback_module: str | None = None,
+) -> Callable[[str], Any]:
+ """Create a function that helps retrieve objects from their new locations.
+
+ The goal of this function is to help users transition from deprecated
+ imports to new imports.
+
+ The function will raise deprecation warning on loops using
+ `deprecated_lookups` or `fallback_module`.
+
+ Module lookups will import without deprecation warnings (used to speed
+ up imports from large namespaces like llms or chat models).
+
+ This function should ideally only be used with deprecated imports not with
+ existing imports that are valid, as in addition to raising deprecation warnings
+ the dynamic imports can create other issues for developers (e.g.,
+ loss of type information, IDE support for going to definition etc).
+
+ Args:
+ package: Current package. Use `__package__`
+ module_lookup: Maps name of object to the module where it is defined.
+ e.g.,
+ ```json
+ {
+ "MyDocumentLoader": (
+ "langchain_community.document_loaders.my_document_loader"
+ )
+ }
+ ```
+ deprecated_lookups: Same as module look up, but will raise
+ deprecation warnings.
+ fallback_module: Module to import from if the object is not found in
+ `module_lookup` or if `module_lookup` is not provided.
+
+ Returns:
+ A function that imports objects from the specified modules.
+ """
+ all_module_lookup = {**(deprecated_lookups or {}), **(module_lookup or {})}
+
+ def import_by_name(name: str) -> Any:
+ """Import stores from `langchain_community`."""
+ # If not in interactive env, raise warning.
+ if all_module_lookup and name in all_module_lookup:
+ new_module = all_module_lookup[name]
+ if new_module.split(".")[0] not in ALLOWED_TOP_LEVEL_PKGS:
+ msg = (
+ f"Importing from {new_module} is not allowed. "
+ f"Allowed top-level packages are: {ALLOWED_TOP_LEVEL_PKGS}"
+ )
+ raise AssertionError(msg)
+
+ try:
+ module = importlib.import_module(new_module)
+ except ModuleNotFoundError as e:
+ if new_module.startswith("langchain_community"):
+ msg = (
+ f"Module {new_module} not found. "
+ "Please install langchain-community to access this module. "
+ "You can install it using `pip install -U langchain-community`"
+ )
+ raise ModuleNotFoundError(msg) from e
+ raise
+
+ try:
+ result = getattr(module, name)
+ if (
+ not is_interactive_env()
+ and deprecated_lookups
+ and name in deprecated_lookups
+ # Depth 3:
+ # -> internal.py
+ # |-> module_import.py
+ # |-> Module in langchain that uses this function
+ # |-> [calling code] whose frame we want to inspect.
+ and not internal.is_caller_internal(depth=3)
+ ):
+ warn_deprecated(
+ since="0.1",
+ pending=False,
+ removal="2.0.0",
+ message=(
+ f"Importing {name} from {package} is deprecated. "
+ f"Please replace deprecated imports:\n\n"
+ f">> from {package} import {name}\n\n"
+ "with new imports of:\n\n"
+ f">> from {new_module} import {name}\n"
+ "You can use the langchain cli to **automatically** "
+ "upgrade many imports. Please see documentation here "
+ ""
+ ),
+ )
+ except Exception as e:
+ msg = f"module {new_module} has no attribute {name}"
+ raise AttributeError(msg) from e
+
+ return result
+
+ if fallback_module:
+ try:
+ module = importlib.import_module(fallback_module)
+ result = getattr(module, name)
+ if (
+ not is_interactive_env()
+ # Depth 3:
+ # internal.py
+ # |-> module_import.py
+ # |->Module in langchain that uses this function
+ # |-> [calling code] whose frame we want to inspect.
+ and not internal.is_caller_internal(depth=3)
+ ):
+ warn_deprecated(
+ since="0.1",
+ pending=False,
+ removal="2.0.0",
+ message=(
+ f"Importing {name} from {package} is deprecated. "
+ f"Please replace deprecated imports:\n\n"
+ f">> from {package} import {name}\n\n"
+ "with new imports of:\n\n"
+ f">> from {fallback_module} import {name}\n"
+ "You can use the langchain cli to **automatically** "
+ "upgrade many imports. Please see documentation here "
+ ""
+ ),
+ )
+
+ except Exception as e:
+ msg = f"module {fallback_module} has no attribute {name}"
+ raise AttributeError(msg) from e
+
+ return result
+
+ msg = f"module {package} has no attribute {name}"
+ raise AttributeError(msg)
+
+ return import_by_name
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/path.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/path.py
new file mode 100644
index 0000000000000000000000000000000000000000..d54268626998878843574d3f67e003636f8e5fb1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/_api/path.py
@@ -0,0 +1,3 @@
+from langchain_core._api.path import as_import_path, get_relative_path
+
+__all__ = ["as_import_path", "get_relative_path"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/adapters/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/adapters/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/adapters/openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/adapters/openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..05192f4b7593431f096f77e58c9bb20195a57926
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/adapters/openai.py
@@ -0,0 +1,63 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.adapters.openai import (
+ Chat,
+ ChatCompletion,
+ ChatCompletionChunk,
+ ChatCompletions,
+ Choice,
+ ChoiceChunk,
+ Completions,
+ IndexableBaseModel,
+ chat,
+ convert_dict_to_message,
+ convert_message_to_dict,
+ convert_messages_for_finetuning,
+ convert_openai_messages,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+MODULE_LOOKUP = {
+ "IndexableBaseModel": "langchain_community.adapters.openai",
+ "Choice": "langchain_community.adapters.openai",
+ "ChatCompletions": "langchain_community.adapters.openai",
+ "ChoiceChunk": "langchain_community.adapters.openai",
+ "ChatCompletionChunk": "langchain_community.adapters.openai",
+ "convert_dict_to_message": "langchain_community.adapters.openai",
+ "convert_message_to_dict": "langchain_community.adapters.openai",
+ "convert_openai_messages": "langchain_community.adapters.openai",
+ "ChatCompletion": "langchain_community.adapters.openai",
+ "convert_messages_for_finetuning": "langchain_community.adapters.openai",
+ "Completions": "langchain_community.adapters.openai",
+ "Chat": "langchain_community.adapters.openai",
+ "chat": "langchain_community.adapters.openai",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=MODULE_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Chat",
+ "ChatCompletion",
+ "ChatCompletionChunk",
+ "ChatCompletions",
+ "Choice",
+ "ChoiceChunk",
+ "Completions",
+ "IndexableBaseModel",
+ "chat",
+ "convert_dict_to_message",
+ "convert_message_to_dict",
+ "convert_messages_for_finetuning",
+ "convert_openai_messages",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..48a4b3a6c55402ff47ad19c1c23f6013d0622ec5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/__init__.py
@@ -0,0 +1,164 @@
+"""**Agent** is a class that uses an LLM to choose a sequence of actions to take.
+
+In Chains, a sequence of actions is hardcoded. In Agents,
+a language model is used as a reasoning engine to determine which actions
+to take and in which order.
+
+Agents select and use **Tools** and **Toolkits** for actions.
+"""
+
+from pathlib import Path
+from typing import TYPE_CHECKING, Any
+
+from langchain_core._api.path import as_import_path
+from langchain_core.tools import Tool
+from langchain_core.tools.convert import tool
+
+from langchain_classic._api import create_importer
+from langchain_classic.agents.agent import (
+ Agent,
+ AgentExecutor,
+ AgentOutputParser,
+ BaseMultiActionAgent,
+ BaseSingleActionAgent,
+ LLMSingleActionAgent,
+)
+from langchain_classic.agents.agent_iterator import AgentExecutorIterator
+from langchain_classic.agents.agent_toolkits.vectorstore.base import (
+ create_vectorstore_agent,
+ create_vectorstore_router_agent,
+)
+from langchain_classic.agents.agent_types import AgentType
+from langchain_classic.agents.conversational.base import ConversationalAgent
+from langchain_classic.agents.conversational_chat.base import ConversationalChatAgent
+from langchain_classic.agents.initialize import initialize_agent
+from langchain_classic.agents.json_chat.base import create_json_chat_agent
+from langchain_classic.agents.loading import load_agent
+from langchain_classic.agents.mrkl.base import MRKLChain, ZeroShotAgent
+from langchain_classic.agents.openai_functions_agent.base import (
+ OpenAIFunctionsAgent,
+ create_openai_functions_agent,
+)
+from langchain_classic.agents.openai_functions_multi_agent.base import (
+ OpenAIMultiFunctionsAgent,
+)
+from langchain_classic.agents.openai_tools.base import create_openai_tools_agent
+from langchain_classic.agents.react.agent import create_react_agent
+from langchain_classic.agents.react.base import ReActChain, ReActTextWorldAgent
+from langchain_classic.agents.self_ask_with_search.base import (
+ SelfAskWithSearchChain,
+ create_self_ask_with_search_agent,
+)
+from langchain_classic.agents.structured_chat.base import (
+ StructuredChatAgent,
+ create_structured_chat_agent,
+)
+from langchain_classic.agents.tool_calling_agent.base import create_tool_calling_agent
+from langchain_classic.agents.xml.base import XMLAgent, create_xml_agent
+
+if TYPE_CHECKING:
+ from langchain_community.agent_toolkits.json.base import create_json_agent
+ from langchain_community.agent_toolkits.load_tools import (
+ get_all_tool_names,
+ load_huggingface_tool,
+ load_tools,
+ )
+ from langchain_community.agent_toolkits.openapi.base import create_openapi_agent
+ from langchain_community.agent_toolkits.powerbi.base import create_pbi_agent
+ from langchain_community.agent_toolkits.powerbi.chat_base import (
+ create_pbi_chat_agent,
+ )
+ from langchain_community.agent_toolkits.spark_sql.base import create_spark_sql_agent
+ from langchain_community.agent_toolkits.sql.base import create_sql_agent
+
+DEPRECATED_CODE = [
+ "create_csv_agent",
+ "create_pandas_dataframe_agent",
+ "create_spark_dataframe_agent",
+ "create_xorbits_agent",
+]
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "create_json_agent": "langchain_community.agent_toolkits.json.base",
+ "create_openapi_agent": "langchain_community.agent_toolkits.openapi.base",
+ "create_pbi_agent": "langchain_community.agent_toolkits.powerbi.base",
+ "create_pbi_chat_agent": "langchain_community.agent_toolkits.powerbi.chat_base",
+ "create_spark_sql_agent": "langchain_community.agent_toolkits.spark_sql.base",
+ "create_sql_agent": "langchain_community.agent_toolkits.sql.base",
+ "load_tools": "langchain_community.agent_toolkits.load_tools",
+ "load_huggingface_tool": "langchain_community.agent_toolkits.load_tools",
+ "get_all_tool_names": "langchain_community.agent_toolkits.load_tools",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Get attr name."""
+ if name in DEPRECATED_CODE:
+ # Get directory of langchain package
+ here = Path(__file__).parents[1]
+ relative_path = as_import_path(
+ Path(__file__).parent,
+ suffix=name,
+ relative_to=here,
+ )
+ old_path = "langchain_classic." + relative_path
+ new_path = "langchain_experimental." + relative_path
+ msg = (
+ f"{name} has been moved to langchain_experimental. "
+ "See https://github.com/langchain-ai/langchain/discussions/11680"
+ "for more information.\n"
+ f"Please update your import statement from: `{old_path}` to `{new_path}`."
+ )
+ raise ImportError(msg)
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Agent",
+ "AgentExecutor",
+ "AgentExecutorIterator",
+ "AgentOutputParser",
+ "AgentType",
+ "BaseMultiActionAgent",
+ "BaseSingleActionAgent",
+ "ConversationalAgent",
+ "ConversationalChatAgent",
+ "LLMSingleActionAgent",
+ "MRKLChain",
+ "OpenAIFunctionsAgent",
+ "OpenAIMultiFunctionsAgent",
+ "ReActChain",
+ "ReActTextWorldAgent",
+ "SelfAskWithSearchChain",
+ "StructuredChatAgent",
+ "Tool",
+ "XMLAgent",
+ "ZeroShotAgent",
+ "create_json_agent",
+ "create_json_chat_agent",
+ "create_openai_functions_agent",
+ "create_openai_tools_agent",
+ "create_openapi_agent",
+ "create_pbi_agent",
+ "create_pbi_chat_agent",
+ "create_react_agent",
+ "create_self_ask_with_search_agent",
+ "create_spark_sql_agent",
+ "create_sql_agent",
+ "create_structured_chat_agent",
+ "create_tool_calling_agent",
+ "create_vectorstore_agent",
+ "create_vectorstore_router_agent",
+ "create_xml_agent",
+ "get_all_tool_names",
+ "initialize_agent",
+ "load_agent",
+ "load_huggingface_tool",
+ "load_tools",
+ "tool",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..b92a023ab5836665e06388c4fde9a5fad1751410
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent.py
@@ -0,0 +1,1792 @@
+"""Chain that takes in an input and produces an action and action input."""
+
+from __future__ import annotations
+
+import asyncio
+import builtins
+import contextlib
+import json
+import logging
+import time
+from abc import abstractmethod
+from collections.abc import AsyncIterator, Callable, Iterator, Sequence
+from pathlib import Path
+from typing import (
+ Any,
+ cast,
+)
+
+import yaml
+from langchain_core._api import deprecated
+from langchain_core.agents import AgentAction, AgentFinish, AgentStep
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForChainRun,
+ AsyncCallbackManagerForToolRun,
+ BaseCallbackManager,
+ CallbackManagerForChainRun,
+ CallbackManagerForToolRun,
+ Callbacks,
+)
+from langchain_core.exceptions import OutputParserException
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.messages import BaseMessage
+from langchain_core.output_parsers import BaseOutputParser
+from langchain_core.prompts import BasePromptTemplate
+from langchain_core.prompts.few_shot import FewShotPromptTemplate
+from langchain_core.prompts.prompt import PromptTemplate
+from langchain_core.runnables import Runnable, RunnableConfig, ensure_config
+from langchain_core.runnables.utils import AddableDict
+from langchain_core.tools import BaseTool
+from langchain_core.utils.input import get_color_mapping
+from pydantic import BaseModel, ConfigDict, model_validator
+from typing_extensions import Self, override
+
+from langchain_classic._api.deprecation import AGENT_DEPRECATION_WARNING
+from langchain_classic.agents.agent_iterator import AgentExecutorIterator
+from langchain_classic.agents.agent_types import AgentType
+from langchain_classic.agents.tools import InvalidTool
+from langchain_classic.chains.base import Chain
+from langchain_classic.chains.llm import LLMChain
+from langchain_classic.utilities.asyncio import asyncio_timeout
+
+logger = logging.getLogger(__name__)
+
+
+class BaseSingleActionAgent(BaseModel):
+ """Base Single Action Agent class."""
+
+ @property
+ def return_values(self) -> list[str]:
+ """Return values of the agent."""
+ return ["output"]
+
+ def get_allowed_tools(self) -> list[str] | None:
+ """Get allowed tools."""
+ return None
+
+ @abstractmethod
+ def plan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+
+ @abstractmethod
+ async def aplan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Async given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+
+ @property
+ @abstractmethod
+ def input_keys(self) -> list[str]:
+ """Return the input keys."""
+
+ def return_stopped_response(
+ self,
+ early_stopping_method: str,
+ intermediate_steps: list[tuple[AgentAction, str]], # noqa: ARG002
+ **_: Any,
+ ) -> AgentFinish:
+ """Return response when agent has been stopped due to max iterations.
+
+ Args:
+ early_stopping_method: Method to use for early stopping.
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+
+ Returns:
+ Agent finish object.
+
+ Raises:
+ ValueError: If `early_stopping_method` is not supported.
+ """
+ if early_stopping_method == "force":
+ # `force` just returns a constant string
+ return AgentFinish(
+ {"output": "Agent stopped due to iteration limit or time limit."},
+ "",
+ )
+ msg = f"Got unsupported early_stopping_method `{early_stopping_method}`"
+ raise ValueError(msg)
+
+ @classmethod
+ def from_llm_and_tools(
+ cls,
+ llm: BaseLanguageModel,
+ tools: Sequence[BaseTool],
+ callback_manager: BaseCallbackManager | None = None,
+ **kwargs: Any,
+ ) -> BaseSingleActionAgent:
+ """Construct an agent from an LLM and tools.
+
+ Args:
+ llm: Language model to use.
+ tools: Tools to use.
+ callback_manager: Callback manager to use.
+ kwargs: Additional arguments.
+
+ Returns:
+ Agent object.
+ """
+ raise NotImplementedError
+
+ @property
+ def _agent_type(self) -> str:
+ """Return Identifier of an agent type."""
+ raise NotImplementedError
+
+ @override
+ def dict(self, **kwargs: Any) -> builtins.dict:
+ """Return dictionary representation of agent.
+
+ Returns:
+ Dictionary representation of agent.
+ """
+ _dict = super().model_dump()
+ try:
+ _type = self._agent_type
+ except NotImplementedError:
+ _type = None
+ if isinstance(_type, AgentType):
+ _dict["_type"] = str(_type.value)
+ elif _type is not None:
+ _dict["_type"] = _type
+ return _dict
+
+ def save(self, file_path: Path | str) -> None:
+ """Save the agent.
+
+ Args:
+ file_path: Path to file to save the agent to.
+
+ Example:
+ ```python
+ # If working with agent executor
+ agent.agent.save(file_path="path/agent.yaml")
+ ```
+ """
+ # Convert file to Path object.
+ save_path = Path(file_path) if isinstance(file_path, str) else file_path
+
+ directory_path = save_path.parent
+ directory_path.mkdir(parents=True, exist_ok=True)
+
+ # Fetch dictionary to save
+ agent_dict = self.dict()
+ if "_type" not in agent_dict:
+ msg = f"Agent {self} does not support saving"
+ raise NotImplementedError(msg)
+
+ if save_path.suffix == ".json":
+ with save_path.open("w") as f:
+ json.dump(agent_dict, f, indent=4)
+ elif save_path.suffix.endswith((".yaml", ".yml")):
+ with save_path.open("w") as f:
+ yaml.dump(agent_dict, f, default_flow_style=False)
+ else:
+ msg = f"{save_path} must be json or yaml"
+ raise ValueError(msg)
+
+ def tool_run_logging_kwargs(self) -> builtins.dict:
+ """Return logging kwargs for tool run."""
+ return {}
+
+
+class BaseMultiActionAgent(BaseModel):
+ """Base Multi Action Agent class."""
+
+ @property
+ def return_values(self) -> list[str]:
+ """Return values of the agent."""
+ return ["output"]
+
+ def get_allowed_tools(self) -> list[str] | None:
+ """Get allowed tools.
+
+ Returns:
+ Allowed tools.
+ """
+ return None
+
+ @abstractmethod
+ def plan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> list[AgentAction] | AgentFinish:
+ """Given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with the observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Actions specifying what tool to use.
+ """
+
+ @abstractmethod
+ async def aplan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> list[AgentAction] | AgentFinish:
+ """Async given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with the observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Actions specifying what tool to use.
+ """
+
+ @property
+ @abstractmethod
+ def input_keys(self) -> list[str]:
+ """Return the input keys."""
+
+ def return_stopped_response(
+ self,
+ early_stopping_method: str,
+ intermediate_steps: list[tuple[AgentAction, str]], # noqa: ARG002
+ **_: Any,
+ ) -> AgentFinish:
+ """Return response when agent has been stopped due to max iterations.
+
+ Args:
+ early_stopping_method: Method to use for early stopping.
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+
+ Returns:
+ Agent finish object.
+
+ Raises:
+ ValueError: If `early_stopping_method` is not supported.
+ """
+ if early_stopping_method == "force":
+ # `force` just returns a constant string
+ return AgentFinish({"output": "Agent stopped due to max iterations."}, "")
+ msg = f"Got unsupported early_stopping_method `{early_stopping_method}`"
+ raise ValueError(msg)
+
+ @property
+ def _agent_type(self) -> str:
+ """Return Identifier of an agent type."""
+ raise NotImplementedError
+
+ @override
+ def dict(self, **kwargs: Any) -> builtins.dict:
+ """Return dictionary representation of agent."""
+ _dict = super().model_dump()
+ with contextlib.suppress(NotImplementedError):
+ _dict["_type"] = str(self._agent_type)
+ return _dict
+
+ def save(self, file_path: Path | str) -> None:
+ """Save the agent.
+
+ Args:
+ file_path: Path to file to save the agent to.
+
+ Raises:
+ NotImplementedError: If agent does not support saving.
+ ValueError: If `file_path` is not json or yaml.
+
+ Example:
+ ```python
+ # If working with agent executor
+ agent.agent.save(file_path="path/agent.yaml")
+ ```
+ """
+ # Convert file to Path object.
+ save_path = Path(file_path) if isinstance(file_path, str) else file_path
+
+ # Fetch dictionary to save
+ agent_dict = self.dict()
+ if "_type" not in agent_dict:
+ msg = f"Agent {self} does not support saving."
+ raise NotImplementedError(msg)
+
+ directory_path = save_path.parent
+ directory_path.mkdir(parents=True, exist_ok=True)
+
+ if save_path.suffix == ".json":
+ with save_path.open("w") as f:
+ json.dump(agent_dict, f, indent=4)
+ elif save_path.suffix.endswith((".yaml", ".yml")):
+ with save_path.open("w") as f:
+ yaml.dump(agent_dict, f, default_flow_style=False)
+ else:
+ msg = f"{save_path} must be json or yaml"
+ raise ValueError(msg)
+
+ def tool_run_logging_kwargs(self) -> builtins.dict:
+ """Return logging kwargs for tool run."""
+ return {}
+
+
+class AgentOutputParser(BaseOutputParser[AgentAction | AgentFinish]):
+ """Base class for parsing agent output into agent action/finish."""
+
+ @abstractmethod
+ def parse(self, text: str) -> AgentAction | AgentFinish:
+ """Parse text into agent action/finish."""
+
+
+class MultiActionAgentOutputParser(
+ BaseOutputParser[list[AgentAction] | AgentFinish],
+):
+ """Base class for parsing agent output into agent actions/finish.
+
+ This is used for agents that can return multiple actions.
+ """
+
+ @abstractmethod
+ def parse(self, text: str) -> list[AgentAction] | AgentFinish:
+ """Parse text into agent actions/finish.
+
+ Args:
+ text: Text to parse.
+
+ Returns:
+ List of agent actions or agent finish.
+ """
+
+
+class RunnableAgent(BaseSingleActionAgent):
+ """Agent powered by Runnables."""
+
+ runnable: Runnable[dict, AgentAction | AgentFinish]
+ """Runnable to call to get agent action."""
+ input_keys_arg: list[str] = []
+ return_keys_arg: list[str] = []
+ stream_runnable: bool = True
+ """Whether to stream from the runnable or not.
+
+ If `True` then underlying LLM is invoked in a streaming fashion to make it possible
+ to get access to the individual LLM tokens when using stream_log with the
+ `AgentExecutor`. If `False` then LLM is invoked in a non-streaming fashion and
+ individual LLM tokens will not be available in stream_log.
+ """
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ @property
+ def return_values(self) -> list[str]:
+ """Return values of the agent."""
+ return self.return_keys_arg
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Return the input keys."""
+ return self.input_keys_arg
+
+ def plan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Based on past history and current inputs, decide what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with the observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ inputs = {**kwargs, "intermediate_steps": intermediate_steps}
+ final_output: Any = None
+ if self.stream_runnable:
+ # Use streaming to make sure that the underlying LLM is invoked in a
+ # streaming
+ # fashion to make it possible to get access to the individual LLM tokens
+ # when using stream_log with the AgentExecutor.
+ # Because the response from the plan is not a generator, we need to
+ # accumulate the output into final output and return that.
+ for chunk in self.runnable.stream(inputs, config={"callbacks": callbacks}):
+ if final_output is None:
+ final_output = chunk
+ else:
+ final_output += chunk
+ else:
+ final_output = self.runnable.invoke(inputs, config={"callbacks": callbacks})
+
+ return final_output
+
+ async def aplan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Async based on past history and current inputs, decide what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ inputs = {**kwargs, "intermediate_steps": intermediate_steps}
+ final_output: Any = None
+ if self.stream_runnable:
+ # Use streaming to make sure that the underlying LLM is invoked in a
+ # streaming
+ # fashion to make it possible to get access to the individual LLM tokens
+ # when using stream_log with the AgentExecutor.
+ # Because the response from the plan is not a generator, we need to
+ # accumulate the output into final output and return that.
+ async for chunk in self.runnable.astream(
+ inputs,
+ config={"callbacks": callbacks},
+ ):
+ if final_output is None:
+ final_output = chunk
+ else:
+ final_output += chunk
+ else:
+ final_output = await self.runnable.ainvoke(
+ inputs,
+ config={"callbacks": callbacks},
+ )
+ return final_output
+
+
+class RunnableMultiActionAgent(BaseMultiActionAgent):
+ """Agent powered by Runnables."""
+
+ runnable: Runnable[dict, list[AgentAction] | AgentFinish]
+ """Runnable to call to get agent actions."""
+ input_keys_arg: list[str] = []
+ return_keys_arg: list[str] = []
+ stream_runnable: bool = True
+ """Whether to stream from the runnable or not.
+
+ If `True` then underlying LLM is invoked in a streaming fashion to make it possible
+ to get access to the individual LLM tokens when using stream_log with the
+ `AgentExecutor`. If `False` then LLM is invoked in a non-streaming fashion and
+ individual LLM tokens will not be available in stream_log.
+ """
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ @property
+ def return_values(self) -> list[str]:
+ """Return values of the agent."""
+ return self.return_keys_arg
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Return the input keys.
+
+ Returns:
+ List of input keys.
+ """
+ return self.input_keys_arg
+
+ def plan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> list[AgentAction] | AgentFinish:
+ """Based on past history and current inputs, decide what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with the observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ inputs = {**kwargs, "intermediate_steps": intermediate_steps}
+ final_output: Any = None
+ if self.stream_runnable:
+ # Use streaming to make sure that the underlying LLM is invoked in a
+ # streaming
+ # fashion to make it possible to get access to the individual LLM tokens
+ # when using stream_log with the AgentExecutor.
+ # Because the response from the plan is not a generator, we need to
+ # accumulate the output into final output and return that.
+ for chunk in self.runnable.stream(inputs, config={"callbacks": callbacks}):
+ if final_output is None:
+ final_output = chunk
+ else:
+ final_output += chunk
+ else:
+ final_output = self.runnable.invoke(inputs, config={"callbacks": callbacks})
+
+ return final_output
+
+ async def aplan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> list[AgentAction] | AgentFinish:
+ """Async based on past history and current inputs, decide what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ inputs = {**kwargs, "intermediate_steps": intermediate_steps}
+ final_output: Any = None
+ if self.stream_runnable:
+ # Use streaming to make sure that the underlying LLM is invoked in a
+ # streaming
+ # fashion to make it possible to get access to the individual LLM tokens
+ # when using stream_log with the AgentExecutor.
+ # Because the response from the plan is not a generator, we need to
+ # accumulate the output into final output and return that.
+ async for chunk in self.runnable.astream(
+ inputs,
+ config={"callbacks": callbacks},
+ ):
+ if final_output is None:
+ final_output = chunk
+ else:
+ final_output += chunk
+ else:
+ final_output = await self.runnable.ainvoke(
+ inputs,
+ config={"callbacks": callbacks},
+ )
+
+ return final_output
+
+
+@deprecated(
+ "0.1.0",
+ message=AGENT_DEPRECATION_WARNING,
+ removal="2.0.0",
+)
+class LLMSingleActionAgent(BaseSingleActionAgent):
+ """Base class for single action agents."""
+
+ llm_chain: LLMChain
+ """LLMChain to use for agent."""
+ output_parser: AgentOutputParser
+ """Output parser to use for agent."""
+ stop: list[str]
+ """List of strings to stop on."""
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Return the input keys.
+
+ Returns:
+ List of input keys.
+ """
+ return list(set(self.llm_chain.input_keys) - {"intermediate_steps"})
+
+ @override
+ def dict(self, **kwargs: Any) -> builtins.dict:
+ """Return dictionary representation of agent."""
+ _dict = super().dict()
+ del _dict["output_parser"]
+ return _dict
+
+ def plan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with the observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ output = self.llm_chain.run(
+ intermediate_steps=intermediate_steps,
+ stop=self.stop,
+ callbacks=callbacks,
+ **kwargs,
+ )
+ return self.output_parser.parse(output)
+
+ async def aplan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Async given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ output = await self.llm_chain.arun(
+ intermediate_steps=intermediate_steps,
+ stop=self.stop,
+ callbacks=callbacks,
+ **kwargs,
+ )
+ return self.output_parser.parse(output)
+
+ def tool_run_logging_kwargs(self) -> builtins.dict:
+ """Return logging kwargs for tool run."""
+ return {
+ "llm_prefix": "",
+ "observation_prefix": "" if len(self.stop) == 0 else self.stop[0],
+ }
+
+
+@deprecated(
+ "0.1.0",
+ message=AGENT_DEPRECATION_WARNING,
+ removal="2.0.0",
+)
+class Agent(BaseSingleActionAgent):
+ """Agent that calls the language model and deciding the action.
+
+ This is driven by a LLMChain. The prompt in the LLMChain MUST include
+ a variable called "agent_scratchpad" where the agent can put its
+ intermediary work.
+ """
+
+ llm_chain: LLMChain
+ """LLMChain to use for agent."""
+ output_parser: AgentOutputParser
+ """Output parser to use for agent."""
+ allowed_tools: list[str] | None = None
+ """Allowed tools for the agent. If `None`, all tools are allowed."""
+
+ @override
+ def dict(self, **kwargs: Any) -> builtins.dict:
+ """Return dictionary representation of agent."""
+ _dict = super().dict()
+ del _dict["output_parser"]
+ return _dict
+
+ def get_allowed_tools(self) -> list[str] | None:
+ """Get allowed tools."""
+ return self.allowed_tools
+
+ @property
+ def return_values(self) -> list[str]:
+ """Return values of the agent."""
+ return ["output"]
+
+ @property
+ def _stop(self) -> list[str]:
+ return [
+ f"\n{self.observation_prefix.rstrip()}",
+ f"\n\t{self.observation_prefix.rstrip()}",
+ ]
+
+ def _construct_scratchpad(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ ) -> str | list[BaseMessage]:
+ """Construct the scratchpad that lets the agent continue its thought process."""
+ thoughts = ""
+ for action, observation in intermediate_steps:
+ thoughts += action.log
+ thoughts += f"\n{self.observation_prefix}{observation}\n{self.llm_prefix}"
+ return thoughts
+
+ def plan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ full_inputs = self.get_full_inputs(intermediate_steps, **kwargs)
+ full_output = self.llm_chain.predict(callbacks=callbacks, **full_inputs)
+ return self.output_parser.parse(full_output)
+
+ async def aplan(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentAction | AgentFinish:
+ """Async given input, decided what to do.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ callbacks: Callbacks to run.
+ **kwargs: User inputs.
+
+ Returns:
+ Action specifying what tool to use.
+ """
+ full_inputs = self.get_full_inputs(intermediate_steps, **kwargs)
+ full_output = await self.llm_chain.apredict(callbacks=callbacks, **full_inputs)
+ return await self.output_parser.aparse(full_output)
+
+ def get_full_inputs(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ **kwargs: Any,
+ ) -> builtins.dict[str, Any]:
+ """Create the full inputs for the LLMChain from intermediate steps.
+
+ Args:
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ **kwargs: User inputs.
+
+ Returns:
+ Full inputs for the LLMChain.
+ """
+ thoughts = self._construct_scratchpad(intermediate_steps)
+ new_inputs = {"agent_scratchpad": thoughts, "stop": self._stop}
+ return {**kwargs, **new_inputs}
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Return the input keys."""
+ return list(set(self.llm_chain.input_keys) - {"agent_scratchpad"})
+
+ @model_validator(mode="after")
+ def validate_prompt(self) -> Self:
+ """Validate that prompt matches format.
+
+ Args:
+ values: Values to validate.
+
+ Returns:
+ Validated values.
+
+ Raises:
+ ValueError: If `agent_scratchpad` is not in prompt.input_variables
+ and prompt is not a FewShotPromptTemplate or a PromptTemplate.
+ """
+ prompt = self.llm_chain.prompt
+ if "agent_scratchpad" not in prompt.input_variables:
+ logger.warning(
+ "`agent_scratchpad` should be a variable in prompt.input_variables."
+ " Did not find it, so adding it at the end.",
+ )
+ prompt.input_variables.append("agent_scratchpad")
+ if isinstance(prompt, PromptTemplate):
+ prompt.template += "\n{agent_scratchpad}"
+ elif isinstance(prompt, FewShotPromptTemplate):
+ prompt.suffix += "\n{agent_scratchpad}"
+ else:
+ msg = f"Got unexpected prompt type {type(prompt)}"
+ raise ValueError(msg)
+ return self
+
+ @property
+ @abstractmethod
+ def observation_prefix(self) -> str:
+ """Prefix to append the observation with."""
+
+ @property
+ @abstractmethod
+ def llm_prefix(self) -> str:
+ """Prefix to append the LLM call with."""
+
+ @classmethod
+ @abstractmethod
+ def create_prompt(cls, tools: Sequence[BaseTool]) -> BasePromptTemplate:
+ """Create a prompt for this class.
+
+ Args:
+ tools: Tools to use.
+
+ Returns:
+ Prompt template.
+ """
+
+ @classmethod
+ def _validate_tools(cls, tools: Sequence[BaseTool]) -> None:
+ """Validate that appropriate tools are passed in.
+
+ Args:
+ tools: Tools to use.
+ """
+
+ @classmethod
+ @abstractmethod
+ def _get_default_output_parser(cls, **kwargs: Any) -> AgentOutputParser:
+ """Get default output parser for this class."""
+
+ @classmethod
+ def from_llm_and_tools(
+ cls,
+ llm: BaseLanguageModel,
+ tools: Sequence[BaseTool],
+ callback_manager: BaseCallbackManager | None = None,
+ output_parser: AgentOutputParser | None = None,
+ **kwargs: Any,
+ ) -> Agent:
+ """Construct an agent from an LLM and tools.
+
+ Args:
+ llm: Language model to use.
+ tools: Tools to use.
+ callback_manager: Callback manager to use.
+ output_parser: Output parser to use.
+ kwargs: Additional arguments.
+
+ Returns:
+ Agent object.
+ """
+ cls._validate_tools(tools)
+ llm_chain = LLMChain(
+ llm=llm,
+ prompt=cls.create_prompt(tools),
+ callback_manager=callback_manager,
+ )
+ tool_names = [tool.name for tool in tools]
+ _output_parser = output_parser or cls._get_default_output_parser()
+ return cls(
+ llm_chain=llm_chain,
+ allowed_tools=tool_names,
+ output_parser=_output_parser,
+ **kwargs,
+ )
+
+ def return_stopped_response(
+ self,
+ early_stopping_method: str,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ **kwargs: Any,
+ ) -> AgentFinish:
+ """Return response when agent has been stopped due to max iterations.
+
+ Args:
+ early_stopping_method: Method to use for early stopping.
+ intermediate_steps: Steps the LLM has taken to date,
+ along with observations.
+ **kwargs: User inputs.
+
+ Returns:
+ Agent finish object.
+
+ Raises:
+ ValueError: If `early_stopping_method` is not in ['force', 'generate'].
+ """
+ if early_stopping_method == "force":
+ # `force` just returns a constant string
+ return AgentFinish(
+ {"output": "Agent stopped due to iteration limit or time limit."},
+ "",
+ )
+ if early_stopping_method == "generate":
+ # Generate does one final forward pass
+ thoughts = ""
+ for action, observation in intermediate_steps:
+ thoughts += action.log
+ thoughts += (
+ f"\n{self.observation_prefix}{observation}\n{self.llm_prefix}"
+ )
+ # Adding to the previous steps, we now tell the LLM to make a final pred
+ thoughts += (
+ "\n\nI now need to return a final answer based on the previous steps:"
+ )
+ new_inputs = {"agent_scratchpad": thoughts, "stop": self._stop}
+ full_inputs = {**kwargs, **new_inputs}
+ full_output = self.llm_chain.predict(**full_inputs)
+ # We try to extract a final answer
+ parsed_output = self.output_parser.parse(full_output)
+ if isinstance(parsed_output, AgentFinish):
+ # If we can extract, we send the correct stuff
+ return parsed_output
+ # If we can extract, but the tool is not the final tool,
+ # we just return the full output
+ return AgentFinish({"output": full_output}, full_output)
+ msg = (
+ "early_stopping_method should be one of `force` or `generate`, "
+ f"got {early_stopping_method}"
+ )
+ raise ValueError(msg)
+
+ def tool_run_logging_kwargs(self) -> builtins.dict:
+ """Return logging kwargs for tool run."""
+ return {
+ "llm_prefix": self.llm_prefix,
+ "observation_prefix": self.observation_prefix,
+ }
+
+
+class ExceptionTool(BaseTool):
+ """Tool that just returns the query."""
+
+ name: str = "_Exception"
+ """Name of the tool."""
+ description: str = "Exception tool"
+ """Description of the tool."""
+
+ @override
+ def _run(
+ self,
+ query: str,
+ run_manager: CallbackManagerForToolRun | None = None,
+ ) -> str:
+ return query
+
+ @override
+ async def _arun(
+ self,
+ query: str,
+ run_manager: AsyncCallbackManagerForToolRun | None = None,
+ ) -> str:
+ return query
+
+
+NextStepOutput = list[AgentFinish | AgentAction | AgentStep]
+RunnableAgentType = RunnableAgent | RunnableMultiActionAgent
+
+
+class AgentExecutor(Chain):
+ """Agent that is using tools."""
+
+ agent: BaseSingleActionAgent | BaseMultiActionAgent | Runnable
+ """The agent to run for creating a plan and determining actions
+ to take at each step of the execution loop."""
+ tools: Sequence[BaseTool]
+ """The valid tools the agent can call."""
+ return_intermediate_steps: bool = False
+ """Whether to return the agent's trajectory of intermediate steps
+ at the end in addition to the final output."""
+ max_iterations: int | None = 15
+ """The maximum number of steps to take before ending the execution
+ loop.
+
+ Setting to 'None' could lead to an infinite loop."""
+ max_execution_time: float | None = None
+ """The maximum amount of wall clock time to spend in the execution
+ loop.
+ """
+ early_stopping_method: str = "force"
+ """The method to use for early stopping if the agent never
+ returns `AgentFinish`. Either 'force' or 'generate'.
+
+ `"force"` returns a string saying that it stopped because it met a
+ time or iteration limit.
+
+ `"generate"` calls the agent's LLM Chain one final time to generate
+ a final answer based on the previous steps.
+ """
+ handle_parsing_errors: bool | str | Callable[[OutputParserException], str] = False
+ """How to handle errors raised by the agent's output parser.
+ Defaults to `False`, which raises the error.
+ If `true`, the error will be sent back to the LLM as an observation.
+ If a string, the string itself will be sent to the LLM as an observation.
+ If a callable function, the function will be called with the exception as an
+ argument, and the result of that function will be passed to the agent as an
+ observation.
+ """
+ trim_intermediate_steps: (
+ int | Callable[[list[tuple[AgentAction, str]]], list[tuple[AgentAction, str]]]
+ ) = -1
+ """How to trim the intermediate steps before returning them.
+ Defaults to -1, which means no trimming.
+ """
+
+ @classmethod
+ def from_agent_and_tools(
+ cls,
+ agent: BaseSingleActionAgent | BaseMultiActionAgent | Runnable,
+ tools: Sequence[BaseTool],
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> AgentExecutor:
+ """Create from agent and tools.
+
+ Args:
+ agent: Agent to use.
+ tools: Tools to use.
+ callbacks: Callbacks to use.
+ kwargs: Additional arguments.
+
+ Returns:
+ Agent executor object.
+ """
+ return cls(
+ agent=agent,
+ tools=tools,
+ callbacks=callbacks,
+ **kwargs,
+ )
+
+ @model_validator(mode="after")
+ def validate_tools(self) -> Self:
+ """Validate that tools are compatible with agent.
+
+ Args:
+ values: Values to validate.
+
+ Returns:
+ Validated values.
+
+ Raises:
+ ValueError: If allowed tools are different than provided tools.
+ """
+ agent = self.agent
+ tools = self.tools
+ allowed_tools = agent.get_allowed_tools() # type: ignore[union-attr]
+ if allowed_tools is not None and set(allowed_tools) != {
+ tool.name for tool in tools
+ }:
+ msg = (
+ f"Allowed tools ({allowed_tools}) different than "
+ f"provided tools ({[tool.name for tool in tools]})"
+ )
+ raise ValueError(msg)
+ return self
+
+ @model_validator(mode="before")
+ @classmethod
+ def validate_runnable_agent(cls, values: dict) -> Any:
+ """Convert runnable to agent if passed in.
+
+ Args:
+ values: Values to validate.
+
+ Returns:
+ Validated values.
+ """
+ agent = values.get("agent")
+ if agent and isinstance(agent, Runnable):
+ try:
+ output_type = agent.OutputType
+ except TypeError:
+ multi_action = False
+ except Exception:
+ logger.exception("Unexpected error getting OutputType from agent")
+ multi_action = False
+ else:
+ multi_action = output_type == list[AgentAction] | AgentFinish
+
+ stream_runnable = values.pop("stream_runnable", True)
+ if multi_action:
+ values["agent"] = RunnableMultiActionAgent(
+ runnable=agent,
+ stream_runnable=stream_runnable,
+ )
+ else:
+ values["agent"] = RunnableAgent(
+ runnable=agent,
+ stream_runnable=stream_runnable,
+ )
+ return values
+
+ @property
+ def _action_agent(self) -> BaseSingleActionAgent | BaseMultiActionAgent:
+ """Type cast self.agent.
+
+ If the `agent` attribute is a Runnable, it will be converted one of
+ RunnableAgentType in the validate_runnable_agent root_validator.
+
+ To support instantiating with a Runnable, here we explicitly cast the type
+ to reflect the changes made in the root_validator.
+ """
+ if isinstance(self.agent, Runnable):
+ return cast("RunnableAgentType", self.agent)
+ return self.agent
+
+ @override
+ def save(self, file_path: Path | str) -> None:
+ """Raise error - saving not supported for Agent Executors.
+
+ Args:
+ file_path: Path to save to.
+
+ Raises:
+ ValueError: Saving not supported for agent executors.
+ """
+ msg = (
+ "Saving not supported for agent executors. "
+ "If you are trying to save the agent, please use the "
+ "`.save_agent(...)`"
+ )
+ raise ValueError(msg)
+
+ def save_agent(self, file_path: Path | str) -> None:
+ """Save the underlying agent.
+
+ Args:
+ file_path: Path to save to.
+ """
+ return self._action_agent.save(file_path)
+
+ def iter(
+ self,
+ inputs: Any,
+ callbacks: Callbacks = None,
+ *,
+ include_run_info: bool = False,
+ async_: bool = False, # noqa: ARG002 arg kept for backwards compat, but ignored
+ ) -> AgentExecutorIterator:
+ """Enables iteration over steps taken to reach final output.
+
+ Args:
+ inputs: Inputs to the agent.
+ callbacks: Callbacks to run.
+ include_run_info: Whether to include run info.
+ async_: Whether to run async. (Ignored)
+
+ Returns:
+ Agent executor iterator object.
+ """
+ return AgentExecutorIterator(
+ self,
+ inputs,
+ callbacks,
+ tags=self.tags,
+ include_run_info=include_run_info,
+ )
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Return the input keys."""
+ return self._action_agent.input_keys
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Return the singular output key."""
+ if self.return_intermediate_steps:
+ return [*self._action_agent.return_values, "intermediate_steps"]
+ return self._action_agent.return_values
+
+ def lookup_tool(self, name: str) -> BaseTool:
+ """Lookup tool by name.
+
+ Args:
+ name: Name of tool.
+
+ Returns:
+ Tool object.
+ """
+ return {tool.name: tool for tool in self.tools}[name]
+
+ def _should_continue(self, iterations: int, time_elapsed: float) -> bool:
+ if self.max_iterations is not None and iterations >= self.max_iterations:
+ return False
+ return self.max_execution_time is None or time_elapsed < self.max_execution_time
+
+ def _return(
+ self,
+ output: AgentFinish,
+ intermediate_steps: list,
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ if run_manager:
+ run_manager.on_agent_finish(output, color="green", verbose=self.verbose)
+ final_output = output.return_values
+ if self.return_intermediate_steps:
+ final_output["intermediate_steps"] = intermediate_steps
+ return final_output
+
+ async def _areturn(
+ self,
+ output: AgentFinish,
+ intermediate_steps: list,
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ if run_manager:
+ await run_manager.on_agent_finish(
+ output,
+ color="green",
+ verbose=self.verbose,
+ )
+ final_output = output.return_values
+ if self.return_intermediate_steps:
+ final_output["intermediate_steps"] = intermediate_steps
+ return final_output
+
+ def _consume_next_step(
+ self,
+ values: NextStepOutput,
+ ) -> AgentFinish | list[tuple[AgentAction, str]]:
+ if isinstance(values[-1], AgentFinish):
+ if len(values) != 1:
+ msg = "Expected a single AgentFinish output, but got multiple values."
+ raise ValueError(msg)
+ return values[-1]
+ return [(a.action, a.observation) for a in values if isinstance(a, AgentStep)]
+
+ def _take_next_step(
+ self,
+ name_to_tool_map: dict[str, BaseTool],
+ color_mapping: dict[str, str],
+ inputs: dict[str, str],
+ intermediate_steps: list[tuple[AgentAction, str]],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> AgentFinish | list[tuple[AgentAction, str]]:
+ return self._consume_next_step(
+ list(
+ self._iter_next_step(
+ name_to_tool_map,
+ color_mapping,
+ inputs,
+ intermediate_steps,
+ run_manager,
+ ),
+ ),
+ )
+
+ def _iter_next_step(
+ self,
+ name_to_tool_map: dict[str, BaseTool],
+ color_mapping: dict[str, str],
+ inputs: dict[str, str],
+ intermediate_steps: list[tuple[AgentAction, str]],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> Iterator[AgentFinish | AgentAction | AgentStep]:
+ """Take a single step in the thought-action-observation loop.
+
+ Override this to take control of how the agent makes and acts on choices.
+ """
+ try:
+ intermediate_steps = self._prepare_intermediate_steps(intermediate_steps)
+
+ # Call the LLM to see what to do.
+ output = self._action_agent.plan(
+ intermediate_steps,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **inputs,
+ )
+ except OutputParserException as e:
+ if isinstance(self.handle_parsing_errors, bool):
+ raise_error = not self.handle_parsing_errors
+ else:
+ raise_error = False
+ if raise_error:
+ msg = (
+ "An output parsing error occurred. "
+ "In order to pass this error back to the agent and have it try "
+ "again, pass `handle_parsing_errors=True` to the AgentExecutor. "
+ f"This is the error: {e!s}"
+ )
+ raise ValueError(msg) from e
+ text = str(e)
+ if isinstance(self.handle_parsing_errors, bool):
+ if e.send_to_llm:
+ observation = str(e.observation)
+ text = str(e.llm_output)
+ else:
+ observation = "Invalid or incomplete response"
+ elif isinstance(self.handle_parsing_errors, str):
+ observation = self.handle_parsing_errors
+ elif callable(self.handle_parsing_errors):
+ observation = self.handle_parsing_errors(e)
+ else:
+ msg = "Got unexpected type of `handle_parsing_errors`" # type: ignore[unreachable]
+ raise ValueError(msg) from e # noqa: TRY004
+ output = AgentAction("_Exception", observation, text)
+ if run_manager:
+ run_manager.on_agent_action(output, color="green")
+ tool_run_kwargs = self._action_agent.tool_run_logging_kwargs()
+ observation = ExceptionTool().run(
+ output.tool_input,
+ verbose=self.verbose,
+ color=None,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **tool_run_kwargs,
+ )
+ yield AgentStep(action=output, observation=observation)
+ return
+
+ # If the tool chosen is the finishing tool, then we end and return.
+ if isinstance(output, AgentFinish):
+ yield output
+ return
+
+ actions: list[AgentAction]
+ actions = [output] if isinstance(output, AgentAction) else output
+ for agent_action in actions:
+ yield agent_action
+ for agent_action in actions:
+ yield self._perform_agent_action(
+ name_to_tool_map,
+ color_mapping,
+ agent_action,
+ run_manager,
+ )
+
+ def _perform_agent_action(
+ self,
+ name_to_tool_map: dict[str, BaseTool],
+ color_mapping: dict[str, str],
+ agent_action: AgentAction,
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> AgentStep:
+ if run_manager:
+ run_manager.on_agent_action(agent_action, color="green")
+ # Otherwise we lookup the tool
+ if agent_action.tool in name_to_tool_map:
+ tool = name_to_tool_map[agent_action.tool]
+ return_direct = tool.return_direct
+ color = color_mapping[agent_action.tool]
+ tool_run_kwargs = self._action_agent.tool_run_logging_kwargs()
+ if return_direct:
+ tool_run_kwargs["llm_prefix"] = ""
+ # We then call the tool on the tool input to get an observation
+ observation = tool.run(
+ agent_action.tool_input,
+ verbose=self.verbose,
+ color=color,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **tool_run_kwargs,
+ )
+ else:
+ tool_run_kwargs = self._action_agent.tool_run_logging_kwargs()
+ observation = InvalidTool().run(
+ {
+ "requested_tool_name": agent_action.tool,
+ "available_tool_names": list(name_to_tool_map.keys()),
+ },
+ verbose=self.verbose,
+ color=None,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **tool_run_kwargs,
+ )
+ return AgentStep(action=agent_action, observation=observation)
+
+ async def _atake_next_step(
+ self,
+ name_to_tool_map: dict[str, BaseTool],
+ color_mapping: dict[str, str],
+ inputs: dict[str, str],
+ intermediate_steps: list[tuple[AgentAction, str]],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> AgentFinish | list[tuple[AgentAction, str]]:
+ return self._consume_next_step(
+ [
+ a
+ async for a in self._aiter_next_step(
+ name_to_tool_map,
+ color_mapping,
+ inputs,
+ intermediate_steps,
+ run_manager,
+ )
+ ],
+ )
+
+ async def _aiter_next_step(
+ self,
+ name_to_tool_map: dict[str, BaseTool],
+ color_mapping: dict[str, str],
+ inputs: dict[str, str],
+ intermediate_steps: list[tuple[AgentAction, str]],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> AsyncIterator[AgentFinish | AgentAction | AgentStep]:
+ """Take a single step in the thought-action-observation loop.
+
+ Override this to take control of how the agent makes and acts on choices.
+ """
+ try:
+ intermediate_steps = self._prepare_intermediate_steps(intermediate_steps)
+
+ # Call the LLM to see what to do.
+ output = await self._action_agent.aplan(
+ intermediate_steps,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **inputs,
+ )
+ except OutputParserException as e:
+ if isinstance(self.handle_parsing_errors, bool):
+ raise_error = not self.handle_parsing_errors
+ else:
+ raise_error = False
+ if raise_error:
+ msg = (
+ "An output parsing error occurred. "
+ "In order to pass this error back to the agent and have it try "
+ "again, pass `handle_parsing_errors=True` to the AgentExecutor. "
+ f"This is the error: {e!s}"
+ )
+ raise ValueError(msg) from e
+ text = str(e)
+ if isinstance(self.handle_parsing_errors, bool):
+ if e.send_to_llm:
+ observation = str(e.observation)
+ text = str(e.llm_output)
+ else:
+ observation = "Invalid or incomplete response"
+ elif isinstance(self.handle_parsing_errors, str):
+ observation = self.handle_parsing_errors
+ elif callable(self.handle_parsing_errors):
+ observation = self.handle_parsing_errors(e)
+ else:
+ msg = "Got unexpected type of `handle_parsing_errors`" # type: ignore[unreachable]
+ raise ValueError(msg) from e # noqa: TRY004
+ output = AgentAction("_Exception", observation, text)
+ tool_run_kwargs = self._action_agent.tool_run_logging_kwargs()
+ observation = await ExceptionTool().arun(
+ output.tool_input,
+ verbose=self.verbose,
+ color=None,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **tool_run_kwargs,
+ )
+ yield AgentStep(action=output, observation=observation)
+ return
+
+ # If the tool chosen is the finishing tool, then we end and return.
+ if isinstance(output, AgentFinish):
+ yield output
+ return
+
+ actions: list[AgentAction]
+ actions = [output] if isinstance(output, AgentAction) else output
+ for agent_action in actions:
+ yield agent_action
+
+ # Use asyncio.gather to run multiple tool.arun() calls concurrently
+ result = await asyncio.gather(
+ *[
+ self._aperform_agent_action(
+ name_to_tool_map,
+ color_mapping,
+ agent_action,
+ run_manager,
+ )
+ for agent_action in actions
+ ],
+ )
+
+ # TODO: This could yield each result as it becomes available
+ for chunk in result:
+ yield chunk
+
+ async def _aperform_agent_action(
+ self,
+ name_to_tool_map: dict[str, BaseTool],
+ color_mapping: dict[str, str],
+ agent_action: AgentAction,
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> AgentStep:
+ if run_manager:
+ await run_manager.on_agent_action(
+ agent_action,
+ verbose=self.verbose,
+ color="green",
+ )
+ # Otherwise we lookup the tool
+ if agent_action.tool in name_to_tool_map:
+ tool = name_to_tool_map[agent_action.tool]
+ return_direct = tool.return_direct
+ color = color_mapping[agent_action.tool]
+ tool_run_kwargs = self._action_agent.tool_run_logging_kwargs()
+ if return_direct:
+ tool_run_kwargs["llm_prefix"] = ""
+ # We then call the tool on the tool input to get an observation
+ observation = await tool.arun(
+ agent_action.tool_input,
+ verbose=self.verbose,
+ color=color,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **tool_run_kwargs,
+ )
+ else:
+ tool_run_kwargs = self._action_agent.tool_run_logging_kwargs()
+ observation = await InvalidTool().arun(
+ {
+ "requested_tool_name": agent_action.tool,
+ "available_tool_names": list(name_to_tool_map.keys()),
+ },
+ verbose=self.verbose,
+ color=None,
+ callbacks=run_manager.get_child() if run_manager else None,
+ **tool_run_kwargs,
+ )
+ return AgentStep(action=agent_action, observation=observation)
+
+ def _call(
+ self,
+ inputs: dict[str, str],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ """Run text through and get agent response."""
+ # Construct a mapping of tool name to tool for easy lookup
+ name_to_tool_map = {tool.name: tool for tool in self.tools}
+ # We construct a mapping from each tool to a color, used for logging.
+ color_mapping = get_color_mapping(
+ [tool.name for tool in self.tools],
+ excluded_colors=["green", "red"],
+ )
+ intermediate_steps: list[tuple[AgentAction, str]] = []
+ # Let's start tracking the number of iterations and time elapsed
+ iterations = 0
+ time_elapsed = 0.0
+ start_time = time.time()
+ # We now enter the agent loop (until it returns something).
+ while self._should_continue(iterations, time_elapsed):
+ next_step_output = self._take_next_step(
+ name_to_tool_map,
+ color_mapping,
+ inputs,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+ if isinstance(next_step_output, AgentFinish):
+ return self._return(
+ next_step_output,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+
+ intermediate_steps.extend(next_step_output)
+ if len(next_step_output) == 1:
+ next_step_action = next_step_output[0]
+ # See if tool should return directly
+ tool_return = self._get_tool_return(next_step_action)
+ if tool_return is not None:
+ return self._return(
+ tool_return,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+ iterations += 1
+ time_elapsed = time.time() - start_time
+ output = self._action_agent.return_stopped_response(
+ self.early_stopping_method,
+ intermediate_steps,
+ **inputs,
+ )
+ return self._return(output, intermediate_steps, run_manager=run_manager)
+
+ async def _acall(
+ self,
+ inputs: dict[str, str],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ """Async run text through and get agent response."""
+ # Construct a mapping of tool name to tool for easy lookup
+ name_to_tool_map = {tool.name: tool for tool in self.tools}
+ # We construct a mapping from each tool to a color, used for logging.
+ color_mapping = get_color_mapping(
+ [tool.name for tool in self.tools],
+ excluded_colors=["green"],
+ )
+ intermediate_steps: list[tuple[AgentAction, str]] = []
+ # Let's start tracking the number of iterations and time elapsed
+ iterations = 0
+ time_elapsed = 0.0
+ start_time = time.time()
+ # We now enter the agent loop (until it returns something).
+ try:
+ async with asyncio_timeout(self.max_execution_time):
+ while self._should_continue(iterations, time_elapsed):
+ next_step_output = await self._atake_next_step(
+ name_to_tool_map,
+ color_mapping,
+ inputs,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+ if isinstance(next_step_output, AgentFinish):
+ return await self._areturn(
+ next_step_output,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+
+ intermediate_steps.extend(next_step_output)
+ if len(next_step_output) == 1:
+ next_step_action = next_step_output[0]
+ # See if tool should return directly
+ tool_return = self._get_tool_return(next_step_action)
+ if tool_return is not None:
+ return await self._areturn(
+ tool_return,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+
+ iterations += 1
+ time_elapsed = time.time() - start_time
+ output = self._action_agent.return_stopped_response(
+ self.early_stopping_method,
+ intermediate_steps,
+ **inputs,
+ )
+ return await self._areturn(
+ output,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+ except (TimeoutError, asyncio.TimeoutError):
+ # stop early when interrupted by the async timeout
+ output = self._action_agent.return_stopped_response(
+ self.early_stopping_method,
+ intermediate_steps,
+ **inputs,
+ )
+ return await self._areturn(
+ output,
+ intermediate_steps,
+ run_manager=run_manager,
+ )
+
+ def _get_tool_return(
+ self,
+ next_step_output: tuple[AgentAction, str],
+ ) -> AgentFinish | None:
+ """Check if the tool is a returning tool."""
+ agent_action, observation = next_step_output
+ name_to_tool_map = {tool.name: tool for tool in self.tools}
+ return_value_key = "output"
+ if len(self._action_agent.return_values) > 0:
+ return_value_key = self._action_agent.return_values[0]
+ # Invalid tools won't be in the map, so we return False.
+ if (
+ agent_action.tool in name_to_tool_map
+ and name_to_tool_map[agent_action.tool].return_direct
+ ):
+ return AgentFinish(
+ {return_value_key: observation},
+ "",
+ )
+ return None
+
+ def _prepare_intermediate_steps(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ ) -> list[tuple[AgentAction, str]]:
+ if (
+ isinstance(self.trim_intermediate_steps, int)
+ and self.trim_intermediate_steps > 0
+ ):
+ return intermediate_steps[-self.trim_intermediate_steps :]
+ if callable(self.trim_intermediate_steps):
+ return self.trim_intermediate_steps(intermediate_steps)
+ return intermediate_steps
+
+ @override
+ def stream(
+ self,
+ input: dict[str, Any] | Any,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> Iterator[AddableDict]:
+ """Enables streaming over steps taken to reach final output.
+
+ Args:
+ input: Input to the agent.
+ config: Config to use.
+ kwargs: Additional arguments.
+
+ Yields:
+ Addable dictionary.
+ """
+ config = ensure_config(config)
+ iterator = AgentExecutorIterator(
+ self,
+ input,
+ config.get("callbacks"),
+ tags=config.get("tags"),
+ metadata=config.get("metadata"),
+ run_name=config.get("run_name"),
+ run_id=config.get("run_id"),
+ yield_actions=True,
+ **kwargs,
+ )
+ yield from iterator
+
+ @override
+ async def astream(
+ self,
+ input: dict[str, Any] | Any,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> AsyncIterator[AddableDict]:
+ """Async enables streaming over steps taken to reach final output.
+
+ Args:
+ input: Input to the agent.
+ config: Config to use.
+ kwargs: Additional arguments.
+
+ Yields:
+ Addable dictionary.
+ """
+ config = ensure_config(config)
+ iterator = AgentExecutorIterator(
+ self,
+ input,
+ config.get("callbacks"),
+ tags=config.get("tags"),
+ metadata=config.get("metadata"),
+ run_name=config.get("run_name"),
+ run_id=config.get("run_id"),
+ yield_actions=True,
+ **kwargs,
+ )
+ async for step in iterator:
+ yield step
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent_iterator.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent_iterator.py
new file mode 100644
index 0000000000000000000000000000000000000000..138b58f69c2c71440fb7462e3f0dcf1c969b48ce
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent_iterator.py
@@ -0,0 +1,432 @@
+from __future__ import annotations
+
+import asyncio
+import logging
+import time
+from collections.abc import AsyncIterator, Iterator
+from typing import (
+ TYPE_CHECKING,
+ Any,
+)
+from uuid import UUID
+
+from langchain_core.agents import (
+ AgentAction,
+ AgentFinish,
+ AgentStep,
+)
+from langchain_core.callbacks import (
+ AsyncCallbackManager,
+ AsyncCallbackManagerForChainRun,
+ CallbackManager,
+ CallbackManagerForChainRun,
+ Callbacks,
+)
+from langchain_core.load.dump import dumpd
+from langchain_core.outputs import RunInfo
+from langchain_core.runnables.utils import AddableDict
+from langchain_core.tools import BaseTool
+from langchain_core.utils.input import get_color_mapping
+
+from langchain_classic.schema import RUN_KEY
+from langchain_classic.utilities.asyncio import asyncio_timeout
+
+if TYPE_CHECKING:
+ from langchain_classic.agents.agent import AgentExecutor, NextStepOutput
+
+logger = logging.getLogger(__name__)
+
+
+class AgentExecutorIterator:
+ """Iterator for AgentExecutor."""
+
+ def __init__(
+ self,
+ agent_executor: AgentExecutor,
+ inputs: Any,
+ callbacks: Callbacks = None,
+ *,
+ tags: list[str] | None = None,
+ metadata: dict[str, Any] | None = None,
+ run_name: str | None = None,
+ run_id: UUID | None = None,
+ include_run_info: bool = False,
+ yield_actions: bool = False,
+ ):
+ """Initialize the `AgentExecutorIterator`.
+
+ Initialize the `AgentExecutorIterator` with the given `AgentExecutor`,
+ inputs, and optional callbacks.
+
+ Args:
+ agent_executor: The `AgentExecutor` to iterate over.
+ inputs: The inputs to the `AgentExecutor`.
+ callbacks: The callbacks to use during iteration.
+ tags: The tags to use during iteration.
+ metadata: The metadata to use during iteration.
+ run_name: The name of the run.
+ run_id: The ID of the run.
+ include_run_info: Whether to include run info in the output.
+ yield_actions: Whether to yield actions as they are generated.
+ """
+ self._agent_executor = agent_executor
+ self.inputs = inputs
+ self.callbacks = callbacks
+ self.tags = tags
+ self.metadata = metadata
+ self.run_name = run_name
+ self.run_id = run_id
+ self.include_run_info = include_run_info
+ self.yield_actions = yield_actions
+ self.reset()
+
+ _inputs: dict[str, str]
+ callbacks: Callbacks
+ tags: list[str] | None
+ metadata: dict[str, Any] | None
+ run_name: str | None
+ run_id: UUID | None
+ include_run_info: bool
+ yield_actions: bool
+
+ @property
+ def inputs(self) -> dict[str, str]:
+ """The inputs to the `AgentExecutor`."""
+ return self._inputs
+
+ @inputs.setter
+ def inputs(self, inputs: Any) -> None:
+ self._inputs = self.agent_executor.prep_inputs(inputs)
+
+ @property
+ def agent_executor(self) -> AgentExecutor:
+ """The `AgentExecutor` to iterate over."""
+ return self._agent_executor
+
+ @agent_executor.setter
+ def agent_executor(self, agent_executor: AgentExecutor) -> None:
+ self._agent_executor = agent_executor
+ # force re-prep inputs in case agent_executor's prep_inputs fn changed
+ self.inputs = self.inputs
+
+ @property
+ def name_to_tool_map(self) -> dict[str, BaseTool]:
+ """A mapping of tool names to tools."""
+ return {tool.name: tool for tool in self.agent_executor.tools}
+
+ @property
+ def color_mapping(self) -> dict[str, str]:
+ """A mapping of tool names to colors."""
+ return get_color_mapping(
+ [tool.name for tool in self.agent_executor.tools],
+ excluded_colors=["green", "red"],
+ )
+
+ def reset(self) -> None:
+ """Reset the iterator to its initial state.
+
+ Reset the iterator to its initial state, clearing intermediate steps,
+ iterations, and time elapsed.
+ """
+ logger.debug("(Re)setting AgentExecutorIterator to fresh state")
+ self.intermediate_steps: list[tuple[AgentAction, str]] = []
+ self.iterations = 0
+ # maybe better to start these on the first __anext__ call?
+ self.time_elapsed = 0.0
+ self.start_time = time.time()
+
+ def update_iterations(self) -> None:
+ """Increment the number of iterations and update the time elapsed."""
+ self.iterations += 1
+ self.time_elapsed = time.time() - self.start_time
+ logger.debug(
+ "Agent Iterations: %s (%.2fs elapsed)",
+ self.iterations,
+ self.time_elapsed,
+ )
+
+ def make_final_outputs(
+ self,
+ outputs: dict[str, Any],
+ run_manager: CallbackManagerForChainRun | AsyncCallbackManagerForChainRun,
+ ) -> AddableDict:
+ """Make final outputs for the iterator.
+
+ Args:
+ outputs: The outputs from the agent executor.
+ run_manager: The run manager to use for callbacks.
+ """
+ # have access to intermediate steps by design in iterator,
+ # so return only outputs may as well always be true.
+
+ prepared_outputs = AddableDict(
+ self.agent_executor.prep_outputs(
+ self.inputs,
+ outputs,
+ return_only_outputs=True,
+ ),
+ )
+ if self.include_run_info:
+ prepared_outputs[RUN_KEY] = RunInfo(run_id=run_manager.run_id)
+ return prepared_outputs
+
+ def __iter__(self: AgentExecutorIterator) -> Iterator[AddableDict]:
+ """Create an async iterator for the `AgentExecutor`."""
+ logger.debug("Initialising AgentExecutorIterator")
+ self.reset()
+ callback_manager = CallbackManager.configure(
+ self.callbacks,
+ self.agent_executor.callbacks,
+ self.agent_executor.verbose,
+ self.tags,
+ self.agent_executor.tags,
+ self.metadata,
+ self.agent_executor.metadata,
+ )
+ run_manager = callback_manager.on_chain_start(
+ dumpd(self.agent_executor),
+ self.inputs,
+ self.run_id,
+ name=self.run_name,
+ )
+ try:
+ while self.agent_executor._should_continue( # noqa: SLF001
+ self.iterations,
+ self.time_elapsed,
+ ):
+ # take the next step: this plans next action, executes it,
+ # yielding action and observation as they are generated
+ next_step_seq: NextStepOutput = []
+ for chunk in self.agent_executor._iter_next_step( # noqa: SLF001
+ self.name_to_tool_map,
+ self.color_mapping,
+ self.inputs,
+ self.intermediate_steps,
+ run_manager,
+ ):
+ next_step_seq.append(chunk)
+ # if we're yielding actions, yield them as they come
+ # do not yield AgentFinish, which will be handled below
+ if self.yield_actions:
+ if isinstance(chunk, AgentAction):
+ yield AddableDict(actions=[chunk], messages=chunk.messages)
+ elif isinstance(chunk, AgentStep):
+ yield AddableDict(steps=[chunk], messages=chunk.messages)
+
+ # convert iterator output to format handled by _process_next_step_output
+ next_step = self.agent_executor._consume_next_step(next_step_seq) # noqa: SLF001
+ # update iterations and time elapsed
+ self.update_iterations()
+ # decide if this is the final output
+ output = self._process_next_step_output(next_step, run_manager)
+ is_final = "intermediate_step" not in output
+ # yield the final output always
+ # for backwards compat, yield int. output if not yielding actions
+ if not self.yield_actions or is_final:
+ yield output
+ # if final output reached, stop iteration
+ if is_final:
+ return
+ except BaseException as e:
+ run_manager.on_chain_error(e)
+ raise
+
+ # if we got here means we exhausted iterations or time
+ yield self._stop(run_manager)
+
+ async def __aiter__(self) -> AsyncIterator[AddableDict]:
+ """Create an async iterator for the `AgentExecutor`.
+
+ N.B. __aiter__ must be a normal method, so need to initialize async run manager
+ on first __anext__ call where we can await it.
+ """
+ logger.debug("Initialising AgentExecutorIterator (async)")
+ self.reset()
+ callback_manager = AsyncCallbackManager.configure(
+ self.callbacks,
+ self.agent_executor.callbacks,
+ self.agent_executor.verbose,
+ self.tags,
+ self.agent_executor.tags,
+ self.metadata,
+ self.agent_executor.metadata,
+ )
+ run_manager = await callback_manager.on_chain_start(
+ dumpd(self.agent_executor),
+ self.inputs,
+ self.run_id,
+ name=self.run_name,
+ )
+ try:
+ async with asyncio_timeout(self.agent_executor.max_execution_time):
+ while self.agent_executor._should_continue( # noqa: SLF001
+ self.iterations,
+ self.time_elapsed,
+ ):
+ # take the next step: this plans next action, executes it,
+ # yielding action and observation as they are generated
+ next_step_seq: NextStepOutput = []
+ async for chunk in self.agent_executor._aiter_next_step( # noqa: SLF001
+ self.name_to_tool_map,
+ self.color_mapping,
+ self.inputs,
+ self.intermediate_steps,
+ run_manager,
+ ):
+ next_step_seq.append(chunk)
+ # if we're yielding actions, yield them as they come
+ # do not yield AgentFinish, which will be handled below
+ if self.yield_actions:
+ if isinstance(chunk, AgentAction):
+ yield AddableDict(
+ actions=[chunk],
+ messages=chunk.messages,
+ )
+ elif isinstance(chunk, AgentStep):
+ yield AddableDict(
+ steps=[chunk],
+ messages=chunk.messages,
+ )
+
+ # convert iterator output to format handled by _process_next_step
+ next_step = self.agent_executor._consume_next_step(next_step_seq) # noqa: SLF001
+ # update iterations and time elapsed
+ self.update_iterations()
+ # decide if this is the final output
+ output = await self._aprocess_next_step_output(
+ next_step,
+ run_manager,
+ )
+ is_final = "intermediate_step" not in output
+ # yield the final output always
+ # for backwards compat, yield int. output if not yielding actions
+ if not self.yield_actions or is_final:
+ yield output
+ # if final output reached, stop iteration
+ if is_final:
+ return
+ except (TimeoutError, asyncio.TimeoutError):
+ yield await self._astop(run_manager)
+ return
+ except BaseException as e:
+ await run_manager.on_chain_error(e)
+ raise
+
+ # if we got here means we exhausted iterations or time
+ yield await self._astop(run_manager)
+
+ def _process_next_step_output(
+ self,
+ next_step_output: AgentFinish | list[tuple[AgentAction, str]],
+ run_manager: CallbackManagerForChainRun,
+ ) -> AddableDict:
+ """Process the output of the next step.
+
+ Process the output of the next step,
+ handling AgentFinish and tool return cases.
+ """
+ logger.debug("Processing output of Agent loop step")
+ if isinstance(next_step_output, AgentFinish):
+ logger.debug(
+ "Hit AgentFinish: _return -> on_chain_end -> run final output logic",
+ )
+ return self._return(next_step_output, run_manager=run_manager)
+
+ self.intermediate_steps.extend(next_step_output)
+ logger.debug("Updated intermediate_steps with step output")
+
+ # Check for tool return
+ if len(next_step_output) == 1:
+ next_step_action = next_step_output[0]
+ tool_return = self.agent_executor._get_tool_return(next_step_action) # noqa: SLF001
+ if tool_return is not None:
+ return self._return(tool_return, run_manager=run_manager)
+
+ return AddableDict(intermediate_step=next_step_output)
+
+ async def _aprocess_next_step_output(
+ self,
+ next_step_output: AgentFinish | list[tuple[AgentAction, str]],
+ run_manager: AsyncCallbackManagerForChainRun,
+ ) -> AddableDict:
+ """Process the output of the next async step.
+
+ Process the output of the next async step,
+ handling AgentFinish and tool return cases.
+ """
+ logger.debug("Processing output of async Agent loop step")
+ if isinstance(next_step_output, AgentFinish):
+ logger.debug(
+ "Hit AgentFinish: _areturn -> on_chain_end -> run final output logic",
+ )
+ return await self._areturn(next_step_output, run_manager=run_manager)
+
+ self.intermediate_steps.extend(next_step_output)
+ logger.debug("Updated intermediate_steps with step output")
+
+ # Check for tool return
+ if len(next_step_output) == 1:
+ next_step_action = next_step_output[0]
+ tool_return = self.agent_executor._get_tool_return(next_step_action) # noqa: SLF001
+ if tool_return is not None:
+ return await self._areturn(tool_return, run_manager=run_manager)
+
+ return AddableDict(intermediate_step=next_step_output)
+
+ def _stop(self, run_manager: CallbackManagerForChainRun) -> AddableDict:
+ """Stop the iterator.
+
+ Stop the iterator and raise a StopIteration exception with the stopped response.
+ """
+ logger.warning("Stopping agent prematurely due to triggering stop condition")
+ # this manually constructs agent finish with output key
+ output = self.agent_executor._action_agent.return_stopped_response( # noqa: SLF001
+ self.agent_executor.early_stopping_method,
+ self.intermediate_steps,
+ **self.inputs,
+ )
+ return self._return(output, run_manager=run_manager)
+
+ async def _astop(self, run_manager: AsyncCallbackManagerForChainRun) -> AddableDict:
+ """Stop the async iterator.
+
+ Stop the async iterator and raise a StopAsyncIteration exception with
+ the stopped response.
+ """
+ logger.warning("Stopping agent prematurely due to triggering stop condition")
+ output = self.agent_executor._action_agent.return_stopped_response( # noqa: SLF001
+ self.agent_executor.early_stopping_method,
+ self.intermediate_steps,
+ **self.inputs,
+ )
+ return await self._areturn(output, run_manager=run_manager)
+
+ def _return(
+ self,
+ output: AgentFinish,
+ run_manager: CallbackManagerForChainRun,
+ ) -> AddableDict:
+ """Return the final output of the iterator."""
+ returned_output = self.agent_executor._return( # noqa: SLF001
+ output,
+ self.intermediate_steps,
+ run_manager=run_manager,
+ )
+ returned_output["messages"] = output.messages
+ run_manager.on_chain_end(returned_output)
+ return self.make_final_outputs(returned_output, run_manager)
+
+ async def _areturn(
+ self,
+ output: AgentFinish,
+ run_manager: AsyncCallbackManagerForChainRun,
+ ) -> AddableDict:
+ """Return the final output of the async iterator."""
+ returned_output = await self.agent_executor._areturn( # noqa: SLF001
+ output,
+ self.intermediate_steps,
+ run_manager=run_manager,
+ )
+ returned_output["messages"] = output.messages
+ await run_manager.on_chain_end(returned_output)
+ return self.make_final_outputs(returned_output, run_manager)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent_types.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent_types.py
new file mode 100644
index 0000000000000000000000000000000000000000..b7d14b6363dee322bdbf0f491916e574877c8ba3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/agent_types.py
@@ -0,0 +1,54 @@
+"""Module definitions of agent types together with corresponding agents."""
+
+from enum import Enum
+
+from langchain_core._api import deprecated
+
+from langchain_classic._api.deprecation import AGENT_DEPRECATION_WARNING
+
+
+@deprecated(
+ "0.1.0",
+ message=AGENT_DEPRECATION_WARNING,
+ removal="2.0.0",
+)
+class AgentType(str, Enum):
+ """An enum for agent types."""
+
+ ZERO_SHOT_REACT_DESCRIPTION = "zero-shot-react-description"
+ """A zero shot agent that does a reasoning step before acting."""
+
+ REACT_DOCSTORE = "react-docstore"
+ """A zero shot agent that does a reasoning step before acting.
+
+ This agent has access to a document store that allows it to look up
+ relevant information to answering the question.
+ """
+
+ SELF_ASK_WITH_SEARCH = "self-ask-with-search"
+ """An agent that breaks down a complex question into a series of simpler questions.
+
+ This agent uses a search tool to look up answers to the simpler questions
+ in order to answer the original complex question.
+ """
+ CONVERSATIONAL_REACT_DESCRIPTION = "conversational-react-description"
+ CHAT_ZERO_SHOT_REACT_DESCRIPTION = "chat-zero-shot-react-description"
+ """A zero shot agent that does a reasoning step before acting.
+
+ This agent is designed to be used in conjunction
+ """
+
+ CHAT_CONVERSATIONAL_REACT_DESCRIPTION = "chat-conversational-react-description"
+
+ STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION = (
+ "structured-chat-zero-shot-react-description"
+ )
+ """An zero-shot react agent optimized for chat models.
+
+ This agent is capable of invoking tools that have multiple inputs.
+ """
+
+ OPENAI_FUNCTIONS = "openai-functions"
+ """An agent optimized for using open AI functions."""
+
+ OPENAI_MULTI_FUNCTIONS = "openai-multi-functions"
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/initialize.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/initialize.py
new file mode 100644
index 0000000000000000000000000000000000000000..ee45a138ccf961bd8f787ad858ee884e618d2816
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/initialize.py
@@ -0,0 +1,116 @@
+"""Load agent."""
+
+import contextlib
+from collections.abc import Sequence
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import BaseTool
+
+from langchain_classic._api.deprecation import AGENT_DEPRECATION_WARNING
+from langchain_classic.agents.agent import AgentExecutor
+from langchain_classic.agents.agent_types import AgentType
+from langchain_classic.agents.loading import load_agent
+from langchain_classic.agents.types import AGENT_TO_CLASS
+
+
+@deprecated(
+ "0.1.0",
+ message=AGENT_DEPRECATION_WARNING,
+ removal="2.0.0",
+)
+def initialize_agent(
+ tools: Sequence[BaseTool],
+ llm: BaseLanguageModel,
+ agent: AgentType | None = None,
+ callback_manager: BaseCallbackManager | None = None,
+ agent_path: str | None = None,
+ agent_kwargs: dict | None = None,
+ *,
+ tags: Sequence[str] | None = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Load an agent executor given tools and LLM.
+
+ !!! warning
+
+ This function is no deprecated in favor of
+ [`create_agent`][langchain.agents.create_agent] from the `langchain`
+ package, which provides a more flexible agent factory with middleware
+ support, structured output, and integration with LangGraph.
+
+ For migration guidance, see
+ [Migrating to langchain v1](https://docs.langchain.com/oss/python/migrate/langchain-v1)
+ and
+ [Migrating from AgentExecutor](https://python.langchain.com/docs/how_to/migrate_agent/).
+
+ Args:
+ tools: List of tools this agent has access to.
+ llm: Language model to use as the agent.
+ agent: Agent type to use. If `None` and agent_path is also None, will default
+ to AgentType.ZERO_SHOT_REACT_DESCRIPTION.
+ callback_manager: CallbackManager to use. Global callback manager is used if
+ not provided.
+ agent_path: Path to serialized agent to use. If `None` and agent is also None,
+ will default to AgentType.ZERO_SHOT_REACT_DESCRIPTION.
+ agent_kwargs: Additional keyword arguments to pass to the underlying agent.
+ tags: Tags to apply to the traced runs.
+ kwargs: Additional keyword arguments passed to the agent executor.
+
+ Returns:
+ An agent executor.
+
+ Raises:
+ ValueError: If both `agent` and `agent_path` are specified.
+ ValueError: If `agent` is not a valid agent type.
+ ValueError: If both `agent` and `agent_path` are None.
+ """
+ tags_ = list(tags) if tags else []
+ if agent is None and agent_path is None:
+ agent = AgentType.ZERO_SHOT_REACT_DESCRIPTION
+ if agent is not None and agent_path is not None:
+ msg = (
+ "Both `agent` and `agent_path` are specified, "
+ "but at most only one should be."
+ )
+ raise ValueError(msg)
+ if agent is not None:
+ if agent not in AGENT_TO_CLASS:
+ msg = (
+ f"Got unknown agent type: {agent}. "
+ f"Valid types are: {AGENT_TO_CLASS.keys()}."
+ )
+ raise ValueError(msg)
+ tags_.append(agent.value if isinstance(agent, AgentType) else agent)
+ agent_cls = AGENT_TO_CLASS[agent]
+ agent_kwargs = agent_kwargs or {}
+ agent_obj = agent_cls.from_llm_and_tools(
+ llm,
+ tools,
+ callback_manager=callback_manager,
+ **agent_kwargs,
+ )
+ elif agent_path is not None:
+ agent_obj = load_agent(
+ agent_path,
+ llm=llm,
+ tools=tools,
+ callback_manager=callback_manager,
+ )
+ with contextlib.suppress(NotImplementedError):
+ # TODO: Add tags from the serialized object directly.
+ tags_.append(agent_obj._agent_type) # noqa: SLF001
+ else:
+ msg = (
+ "Somehow both `agent` and `agent_path` are None, this should never happen."
+ )
+ raise ValueError(msg)
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent_obj,
+ tools=tools,
+ callback_manager=callback_manager,
+ tags=tags_,
+ **kwargs,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/load_tools.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/load_tools.py
new file mode 100644
index 0000000000000000000000000000000000000000..63fabb424e545a5248e902597f198ddb351449de
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/load_tools.py
@@ -0,0 +1,13 @@
+from typing import Any
+
+from langchain_classic._api import create_importer
+
+_importer = create_importer(
+ __package__,
+ fallback_module="langchain_community.agent_toolkits.load_tools",
+)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _importer(name)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/loading.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/loading.py
new file mode 100644
index 0000000000000000000000000000000000000000..87b8b57ca7d2a7c3a6f247ffa2db565e66e731ca
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/loading.py
@@ -0,0 +1,148 @@
+"""Functionality for loading agents."""
+
+import json
+import logging
+from pathlib import Path
+from typing import Any
+
+import yaml
+from langchain_core._api import deprecated
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import Tool
+
+from langchain_classic.agents.agent import BaseMultiActionAgent, BaseSingleActionAgent
+from langchain_classic.agents.types import AGENT_TO_CLASS
+from langchain_classic.chains.loading import load_chain, load_chain_from_config
+
+logger = logging.getLogger(__name__)
+
+URL_BASE = "https://raw.githubusercontent.com/hwchase17/langchain-hub/master/agents/"
+
+
+def _load_agent_from_tools(
+ config: dict,
+ llm: BaseLanguageModel,
+ tools: list[Tool],
+ **kwargs: Any,
+) -> BaseSingleActionAgent | BaseMultiActionAgent:
+ config_type = config.pop("_type")
+ if config_type not in AGENT_TO_CLASS:
+ msg = f"Loading {config_type} agent not supported"
+ raise ValueError(msg)
+
+ agent_cls = AGENT_TO_CLASS[config_type]
+ combined_config = {**config, **kwargs}
+ return agent_cls.from_llm_and_tools(llm, tools, **combined_config)
+
+
+@deprecated("0.1.0", removal="2.0.0")
+def load_agent_from_config(
+ config: dict,
+ llm: BaseLanguageModel | None = None,
+ tools: list[Tool] | None = None,
+ **kwargs: Any,
+) -> BaseSingleActionAgent | BaseMultiActionAgent:
+ """Load agent from Config Dict.
+
+ Args:
+ config: Config dict to load agent from.
+ llm: Language model to use as the agent.
+ tools: List of tools this agent has access to.
+ kwargs: Additional keyword arguments passed to the agent executor.
+
+ Returns:
+ An agent executor.
+
+ Raises:
+ ValueError: If agent type is not specified in the config.
+ """
+ if "_type" not in config:
+ msg = "Must specify an agent Type in config"
+ raise ValueError(msg)
+ load_from_tools = config.pop("load_from_llm_and_tools", False)
+ if load_from_tools:
+ if llm is None:
+ msg = (
+ "If `load_from_llm_and_tools` is set to True, then LLM must be provided"
+ )
+ raise ValueError(msg)
+ if tools is None:
+ msg = (
+ "If `load_from_llm_and_tools` is set to True, "
+ "then tools must be provided"
+ )
+ raise ValueError(msg)
+ return _load_agent_from_tools(config, llm, tools, **kwargs)
+ config_type = config.pop("_type")
+
+ if config_type not in AGENT_TO_CLASS:
+ msg = f"Loading {config_type} agent not supported"
+ raise ValueError(msg)
+
+ agent_cls = AGENT_TO_CLASS[config_type]
+ if "llm_chain" in config:
+ config["llm_chain"] = load_chain_from_config(config.pop("llm_chain"))
+ elif "llm_chain_path" in config:
+ config["llm_chain"] = load_chain(config.pop("llm_chain_path"))
+ else:
+ msg = "One of `llm_chain` and `llm_chain_path` should be specified."
+ raise ValueError(msg)
+ if "output_parser" in config:
+ logger.warning(
+ "Currently loading output parsers on agent is not supported, "
+ "will just use the default one.",
+ )
+ del config["output_parser"]
+
+ combined_config = {**config, **kwargs}
+ return agent_cls(**combined_config)
+
+
+@deprecated("0.1.0", removal="2.0.0")
+def load_agent(
+ path: str | Path,
+ **kwargs: Any,
+) -> BaseSingleActionAgent | BaseMultiActionAgent:
+ """Unified method for loading an agent from LangChainHub or local fs.
+
+ Args:
+ path: Path to the agent file.
+ kwargs: Additional keyword arguments passed to the agent executor.
+
+ Returns:
+ An agent executor.
+
+ Raises:
+ RuntimeError: If loading from the deprecated github-based
+ Hub is attempted.
+ """
+ if isinstance(path, str) and path.startswith("lc://"):
+ msg = (
+ "Loading from the deprecated github-based Hub is no longer supported. "
+ "Please use the new LangChain Hub at https://smith.langchain.com/hub "
+ "instead."
+ )
+ raise RuntimeError(msg)
+ return _load_agent_from_file(path, **kwargs)
+
+
+def _load_agent_from_file(
+ file: str | Path,
+ **kwargs: Any,
+) -> BaseSingleActionAgent | BaseMultiActionAgent:
+ """Load agent from file."""
+ valid_suffixes = {"json", "yaml"}
+ # Convert file to Path object.
+ file_path = Path(file) if isinstance(file, str) else file
+ # Load from either json or yaml.
+ if file_path.suffix[1:] == "json":
+ with file_path.open() as f:
+ config = json.load(f)
+ elif file_path.suffix[1:] == "yaml":
+ with file_path.open() as f:
+ config = yaml.safe_load(f)
+ else:
+ msg = f"Unsupported file type, must be one of {valid_suffixes}."
+ raise ValueError(msg)
+ # Load the agent from the config now.
+ return load_agent_from_config(config, **kwargs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/schema.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..74a0c9c498d9387a52b0c21d70883749358ce446
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/schema.py
@@ -0,0 +1,37 @@
+from typing import Any
+
+from langchain_core.agents import AgentAction
+from langchain_core.prompts.chat import ChatPromptTemplate
+from typing_extensions import override
+
+
+class AgentScratchPadChatPromptTemplate(ChatPromptTemplate):
+ """Chat prompt template for the agent scratchpad."""
+
+ @classmethod
+ @override
+ def is_lc_serializable(cls) -> bool:
+ return False
+
+ def _construct_agent_scratchpad(
+ self,
+ intermediate_steps: list[tuple[AgentAction, str]],
+ ) -> str:
+ if len(intermediate_steps) == 0:
+ return ""
+ thoughts = ""
+ for action, observation in intermediate_steps:
+ thoughts += action.log
+ thoughts += f"\nObservation: {observation}\nThought: "
+ return (
+ f"This was your previous work "
+ f"(but I haven't seen any of it! I only see what "
+ f"you return as final answer):\n{thoughts}"
+ )
+
+ def _merge_partial_and_user_variables(self, **kwargs: Any) -> dict[str, Any]:
+ intermediate_steps = kwargs.pop("intermediate_steps")
+ kwargs["agent_scratchpad"] = self._construct_agent_scratchpad(
+ intermediate_steps,
+ )
+ return kwargs
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/tools.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/tools.py
new file mode 100644
index 0000000000000000000000000000000000000000..9b599ef556d2fefd8d514e4fb5c1aef3c96efc04
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/tools.py
@@ -0,0 +1,48 @@
+"""Interface for tools."""
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForToolRun,
+ CallbackManagerForToolRun,
+)
+from langchain_core.tools import BaseTool, tool
+from typing_extensions import override
+
+
+class InvalidTool(BaseTool):
+ """Tool that is run when invalid tool name is encountered by agent."""
+
+ name: str = "invalid_tool"
+ """Name of the tool."""
+ description: str = "Called when tool name is invalid. Suggests valid tool names."
+ """Description of the tool."""
+
+ @override
+ def _run(
+ self,
+ requested_tool_name: str,
+ available_tool_names: list[str],
+ run_manager: CallbackManagerForToolRun | None = None,
+ ) -> str:
+ """Use the tool."""
+ available_tool_names_str = ", ".join(list(available_tool_names))
+ return (
+ f"{requested_tool_name} is not a valid tool, "
+ f"try one of [{available_tool_names_str}]."
+ )
+
+ @override
+ async def _arun(
+ self,
+ requested_tool_name: str,
+ available_tool_names: list[str],
+ run_manager: AsyncCallbackManagerForToolRun | None = None,
+ ) -> str:
+ """Use the tool asynchronously."""
+ available_tool_names_str = ", ".join(list(available_tool_names))
+ return (
+ f"{requested_tool_name} is not a valid tool, "
+ f"try one of [{available_tool_names_str}]."
+ )
+
+
+__all__ = ["InvalidTool", "tool"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/types.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/types.py
new file mode 100644
index 0000000000000000000000000000000000000000..406d814b590fbd541ca0227095262858e04fa692
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/types.py
@@ -0,0 +1,27 @@
+from langchain_classic.agents.agent import BaseSingleActionAgent
+from langchain_classic.agents.agent_types import AgentType
+from langchain_classic.agents.chat.base import ChatAgent
+from langchain_classic.agents.conversational.base import ConversationalAgent
+from langchain_classic.agents.conversational_chat.base import ConversationalChatAgent
+from langchain_classic.agents.mrkl.base import ZeroShotAgent
+from langchain_classic.agents.openai_functions_agent.base import OpenAIFunctionsAgent
+from langchain_classic.agents.openai_functions_multi_agent.base import (
+ OpenAIMultiFunctionsAgent,
+)
+from langchain_classic.agents.react.base import ReActDocstoreAgent
+from langchain_classic.agents.self_ask_with_search.base import SelfAskWithSearchAgent
+from langchain_classic.agents.structured_chat.base import StructuredChatAgent
+
+AGENT_TYPE = type[BaseSingleActionAgent] | type[OpenAIMultiFunctionsAgent]
+
+AGENT_TO_CLASS: dict[AgentType, AGENT_TYPE] = {
+ AgentType.ZERO_SHOT_REACT_DESCRIPTION: ZeroShotAgent,
+ AgentType.REACT_DOCSTORE: ReActDocstoreAgent,
+ AgentType.SELF_ASK_WITH_SEARCH: SelfAskWithSearchAgent,
+ AgentType.CONVERSATIONAL_REACT_DESCRIPTION: ConversationalAgent,
+ AgentType.CHAT_ZERO_SHOT_REACT_DESCRIPTION: ChatAgent,
+ AgentType.CHAT_CONVERSATIONAL_REACT_DESCRIPTION: ConversationalChatAgent,
+ AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION: StructuredChatAgent,
+ AgentType.OPENAI_FUNCTIONS: OpenAIFunctionsAgent,
+ AgentType.OPENAI_MULTI_FUNCTIONS: OpenAIMultiFunctionsAgent,
+}
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..45544153ad243876b4c7bfcaa01820ffde69c091
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/agents/utils.py
@@ -0,0 +1,19 @@
+from collections.abc import Sequence
+
+from langchain_core.tools import BaseTool
+
+
+def validate_tools_single_input(class_name: str, tools: Sequence[BaseTool]) -> None:
+ """Validate tools for single input.
+
+ Args:
+ class_name: Name of the class.
+ tools: List of tools to validate.
+
+ Raises:
+ ValueError: If a multi-input tool is found in tools.
+ """
+ for tool in tools:
+ if not tool.is_single_input:
+ msg = f"{class_name} does not support multi-input tool {tool.name}."
+ raise ValueError(msg)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..3ce6f21173379c30741d1d8044dc355153ace075
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/__init__.py
@@ -0,0 +1,130 @@
+"""**Callback handlers** allow listening to events in LangChain."""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.callbacks import (
+ FileCallbackHandler,
+ StdOutCallbackHandler,
+ StreamingStdOutCallbackHandler,
+)
+from langchain_core.tracers.context import (
+ collect_runs,
+ tracing_v2_enabled,
+)
+from langchain_core.tracers.langchain import LangChainTracer
+
+from langchain_classic._api import create_importer
+from langchain_classic.callbacks.streaming_aiter import AsyncIteratorCallbackHandler
+from langchain_classic.callbacks.streaming_stdout_final_only import (
+ FinalStreamingStdOutCallbackHandler,
+)
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.aim_callback import AimCallbackHandler
+ from langchain_community.callbacks.argilla_callback import ArgillaCallbackHandler
+ from langchain_community.callbacks.arize_callback import ArizeCallbackHandler
+ from langchain_community.callbacks.arthur_callback import ArthurCallbackHandler
+ from langchain_community.callbacks.clearml_callback import ClearMLCallbackHandler
+ from langchain_community.callbacks.comet_ml_callback import CometCallbackHandler
+ from langchain_community.callbacks.context_callback import ContextCallbackHandler
+ from langchain_community.callbacks.flyte_callback import FlyteCallbackHandler
+ from langchain_community.callbacks.human import HumanApprovalCallbackHandler
+ from langchain_community.callbacks.infino_callback import InfinoCallbackHandler
+ from langchain_community.callbacks.labelstudio_callback import (
+ LabelStudioCallbackHandler,
+ )
+ from langchain_community.callbacks.llmonitor_callback import (
+ LLMonitorCallbackHandler,
+ )
+ from langchain_community.callbacks.manager import (
+ get_openai_callback,
+ wandb_tracing_enabled,
+ )
+ from langchain_community.callbacks.mlflow_callback import MlflowCallbackHandler
+ from langchain_community.callbacks.openai_info import OpenAICallbackHandler
+ from langchain_community.callbacks.promptlayer_callback import (
+ PromptLayerCallbackHandler,
+ )
+ from langchain_community.callbacks.sagemaker_callback import (
+ SageMakerCallbackHandler,
+ )
+ from langchain_community.callbacks.streamlit import StreamlitCallbackHandler
+ from langchain_community.callbacks.streamlit.streamlit_callback_handler import (
+ LLMThoughtLabeler,
+ )
+ from langchain_community.callbacks.trubrics_callback import TrubricsCallbackHandler
+ from langchain_community.callbacks.wandb_callback import WandbCallbackHandler
+ from langchain_community.callbacks.whylabs_callback import WhyLabsCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AimCallbackHandler": "langchain_community.callbacks.aim_callback",
+ "ArgillaCallbackHandler": "langchain_community.callbacks.argilla_callback",
+ "ArizeCallbackHandler": "langchain_community.callbacks.arize_callback",
+ "PromptLayerCallbackHandler": "langchain_community.callbacks.promptlayer_callback",
+ "ArthurCallbackHandler": "langchain_community.callbacks.arthur_callback",
+ "ClearMLCallbackHandler": "langchain_community.callbacks.clearml_callback",
+ "CometCallbackHandler": "langchain_community.callbacks.comet_ml_callback",
+ "ContextCallbackHandler": "langchain_community.callbacks.context_callback",
+ "HumanApprovalCallbackHandler": "langchain_community.callbacks.human",
+ "InfinoCallbackHandler": "langchain_community.callbacks.infino_callback",
+ "MlflowCallbackHandler": "langchain_community.callbacks.mlflow_callback",
+ "LLMonitorCallbackHandler": "langchain_community.callbacks.llmonitor_callback",
+ "OpenAICallbackHandler": "langchain_community.callbacks.openai_info",
+ "LLMThoughtLabeler": (
+ "langchain_community.callbacks.streamlit.streamlit_callback_handler"
+ ),
+ "StreamlitCallbackHandler": "langchain_community.callbacks.streamlit",
+ "WandbCallbackHandler": "langchain_community.callbacks.wandb_callback",
+ "WhyLabsCallbackHandler": "langchain_community.callbacks.whylabs_callback",
+ "get_openai_callback": "langchain_community.callbacks.manager",
+ "wandb_tracing_enabled": "langchain_community.callbacks.manager",
+ "FlyteCallbackHandler": "langchain_community.callbacks.flyte_callback",
+ "SageMakerCallbackHandler": "langchain_community.callbacks.sagemaker_callback",
+ "LabelStudioCallbackHandler": "langchain_community.callbacks.labelstudio_callback",
+ "TrubricsCallbackHandler": "langchain_community.callbacks.trubrics_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AimCallbackHandler",
+ "ArgillaCallbackHandler",
+ "ArizeCallbackHandler",
+ "ArthurCallbackHandler",
+ "AsyncIteratorCallbackHandler",
+ "ClearMLCallbackHandler",
+ "CometCallbackHandler",
+ "ContextCallbackHandler",
+ "FileCallbackHandler",
+ "FinalStreamingStdOutCallbackHandler",
+ "FlyteCallbackHandler",
+ "HumanApprovalCallbackHandler",
+ "InfinoCallbackHandler",
+ "LLMThoughtLabeler",
+ "LLMonitorCallbackHandler",
+ "LabelStudioCallbackHandler",
+ "LangChainTracer",
+ "MlflowCallbackHandler",
+ "OpenAICallbackHandler",
+ "PromptLayerCallbackHandler",
+ "SageMakerCallbackHandler",
+ "StdOutCallbackHandler",
+ "StreamingStdOutCallbackHandler",
+ "StreamlitCallbackHandler",
+ "TrubricsCallbackHandler",
+ "WandbCallbackHandler",
+ "WhyLabsCallbackHandler",
+ "collect_runs",
+ "get_openai_callback",
+ "tracing_v2_enabled",
+ "wandb_tracing_enabled",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/aim_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/aim_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..f0ac256f3adddc0bf6d52e4b61fde46aaa43ef3a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/aim_callback.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.aim_callback import (
+ AimCallbackHandler,
+ BaseMetadataCallbackHandler,
+ import_aim,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "import_aim": "langchain_community.callbacks.aim_callback",
+ "BaseMetadataCallbackHandler": "langchain_community.callbacks.aim_callback",
+ "AimCallbackHandler": "langchain_community.callbacks.aim_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AimCallbackHandler",
+ "BaseMetadataCallbackHandler",
+ "import_aim",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/argilla_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/argilla_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f036fb16828abdb8c621afc4d071ed6742c167e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/argilla_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.argilla_callback import ArgillaCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ArgillaCallbackHandler": "langchain_community.callbacks.argilla_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArgillaCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/arize_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/arize_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f622889376a884008946830e19216d05725c69e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/arize_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.arize_callback import ArizeCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ArizeCallbackHandler": "langchain_community.callbacks.arize_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArizeCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/arthur_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/arthur_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..ece21efcdf57fd1ea65ad7f0cacd12d406ef166e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/arthur_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.arthur_callback import ArthurCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ArthurCallbackHandler": "langchain_community.callbacks.arthur_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArthurCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..f360dd6d3bf7143fa643c8acaf9b24a840999a61
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/base.py
@@ -0,0 +1,29 @@
+"""Base callback handler that can be used to handle callbacks in langchain."""
+
+from __future__ import annotations
+
+from langchain_core.callbacks import (
+ AsyncCallbackHandler,
+ BaseCallbackHandler,
+ BaseCallbackManager,
+ CallbackManagerMixin,
+ Callbacks,
+ ChainManagerMixin,
+ LLMManagerMixin,
+ RetrieverManagerMixin,
+ RunManagerMixin,
+ ToolManagerMixin,
+)
+
+__all__ = [
+ "AsyncCallbackHandler",
+ "BaseCallbackHandler",
+ "BaseCallbackManager",
+ "CallbackManagerMixin",
+ "Callbacks",
+ "ChainManagerMixin",
+ "LLMManagerMixin",
+ "RetrieverManagerMixin",
+ "RunManagerMixin",
+ "ToolManagerMixin",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/clearml_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/clearml_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d89a3776a55a1dde68a7372ec8e89f81d20c8f4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/clearml_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.clearml_callback import ClearMLCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ClearMLCallbackHandler": "langchain_community.callbacks.clearml_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ClearMLCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/comet_ml_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/comet_ml_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..eeec9f0c4ef33edcb578796222f5d94d083883b4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/comet_ml_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.comet_ml_callback import CometCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CometCallbackHandler": "langchain_community.callbacks.comet_ml_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CometCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/confident_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/confident_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..60bbc87008eab44b40345f54e611e38c84094a3f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/confident_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.confident_callback import DeepEvalCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DeepEvalCallbackHandler": "langchain_community.callbacks.confident_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DeepEvalCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/context_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/context_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..e63c1136af4e7bc8d33f825c6b5f32f80bce30c8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/context_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.context_callback import ContextCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ContextCallbackHandler": "langchain_community.callbacks.context_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ContextCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/file.py
new file mode 100644
index 0000000000000000000000000000000000000000..15fa41018839e0a53d2d2349b436651e039b1af4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/file.py
@@ -0,0 +1,3 @@
+from langchain_core.callbacks.file import FileCallbackHandler
+
+__all__ = ["FileCallbackHandler"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/flyte_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/flyte_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..852a325233bc6bf0488e963fffe99c21fc13b2ee
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/flyte_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.flyte_callback import FlyteCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "FlyteCallbackHandler": "langchain_community.callbacks.flyte_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FlyteCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/human.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/human.py
new file mode 100644
index 0000000000000000000000000000000000000000..65a2e0a06b9dfb2a0f466e2de4ce231d158f42d8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/human.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.human import (
+ AsyncHumanApprovalCallbackHandler,
+ HumanApprovalCallbackHandler,
+ HumanRejectedException,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "HumanRejectedException": "langchain_community.callbacks.human",
+ "HumanApprovalCallbackHandler": "langchain_community.callbacks.human",
+ "AsyncHumanApprovalCallbackHandler": "langchain_community.callbacks.human",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AsyncHumanApprovalCallbackHandler",
+ "HumanApprovalCallbackHandler",
+ "HumanRejectedException",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/infino_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/infino_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..7ce2de2f562dea0e286d6d4a83a6ba2f284ab45f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/infino_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.infino_callback import InfinoCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "InfinoCallbackHandler": "langchain_community.callbacks.infino_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "InfinoCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/labelstudio_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/labelstudio_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..2f848cf23a9dc3dc59bbab31facaa43d0def7641
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/labelstudio_callback.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.labelstudio_callback import (
+ LabelStudioCallbackHandler,
+ LabelStudioMode,
+ get_default_label_configs,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LabelStudioMode": "langchain_community.callbacks.labelstudio_callback",
+ "get_default_label_configs": "langchain_community.callbacks.labelstudio_callback",
+ "LabelStudioCallbackHandler": "langchain_community.callbacks.labelstudio_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LabelStudioCallbackHandler",
+ "LabelStudioMode",
+ "get_default_label_configs",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/llmonitor_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/llmonitor_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..722dbaf0734c7c3ad991d1b4810e4e9326bc24b7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/llmonitor_callback.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.llmonitor_callback import (
+ LLMonitorCallbackHandler,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LLMonitorCallbackHandler": "langchain_community.callbacks.llmonitor_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LLMonitorCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/manager.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/manager.py
new file mode 100644
index 0000000000000000000000000000000000000000..71254afd9e7414722129038ae44459f82fd211ee
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/manager.py
@@ -0,0 +1,87 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.callbacks import Callbacks
+from langchain_core.callbacks.manager import (
+ AsyncCallbackManager,
+ AsyncCallbackManagerForChainGroup,
+ AsyncCallbackManagerForChainRun,
+ AsyncCallbackManagerForLLMRun,
+ AsyncCallbackManagerForRetrieverRun,
+ AsyncCallbackManagerForToolRun,
+ AsyncParentRunManager,
+ AsyncRunManager,
+ BaseRunManager,
+ CallbackManager,
+ CallbackManagerForChainGroup,
+ CallbackManagerForChainRun,
+ CallbackManagerForLLMRun,
+ CallbackManagerForRetrieverRun,
+ CallbackManagerForToolRun,
+ ParentRunManager,
+ RunManager,
+ ahandle_event,
+ atrace_as_chain_group,
+ handle_event,
+ trace_as_chain_group,
+)
+from langchain_core.tracers.context import (
+ collect_runs,
+ tracing_v2_enabled,
+)
+from langchain_core.utils.env import env_var_is_set
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.manager import (
+ get_openai_callback,
+ wandb_tracing_enabled,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "get_openai_callback": "langchain_community.callbacks.manager",
+ "wandb_tracing_enabled": "langchain_community.callbacks.manager",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AsyncCallbackManager",
+ "AsyncCallbackManagerForChainGroup",
+ "AsyncCallbackManagerForChainRun",
+ "AsyncCallbackManagerForLLMRun",
+ "AsyncCallbackManagerForRetrieverRun",
+ "AsyncCallbackManagerForToolRun",
+ "AsyncParentRunManager",
+ "AsyncRunManager",
+ "BaseRunManager",
+ "CallbackManager",
+ "CallbackManagerForChainGroup",
+ "CallbackManagerForChainRun",
+ "CallbackManagerForLLMRun",
+ "CallbackManagerForRetrieverRun",
+ "CallbackManagerForToolRun",
+ "Callbacks",
+ "ParentRunManager",
+ "RunManager",
+ "ahandle_event",
+ "atrace_as_chain_group",
+ "collect_runs",
+ "env_var_is_set",
+ "get_openai_callback",
+ "handle_event",
+ "trace_as_chain_group",
+ "tracing_v2_enabled",
+ "wandb_tracing_enabled",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/mlflow_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/mlflow_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..c8ba3f9b69344290f5deea99873cdb35c1abb431
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/mlflow_callback.py
@@ -0,0 +1,38 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.mlflow_callback import (
+ MlflowCallbackHandler,
+ MlflowLogger,
+ analyze_text,
+ construct_html_from_prompt_and_generation,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "analyze_text": "langchain_community.callbacks.mlflow_callback",
+ "construct_html_from_prompt_and_generation": (
+ "langchain_community.callbacks.mlflow_callback"
+ ),
+ "MlflowLogger": "langchain_community.callbacks.mlflow_callback",
+ "MlflowCallbackHandler": "langchain_community.callbacks.mlflow_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MlflowCallbackHandler",
+ "MlflowLogger",
+ "analyze_text",
+ "construct_html_from_prompt_and_generation",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/openai_info.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/openai_info.py
new file mode 100644
index 0000000000000000000000000000000000000000..f6d66ef66376cb748be61ef254f35fa3418dcd44
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/openai_info.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.openai_info import OpenAICallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "OpenAICallbackHandler": "langchain_community.callbacks.openai_info",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenAICallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/promptlayer_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/promptlayer_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..a396b23335e9e39227bdf1ffa16fbaebff2e5a93
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/promptlayer_callback.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.promptlayer_callback import (
+ PromptLayerCallbackHandler,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "PromptLayerCallbackHandler": "langchain_community.callbacks.promptlayer_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PromptLayerCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/sagemaker_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/sagemaker_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..32a962f7ed74358893ac8f592621bbbf4ed9973e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/sagemaker_callback.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.sagemaker_callback import (
+ SageMakerCallbackHandler,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SageMakerCallbackHandler": "langchain_community.callbacks.sagemaker_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SageMakerCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/stdout.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/stdout.py
new file mode 100644
index 0000000000000000000000000000000000000000..754e58248e4700a666314dddf21a8f4248f8e541
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/stdout.py
@@ -0,0 +1,3 @@
+from langchain_core.callbacks.stdout import StdOutCallbackHandler
+
+__all__ = ["StdOutCallbackHandler"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_aiter.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_aiter.py
new file mode 100644
index 0000000000000000000000000000000000000000..0811e86a3e7818cd9ee25fdfd802b4c04efdf586
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_aiter.py
@@ -0,0 +1,83 @@
+from __future__ import annotations
+
+import asyncio
+from collections.abc import AsyncIterator
+from typing import Any, Literal, cast
+
+from langchain_core.callbacks import AsyncCallbackHandler
+from langchain_core.outputs import LLMResult
+from typing_extensions import override
+
+# TODO: If used by two LLM runs in parallel this won't work as expected
+
+
+class AsyncIteratorCallbackHandler(AsyncCallbackHandler):
+ """Callback handler that returns an async iterator."""
+
+ queue: asyncio.Queue[str]
+
+ done: asyncio.Event
+
+ @property
+ def always_verbose(self) -> bool:
+ """Always verbose."""
+ return True
+
+ def __init__(self) -> None:
+ """Instantiate AsyncIteratorCallbackHandler."""
+ self.queue = asyncio.Queue()
+ self.done = asyncio.Event()
+
+ @override
+ async def on_llm_start(
+ self,
+ serialized: dict[str, Any],
+ prompts: list[str],
+ **kwargs: Any,
+ ) -> None:
+ # If two calls are made in a row, this resets the state
+ self.done.clear()
+
+ @override
+ async def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
+ if token is not None and token != "":
+ self.queue.put_nowait(token)
+
+ @override
+ async def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None:
+ self.done.set()
+
+ @override
+ async def on_llm_error(self, error: BaseException, **kwargs: Any) -> None:
+ self.done.set()
+
+ # TODO: implement the other methods
+
+ async def aiter(self) -> AsyncIterator[str]:
+ """Asynchronous iterator that yields tokens."""
+ while not self.queue.empty() or not self.done.is_set():
+ # Wait for the next token in the queue,
+ # but stop waiting if the done event is set
+ done, other = await asyncio.wait(
+ [
+ # NOTE: If you add other tasks here, update the code below,
+ # which assumes each set has exactly one task each
+ asyncio.ensure_future(self.queue.get()),
+ asyncio.ensure_future(self.done.wait()),
+ ],
+ return_when=asyncio.FIRST_COMPLETED,
+ )
+
+ # Cancel the other task
+ if other:
+ other.pop().cancel()
+
+ # Extract the value of the first completed task
+ token_or_done = cast("str | Literal[True]", done.pop().result())
+
+ # If the extracted value is the boolean True, the done event was set
+ if token_or_done is True:
+ break
+
+ # Otherwise, the extracted value is a token, which we yield
+ yield token_or_done
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_aiter_final_only.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_aiter_final_only.py
new file mode 100644
index 0000000000000000000000000000000000000000..744475e662803d4381f71e51e9e5c5a77b750a3c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_aiter_final_only.py
@@ -0,0 +1,98 @@
+from __future__ import annotations
+
+from typing import Any
+
+from langchain_core.outputs import LLMResult
+from typing_extensions import override
+
+from langchain_classic.callbacks.streaming_aiter import AsyncIteratorCallbackHandler
+
+DEFAULT_ANSWER_PREFIX_TOKENS = ["Final", "Answer", ":"]
+
+
+class AsyncFinalIteratorCallbackHandler(AsyncIteratorCallbackHandler):
+ """Callback handler that returns an async iterator.
+
+ Only the final output of the agent will be iterated.
+ """
+
+ def append_to_last_tokens(self, token: str) -> None:
+ """Append token to the last tokens."""
+ self.last_tokens.append(token)
+ self.last_tokens_stripped.append(token.strip())
+ if len(self.last_tokens) > len(self.answer_prefix_tokens):
+ self.last_tokens.pop(0)
+ self.last_tokens_stripped.pop(0)
+
+ def check_if_answer_reached(self) -> bool:
+ """Check if the answer has been reached."""
+ if self.strip_tokens:
+ return self.last_tokens_stripped == self.answer_prefix_tokens_stripped
+ return self.last_tokens == self.answer_prefix_tokens
+
+ def __init__(
+ self,
+ *,
+ answer_prefix_tokens: list[str] | None = None,
+ strip_tokens: bool = True,
+ stream_prefix: bool = False,
+ ) -> None:
+ """Instantiate AsyncFinalIteratorCallbackHandler.
+
+ Args:
+ answer_prefix_tokens: Token sequence that prefixes the answer.
+ Default is ["Final", "Answer", ":"]
+ strip_tokens: Ignore white spaces and new lines when comparing
+ answer_prefix_tokens to last tokens? (to determine if answer has been
+ reached)
+ stream_prefix: Should answer prefix itself also be streamed?
+ """
+ super().__init__()
+ if answer_prefix_tokens is None:
+ self.answer_prefix_tokens = DEFAULT_ANSWER_PREFIX_TOKENS
+ else:
+ self.answer_prefix_tokens = answer_prefix_tokens
+ if strip_tokens:
+ self.answer_prefix_tokens_stripped = [
+ token.strip() for token in self.answer_prefix_tokens
+ ]
+ else:
+ self.answer_prefix_tokens_stripped = self.answer_prefix_tokens
+ self.last_tokens = [""] * len(self.answer_prefix_tokens)
+ self.last_tokens_stripped = [""] * len(self.answer_prefix_tokens)
+ self.strip_tokens = strip_tokens
+ self.stream_prefix = stream_prefix
+ self.answer_reached = False
+
+ @override
+ async def on_llm_start(
+ self,
+ serialized: dict[str, Any],
+ prompts: list[str],
+ **kwargs: Any,
+ ) -> None:
+ # If two calls are made in a row, this resets the state
+ self.done.clear()
+ self.answer_reached = False
+
+ @override
+ async def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None:
+ if self.answer_reached:
+ self.done.set()
+
+ @override
+ async def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
+ # Remember the last n tokens, where n = len(answer_prefix_tokens)
+ self.append_to_last_tokens(token)
+
+ # Check if the last n tokens match the answer_prefix_tokens list ...
+ if self.check_if_answer_reached():
+ self.answer_reached = True
+ if self.stream_prefix:
+ for t in self.last_tokens:
+ self.queue.put_nowait(t)
+ return
+
+ # If yes, then put tokens from now on
+ if self.answer_reached:
+ self.queue.put_nowait(token)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_stdout.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_stdout.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cebc74183fdc22ce8362a51dfeb95ef53f39dcf
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_stdout.py
@@ -0,0 +1,5 @@
+"""Callback Handler streams to stdout on new llm token."""
+
+from langchain_core.callbacks import StreamingStdOutCallbackHandler
+
+__all__ = ["StreamingStdOutCallbackHandler"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_stdout_final_only.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_stdout_final_only.py
new file mode 100644
index 0000000000000000000000000000000000000000..e8eee519b3e9efd8b4f4ba6ffdab13c1485124ae
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/streaming_stdout_final_only.py
@@ -0,0 +1,96 @@
+"""Callback Handler streams to stdout on new llm token."""
+
+import sys
+from typing import Any
+
+from langchain_core.callbacks import StreamingStdOutCallbackHandler
+from typing_extensions import override
+
+DEFAULT_ANSWER_PREFIX_TOKENS = ["Final", "Answer", ":"]
+
+
+class FinalStreamingStdOutCallbackHandler(StreamingStdOutCallbackHandler):
+ """Callback handler for streaming in agents.
+
+ Only works with agents using LLMs that support streaming.
+
+ Only the final output of the agent will be streamed.
+ """
+
+ def append_to_last_tokens(self, token: str) -> None:
+ """Append token to the last tokens."""
+ self.last_tokens.append(token)
+ self.last_tokens_stripped.append(token.strip())
+ if len(self.last_tokens) > len(self.answer_prefix_tokens):
+ self.last_tokens.pop(0)
+ self.last_tokens_stripped.pop(0)
+
+ def check_if_answer_reached(self) -> bool:
+ """Check if the answer has been reached."""
+ if self.strip_tokens:
+ return self.last_tokens_stripped == self.answer_prefix_tokens_stripped
+ return self.last_tokens == self.answer_prefix_tokens
+
+ def __init__(
+ self,
+ *,
+ answer_prefix_tokens: list[str] | None = None,
+ strip_tokens: bool = True,
+ stream_prefix: bool = False,
+ ) -> None:
+ """Instantiate FinalStreamingStdOutCallbackHandler.
+
+ Args:
+ answer_prefix_tokens: Token sequence that prefixes the answer.
+ Default is ["Final", "Answer", ":"]
+ strip_tokens: Ignore white spaces and new lines when comparing
+ answer_prefix_tokens to last tokens? (to determine if answer has been
+ reached)
+ stream_prefix: Should answer prefix itself also be streamed?
+ """
+ super().__init__()
+ if answer_prefix_tokens is None:
+ self.answer_prefix_tokens = DEFAULT_ANSWER_PREFIX_TOKENS
+ else:
+ self.answer_prefix_tokens = answer_prefix_tokens
+ if strip_tokens:
+ self.answer_prefix_tokens_stripped = [
+ token.strip() for token in self.answer_prefix_tokens
+ ]
+ else:
+ self.answer_prefix_tokens_stripped = self.answer_prefix_tokens
+ self.last_tokens = [""] * len(self.answer_prefix_tokens)
+ self.last_tokens_stripped = [""] * len(self.answer_prefix_tokens)
+ self.strip_tokens = strip_tokens
+ self.stream_prefix = stream_prefix
+ self.answer_reached = False
+
+ @override
+ def on_llm_start(
+ self,
+ serialized: dict[str, Any],
+ prompts: list[str],
+ **kwargs: Any,
+ ) -> None:
+ """Run when LLM starts running."""
+ self.answer_reached = False
+
+ @override
+ def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
+ """Run on new LLM token. Only available when streaming is enabled."""
+ # Remember the last n tokens, where n = len(answer_prefix_tokens)
+ self.append_to_last_tokens(token)
+
+ # Check if the last n tokens match the answer_prefix_tokens list ...
+ if self.check_if_answer_reached():
+ self.answer_reached = True
+ if self.stream_prefix:
+ for t in self.last_tokens:
+ sys.stdout.write(t)
+ sys.stdout.flush()
+ return
+
+ # ... if yes, then print tokens from now on
+ if self.answer_reached:
+ sys.stdout.write(token)
+ sys.stdout.flush()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/trubrics_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/trubrics_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed91fd37b4ddc4911015965568dce5ada7e6b73b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/trubrics_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.trubrics_callback import TrubricsCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "TrubricsCallbackHandler": "langchain_community.callbacks.trubrics_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TrubricsCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..104d77b5935fae20300cb13c602f517055a171c9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/utils.py
@@ -0,0 +1,48 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.utils import (
+ BaseMetadataCallbackHandler,
+ _flatten_dict,
+ flatten_dict,
+ hash_string,
+ import_pandas,
+ import_spacy,
+ import_textstat,
+ load_json,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "import_spacy": "langchain_community.callbacks.utils",
+ "import_pandas": "langchain_community.callbacks.utils",
+ "import_textstat": "langchain_community.callbacks.utils",
+ "_flatten_dict": "langchain_community.callbacks.utils",
+ "flatten_dict": "langchain_community.callbacks.utils",
+ "hash_string": "langchain_community.callbacks.utils",
+ "load_json": "langchain_community.callbacks.utils",
+ "BaseMetadataCallbackHandler": "langchain_community.callbacks.utils",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BaseMetadataCallbackHandler",
+ "_flatten_dict",
+ "flatten_dict",
+ "hash_string",
+ "import_pandas",
+ "import_spacy",
+ "import_textstat",
+ "load_json",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/wandb_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/wandb_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..652a54c49a2a74b46772d86713eb800e66d8ac23
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/wandb_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.wandb_callback import WandbCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "WandbCallbackHandler": "langchain_community.callbacks.wandb_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WandbCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/whylabs_callback.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/whylabs_callback.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba585c8eeb8d0e60b1a371bb84f068386aaeab2b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/callbacks/whylabs_callback.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.callbacks.whylabs_callback import WhyLabsCallbackHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "WhyLabsCallbackHandler": "langchain_community.callbacks.whylabs_callback",
+}
+
+_import_attribute = create_importer(__file__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WhyLabsCallbackHandler",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..8c9cf40439d293995c03e89bb71fb098a125cdc7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/__init__.py
@@ -0,0 +1,96 @@
+"""**Chains** are easily reusable components linked together.
+
+Chains encode a sequence of calls to components like models, document retrievers,
+other Chains, etc., and provide a simple interface to this sequence.
+
+The Chain interface makes it easy to create apps that are:
+
+ - **Stateful:** add Memory to any Chain to give it state,
+ - **Observable:** pass Callbacks to a Chain to execute additional functionality,
+ like logging, outside the main sequence of component calls,
+ - **Composable:** combine Chains with other components, including other Chains.
+"""
+
+from typing import Any
+
+from langchain_classic._api import create_importer
+
+_module_lookup = {
+ "APIChain": "langchain_classic.chains.api.base",
+ "OpenAPIEndpointChain": "langchain_community.chains.openapi.chain",
+ "AnalyzeDocumentChain": "langchain_classic.chains.combine_documents.base",
+ "MapReduceDocumentsChain": "langchain_classic.chains.combine_documents.map_reduce",
+ "MapRerankDocumentsChain": "langchain_classic.chains.combine_documents.map_rerank",
+ "ReduceDocumentsChain": "langchain_classic.chains.combine_documents.reduce",
+ "RefineDocumentsChain": "langchain_classic.chains.combine_documents.refine",
+ "StuffDocumentsChain": "langchain_classic.chains.combine_documents.stuff",
+ "ConstitutionalChain": "langchain_classic.chains.constitutional_ai.base",
+ "ConversationChain": "langchain_classic.chains.conversation.base",
+ "ChatVectorDBChain": "langchain_classic.chains.conversational_retrieval.base",
+ "ConversationalRetrievalChain": (
+ "langchain_classic.chains.conversational_retrieval.base"
+ ),
+ "generate_example": "langchain_classic.chains.example_generator",
+ "FlareChain": "langchain_classic.chains.flare.base",
+ "ArangoGraphQAChain": "langchain_community.chains.graph_qa.arangodb",
+ "GraphQAChain": "langchain_community.chains.graph_qa.base",
+ "GraphCypherQAChain": "langchain_community.chains.graph_qa.cypher",
+ "FalkorDBQAChain": "langchain_community.chains.graph_qa.falkordb",
+ "HugeGraphQAChain": "langchain_community.chains.graph_qa.hugegraph",
+ "KuzuQAChain": "langchain_community.chains.graph_qa.kuzu",
+ "NebulaGraphQAChain": "langchain_community.chains.graph_qa.nebulagraph",
+ "NeptuneOpenCypherQAChain": "langchain_community.chains.graph_qa.neptune_cypher",
+ "NeptuneSparqlQAChain": "langchain_community.chains.graph_qa.neptune_sparql",
+ "OntotextGraphDBQAChain": "langchain_community.chains.graph_qa.ontotext_graphdb",
+ "GraphSparqlQAChain": "langchain_community.chains.graph_qa.sparql",
+ "create_history_aware_retriever": (
+ "langchain_classic.chains.history_aware_retriever"
+ ),
+ "HypotheticalDocumentEmbedder": "langchain_classic.chains.hyde.base",
+ "LLMChain": "langchain_classic.chains.llm",
+ "LLMCheckerChain": "langchain_classic.chains.llm_checker.base",
+ "LLMMathChain": "langchain_classic.chains.llm_math.base",
+ "LLMRequestsChain": "langchain_community.chains.llm_requests",
+ "LLMSummarizationCheckerChain": (
+ "langchain_classic.chains.llm_summarization_checker.base"
+ ),
+ "load_chain": "langchain_classic.chains.loading",
+ "MapReduceChain": "langchain_classic.chains.mapreduce",
+ "OpenAIModerationChain": "langchain_classic.chains.moderation",
+ "NatBotChain": "langchain_classic.chains.natbot.base",
+ "create_citation_fuzzy_match_chain": "langchain_classic.chains.openai_functions",
+ "create_citation_fuzzy_match_runnable": "langchain_classic.chains.openai_functions",
+ "create_extraction_chain": "langchain_classic.chains.openai_functions",
+ "create_extraction_chain_pydantic": "langchain_classic.chains.openai_functions",
+ "create_qa_with_sources_chain": "langchain_classic.chains.openai_functions",
+ "create_qa_with_structure_chain": "langchain_classic.chains.openai_functions",
+ "create_tagging_chain": "langchain_classic.chains.openai_functions",
+ "create_tagging_chain_pydantic": "langchain_classic.chains.openai_functions",
+ "QAGenerationChain": "langchain_classic.chains.qa_generation.base",
+ "QAWithSourcesChain": "langchain_classic.chains.qa_with_sources.base",
+ "RetrievalQAWithSourcesChain": "langchain_classic.chains.qa_with_sources.retrieval",
+ "VectorDBQAWithSourcesChain": "langchain_classic.chains.qa_with_sources.vector_db",
+ "create_retrieval_chain": "langchain_classic.chains.retrieval",
+ "RetrievalQA": "langchain_classic.chains.retrieval_qa.base",
+ "VectorDBQA": "langchain_classic.chains.retrieval_qa.base",
+ "LLMRouterChain": "langchain_classic.chains.router",
+ "MultiPromptChain": "langchain_classic.chains.router",
+ "MultiRetrievalQAChain": "langchain_classic.chains.router",
+ "MultiRouteChain": "langchain_classic.chains.router",
+ "RouterChain": "langchain_classic.chains.router",
+ "SequentialChain": "langchain_classic.chains.sequential",
+ "SimpleSequentialChain": "langchain_classic.chains.sequential",
+ "create_sql_query_chain": "langchain_classic.chains.sql_database.query",
+ "create_structured_output_runnable": "langchain_classic.chains.structured_output",
+ "load_summarize_chain": "langchain_classic.chains.summarize",
+ "TransformChain": "langchain_classic.chains.transform",
+}
+
+importer = create_importer(__package__, module_lookup=_module_lookup)
+
+
+def __getattr__(name: str) -> Any:
+ return importer(name)
+
+
+__all__ = list(_module_lookup.keys())
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..1f9c4add76f4fad207b14f82ae38a2162bb9c145
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/base.py
@@ -0,0 +1,806 @@
+"""Base interface that all chains should implement."""
+
+import builtins
+import contextlib
+import inspect
+import json
+import logging
+import warnings
+from abc import ABC, abstractmethod
+from pathlib import Path
+from typing import Any, cast
+
+import yaml
+from langchain_core._api import deprecated
+from langchain_core.callbacks import (
+ AsyncCallbackManager,
+ AsyncCallbackManagerForChainRun,
+ BaseCallbackManager,
+ CallbackManager,
+ CallbackManagerForChainRun,
+ Callbacks,
+)
+from langchain_core.outputs import RunInfo
+from langchain_core.runnables import (
+ RunnableConfig,
+ RunnableSerializable,
+ ensure_config,
+ run_in_executor,
+)
+from langchain_core.utils.pydantic import create_model
+from pydantic import (
+ BaseModel,
+ ConfigDict,
+ Field,
+ field_validator,
+ model_validator,
+)
+from typing_extensions import override
+
+from langchain_classic.base_memory import BaseMemory
+from langchain_classic.schema import RUN_KEY
+
+logger = logging.getLogger(__name__)
+
+
+def _get_verbosity() -> bool:
+ from langchain_classic.globals import get_verbose
+
+ return get_verbose()
+
+
+class Chain(RunnableSerializable[dict[str, Any], dict[str, Any]], ABC):
+ """Abstract base class for creating structured sequences of calls to components.
+
+ Chains should be used to encode a sequence of calls to components like
+ models, document retrievers, other chains, etc., and provide a simple interface
+ to this sequence.
+
+ The Chain interface makes it easy to create apps that are:
+ - Stateful: add Memory to any Chain to give it state,
+ - Observable: pass Callbacks to a Chain to execute additional functionality,
+ like logging, outside the main sequence of component calls,
+ - Composable: the Chain API is flexible enough that it is easy to combine
+ Chains with other components, including other Chains.
+
+ The main methods exposed by chains are:
+ - `__call__`: Chains are callable. The `__call__` method is the primary way to
+ execute a Chain. This takes inputs as a dictionary and returns a
+ dictionary output.
+ - `run`: A convenience method that takes inputs as args/kwargs and returns the
+ output as a string or object. This method can only be used for a subset of
+ chains and cannot return as rich of an output as `__call__`.
+ """
+
+ memory: BaseMemory | None = None
+ """Optional memory object.
+ Memory is a class that gets called at the start
+ and at the end of every chain. At the start, memory loads variables and passes
+ them along in the chain. At the end, it saves any returned variables.
+ There are many different types of memory - please see memory docs
+ for the full catalog."""
+ callbacks: Callbacks = Field(default=None, exclude=True)
+ """Optional list of callback handlers (or callback manager).
+ Callback handlers are called throughout the lifecycle of a call to a chain,
+ starting with on_chain_start, ending with on_chain_end or on_chain_error.
+ Each custom chain can optionally call additional callback methods, see Callback docs
+ for full details."""
+ verbose: bool = Field(default_factory=_get_verbosity)
+ """Whether or not run in verbose mode. In verbose mode, some intermediate logs
+ will be printed to the console. Defaults to the global `verbose` value,
+ accessible via `langchain.globals.get_verbose()`."""
+ tags: list[str] | None = None
+ """Optional list of tags associated with the chain.
+ These tags will be associated with each call to this chain,
+ and passed as arguments to the handlers defined in `callbacks`.
+ You can use these to eg identify a specific instance of a chain with its use case.
+ """
+ metadata: builtins.dict[str, Any] | None = None
+ """Optional metadata associated with the chain.
+ This metadata will be associated with each call to this chain,
+ and passed as arguments to the handlers defined in `callbacks`.
+ You can use these to eg identify a specific instance of a chain with its use case.
+ """
+ callback_manager: BaseCallbackManager | None = Field(default=None, exclude=True)
+ """[DEPRECATED] Use `callbacks` instead."""
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ @override
+ def get_input_schema(
+ self,
+ config: RunnableConfig | None = None,
+ ) -> type[BaseModel]:
+ # This is correct, but pydantic typings/mypy don't think so.
+ return create_model("ChainInput", **dict.fromkeys(self.input_keys, (Any, None)))
+
+ @override
+ def get_output_schema(
+ self,
+ config: RunnableConfig | None = None,
+ ) -> type[BaseModel]:
+ # This is correct, but pydantic typings/mypy don't think so.
+ return create_model(
+ "ChainOutput",
+ **dict.fromkeys(self.output_keys, (Any, None)),
+ )
+
+ @override
+ def invoke(
+ self,
+ input: dict[str, Any],
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> dict[str, Any]:
+ config = ensure_config(config)
+ callbacks = config.get("callbacks")
+ tags = config.get("tags")
+ metadata = config.get("metadata")
+ run_name = config.get("run_name") or self.get_name()
+ run_id = config.get("run_id")
+ include_run_info = kwargs.get("include_run_info", False)
+ return_only_outputs = kwargs.get("return_only_outputs", False)
+
+ inputs = self.prep_inputs(input)
+ callback_manager = CallbackManager.configure(
+ callbacks,
+ self.callbacks,
+ self.verbose,
+ tags,
+ self.tags,
+ metadata,
+ self.metadata,
+ )
+ new_arg_supported = inspect.signature(self._call).parameters.get("run_manager")
+
+ run_manager = callback_manager.on_chain_start(
+ None,
+ inputs,
+ run_id,
+ name=run_name,
+ )
+ try:
+ self._validate_inputs(inputs)
+ outputs = (
+ self._call(inputs, run_manager=run_manager)
+ if new_arg_supported
+ else self._call(inputs)
+ )
+
+ final_outputs: dict[str, Any] = self.prep_outputs(
+ inputs,
+ outputs,
+ return_only_outputs,
+ )
+ except BaseException as e:
+ run_manager.on_chain_error(e)
+ raise
+ run_manager.on_chain_end(outputs)
+
+ if include_run_info:
+ final_outputs[RUN_KEY] = RunInfo(run_id=run_manager.run_id)
+ return final_outputs
+
+ @override
+ async def ainvoke(
+ self,
+ input: dict[str, Any],
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> dict[str, Any]:
+ config = ensure_config(config)
+ callbacks = config.get("callbacks")
+ tags = config.get("tags")
+ metadata = config.get("metadata")
+ run_name = config.get("run_name") or self.get_name()
+ run_id = config.get("run_id")
+ include_run_info = kwargs.get("include_run_info", False)
+ return_only_outputs = kwargs.get("return_only_outputs", False)
+
+ inputs = await self.aprep_inputs(input)
+ callback_manager = AsyncCallbackManager.configure(
+ callbacks,
+ self.callbacks,
+ self.verbose,
+ tags,
+ self.tags,
+ metadata,
+ self.metadata,
+ )
+ new_arg_supported = inspect.signature(self._acall).parameters.get("run_manager")
+ run_manager = await callback_manager.on_chain_start(
+ None,
+ inputs,
+ run_id,
+ name=run_name,
+ )
+ try:
+ self._validate_inputs(inputs)
+ outputs = (
+ await self._acall(inputs, run_manager=run_manager)
+ if new_arg_supported
+ else await self._acall(inputs)
+ )
+ final_outputs: dict[str, Any] = await self.aprep_outputs(
+ inputs,
+ outputs,
+ return_only_outputs,
+ )
+ except BaseException as e:
+ await run_manager.on_chain_error(e)
+ raise
+ await run_manager.on_chain_end(outputs)
+
+ if include_run_info:
+ final_outputs[RUN_KEY] = RunInfo(run_id=run_manager.run_id)
+ return final_outputs
+
+ @property
+ def _chain_type(self) -> str:
+ msg = "Saving not supported for this chain type."
+ raise NotImplementedError(msg)
+
+ @model_validator(mode="before")
+ @classmethod
+ def raise_callback_manager_deprecation(cls, values: dict) -> Any:
+ """Raise deprecation warning if callback_manager is used."""
+ if values.get("callback_manager") is not None:
+ if values.get("callbacks") is not None:
+ msg = (
+ "Cannot specify both callback_manager and callbacks. "
+ "callback_manager is deprecated, callbacks is the preferred "
+ "parameter to pass in."
+ )
+ raise ValueError(msg)
+ warnings.warn(
+ "callback_manager is deprecated. Please use callbacks instead.",
+ DeprecationWarning,
+ stacklevel=4,
+ )
+ values["callbacks"] = values.pop("callback_manager", None)
+ return values
+
+ @field_validator("verbose", mode="before")
+ @classmethod
+ def set_verbose(
+ cls,
+ verbose: bool | None, # noqa: FBT001
+ ) -> bool:
+ """Set the chain verbosity.
+
+ Defaults to the global setting if not specified by the user.
+ """
+ if verbose is None:
+ return _get_verbosity()
+ return verbose
+
+ @property
+ @abstractmethod
+ def input_keys(self) -> list[str]:
+ """Keys expected to be in the chain input."""
+
+ @property
+ @abstractmethod
+ def output_keys(self) -> list[str]:
+ """Keys expected to be in the chain output."""
+
+ def _validate_inputs(self, inputs: Any) -> None:
+ """Check that all inputs are present."""
+ if not isinstance(inputs, dict):
+ _input_keys = set(self.input_keys)
+ if self.memory is not None:
+ # If there are multiple input keys, but some get set by memory so that
+ # only one is not set, we can still figure out which key it is.
+ _input_keys = _input_keys.difference(self.memory.memory_variables)
+ if len(_input_keys) != 1:
+ msg = (
+ f"A single string input was passed in, but this chain expects "
+ f"multiple inputs ({_input_keys}). When a chain expects "
+ f"multiple inputs, please call it by passing in a dictionary, "
+ "eg `chain({'foo': 1, 'bar': 2})`"
+ )
+ raise ValueError(msg)
+
+ missing_keys = set(self.input_keys).difference(inputs)
+ if missing_keys:
+ msg = f"Missing some input keys: {missing_keys}"
+ raise ValueError(msg)
+
+ def _validate_outputs(self, outputs: dict[str, Any]) -> None:
+ missing_keys = set(self.output_keys).difference(outputs)
+ if missing_keys:
+ msg = f"Missing some output keys: {missing_keys}"
+ raise ValueError(msg)
+
+ @abstractmethod
+ def _call(
+ self,
+ inputs: builtins.dict[str, Any],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> builtins.dict[str, Any]:
+ """Execute the chain.
+
+ This is a private method that is not user-facing. It is only called within
+ `Chain.__call__`, which is the user-facing wrapper method that handles
+ callbacks configuration and some input/output processing.
+
+ Args:
+ inputs: A dict of named inputs to the chain. Assumed to contain all inputs
+ specified in `Chain.input_keys`, including any inputs added by memory.
+ run_manager: The callbacks manager that contains the callback handlers for
+ this run of the chain.
+
+ Returns:
+ A dict of named outputs. Should contain all outputs specified in
+ `Chain.output_keys`.
+ """
+
+ async def _acall(
+ self,
+ inputs: builtins.dict[str, Any],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> builtins.dict[str, Any]:
+ """Asynchronously execute the chain.
+
+ This is a private method that is not user-facing. It is only called within
+ `Chain.acall`, which is the user-facing wrapper method that handles
+ callbacks configuration and some input/output processing.
+
+ Args:
+ inputs: A dict of named inputs to the chain. Assumed to contain all inputs
+ specified in `Chain.input_keys`, including any inputs added by memory.
+ run_manager: The callbacks manager that contains the callback handlers for
+ this run of the chain.
+
+ Returns:
+ A dict of named outputs. Should contain all outputs specified in
+ `Chain.output_keys`.
+ """
+ return await run_in_executor(
+ None,
+ self._call,
+ inputs,
+ run_manager.get_sync() if run_manager else None,
+ )
+
+ @deprecated("0.1.0", alternative="invoke", removal="2.0.0")
+ def __call__(
+ self,
+ inputs: dict[str, Any] | Any,
+ return_only_outputs: bool = False, # noqa: FBT001,FBT002
+ callbacks: Callbacks = None,
+ *,
+ tags: list[str] | None = None,
+ metadata: dict[str, Any] | None = None,
+ run_name: str | None = None,
+ include_run_info: bool = False,
+ ) -> dict[str, Any]:
+ """Execute the chain.
+
+ Args:
+ inputs: Dictionary of inputs, or single input if chain expects
+ only one param. Should contain all inputs specified in
+ `Chain.input_keys` except for inputs that will be set by the chain's
+ memory.
+ return_only_outputs: Whether to return only outputs in the
+ response. If `True`, only new keys generated by this chain will be
+ returned. If `False`, both input keys and new keys generated by this
+ chain will be returned.
+ callbacks: Callbacks to use for this chain run. These will be called in
+ addition to callbacks passed to the chain during construction, but only
+ these runtime callbacks will propagate to calls to other objects.
+ tags: List of string tags to pass to all callbacks. These will be passed in
+ addition to tags passed to the chain during construction, but only
+ these runtime tags will propagate to calls to other objects.
+ metadata: Optional metadata associated with the chain.
+ run_name: Optional name for this run of the chain.
+ include_run_info: Whether to include run info in the response. Defaults
+ to False.
+
+ Returns:
+ A dict of named outputs. Should contain all outputs specified in
+ `Chain.output_keys`.
+ """
+ config = {
+ "callbacks": callbacks,
+ "tags": tags,
+ "metadata": metadata,
+ "run_name": run_name,
+ }
+
+ return self.invoke(
+ inputs,
+ cast("RunnableConfig", {k: v for k, v in config.items() if v is not None}),
+ return_only_outputs=return_only_outputs,
+ include_run_info=include_run_info,
+ )
+
+ @deprecated("0.1.0", alternative="ainvoke", removal="2.0.0")
+ async def acall(
+ self,
+ inputs: dict[str, Any] | Any,
+ return_only_outputs: bool = False, # noqa: FBT001,FBT002
+ callbacks: Callbacks = None,
+ *,
+ tags: list[str] | None = None,
+ metadata: dict[str, Any] | None = None,
+ run_name: str | None = None,
+ include_run_info: bool = False,
+ ) -> dict[str, Any]:
+ """Asynchronously execute the chain.
+
+ Args:
+ inputs: Dictionary of inputs, or single input if chain expects
+ only one param. Should contain all inputs specified in
+ `Chain.input_keys` except for inputs that will be set by the chain's
+ memory.
+ return_only_outputs: Whether to return only outputs in the
+ response. If `True`, only new keys generated by this chain will be
+ returned. If `False`, both input keys and new keys generated by this
+ chain will be returned.
+ callbacks: Callbacks to use for this chain run. These will be called in
+ addition to callbacks passed to the chain during construction, but only
+ these runtime callbacks will propagate to calls to other objects.
+ tags: List of string tags to pass to all callbacks. These will be passed in
+ addition to tags passed to the chain during construction, but only
+ these runtime tags will propagate to calls to other objects.
+ metadata: Optional metadata associated with the chain.
+ run_name: Optional name for this run of the chain.
+ include_run_info: Whether to include run info in the response. Defaults
+ to False.
+
+ Returns:
+ A dict of named outputs. Should contain all outputs specified in
+ `Chain.output_keys`.
+ """
+ config = {
+ "callbacks": callbacks,
+ "tags": tags,
+ "metadata": metadata,
+ "run_name": run_name,
+ }
+ return await self.ainvoke(
+ inputs,
+ cast("RunnableConfig", {k: v for k, v in config.items() if k is not None}),
+ return_only_outputs=return_only_outputs,
+ include_run_info=include_run_info,
+ )
+
+ def prep_outputs(
+ self,
+ inputs: dict[str, str],
+ outputs: dict[str, str],
+ return_only_outputs: bool = False, # noqa: FBT001,FBT002
+ ) -> dict[str, str]:
+ """Validate and prepare chain outputs, and save info about this run to memory.
+
+ Args:
+ inputs: Dictionary of chain inputs, including any inputs added by chain
+ memory.
+ outputs: Dictionary of initial chain outputs.
+ return_only_outputs: Whether to only return the chain outputs. If `False`,
+ inputs are also added to the final outputs.
+
+ Returns:
+ A dict of the final chain outputs.
+ """
+ self._validate_outputs(outputs)
+ if self.memory is not None:
+ self.memory.save_context(inputs, outputs)
+ if return_only_outputs:
+ return outputs
+ return {**inputs, **outputs}
+
+ async def aprep_outputs(
+ self,
+ inputs: dict[str, str],
+ outputs: dict[str, str],
+ return_only_outputs: bool = False, # noqa: FBT001,FBT002
+ ) -> dict[str, str]:
+ """Validate and prepare chain outputs, and save info about this run to memory.
+
+ Args:
+ inputs: Dictionary of chain inputs, including any inputs added by chain
+ memory.
+ outputs: Dictionary of initial chain outputs.
+ return_only_outputs: Whether to only return the chain outputs. If `False`,
+ inputs are also added to the final outputs.
+
+ Returns:
+ A dict of the final chain outputs.
+ """
+ self._validate_outputs(outputs)
+ if self.memory is not None:
+ await self.memory.asave_context(inputs, outputs)
+ if return_only_outputs:
+ return outputs
+ return {**inputs, **outputs}
+
+ def prep_inputs(self, inputs: dict[str, Any] | Any) -> dict[str, str]:
+ """Prepare chain inputs, including adding inputs from memory.
+
+ Args:
+ inputs: Dictionary of raw inputs, or single input if chain expects
+ only one param. Should contain all inputs specified in
+ `Chain.input_keys` except for inputs that will be set by the chain's
+ memory.
+
+ Returns:
+ A dictionary of all inputs, including those added by the chain's memory.
+ """
+ if not isinstance(inputs, dict):
+ _input_keys = set(self.input_keys)
+ if self.memory is not None:
+ # If there are multiple input keys, but some get set by memory so that
+ # only one is not set, we can still figure out which key it is.
+ _input_keys = _input_keys.difference(self.memory.memory_variables)
+ inputs = {next(iter(_input_keys)): inputs}
+ if self.memory is not None:
+ external_context = self.memory.load_memory_variables(inputs)
+ inputs = dict(inputs, **external_context)
+ return inputs
+
+ async def aprep_inputs(self, inputs: dict[str, Any] | Any) -> dict[str, str]:
+ """Prepare chain inputs, including adding inputs from memory.
+
+ Args:
+ inputs: Dictionary of raw inputs, or single input if chain expects
+ only one param. Should contain all inputs specified in
+ `Chain.input_keys` except for inputs that will be set by the chain's
+ memory.
+
+ Returns:
+ A dictionary of all inputs, including those added by the chain's memory.
+ """
+ if not isinstance(inputs, dict):
+ _input_keys = set(self.input_keys)
+ if self.memory is not None:
+ # If there are multiple input keys, but some get set by memory so that
+ # only one is not set, we can still figure out which key it is.
+ _input_keys = _input_keys.difference(self.memory.memory_variables)
+ inputs = {next(iter(_input_keys)): inputs}
+ if self.memory is not None:
+ external_context = await self.memory.aload_memory_variables(inputs)
+ inputs = dict(inputs, **external_context)
+ return inputs
+
+ @property
+ def _run_output_key(self) -> str:
+ if len(self.output_keys) != 1:
+ msg = (
+ f"`run` not supported when there is not exactly "
+ f"one output key. Got {self.output_keys}."
+ )
+ raise ValueError(msg)
+ return self.output_keys[0]
+
+ @deprecated("0.1.0", alternative="invoke", removal="2.0.0")
+ def run(
+ self,
+ *args: Any,
+ callbacks: Callbacks = None,
+ tags: list[str] | None = None,
+ metadata: dict[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> Any:
+ """Convenience method for executing chain.
+
+ The main difference between this method and `Chain.__call__` is that this
+ method expects inputs to be passed directly in as positional arguments or
+ keyword arguments, whereas `Chain.__call__` expects a single input dictionary
+ with all the inputs
+
+ Args:
+ *args: If the chain expects a single input, it can be passed in as the
+ sole positional argument.
+ callbacks: Callbacks to use for this chain run. These will be called in
+ addition to callbacks passed to the chain during construction, but only
+ these runtime callbacks will propagate to calls to other objects.
+ tags: List of string tags to pass to all callbacks. These will be passed in
+ addition to tags passed to the chain during construction, but only
+ these runtime tags will propagate to calls to other objects.
+ metadata: Optional metadata associated with the chain.
+ **kwargs: If the chain expects multiple inputs, they can be passed in
+ directly as keyword arguments.
+
+ Returns:
+ The chain output.
+
+ Example:
+ ```python
+ # Suppose we have a single-input chain that takes a 'question' string:
+ chain.run("What's the temperature in Boise, Idaho?")
+ # -> "The temperature in Boise is..."
+
+ # Suppose we have a multi-input chain that takes a 'question' string
+ # and 'context' string:
+ question = "What's the temperature in Boise, Idaho?"
+ context = "Weather report for Boise, Idaho on 07/03/23..."
+ chain.run(question=question, context=context)
+ # -> "The temperature in Boise is..."
+ ```
+ """
+ # Run at start to make sure this is possible/defined
+ _output_key = self._run_output_key
+
+ if args and not kwargs:
+ if len(args) != 1:
+ msg = "`run` supports only one positional argument."
+ raise ValueError(msg)
+ return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
+ _output_key
+ ]
+
+ if kwargs and not args:
+ return self(kwargs, callbacks=callbacks, tags=tags, metadata=metadata)[
+ _output_key
+ ]
+
+ if not kwargs and not args:
+ msg = (
+ "`run` supported with either positional arguments or keyword arguments,"
+ " but none were provided."
+ )
+ raise ValueError(msg)
+ msg = (
+ f"`run` supported with either positional arguments or keyword arguments"
+ f" but not both. Got args: {args} and kwargs: {kwargs}."
+ )
+ raise ValueError(msg)
+
+ @deprecated("0.1.0", alternative="ainvoke", removal="2.0.0")
+ async def arun(
+ self,
+ *args: Any,
+ callbacks: Callbacks = None,
+ tags: list[str] | None = None,
+ metadata: dict[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> Any:
+ """Convenience method for executing chain.
+
+ The main difference between this method and `Chain.__call__` is that this
+ method expects inputs to be passed directly in as positional arguments or
+ keyword arguments, whereas `Chain.__call__` expects a single input dictionary
+ with all the inputs
+
+
+ Args:
+ *args: If the chain expects a single input, it can be passed in as the
+ sole positional argument.
+ callbacks: Callbacks to use for this chain run. These will be called in
+ addition to callbacks passed to the chain during construction, but only
+ these runtime callbacks will propagate to calls to other objects.
+ tags: List of string tags to pass to all callbacks. These will be passed in
+ addition to tags passed to the chain during construction, but only
+ these runtime tags will propagate to calls to other objects.
+ metadata: Optional metadata associated with the chain.
+ **kwargs: If the chain expects multiple inputs, they can be passed in
+ directly as keyword arguments.
+
+ Returns:
+ The chain output.
+
+ Example:
+ ```python
+ # Suppose we have a single-input chain that takes a 'question' string:
+ await chain.arun("What's the temperature in Boise, Idaho?")
+ # -> "The temperature in Boise is..."
+
+ # Suppose we have a multi-input chain that takes a 'question' string
+ # and 'context' string:
+ question = "What's the temperature in Boise, Idaho?"
+ context = "Weather report for Boise, Idaho on 07/03/23..."
+ await chain.arun(question=question, context=context)
+ # -> "The temperature in Boise is..."
+ ```
+ """
+ if len(self.output_keys) != 1:
+ msg = (
+ f"`run` not supported when there is not exactly "
+ f"one output key. Got {self.output_keys}."
+ )
+ raise ValueError(msg)
+ if args and not kwargs:
+ if len(args) != 1:
+ msg = "`run` supports only one positional argument."
+ raise ValueError(msg)
+ return (
+ await self.acall(
+ args[0],
+ callbacks=callbacks,
+ tags=tags,
+ metadata=metadata,
+ )
+ )[self.output_keys[0]]
+
+ if kwargs and not args:
+ return (
+ await self.acall(
+ kwargs,
+ callbacks=callbacks,
+ tags=tags,
+ metadata=metadata,
+ )
+ )[self.output_keys[0]]
+
+ msg = (
+ f"`run` supported with either positional arguments or keyword arguments"
+ f" but not both. Got args: {args} and kwargs: {kwargs}."
+ )
+ raise ValueError(msg)
+
+ def dict(self, **kwargs: Any) -> dict:
+ """Dictionary representation of chain.
+
+ Expects `Chain._chain_type` property to be implemented and for memory to be
+ null.
+
+ Args:
+ **kwargs: Keyword arguments passed to default `pydantic.BaseModel.dict`
+ method.
+
+ Returns:
+ A dictionary representation of the chain.
+
+ Example:
+ ```python
+ chain.model_dump(exclude_unset=True)
+ # -> {"_type": "foo", "verbose": False, ...}
+ ```
+ """
+ _dict = super().model_dump(**kwargs)
+ with contextlib.suppress(NotImplementedError):
+ _dict["_type"] = self._chain_type
+ return _dict
+
+ def save(self, file_path: Path | str) -> None:
+ """Save the chain.
+
+ Expects `Chain._chain_type` property to be implemented and for memory to be
+ null.
+
+ Args:
+ file_path: Path to file to save the chain to.
+
+ Example:
+ ```python
+ chain.save(file_path="path/chain.yaml")
+ ```
+ """
+ if self.memory is not None:
+ msg = "Saving of memory is not yet supported."
+ raise ValueError(msg)
+
+ # Fetch dictionary to save
+ chain_dict = self.model_dump()
+ if "_type" not in chain_dict:
+ msg = f"Chain {self} does not support saving."
+ raise NotImplementedError(msg)
+
+ # Convert file to Path object.
+ save_path = Path(file_path) if isinstance(file_path, str) else file_path
+
+ directory_path = save_path.parent
+ directory_path.mkdir(parents=True, exist_ok=True)
+
+ if save_path.suffix == ".json":
+ with save_path.open("w") as f:
+ json.dump(chain_dict, f, indent=4)
+ elif save_path.suffix.endswith((".yaml", ".yml")):
+ with save_path.open("w") as f:
+ yaml.dump(chain_dict, f, default_flow_style=False)
+ else:
+ msg = f"{save_path} must be json or yaml"
+ raise ValueError(msg)
+
+ @deprecated("0.1.0", alternative="batch", removal="2.0.0")
+ def apply(
+ self,
+ input_list: list[builtins.dict[str, Any]],
+ callbacks: Callbacks = None,
+ ) -> list[builtins.dict[str, str]]:
+ """Call the chain on all inputs in the list."""
+ return [self(inputs, callbacks=callbacks) for inputs in input_list]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/example_generator.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/example_generator.py
new file mode 100644
index 0000000000000000000000000000000000000000..463f29a52329d842349cb893a9ff9adc685c4305
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/example_generator.py
@@ -0,0 +1,22 @@
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.output_parsers import StrOutputParser
+from langchain_core.prompts.few_shot import FewShotPromptTemplate
+from langchain_core.prompts.prompt import PromptTemplate
+
+TEST_GEN_TEMPLATE_SUFFIX = "Add another example."
+
+
+def generate_example(
+ examples: list[dict],
+ llm: BaseLanguageModel,
+ prompt_template: PromptTemplate,
+) -> str:
+ """Return another example given a list of examples for a prompt."""
+ prompt = FewShotPromptTemplate(
+ examples=examples,
+ suffix=TEST_GEN_TEMPLATE_SUFFIX,
+ input_variables=[],
+ example_prompt=prompt_template,
+ )
+ chain = prompt | llm | StrOutputParser()
+ return chain.invoke({})
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/history_aware_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/history_aware_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..0926cdeaedfbe95a6a0b5c60242271c231bac8f4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/history_aware_retriever.py
@@ -0,0 +1,68 @@
+from __future__ import annotations
+
+from langchain_core.language_models import LanguageModelLike
+from langchain_core.output_parsers import StrOutputParser
+from langchain_core.prompts import BasePromptTemplate
+from langchain_core.retrievers import RetrieverLike, RetrieverOutputLike
+from langchain_core.runnables import RunnableBranch
+
+
+def create_history_aware_retriever(
+ llm: LanguageModelLike,
+ retriever: RetrieverLike,
+ prompt: BasePromptTemplate,
+) -> RetrieverOutputLike:
+ """Create a chain that takes conversation history and returns documents.
+
+ If there is no `chat_history`, then the `input` is just passed directly to the
+ retriever. If there is `chat_history`, then the prompt and LLM will be used
+ to generate a search query. That search query is then passed to the retriever.
+
+ Args:
+ llm: Language model to use for generating a search term given chat history
+ retriever: `RetrieverLike` object that takes a string as input and outputs
+ a list of `Document` objects.
+ prompt: The prompt used to generate the search query for the retriever.
+
+ Returns:
+ An LCEL Runnable. The runnable input must take in `input`, and if there
+ is chat history should take it in the form of `chat_history`.
+ The `Runnable` output is a list of `Document` objects
+
+ Example:
+ ```python
+ # pip install -U langchain langchain-community
+
+ from langchain_openai import ChatOpenAI
+ from langchain_classic.chains import create_history_aware_retriever
+ from langchain_classic import hub
+
+ rephrase_prompt = hub.pull("langchain-ai/chat-langchain-rephrase")
+ model = ChatOpenAI()
+ retriever = ...
+ chat_retriever_chain = create_history_aware_retriever(
+ model, retriever, rephrase_prompt
+ )
+
+ chain.invoke({"input": "...", "chat_history": })
+
+ ```
+ """
+ if "input" not in prompt.input_variables:
+ msg = (
+ "Expected `input` to be a prompt variable, "
+ f"but got {prompt.input_variables}"
+ )
+ raise ValueError(msg)
+
+ retrieve_documents: RetrieverOutputLike = RunnableBranch(
+ (
+ # Both empty string and empty list evaluate to False
+ lambda x: not x.get("chat_history", False),
+ # If no chat history, then we just pass input to retriever
+ (lambda x: x["input"]) | retriever,
+ ),
+ # If chat history, then we pass inputs to LLM chain, then to retriever
+ prompt | llm | StrOutputParser() | retriever,
+ ).with_config(run_name="chat_retriever_chain")
+ return retrieve_documents
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/llm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/llm.py
new file mode 100644
index 0000000000000000000000000000000000000000..cb5e45dcebf9a6d7ec441e85499e4653e1898f11
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/llm.py
@@ -0,0 +1,432 @@
+"""Chain that just formats a prompt and calls an LLM."""
+
+from __future__ import annotations
+
+import warnings
+from collections.abc import Sequence
+from typing import Any, cast
+
+from langchain_core._api import deprecated
+from langchain_core.callbacks import (
+ AsyncCallbackManager,
+ AsyncCallbackManagerForChainRun,
+ CallbackManager,
+ CallbackManagerForChainRun,
+ Callbacks,
+)
+from langchain_core.language_models import (
+ BaseLanguageModel,
+ LanguageModelInput,
+)
+from langchain_core.messages import BaseMessage
+from langchain_core.output_parsers import BaseLLMOutputParser, StrOutputParser
+from langchain_core.outputs import ChatGeneration, Generation, LLMResult
+from langchain_core.prompt_values import PromptValue
+from langchain_core.prompts import BasePromptTemplate, PromptTemplate
+from langchain_core.runnables import (
+ Runnable,
+ RunnableBinding,
+ RunnableBranch,
+ RunnableWithFallbacks,
+)
+from langchain_core.runnables.configurable import DynamicRunnable
+from langchain_core.utils.input import get_colored_text
+from pydantic import ConfigDict, Field
+from typing_extensions import override
+
+from langchain_classic.chains.base import Chain
+
+
+@deprecated(
+ since="0.1.17",
+ alternative="RunnableSequence, e.g., `prompt | llm`",
+ removal="2.0.0",
+)
+class LLMChain(Chain):
+ """Chain to run queries against LLMs.
+
+ This class is deprecated. See below for an example implementation using
+ LangChain runnables:
+
+ ```python
+ from langchain_core.output_parsers import StrOutputParser
+ from langchain_core.prompts import PromptTemplate
+ from langchain_openai import OpenAI
+
+ prompt_template = "Tell me a {adjective} joke"
+ prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)
+ model = OpenAI()
+ chain = prompt | model | StrOutputParser()
+
+ chain.invoke("your adjective here")
+ ```
+
+ Example:
+ ```python
+ from langchain_classic.chains import LLMChain
+ from langchain_openai import OpenAI
+ from langchain_core.prompts import PromptTemplate
+
+ prompt_template = "Tell me a {adjective} joke"
+ prompt = PromptTemplate(input_variables=["adjective"], template=prompt_template)
+ model = LLMChain(llm=OpenAI(), prompt=prompt)
+ ```
+ """
+
+ @classmethod
+ @override
+ def is_lc_serializable(cls) -> bool:
+ return True
+
+ prompt: BasePromptTemplate
+ """Prompt object to use."""
+ llm: Runnable[LanguageModelInput, str] | Runnable[LanguageModelInput, BaseMessage]
+ """Language model to call."""
+ output_key: str = "text"
+ output_parser: BaseLLMOutputParser = Field(default_factory=StrOutputParser)
+ """Output parser to use.
+ Defaults to one that takes the most likely string but does not change it
+ otherwise."""
+ return_final_only: bool = True
+ """Whether to return only the final parsed result.
+ If `False`, will return a bunch of extra information about the generation."""
+ llm_kwargs: dict = Field(default_factory=dict)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Will be whatever keys the prompt expects."""
+ return self.prompt.input_variables
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Will always return text key."""
+ if self.return_final_only:
+ return [self.output_key]
+ return [self.output_key, "full_generation"]
+
+ def _call(
+ self,
+ inputs: dict[str, Any],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ response = self.generate([inputs], run_manager=run_manager)
+ return self.create_outputs(response)[0]
+
+ def generate(
+ self,
+ input_list: list[dict[str, Any]],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> LLMResult:
+ """Generate LLM result from inputs."""
+ prompts, stop = self.prep_prompts(input_list, run_manager=run_manager)
+ callbacks = run_manager.get_child() if run_manager else None
+ if isinstance(self.llm, BaseLanguageModel):
+ return self.llm.generate_prompt(
+ prompts,
+ stop,
+ callbacks=callbacks,
+ **self.llm_kwargs,
+ )
+ results = self.llm.bind(stop=stop, **self.llm_kwargs).batch(
+ cast("list", prompts),
+ {"callbacks": callbacks},
+ )
+ generations: list[list[Generation]] = []
+ for res in results:
+ if isinstance(res, BaseMessage):
+ generations.append([ChatGeneration(message=res)])
+ else:
+ generations.append([Generation(text=res)])
+ return LLMResult(generations=generations)
+
+ async def agenerate(
+ self,
+ input_list: list[dict[str, Any]],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> LLMResult:
+ """Generate LLM result from inputs."""
+ prompts, stop = await self.aprep_prompts(input_list, run_manager=run_manager)
+ callbacks = run_manager.get_child() if run_manager else None
+ if isinstance(self.llm, BaseLanguageModel):
+ return await self.llm.agenerate_prompt(
+ prompts,
+ stop,
+ callbacks=callbacks,
+ **self.llm_kwargs,
+ )
+ results = await self.llm.bind(stop=stop, **self.llm_kwargs).abatch(
+ cast("list", prompts),
+ {"callbacks": callbacks},
+ )
+ generations: list[list[Generation]] = []
+ for res in results:
+ if isinstance(res, BaseMessage):
+ generations.append([ChatGeneration(message=res)])
+ else:
+ generations.append([Generation(text=res)])
+ return LLMResult(generations=generations)
+
+ def prep_prompts(
+ self,
+ input_list: list[dict[str, Any]],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> tuple[list[PromptValue], list[str] | None]:
+ """Prepare prompts from inputs."""
+ stop = None
+ if len(input_list) == 0:
+ return [], stop
+ if "stop" in input_list[0]:
+ stop = input_list[0]["stop"]
+ prompts = []
+ for inputs in input_list:
+ selected_inputs = {k: inputs[k] for k in self.prompt.input_variables}
+ prompt = self.prompt.format_prompt(**selected_inputs)
+ _colored_text = get_colored_text(prompt.to_string(), "green")
+ _text = "Prompt after formatting:\n" + _colored_text
+ if run_manager:
+ run_manager.on_text(_text, end="\n", verbose=self.verbose)
+ if "stop" in inputs and inputs["stop"] != stop:
+ msg = "If `stop` is present in any inputs, should be present in all."
+ raise ValueError(msg)
+ prompts.append(prompt)
+ return prompts, stop
+
+ async def aprep_prompts(
+ self,
+ input_list: list[dict[str, Any]],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> tuple[list[PromptValue], list[str] | None]:
+ """Prepare prompts from inputs."""
+ stop = None
+ if len(input_list) == 0:
+ return [], stop
+ if "stop" in input_list[0]:
+ stop = input_list[0]["stop"]
+ prompts = []
+ for inputs in input_list:
+ selected_inputs = {k: inputs[k] for k in self.prompt.input_variables}
+ prompt = self.prompt.format_prompt(**selected_inputs)
+ _colored_text = get_colored_text(prompt.to_string(), "green")
+ _text = "Prompt after formatting:\n" + _colored_text
+ if run_manager:
+ await run_manager.on_text(_text, end="\n", verbose=self.verbose)
+ if "stop" in inputs and inputs["stop"] != stop:
+ msg = "If `stop` is present in any inputs, should be present in all."
+ raise ValueError(msg)
+ prompts.append(prompt)
+ return prompts, stop
+
+ def apply(
+ self,
+ input_list: list[dict[str, Any]],
+ callbacks: Callbacks = None,
+ ) -> list[dict[str, str]]:
+ """Utilize the LLM generate method for speed gains."""
+ callback_manager = CallbackManager.configure(
+ callbacks,
+ self.callbacks,
+ self.verbose,
+ )
+ run_manager = callback_manager.on_chain_start(
+ None,
+ {"input_list": input_list},
+ name=self.get_name(),
+ )
+ try:
+ response = self.generate(input_list, run_manager=run_manager)
+ except BaseException as e:
+ run_manager.on_chain_error(e)
+ raise
+ outputs = self.create_outputs(response)
+ run_manager.on_chain_end({"outputs": outputs})
+ return outputs
+
+ async def aapply(
+ self,
+ input_list: list[dict[str, Any]],
+ callbacks: Callbacks = None,
+ ) -> list[dict[str, str]]:
+ """Utilize the LLM generate method for speed gains."""
+ callback_manager = AsyncCallbackManager.configure(
+ callbacks,
+ self.callbacks,
+ self.verbose,
+ )
+ run_manager = await callback_manager.on_chain_start(
+ None,
+ {"input_list": input_list},
+ name=self.get_name(),
+ )
+ try:
+ response = await self.agenerate(input_list, run_manager=run_manager)
+ except BaseException as e:
+ await run_manager.on_chain_error(e)
+ raise
+ outputs = self.create_outputs(response)
+ await run_manager.on_chain_end({"outputs": outputs})
+ return outputs
+
+ @property
+ def _run_output_key(self) -> str:
+ return self.output_key
+
+ def create_outputs(self, llm_result: LLMResult) -> list[dict[str, Any]]:
+ """Create outputs from response."""
+ result = [
+ # Get the text of the top generated string.
+ {
+ self.output_key: self.output_parser.parse_result(generation),
+ "full_generation": generation,
+ }
+ for generation in llm_result.generations
+ ]
+ if self.return_final_only:
+ result = [{self.output_key: r[self.output_key]} for r in result]
+ return result
+
+ async def _acall(
+ self,
+ inputs: dict[str, Any],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ response = await self.agenerate([inputs], run_manager=run_manager)
+ return self.create_outputs(response)[0]
+
+ def predict(self, callbacks: Callbacks = None, **kwargs: Any) -> str:
+ """Format prompt with kwargs and pass to LLM.
+
+ Args:
+ callbacks: Callbacks to pass to LLMChain
+ **kwargs: Keys to pass to prompt template.
+
+ Returns:
+ Completion from LLM.
+
+ Example:
+ ```python
+ completion = llm.predict(adjective="funny")
+ ```
+ """
+ return self(kwargs, callbacks=callbacks)[self.output_key]
+
+ async def apredict(self, callbacks: Callbacks = None, **kwargs: Any) -> str:
+ """Format prompt with kwargs and pass to LLM.
+
+ Args:
+ callbacks: Callbacks to pass to LLMChain
+ **kwargs: Keys to pass to prompt template.
+
+ Returns:
+ Completion from LLM.
+
+ Example:
+ ```python
+ completion = llm.predict(adjective="funny")
+ ```
+ """
+ return (await self.acall(kwargs, callbacks=callbacks))[self.output_key]
+
+ def predict_and_parse(
+ self,
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> str | list[str] | dict[str, Any]:
+ """Call predict and then parse the results."""
+ warnings.warn(
+ "The predict_and_parse method is deprecated, "
+ "instead pass an output parser directly to LLMChain.",
+ stacklevel=2,
+ )
+ result = self.predict(callbacks=callbacks, **kwargs)
+ if self.prompt.output_parser is not None:
+ return self.prompt.output_parser.parse(result)
+ return result
+
+ async def apredict_and_parse(
+ self,
+ callbacks: Callbacks = None,
+ **kwargs: Any,
+ ) -> str | list[str] | dict[str, str]:
+ """Call apredict and then parse the results."""
+ warnings.warn(
+ "The apredict_and_parse method is deprecated, "
+ "instead pass an output parser directly to LLMChain.",
+ stacklevel=2,
+ )
+ result = await self.apredict(callbacks=callbacks, **kwargs)
+ if self.prompt.output_parser is not None:
+ return self.prompt.output_parser.parse(result)
+ return result
+
+ def apply_and_parse(
+ self,
+ input_list: list[dict[str, Any]],
+ callbacks: Callbacks = None,
+ ) -> Sequence[str | list[str] | dict[str, str]]:
+ """Call apply and then parse the results."""
+ warnings.warn(
+ "The apply_and_parse method is deprecated, "
+ "instead pass an output parser directly to LLMChain.",
+ stacklevel=2,
+ )
+ result = self.apply(input_list, callbacks=callbacks)
+ return self._parse_generation(result)
+
+ def _parse_generation(
+ self,
+ generation: list[dict[str, str]],
+ ) -> Sequence[str | list[str] | dict[str, str]]:
+ if self.prompt.output_parser is not None:
+ return [
+ self.prompt.output_parser.parse(res[self.output_key])
+ for res in generation
+ ]
+ return generation
+
+ async def aapply_and_parse(
+ self,
+ input_list: list[dict[str, Any]],
+ callbacks: Callbacks = None,
+ ) -> Sequence[str | list[str] | dict[str, str]]:
+ """Call apply and then parse the results."""
+ warnings.warn(
+ "The aapply_and_parse method is deprecated, "
+ "instead pass an output parser directly to LLMChain.",
+ stacklevel=2,
+ )
+ result = await self.aapply(input_list, callbacks=callbacks)
+ return self._parse_generation(result)
+
+ @property
+ def _chain_type(self) -> str:
+ return "llm_chain"
+
+ @classmethod
+ def from_string(cls, llm: BaseLanguageModel, template: str) -> LLMChain:
+ """Create LLMChain from LLM and template."""
+ prompt_template = PromptTemplate.from_template(template)
+ return cls(llm=llm, prompt=prompt_template)
+
+ def _get_num_tokens(self, text: str) -> int:
+ return _get_language_model(self.llm).get_num_tokens(text)
+
+
+def _get_language_model(llm_like: Runnable) -> BaseLanguageModel:
+ if isinstance(llm_like, BaseLanguageModel):
+ return llm_like
+ if isinstance(llm_like, RunnableBinding):
+ return _get_language_model(llm_like.bound)
+ if isinstance(llm_like, RunnableWithFallbacks):
+ return _get_language_model(llm_like.runnable)
+ if isinstance(llm_like, (RunnableBranch, DynamicRunnable)):
+ return _get_language_model(llm_like.default)
+ msg = (
+ f"Unable to extract BaseLanguageModel from llm_like object of type "
+ f"{type(llm_like)}"
+ )
+ raise ValueError(msg)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/llm_requests.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/llm_requests.py
new file mode 100644
index 0000000000000000000000000000000000000000..bcd166284e1cf85f155a259fe74d80aa47cfc7c7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/llm_requests.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chains.llm_requests import LLMRequestsChain
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LLMRequestsChain": "langchain_community.chains.llm_requests",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = ["LLMRequestsChain"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/loading.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/loading.py
new file mode 100644
index 0000000000000000000000000000000000000000..112e67af6bf28b9b28b9b76a99c01fe9723b6a0d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/loading.py
@@ -0,0 +1,736 @@
+"""Functionality for loading chains."""
+
+from __future__ import annotations
+
+import json
+from pathlib import Path
+from typing import TYPE_CHECKING, Any
+
+import yaml
+from langchain_core._api import deprecated
+from langchain_core.prompts.loading import (
+ _load_output_parser,
+ load_prompt,
+ load_prompt_from_config,
+)
+
+from langchain_classic.chains import ReduceDocumentsChain
+from langchain_classic.chains.api.base import APIChain
+from langchain_classic.chains.base import Chain
+from langchain_classic.chains.combine_documents.map_reduce import (
+ MapReduceDocumentsChain,
+)
+from langchain_classic.chains.combine_documents.map_rerank import (
+ MapRerankDocumentsChain,
+)
+from langchain_classic.chains.combine_documents.refine import RefineDocumentsChain
+from langchain_classic.chains.combine_documents.stuff import StuffDocumentsChain
+from langchain_classic.chains.hyde.base import HypotheticalDocumentEmbedder
+from langchain_classic.chains.llm import LLMChain
+from langchain_classic.chains.llm_checker.base import LLMCheckerChain
+from langchain_classic.chains.llm_math.base import LLMMathChain
+from langchain_classic.chains.qa_with_sources.base import QAWithSourcesChain
+from langchain_classic.chains.qa_with_sources.retrieval import (
+ RetrievalQAWithSourcesChain,
+)
+from langchain_classic.chains.qa_with_sources.vector_db import (
+ VectorDBQAWithSourcesChain,
+)
+from langchain_classic.chains.retrieval_qa.base import RetrievalQA, VectorDBQA
+
+if TYPE_CHECKING:
+ from langchain_community.chains.graph_qa.cypher import GraphCypherQAChain
+
+ from langchain_classic.chains.llm_requests import LLMRequestsChain
+
+try:
+ from langchain_community.llms.loading import load_llm, load_llm_from_config
+except ImportError:
+
+ def load_llm(*_: Any, **__: Any) -> None:
+ """Import error for load_llm."""
+ msg = (
+ "To use this load_llm functionality you must install the "
+ "langchain_community package. "
+ "You can install it with `pip install langchain_community`"
+ )
+ raise ImportError(msg)
+
+ def load_llm_from_config(*_: Any, **__: Any) -> None:
+ """Import error for load_llm_from_config."""
+ msg = (
+ "To use this load_llm_from_config functionality you must install the "
+ "langchain_community package. "
+ "You can install it with `pip install langchain_community`"
+ )
+ raise ImportError(msg)
+
+
+URL_BASE = "https://raw.githubusercontent.com/hwchase17/langchain-hub/master/chains/"
+
+
+def _load_llm_chain(config: dict, **kwargs: Any) -> LLMChain:
+ """Load LLM chain from config dict."""
+ if "llm" in config:
+ llm_config = config.pop("llm")
+ llm = load_llm_from_config(llm_config, **kwargs)
+ elif "llm_path" in config:
+ llm = load_llm(config.pop("llm_path"), **kwargs)
+ else:
+ msg = "One of `llm` or `llm_path` must be present."
+ raise ValueError(msg)
+
+ if "prompt" in config:
+ prompt_config = config.pop("prompt")
+ prompt = load_prompt_from_config(prompt_config)
+ elif "prompt_path" in config:
+ prompt = load_prompt(config.pop("prompt_path"))
+ else:
+ msg = "One of `prompt` or `prompt_path` must be present."
+ raise ValueError(msg)
+ _load_output_parser(config)
+
+ return LLMChain(llm=llm, prompt=prompt, **config)
+
+
+def _load_hyde_chain(config: dict, **kwargs: Any) -> HypotheticalDocumentEmbedder:
+ """Load hypothetical document embedder chain from config dict."""
+ if "llm_chain" in config:
+ llm_chain_config = config.pop("llm_chain")
+ llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
+ elif "llm_chain_path" in config:
+ llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `llm_chain` or `llm_chain_path` must be present."
+ raise ValueError(msg)
+ if "embeddings" in kwargs:
+ embeddings = kwargs.pop("embeddings")
+ else:
+ msg = "`embeddings` must be present."
+ raise ValueError(msg)
+ return HypotheticalDocumentEmbedder(
+ llm_chain=llm_chain,
+ base_embeddings=embeddings,
+ **config,
+ )
+
+
+def _load_stuff_documents_chain(config: dict, **kwargs: Any) -> StuffDocumentsChain:
+ if "llm_chain" in config:
+ llm_chain_config = config.pop("llm_chain")
+ llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
+ elif "llm_chain_path" in config:
+ llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `llm_chain` or `llm_chain_path` must be present."
+ raise ValueError(msg)
+
+ if not isinstance(llm_chain, LLMChain):
+ msg = f"Expected LLMChain, got {llm_chain}"
+ raise ValueError(msg) # noqa: TRY004
+
+ if "document_prompt" in config:
+ prompt_config = config.pop("document_prompt")
+ document_prompt = load_prompt_from_config(prompt_config)
+ elif "document_prompt_path" in config:
+ document_prompt = load_prompt(config.pop("document_prompt_path"))
+ else:
+ msg = "One of `document_prompt` or `document_prompt_path` must be present."
+ raise ValueError(msg)
+
+ return StuffDocumentsChain(
+ llm_chain=llm_chain,
+ document_prompt=document_prompt,
+ **config,
+ )
+
+
+def _load_map_reduce_documents_chain(
+ config: dict,
+ **kwargs: Any,
+) -> MapReduceDocumentsChain:
+ if "llm_chain" in config:
+ llm_chain_config = config.pop("llm_chain")
+ llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
+ elif "llm_chain_path" in config:
+ llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `llm_chain` or `llm_chain_path` must be present."
+ raise ValueError(msg)
+
+ if not isinstance(llm_chain, LLMChain):
+ msg = f"Expected LLMChain, got {llm_chain}"
+ raise ValueError(msg) # noqa: TRY004
+
+ if "reduce_documents_chain" in config:
+ reduce_documents_chain = load_chain_from_config(
+ config.pop("reduce_documents_chain"),
+ **kwargs,
+ )
+ elif "reduce_documents_chain_path" in config:
+ reduce_documents_chain = load_chain(
+ config.pop("reduce_documents_chain_path"),
+ **kwargs,
+ )
+ else:
+ reduce_documents_chain = _load_reduce_documents_chain(config, **kwargs)
+
+ return MapReduceDocumentsChain(
+ llm_chain=llm_chain,
+ reduce_documents_chain=reduce_documents_chain,
+ **config,
+ )
+
+
+def _load_reduce_documents_chain(config: dict, **kwargs: Any) -> ReduceDocumentsChain:
+ combine_documents_chain = None
+ collapse_documents_chain = None
+
+ if "combine_documents_chain" in config:
+ combine_document_chain_config = config.pop("combine_documents_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_document_chain_config,
+ **kwargs,
+ )
+ elif "combine_document_chain" in config:
+ combine_document_chain_config = config.pop("combine_document_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_document_chain_config,
+ **kwargs,
+ )
+ elif "combine_documents_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_documents_chain_path"),
+ **kwargs,
+ )
+ elif "combine_document_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_document_chain_path"),
+ **kwargs,
+ )
+ else:
+ msg = (
+ "One of `combine_documents_chain` or "
+ "`combine_documents_chain_path` must be present."
+ )
+ raise ValueError(msg)
+
+ if "collapse_documents_chain" in config:
+ collapse_document_chain_config = config.pop("collapse_documents_chain")
+ if collapse_document_chain_config is None:
+ collapse_documents_chain = None
+ else:
+ collapse_documents_chain = load_chain_from_config(
+ collapse_document_chain_config,
+ **kwargs,
+ )
+ elif "collapse_documents_chain_path" in config:
+ collapse_documents_chain = load_chain(
+ config.pop("collapse_documents_chain_path"),
+ **kwargs,
+ )
+ elif "collapse_document_chain" in config:
+ collapse_document_chain_config = config.pop("collapse_document_chain")
+ if collapse_document_chain_config is None:
+ collapse_documents_chain = None
+ else:
+ collapse_documents_chain = load_chain_from_config(
+ collapse_document_chain_config,
+ **kwargs,
+ )
+ elif "collapse_document_chain_path" in config:
+ collapse_documents_chain = load_chain(
+ config.pop("collapse_document_chain_path"),
+ **kwargs,
+ )
+
+ return ReduceDocumentsChain(
+ combine_documents_chain=combine_documents_chain,
+ collapse_documents_chain=collapse_documents_chain,
+ **config,
+ )
+
+
+def _load_llm_bash_chain(config: dict, **kwargs: Any) -> Any:
+ """Load LLM Bash chain from config dict."""
+ msg = (
+ "LLMBash Chain is not available through LangChain anymore. "
+ "The relevant code can be found in langchain_experimental, "
+ "but it is not appropriate for production usage due to security "
+ "concerns. Please refer to langchain-experimental repository for more details."
+ )
+ raise NotImplementedError(msg)
+
+
+def _load_llm_checker_chain(config: dict, **kwargs: Any) -> LLMCheckerChain:
+ if "llm" in config:
+ llm_config = config.pop("llm")
+ llm = load_llm_from_config(llm_config, **kwargs)
+ elif "llm_path" in config:
+ llm = load_llm(config.pop("llm_path"), **kwargs)
+ else:
+ msg = "One of `llm` or `llm_path` must be present."
+ raise ValueError(msg)
+ if "create_draft_answer_prompt" in config:
+ create_draft_answer_prompt_config = config.pop("create_draft_answer_prompt")
+ create_draft_answer_prompt = load_prompt_from_config(
+ create_draft_answer_prompt_config,
+ )
+ elif "create_draft_answer_prompt_path" in config:
+ create_draft_answer_prompt = load_prompt(
+ config.pop("create_draft_answer_prompt_path"),
+ )
+ if "list_assertions_prompt" in config:
+ list_assertions_prompt_config = config.pop("list_assertions_prompt")
+ list_assertions_prompt = load_prompt_from_config(list_assertions_prompt_config)
+ elif "list_assertions_prompt_path" in config:
+ list_assertions_prompt = load_prompt(config.pop("list_assertions_prompt_path"))
+ if "check_assertions_prompt" in config:
+ check_assertions_prompt_config = config.pop("check_assertions_prompt")
+ check_assertions_prompt = load_prompt_from_config(
+ check_assertions_prompt_config,
+ )
+ elif "check_assertions_prompt_path" in config:
+ check_assertions_prompt = load_prompt(
+ config.pop("check_assertions_prompt_path"),
+ )
+ if "revised_answer_prompt" in config:
+ revised_answer_prompt_config = config.pop("revised_answer_prompt")
+ revised_answer_prompt = load_prompt_from_config(revised_answer_prompt_config)
+ elif "revised_answer_prompt_path" in config:
+ revised_answer_prompt = load_prompt(config.pop("revised_answer_prompt_path"))
+ return LLMCheckerChain(
+ llm=llm,
+ create_draft_answer_prompt=create_draft_answer_prompt,
+ list_assertions_prompt=list_assertions_prompt,
+ check_assertions_prompt=check_assertions_prompt,
+ revised_answer_prompt=revised_answer_prompt,
+ **config,
+ )
+
+
+def _load_llm_math_chain(config: dict, **kwargs: Any) -> LLMMathChain:
+ llm_chain = None
+ if "llm_chain" in config:
+ llm_chain_config = config.pop("llm_chain")
+ llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
+ elif "llm_chain_path" in config:
+ llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
+ # llm attribute is deprecated in favor of llm_chain, here to support old configs
+ elif "llm" in config:
+ llm_config = config.pop("llm")
+ llm = load_llm_from_config(llm_config, **kwargs)
+ # llm_path attribute is deprecated in favor of llm_chain_path,
+ # its to support old configs
+ elif "llm_path" in config:
+ llm = load_llm(config.pop("llm_path"), **kwargs)
+ else:
+ msg = "One of `llm_chain` or `llm_chain_path` must be present."
+ raise ValueError(msg)
+ if "prompt" in config:
+ prompt_config = config.pop("prompt")
+ prompt = load_prompt_from_config(prompt_config)
+ elif "prompt_path" in config:
+ prompt = load_prompt(config.pop("prompt_path"))
+ if llm_chain:
+ return LLMMathChain(llm_chain=llm_chain, prompt=prompt, **config)
+ return LLMMathChain(llm=llm, prompt=prompt, **config)
+
+
+def _load_map_rerank_documents_chain(
+ config: dict,
+ **kwargs: Any,
+) -> MapRerankDocumentsChain:
+ if "llm_chain" in config:
+ llm_chain_config = config.pop("llm_chain")
+ llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
+ elif "llm_chain_path" in config:
+ llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `llm_chain` or `llm_chain_path` must be present."
+ raise ValueError(msg)
+ return MapRerankDocumentsChain(llm_chain=llm_chain, **config)
+
+
+def _load_pal_chain(config: dict, **kwargs: Any) -> Any:
+ msg = (
+ "PALChain is not available through LangChain anymore. "
+ "The relevant code can be found in langchain_experimental, "
+ "but it is not appropriate for production usage due to security "
+ "concerns. Please refer to langchain-experimental repository for more details."
+ )
+ raise NotImplementedError(msg)
+
+
+def _load_refine_documents_chain(config: dict, **kwargs: Any) -> RefineDocumentsChain:
+ if "initial_llm_chain" in config:
+ initial_llm_chain_config = config.pop("initial_llm_chain")
+ initial_llm_chain = load_chain_from_config(initial_llm_chain_config, **kwargs)
+ elif "initial_llm_chain_path" in config:
+ initial_llm_chain = load_chain(config.pop("initial_llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `initial_llm_chain` or `initial_llm_chain_path` must be present."
+ raise ValueError(msg)
+ if "refine_llm_chain" in config:
+ refine_llm_chain_config = config.pop("refine_llm_chain")
+ refine_llm_chain = load_chain_from_config(refine_llm_chain_config, **kwargs)
+ elif "refine_llm_chain_path" in config:
+ refine_llm_chain = load_chain(config.pop("refine_llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `refine_llm_chain` or `refine_llm_chain_path` must be present."
+ raise ValueError(msg)
+ if "document_prompt" in config:
+ prompt_config = config.pop("document_prompt")
+ document_prompt = load_prompt_from_config(prompt_config)
+ elif "document_prompt_path" in config:
+ document_prompt = load_prompt(config.pop("document_prompt_path"))
+ return RefineDocumentsChain(
+ initial_llm_chain=initial_llm_chain,
+ refine_llm_chain=refine_llm_chain,
+ document_prompt=document_prompt,
+ **config,
+ )
+
+
+def _load_qa_with_sources_chain(config: dict, **kwargs: Any) -> QAWithSourcesChain:
+ if "combine_documents_chain" in config:
+ combine_documents_chain_config = config.pop("combine_documents_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_documents_chain_config,
+ **kwargs,
+ )
+ elif "combine_documents_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_documents_chain_path"),
+ **kwargs,
+ )
+ else:
+ msg = (
+ "One of `combine_documents_chain` or "
+ "`combine_documents_chain_path` must be present."
+ )
+ raise ValueError(msg)
+ return QAWithSourcesChain(combine_documents_chain=combine_documents_chain, **config)
+
+
+def _load_sql_database_chain(config: dict, **kwargs: Any) -> Any:
+ """Load SQL Database chain from config dict."""
+ msg = (
+ "SQLDatabaseChain is not available through LangChain anymore. "
+ "The relevant code can be found in langchain_experimental, "
+ "but it is not appropriate for production usage due to security "
+ "concerns. Please refer to langchain-experimental repository for more details, "
+ "or refer to this tutorial for best practices: "
+ "https://python.langchain.com/docs/tutorials/sql_qa/"
+ )
+ raise NotImplementedError(msg)
+
+
+def _load_vector_db_qa_with_sources_chain(
+ config: dict,
+ **kwargs: Any,
+) -> VectorDBQAWithSourcesChain:
+ if "vectorstore" in kwargs:
+ vectorstore = kwargs.pop("vectorstore")
+ else:
+ msg = "`vectorstore` must be present."
+ raise ValueError(msg)
+ if "combine_documents_chain" in config:
+ combine_documents_chain_config = config.pop("combine_documents_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_documents_chain_config,
+ **kwargs,
+ )
+ elif "combine_documents_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_documents_chain_path"),
+ **kwargs,
+ )
+ else:
+ msg = (
+ "One of `combine_documents_chain` or "
+ "`combine_documents_chain_path` must be present."
+ )
+ raise ValueError(msg)
+ return VectorDBQAWithSourcesChain(
+ combine_documents_chain=combine_documents_chain,
+ vectorstore=vectorstore,
+ **config,
+ )
+
+
+def _load_retrieval_qa(config: dict, **kwargs: Any) -> RetrievalQA:
+ if "retriever" in kwargs:
+ retriever = kwargs.pop("retriever")
+ else:
+ msg = "`retriever` must be present."
+ raise ValueError(msg)
+ if "combine_documents_chain" in config:
+ combine_documents_chain_config = config.pop("combine_documents_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_documents_chain_config,
+ **kwargs,
+ )
+ elif "combine_documents_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_documents_chain_path"),
+ **kwargs,
+ )
+ else:
+ msg = (
+ "One of `combine_documents_chain` or "
+ "`combine_documents_chain_path` must be present."
+ )
+ raise ValueError(msg)
+ return RetrievalQA(
+ combine_documents_chain=combine_documents_chain,
+ retriever=retriever,
+ **config,
+ )
+
+
+def _load_retrieval_qa_with_sources_chain(
+ config: dict,
+ **kwargs: Any,
+) -> RetrievalQAWithSourcesChain:
+ if "retriever" in kwargs:
+ retriever = kwargs.pop("retriever")
+ else:
+ msg = "`retriever` must be present."
+ raise ValueError(msg)
+ if "combine_documents_chain" in config:
+ combine_documents_chain_config = config.pop("combine_documents_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_documents_chain_config,
+ **kwargs,
+ )
+ elif "combine_documents_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_documents_chain_path"),
+ **kwargs,
+ )
+ else:
+ msg = (
+ "One of `combine_documents_chain` or "
+ "`combine_documents_chain_path` must be present."
+ )
+ raise ValueError(msg)
+ return RetrievalQAWithSourcesChain(
+ combine_documents_chain=combine_documents_chain,
+ retriever=retriever,
+ **config,
+ )
+
+
+def _load_vector_db_qa(config: dict, **kwargs: Any) -> VectorDBQA:
+ if "vectorstore" in kwargs:
+ vectorstore = kwargs.pop("vectorstore")
+ else:
+ msg = "`vectorstore` must be present."
+ raise ValueError(msg)
+ if "combine_documents_chain" in config:
+ combine_documents_chain_config = config.pop("combine_documents_chain")
+ combine_documents_chain = load_chain_from_config(
+ combine_documents_chain_config,
+ **kwargs,
+ )
+ elif "combine_documents_chain_path" in config:
+ combine_documents_chain = load_chain(
+ config.pop("combine_documents_chain_path"),
+ **kwargs,
+ )
+ else:
+ msg = (
+ "One of `combine_documents_chain` or "
+ "`combine_documents_chain_path` must be present."
+ )
+ raise ValueError(msg)
+ return VectorDBQA(
+ combine_documents_chain=combine_documents_chain,
+ vectorstore=vectorstore,
+ **config,
+ )
+
+
+def _load_graph_cypher_chain(config: dict, **kwargs: Any) -> GraphCypherQAChain:
+ if "graph" in kwargs:
+ graph = kwargs.pop("graph")
+ else:
+ msg = "`graph` must be present."
+ raise ValueError(msg)
+ if "cypher_generation_chain" in config:
+ cypher_generation_chain_config = config.pop("cypher_generation_chain")
+ cypher_generation_chain = load_chain_from_config(
+ cypher_generation_chain_config,
+ **kwargs,
+ )
+ else:
+ msg = "`cypher_generation_chain` must be present."
+ raise ValueError(msg)
+ if "qa_chain" in config:
+ qa_chain_config = config.pop("qa_chain")
+ qa_chain = load_chain_from_config(qa_chain_config, **kwargs)
+ else:
+ msg = "`qa_chain` must be present."
+ raise ValueError(msg)
+
+ try:
+ from langchain_community.chains.graph_qa.cypher import GraphCypherQAChain
+ except ImportError as e:
+ msg = (
+ "To use this GraphCypherQAChain functionality you must install the "
+ "langchain_community package. "
+ "You can install it with `pip install langchain_community`"
+ )
+ raise ImportError(msg) from e
+ return GraphCypherQAChain(
+ graph=graph,
+ cypher_generation_chain=cypher_generation_chain,
+ qa_chain=qa_chain,
+ **config,
+ )
+
+
+def _load_api_chain(config: dict, **kwargs: Any) -> APIChain:
+ if "api_request_chain" in config:
+ api_request_chain_config = config.pop("api_request_chain")
+ api_request_chain = load_chain_from_config(api_request_chain_config, **kwargs)
+ elif "api_request_chain_path" in config:
+ api_request_chain = load_chain(config.pop("api_request_chain_path"))
+ else:
+ msg = "One of `api_request_chain` or `api_request_chain_path` must be present."
+ raise ValueError(msg)
+ if "api_answer_chain" in config:
+ api_answer_chain_config = config.pop("api_answer_chain")
+ api_answer_chain = load_chain_from_config(api_answer_chain_config, **kwargs)
+ elif "api_answer_chain_path" in config:
+ api_answer_chain = load_chain(config.pop("api_answer_chain_path"), **kwargs)
+ else:
+ msg = "One of `api_answer_chain` or `api_answer_chain_path` must be present."
+ raise ValueError(msg)
+ if "requests_wrapper" in kwargs:
+ requests_wrapper = kwargs.pop("requests_wrapper")
+ else:
+ msg = "`requests_wrapper` must be present."
+ raise ValueError(msg)
+ return APIChain(
+ api_request_chain=api_request_chain,
+ api_answer_chain=api_answer_chain,
+ requests_wrapper=requests_wrapper,
+ **config,
+ )
+
+
+def _load_llm_requests_chain(config: dict, **kwargs: Any) -> LLMRequestsChain:
+ try:
+ from langchain_classic.chains.llm_requests import LLMRequestsChain
+ except ImportError as e:
+ msg = (
+ "To use this LLMRequestsChain functionality you must install the "
+ "langchain package. "
+ "You can install it with `pip install langchain`"
+ )
+ raise ImportError(msg) from e
+
+ if "llm_chain" in config:
+ llm_chain_config = config.pop("llm_chain")
+ llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
+ elif "llm_chain_path" in config:
+ llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
+ else:
+ msg = "One of `llm_chain` or `llm_chain_path` must be present."
+ raise ValueError(msg)
+ if "requests_wrapper" in kwargs:
+ requests_wrapper = kwargs.pop("requests_wrapper")
+ return LLMRequestsChain(
+ llm_chain=llm_chain,
+ requests_wrapper=requests_wrapper,
+ **config,
+ )
+ return LLMRequestsChain(llm_chain=llm_chain, **config)
+
+
+type_to_loader_dict = {
+ "api_chain": _load_api_chain,
+ "hyde_chain": _load_hyde_chain,
+ "llm_chain": _load_llm_chain,
+ "llm_bash_chain": _load_llm_bash_chain,
+ "llm_checker_chain": _load_llm_checker_chain,
+ "llm_math_chain": _load_llm_math_chain,
+ "llm_requests_chain": _load_llm_requests_chain,
+ "pal_chain": _load_pal_chain,
+ "qa_with_sources_chain": _load_qa_with_sources_chain,
+ "stuff_documents_chain": _load_stuff_documents_chain,
+ "map_reduce_documents_chain": _load_map_reduce_documents_chain,
+ "reduce_documents_chain": _load_reduce_documents_chain,
+ "map_rerank_documents_chain": _load_map_rerank_documents_chain,
+ "refine_documents_chain": _load_refine_documents_chain,
+ "sql_database_chain": _load_sql_database_chain,
+ "vector_db_qa_with_sources_chain": _load_vector_db_qa_with_sources_chain,
+ "vector_db_qa": _load_vector_db_qa,
+ "retrieval_qa": _load_retrieval_qa,
+ "retrieval_qa_with_sources_chain": _load_retrieval_qa_with_sources_chain,
+ "graph_cypher_chain": _load_graph_cypher_chain,
+}
+
+
+@deprecated(
+ since="0.2.13",
+ removal="2.0.0",
+ addendum="Chains must be imported from their respective modules.",
+)
+def load_chain_from_config(config: dict, **kwargs: Any) -> Chain:
+ """Load chain from Config Dict."""
+ if "_type" not in config:
+ msg = "Must specify a chain Type in config"
+ raise ValueError(msg)
+ config_type = config.pop("_type")
+
+ if config_type not in type_to_loader_dict:
+ msg = f"Loading {config_type} chain not supported"
+ raise ValueError(msg)
+
+ chain_loader = type_to_loader_dict[config_type]
+ return chain_loader(config, **kwargs)
+
+
+@deprecated(
+ since="0.2.13",
+ removal="2.0.0",
+ addendum="Chains must be imported from their respective modules.",
+)
+def load_chain(path: str | Path, **kwargs: Any) -> Chain:
+ """Unified method for loading a chain from LangChainHub or local fs."""
+ if isinstance(path, str) and path.startswith("lc://"):
+ msg = (
+ "Loading from the deprecated github-based Hub is no longer supported. "
+ "Please use the new LangChain Hub at https://smith.langchain.com/hub "
+ "instead."
+ )
+ raise RuntimeError(msg)
+ return _load_chain_from_file(path, **kwargs)
+
+
+def _load_chain_from_file(file: str | Path, **kwargs: Any) -> Chain:
+ """Load chain from file."""
+ # Convert file to Path object.
+ file_path = Path(file) if isinstance(file, str) else file
+ # Load from either json or yaml.
+ if file_path.suffix == ".json":
+ with file_path.open() as f:
+ config = json.load(f)
+ elif file_path.suffix.endswith((".yaml", ".yml")):
+ with file_path.open() as f:
+ config = yaml.safe_load(f)
+ else:
+ msg = "File type must be json or yaml"
+ raise ValueError(msg)
+
+ # Override default 'verbose' and 'memory' for the chain
+ if "verbose" in kwargs:
+ config["verbose"] = kwargs.pop("verbose")
+ if "memory" in kwargs:
+ config["memory"] = kwargs.pop("memory")
+
+ # Load the chain from the config now.
+ return load_chain_from_config(config, **kwargs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/mapreduce.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/mapreduce.py
new file mode 100644
index 0000000000000000000000000000000000000000..50e154b5d879bf4c62de55eac60b50494345d32f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/mapreduce.py
@@ -0,0 +1,116 @@
+"""Map-reduce chain.
+
+Splits up a document, sends the smaller parts to the LLM with one prompt,
+then combines the results with another one.
+"""
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.callbacks import CallbackManagerForChainRun, Callbacks
+from langchain_core.documents import Document
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.prompts import BasePromptTemplate
+from langchain_text_splitters import TextSplitter
+from pydantic import ConfigDict
+
+from langchain_classic.chains import ReduceDocumentsChain
+from langchain_classic.chains.base import Chain
+from langchain_classic.chains.combine_documents.base import BaseCombineDocumentsChain
+from langchain_classic.chains.combine_documents.map_reduce import (
+ MapReduceDocumentsChain,
+)
+from langchain_classic.chains.combine_documents.stuff import StuffDocumentsChain
+from langchain_classic.chains.llm import LLMChain
+
+
+@deprecated(
+ since="0.2.13",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For map-reduce branching, build a LangGraph using the Send API. See "
+ "https://docs.langchain.com/oss/python/langgraph/use-graph-api#map-reduce-and-the-send-api"
+ ),
+)
+class MapReduceChain(Chain):
+ """Map-reduce chain."""
+
+ combine_documents_chain: BaseCombineDocumentsChain
+ """Chain to use to combine documents."""
+ text_splitter: TextSplitter
+ """Text splitter to use."""
+ input_key: str = "input_text"
+ output_key: str = "output_text"
+
+ @classmethod
+ def from_params(
+ cls,
+ llm: BaseLanguageModel,
+ prompt: BasePromptTemplate,
+ text_splitter: TextSplitter,
+ callbacks: Callbacks = None,
+ combine_chain_kwargs: Mapping[str, Any] | None = None,
+ reduce_chain_kwargs: Mapping[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> MapReduceChain:
+ """Construct a map-reduce chain that uses the chain for map and reduce."""
+ llm_chain = LLMChain(llm=llm, prompt=prompt, callbacks=callbacks)
+ stuff_chain = StuffDocumentsChain(
+ llm_chain=llm_chain,
+ callbacks=callbacks,
+ **(reduce_chain_kwargs or {}),
+ )
+ reduce_documents_chain = ReduceDocumentsChain(
+ combine_documents_chain=stuff_chain,
+ )
+ combine_documents_chain = MapReduceDocumentsChain(
+ llm_chain=llm_chain,
+ reduce_documents_chain=reduce_documents_chain,
+ callbacks=callbacks,
+ **(combine_chain_kwargs or {}),
+ )
+ return cls(
+ combine_documents_chain=combine_documents_chain,
+ text_splitter=text_splitter,
+ callbacks=callbacks,
+ **kwargs,
+ )
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Expect input key."""
+ return [self.input_key]
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Return output key."""
+ return [self.output_key]
+
+ def _call(
+ self,
+ inputs: dict[str, str],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
+ # Split the larger text into smaller chunks.
+ doc_text = inputs.pop(self.input_key)
+ texts = self.text_splitter.split_text(doc_text)
+ docs = [Document(page_content=text) for text in texts]
+ _inputs: dict[str, Any] = {
+ **inputs,
+ self.combine_documents_chain.input_key: docs,
+ }
+ outputs = self.combine_documents_chain.run(
+ _inputs,
+ callbacks=_run_manager.get_child(),
+ )
+ return {self.output_key: outputs}
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/moderation.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/moderation.py
new file mode 100644
index 0000000000000000000000000000000000000000..686655c40dd706e23b0d45b4c79f7e99fabf754b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/moderation.py
@@ -0,0 +1,129 @@
+"""Pass input through a moderation endpoint."""
+
+from typing import Any
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForChainRun,
+ CallbackManagerForChainRun,
+)
+from langchain_core.utils import check_package_version, get_from_dict_or_env
+from pydantic import Field, model_validator
+from typing_extensions import override
+
+from langchain_classic.chains.base import Chain
+
+
+class OpenAIModerationChain(Chain):
+ """Pass input through a moderation endpoint.
+
+ To use, you should have the `openai` python package installed, and the
+ environment variable `OPENAI_API_KEY` set with your API key.
+
+ Any parameters that are valid to be passed to the openai.create call can be passed
+ in, even if not explicitly saved on this class.
+
+ Example:
+ ```python
+ from langchain_classic.chains import OpenAIModerationChain
+
+ moderation = OpenAIModerationChain()
+ ```
+ """
+
+ client: Any = None
+ async_client: Any = None
+ model_name: str | None = None
+ """Moderation model name to use."""
+ error: bool = False
+ """Whether or not to error if bad content was found."""
+ input_key: str = "input"
+ output_key: str = "output"
+ openai_api_key: str | None = None
+ openai_organization: str | None = None
+ openai_pre_1_0: bool = Field(default=False)
+
+ @model_validator(mode="before")
+ @classmethod
+ def validate_environment(cls, values: dict) -> Any:
+ """Validate that api key and python package exists in environment."""
+ openai_api_key = get_from_dict_or_env(
+ values,
+ "openai_api_key",
+ "OPENAI_API_KEY",
+ )
+ openai_organization = get_from_dict_or_env(
+ values,
+ "openai_organization",
+ "OPENAI_ORGANIZATION",
+ default="",
+ )
+ try:
+ import openai
+
+ openai.api_key = openai_api_key
+ if openai_organization:
+ openai.organization = openai_organization
+ values["openai_pre_1_0"] = False
+ try:
+ check_package_version("openai", gte_version="1.0")
+ except ValueError:
+ values["openai_pre_1_0"] = True
+ if values["openai_pre_1_0"]:
+ values["client"] = openai.Moderation # type: ignore[attr-defined,unused-ignore]
+ else:
+ values["client"] = openai.OpenAI(api_key=openai_api_key)
+ values["async_client"] = openai.AsyncOpenAI(api_key=openai_api_key)
+
+ except ImportError as e:
+ msg = (
+ "Could not import openai python package. "
+ "Please install it with `pip install openai`."
+ )
+ raise ImportError(msg) from e
+ return values
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Expect input key."""
+ return [self.input_key]
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Return output key."""
+ return [self.output_key]
+
+ def _moderate(self, text: str, results: Any) -> str:
+ condition = results["flagged"] if self.openai_pre_1_0 else results.flagged
+ if condition:
+ error_str = "Text was found that violates OpenAI's content policy."
+ if self.error:
+ raise ValueError(error_str)
+ return error_str
+ return text
+
+ @override
+ def _call(
+ self,
+ inputs: dict[str, Any],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ text = inputs[self.input_key]
+ if self.openai_pre_1_0:
+ results = self.client.create(text)
+ output = self._moderate(text, results["results"][0])
+ else:
+ results = self.client.moderations.create(input=text)
+ output = self._moderate(text, results.results[0])
+ return {self.output_key: output}
+
+ async def _acall(
+ self,
+ inputs: dict[str, Any],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ if self.openai_pre_1_0:
+ return await super()._acall(inputs, run_manager=run_manager)
+ text = inputs[self.input_key]
+ results = await self.async_client.moderations.create(input=text)
+ output = self._moderate(text, results.results[0])
+ return {self.output_key: output}
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/prompt_selector.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/prompt_selector.py
new file mode 100644
index 0000000000000000000000000000000000000000..431b8df33fd8cb251a81384db9ee5d39c45974d6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/prompt_selector.py
@@ -0,0 +1,65 @@
+from abc import ABC, abstractmethod
+from collections.abc import Callable
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.language_models.chat_models import BaseChatModel
+from langchain_core.language_models.llms import BaseLLM
+from langchain_core.prompts import BasePromptTemplate
+from pydantic import BaseModel, Field
+
+
+class BasePromptSelector(BaseModel, ABC):
+ """Base class for prompt selectors."""
+
+ @abstractmethod
+ def get_prompt(self, llm: BaseLanguageModel) -> BasePromptTemplate:
+ """Get default prompt for a language model."""
+
+
+class ConditionalPromptSelector(BasePromptSelector):
+ """Prompt collection that goes through conditionals."""
+
+ default_prompt: BasePromptTemplate
+ """Default prompt to use if no conditionals match."""
+ conditionals: list[
+ tuple[Callable[[BaseLanguageModel], bool], BasePromptTemplate]
+ ] = Field(default_factory=list)
+ """List of conditionals and prompts to use if the conditionals match."""
+
+ def get_prompt(self, llm: BaseLanguageModel) -> BasePromptTemplate:
+ """Get default prompt for a language model.
+
+ Args:
+ llm: Language model to get prompt for.
+
+ Returns:
+ Prompt to use for the language model.
+ """
+ for condition, prompt in self.conditionals:
+ if condition(llm):
+ return prompt
+ return self.default_prompt
+
+
+def is_llm(llm: BaseLanguageModel) -> bool:
+ """Check if the language model is a LLM.
+
+ Args:
+ llm: Language model to check.
+
+ Returns:
+ `True` if the language model is a BaseLLM model, `False` otherwise.
+ """
+ return isinstance(llm, BaseLLM)
+
+
+def is_chat_model(llm: BaseLanguageModel) -> bool:
+ """Check if the language model is a chat model.
+
+ Args:
+ llm: Language model to check.
+
+ Returns:
+ `True` if the language model is a BaseChatModel model, `False` otherwise.
+ """
+ return isinstance(llm, BaseChatModel)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/retrieval.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/retrieval.py
new file mode 100644
index 0000000000000000000000000000000000000000..5d635265cc98322a10cae8ab1a82e703f3658bc1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/retrieval.py
@@ -0,0 +1,68 @@
+from __future__ import annotations
+
+from typing import Any
+
+from langchain_core.retrievers import (
+ BaseRetriever,
+ RetrieverOutput,
+)
+from langchain_core.runnables import Runnable, RunnablePassthrough
+
+
+def create_retrieval_chain(
+ retriever: BaseRetriever | Runnable[dict, RetrieverOutput],
+ combine_docs_chain: Runnable[dict[str, Any], str],
+) -> Runnable:
+ """Create retrieval chain that retrieves documents and then passes them on.
+
+ Args:
+ retriever: Retriever-like object that returns list of documents. Should
+ either be a subclass of BaseRetriever or a Runnable that returns
+ a list of documents. If a subclass of BaseRetriever, then it
+ is expected that an `input` key be passed in - this is what
+ is will be used to pass into the retriever. If this is NOT a
+ subclass of BaseRetriever, then all the inputs will be passed
+ into this runnable, meaning that runnable should take a dictionary
+ as input.
+ combine_docs_chain: Runnable that takes inputs and produces a string output.
+ The inputs to this will be any original inputs to this chain, a new
+ context key with the retrieved documents, and chat_history (if not present
+ in the inputs) with a value of `[]` (to easily enable conversational
+ retrieval.
+
+ Returns:
+ An LCEL Runnable. The Runnable return is a dictionary containing at the very
+ least a `context` and `answer` key.
+
+ Example:
+ ```python
+ # pip install -U langchain langchain-openai
+
+ from langchain_openai import ChatOpenAI
+ from langchain_classic.chains.combine_documents import (
+ create_stuff_documents_chain,
+ )
+ from langchain_classic.chains import create_retrieval_chain
+ from langchain_classic import hub
+
+ retrieval_qa_chat_prompt = hub.pull("langchain-ai/retrieval-qa-chat")
+ model = ChatOpenAI()
+ retriever = ...
+ combine_docs_chain = create_stuff_documents_chain(
+ model, retrieval_qa_chat_prompt
+ )
+ retrieval_chain = create_retrieval_chain(retriever, combine_docs_chain)
+
+ retrieval_chain.invoke({"input": "..."})
+ ```
+ """
+ if not isinstance(retriever, BaseRetriever):
+ retrieval_docs: Runnable[dict, RetrieverOutput] = retriever
+ else:
+ retrieval_docs = (lambda x: x["input"]) | retriever
+
+ return (
+ RunnablePassthrough.assign(
+ context=retrieval_docs.with_config(run_name="retrieve_documents"),
+ ).assign(answer=combine_docs_chain)
+ ).with_config(run_name="retrieval_chain")
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/sequential.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/sequential.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d333b52b535bc8a7d3d9ad1ebbca8604236f616
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/sequential.py
@@ -0,0 +1,208 @@
+"""Chain pipeline where the outputs of one step feed directly into next."""
+
+from typing import Any
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForChainRun,
+ CallbackManagerForChainRun,
+)
+from langchain_core.utils.input import get_color_mapping
+from pydantic import ConfigDict, model_validator
+from typing_extensions import Self
+
+from langchain_classic.chains.base import Chain
+
+
+class SequentialChain(Chain):
+ """Chain where the outputs of one chain feed directly into next."""
+
+ chains: list[Chain]
+ input_variables: list[str]
+ output_variables: list[str]
+ return_all: bool = False
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Return expected input keys to the chain."""
+ return self.input_variables
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Return output key."""
+ return self.output_variables
+
+ @model_validator(mode="before")
+ @classmethod
+ def validate_chains(cls, values: dict) -> Any:
+ """Validate that the correct inputs exist for all chains."""
+ chains = values["chains"]
+ input_variables = values["input_variables"]
+ memory_keys = []
+ if "memory" in values and values["memory"] is not None:
+ """Validate that prompt input variables are consistent."""
+ memory_keys = values["memory"].memory_variables
+ if set(input_variables).intersection(set(memory_keys)):
+ overlapping_keys = set(input_variables) & set(memory_keys)
+ msg = (
+ f"The input key(s) {''.join(overlapping_keys)} are found "
+ f"in the Memory keys ({memory_keys}) - please use input and "
+ f"memory keys that don't overlap."
+ )
+ raise ValueError(msg)
+
+ known_variables = set(input_variables + memory_keys)
+
+ for chain in chains:
+ missing_vars = set(chain.input_keys).difference(known_variables)
+ if chain.memory:
+ missing_vars = missing_vars.difference(chain.memory.memory_variables)
+
+ if missing_vars:
+ msg = (
+ f"Missing required input keys: {missing_vars}, "
+ f"only had {known_variables}"
+ )
+ raise ValueError(msg)
+ overlapping_keys = known_variables.intersection(chain.output_keys)
+ if overlapping_keys:
+ msg = f"Chain returned keys that already exist: {overlapping_keys}"
+ raise ValueError(msg)
+
+ known_variables |= set(chain.output_keys)
+
+ if "output_variables" not in values:
+ if values.get("return_all", False):
+ output_keys = known_variables.difference(input_variables)
+ else:
+ output_keys = chains[-1].output_keys
+ values["output_variables"] = output_keys
+ else:
+ missing_vars = set(values["output_variables"]).difference(known_variables)
+ if missing_vars:
+ msg = f"Expected output variables that were not found: {missing_vars}."
+ raise ValueError(msg)
+
+ return values
+
+ def _call(
+ self,
+ inputs: dict[str, str],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ known_values = inputs.copy()
+ _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
+ for _i, chain in enumerate(self.chains):
+ callbacks = _run_manager.get_child()
+ outputs = chain(known_values, return_only_outputs=True, callbacks=callbacks)
+ known_values.update(outputs)
+ return {k: known_values[k] for k in self.output_variables}
+
+ async def _acall(
+ self,
+ inputs: dict[str, Any],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ known_values = inputs.copy()
+ _run_manager = run_manager or AsyncCallbackManagerForChainRun.get_noop_manager()
+ callbacks = _run_manager.get_child()
+ for _i, chain in enumerate(self.chains):
+ outputs = await chain.acall(
+ known_values,
+ return_only_outputs=True,
+ callbacks=callbacks,
+ )
+ known_values.update(outputs)
+ return {k: known_values[k] for k in self.output_variables}
+
+
+class SimpleSequentialChain(Chain):
+ """Simple chain where the outputs of one step feed directly into next."""
+
+ chains: list[Chain]
+ strip_outputs: bool = False
+ input_key: str = "input"
+ output_key: str = "output"
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Expect input key."""
+ return [self.input_key]
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Return output key."""
+ return [self.output_key]
+
+ @model_validator(mode="after")
+ def validate_chains(self) -> Self:
+ """Validate that chains are all single input/output."""
+ for chain in self.chains:
+ if len(chain.input_keys) != 1:
+ msg = (
+ "Chains used in SimplePipeline should all have one input, got "
+ f"{chain} with {len(chain.input_keys)} inputs."
+ )
+ raise ValueError(msg)
+ if len(chain.output_keys) != 1:
+ msg = (
+ "Chains used in SimplePipeline should all have one output, got "
+ f"{chain} with {len(chain.output_keys)} outputs."
+ )
+ raise ValueError(msg)
+ return self
+
+ def _call(
+ self,
+ inputs: dict[str, str],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ _run_manager = run_manager or CallbackManagerForChainRun.get_noop_manager()
+ _input = inputs[self.input_key]
+ color_mapping = get_color_mapping([str(i) for i in range(len(self.chains))])
+ for i, chain in enumerate(self.chains):
+ _input = chain.run(
+ _input,
+ callbacks=_run_manager.get_child(f"step_{i + 1}"),
+ )
+ if self.strip_outputs:
+ _input = _input.strip()
+ _run_manager.on_text(
+ _input,
+ color=color_mapping[str(i)],
+ end="\n",
+ verbose=self.verbose,
+ )
+ return {self.output_key: _input}
+
+ async def _acall(
+ self,
+ inputs: dict[str, Any],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ _run_manager = run_manager or AsyncCallbackManagerForChainRun.get_noop_manager()
+ _input = inputs[self.input_key]
+ color_mapping = get_color_mapping([str(i) for i in range(len(self.chains))])
+ for i, chain in enumerate(self.chains):
+ _input = await chain.arun(
+ _input,
+ callbacks=_run_manager.get_child(f"step_{i + 1}"),
+ )
+ if self.strip_outputs:
+ _input = _input.strip()
+ await _run_manager.on_text(
+ _input,
+ color=color_mapping[str(i)],
+ end="\n",
+ verbose=self.verbose,
+ )
+ return {self.output_key: _input}
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/transform.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/transform.py
new file mode 100644
index 0000000000000000000000000000000000000000..a56273f1e5058d1e0bcbbb8b11449a220172ea66
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chains/transform.py
@@ -0,0 +1,79 @@
+"""Chain that runs an arbitrary python function."""
+
+import functools
+import logging
+from collections.abc import Awaitable, Callable
+from typing import Any
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForChainRun,
+ CallbackManagerForChainRun,
+)
+from pydantic import Field
+from typing_extensions import override
+
+from langchain_classic.chains.base import Chain
+
+logger = logging.getLogger(__name__)
+
+
+class TransformChain(Chain):
+ """Chain that transforms the chain output.
+
+ Example:
+ ```python
+ from langchain_classic.chains import TransformChain
+ transform_chain = TransformChain(input_variables=["text"],
+ output_variables["entities"], transform=func())
+
+ ```
+ """
+
+ input_variables: list[str]
+ """The keys expected by the transform's input dictionary."""
+ output_variables: list[str]
+ """The keys returned by the transform's output dictionary."""
+ transform_cb: Callable[[dict[str, str]], dict[str, str]] = Field(alias="transform")
+ """The transform function."""
+ atransform_cb: Callable[[dict[str, Any]], Awaitable[dict[str, Any]]] | None = Field(
+ None, alias="atransform"
+ )
+ """The async coroutine transform function."""
+
+ @staticmethod
+ @functools.lru_cache
+ def _log_once(msg: str) -> None:
+ """Log a message once."""
+ logger.warning(msg)
+
+ @property
+ def input_keys(self) -> list[str]:
+ """Expect input keys."""
+ return self.input_variables
+
+ @property
+ def output_keys(self) -> list[str]:
+ """Return output keys."""
+ return self.output_variables
+
+ @override
+ def _call(
+ self,
+ inputs: dict[str, str],
+ run_manager: CallbackManagerForChainRun | None = None,
+ ) -> dict[str, str]:
+ return self.transform_cb(inputs)
+
+ @override
+ async def _acall(
+ self,
+ inputs: dict[str, Any],
+ run_manager: AsyncCallbackManagerForChainRun | None = None,
+ ) -> dict[str, Any]:
+ if self.atransform_cb is not None:
+ return await self.atransform_cb(inputs)
+ self._log_once(
+ "TransformChain's atransform is not provided, falling"
+ " back to synchronous transform",
+ )
+ return self.transform_cb(inputs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..941d59a4214b4952d56779435a60efaf0dcf6787
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/__init__.py
@@ -0,0 +1,6 @@
+"""**Chat Loaders** load chat messages from common communications platforms.
+
+Load chat messages from various
+communications platforms such as Facebook Messenger, Telegram, and
+WhatsApp. The loaded chat messages can be used for fine-tuning models.
+"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..a5207e6ef4f575cfe24dc1413e1331c3cdb05fee
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/base.py
@@ -0,0 +1,3 @@
+from langchain_core.chat_loaders import BaseChatLoader
+
+__all__ = ["BaseChatLoader"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/facebook_messenger.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/facebook_messenger.py
new file mode 100644
index 0000000000000000000000000000000000000000..48f7ba001a28cdf8e9d7ae7edf933b02e6365709
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/facebook_messenger.py
@@ -0,0 +1,32 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api.module_import import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.facebook_messenger import (
+ FolderFacebookMessengerChatLoader,
+ SingleFileFacebookMessengerChatLoader,
+ )
+
+module_lookup = {
+ "SingleFileFacebookMessengerChatLoader": (
+ "langchain_community.chat_loaders.facebook_messenger"
+ ),
+ "FolderFacebookMessengerChatLoader": (
+ "langchain_community.chat_loaders.facebook_messenger"
+ ),
+}
+
+# Temporary code for backwards compatibility for deprecated imports.
+# This will eventually be removed.
+import_lookup = create_importer(
+ __package__,
+ deprecated_lookups=module_lookup,
+)
+
+
+def __getattr__(name: str) -> Any:
+ return import_lookup(name)
+
+
+__all__ = ["FolderFacebookMessengerChatLoader", "SingleFileFacebookMessengerChatLoader"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/gmail.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/gmail.py
new file mode 100644
index 0000000000000000000000000000000000000000..73c85e408a64af3ec3e4e332a309a220d4c75af7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/gmail.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.gmail import GMailLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GMailLoader": "langchain_community.chat_loaders.gmail"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GMailLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/imessage.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/imessage.py
new file mode 100644
index 0000000000000000000000000000000000000000..4e1e121218a39439e3fb33b8475d530e57244e3e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/imessage.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.imessage import IMessageChatLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"IMessageChatLoader": "langchain_community.chat_loaders.imessage"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "IMessageChatLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/langsmith.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/langsmith.py
new file mode 100644
index 0000000000000000000000000000000000000000..cea2d14614ec2026e5cb2eaec72c5366aaa41761
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/langsmith.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.langsmith import (
+ LangSmithDatasetChatLoader,
+ LangSmithRunChatLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LangSmithRunChatLoader": "langchain_community.chat_loaders.langsmith",
+ "LangSmithDatasetChatLoader": "langchain_community.chat_loaders.langsmith",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LangSmithDatasetChatLoader",
+ "LangSmithRunChatLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/slack.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/slack.py
new file mode 100644
index 0000000000000000000000000000000000000000..d7e4840b474fff12403a347b75bed47c710c7edd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/slack.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.slack import SlackChatLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SlackChatLoader": "langchain_community.chat_loaders.slack"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SlackChatLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/telegram.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/telegram.py
new file mode 100644
index 0000000000000000000000000000000000000000..a182c4a2c63c248ad54b625ac220865bb5490e64
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/telegram.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.telegram import TelegramChatLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TelegramChatLoader": "langchain_community.chat_loaders.telegram"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TelegramChatLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..79b86b244fbd80f1ee98074782ffd54b6443b07a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/utils.py
@@ -0,0 +1,36 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.utils import (
+ map_ai_messages,
+ map_ai_messages_in_session,
+ merge_chat_runs,
+ merge_chat_runs_in_session,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "merge_chat_runs_in_session": "langchain_community.chat_loaders.utils",
+ "merge_chat_runs": "langchain_community.chat_loaders.utils",
+ "map_ai_messages_in_session": "langchain_community.chat_loaders.utils",
+ "map_ai_messages": "langchain_community.chat_loaders.utils",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "map_ai_messages",
+ "map_ai_messages_in_session",
+ "merge_chat_runs",
+ "merge_chat_runs_in_session",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/whatsapp.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/whatsapp.py
new file mode 100644
index 0000000000000000000000000000000000000000..c56ca319d6e001a2ac4c7dfb0461683383e0ad77
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_loaders/whatsapp.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_loaders.whatsapp import WhatsAppChatLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WhatsAppChatLoader": "langchain_community.chat_loaders.whatsapp"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WhatsAppChatLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..640d77a0fa43622d9f8b4fd29431e09f0b59f7d9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/__init__.py
@@ -0,0 +1,66 @@
+"""**Chat Models** are a variation on language models.
+
+While Chat Models use language models under the hood, the interface they expose
+is a bit different. Rather than expose a "text in, text out" API, they expose
+an interface where "chat messages" are the inputs and outputs.
+"""
+
+import warnings
+
+from langchain_core._api import LangChainDeprecationWarning
+
+from langchain_classic._api.interactive_env import is_interactive_env
+from langchain_classic.chat_models.base import init_chat_model
+
+
+def __getattr__(name: str) -> None:
+ from langchain_community import chat_models
+
+ # If not in interactive env, raise warning.
+ if not is_interactive_env():
+ warnings.warn(
+ "Importing chat models from langchain is deprecated. Importing from "
+ "langchain will no longer be supported as of langchain==0.2.0. "
+ "Please import from langchain-community instead:\n\n"
+ f"`from langchain_community.chat_models import {name}`.\n\n"
+ "To install langchain-community run `pip install -U langchain-community`.",
+ stacklevel=2,
+ category=LangChainDeprecationWarning,
+ )
+
+ return getattr(chat_models, name)
+
+
+__all__ = [
+ "AzureChatOpenAI",
+ "BedrockChat",
+ "ChatAnthropic",
+ "ChatAnyscale",
+ "ChatBaichuan",
+ "ChatCohere",
+ "ChatDatabricks",
+ "ChatEverlyAI",
+ "ChatFireworks",
+ "ChatGooglePalm",
+ "ChatHunyuan",
+ "ChatJavelinAIGateway",
+ "ChatKonko",
+ "ChatLiteLLM",
+ "ChatMLflowAIGateway",
+ "ChatMlflow",
+ "ChatOllama",
+ "ChatOpenAI",
+ "ChatVertexAI",
+ "ChatYandexGPT",
+ "ErnieBotChat",
+ "FakeListChatModel",
+ "GigaChat",
+ "HumanInputChatModel",
+ "JinaChat",
+ "MiniMaxChat",
+ "PaiEasChatEndpoint",
+ "PromptLayerChatOpenAI",
+ "QianfanChatEndpoint",
+ "VolcEngineMaasChat",
+ "init_chat_model",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/anthropic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/anthropic.py
new file mode 100644
index 0000000000000000000000000000000000000000..a53850bb99e052612596b14ffef625226f03669f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/anthropic.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.anthropic import (
+ ChatAnthropic,
+ convert_messages_to_prompt_anthropic,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "convert_messages_to_prompt_anthropic": "langchain_community.chat_models.anthropic",
+ "ChatAnthropic": "langchain_community.chat_models.anthropic",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatAnthropic",
+ "convert_messages_to_prompt_anthropic",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/anyscale.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/anyscale.py
new file mode 100644
index 0000000000000000000000000000000000000000..55c8b473fa2bf6bbd6927240eaf3b8c89a49b842
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/anyscale.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.anyscale import ChatAnyscale
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatAnyscale": "langchain_community.chat_models.anyscale"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatAnyscale",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/azure_openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/azure_openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..735eb8694e7e43b53ceaac2212f47a9d998e66cc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/azure_openai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.azure_openai import AzureChatOpenAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AzureChatOpenAI": "langchain_community.chat_models.azure_openai"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureChatOpenAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/azureml_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/azureml_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..ff63dc9ee0cdc17c19ca41f462c1ee1d558d54be
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/azureml_endpoint.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.azureml_endpoint import (
+ AzureMLChatOnlineEndpoint,
+ LlamaContentFormatter,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LlamaContentFormatter": "langchain_community.chat_models.azureml_endpoint",
+ "AzureMLChatOnlineEndpoint": "langchain_community.chat_models.azureml_endpoint",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureMLChatOnlineEndpoint",
+ "LlamaContentFormatter",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/baichuan.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/baichuan.py
new file mode 100644
index 0000000000000000000000000000000000000000..525928103655f21431f35b731fc0bbb6d7d8442a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/baichuan.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.baichuan import ChatBaichuan
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatBaichuan": "langchain_community.chat_models.baichuan"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatBaichuan",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/baidu_qianfan_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/baidu_qianfan_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..e3f9b1b5dbac5cfded6ee8a54db1024726fcabb1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/baidu_qianfan_endpoint.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.baidu_qianfan_endpoint import (
+ QianfanChatEndpoint,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "QianfanChatEndpoint": "langchain_community.chat_models.baidu_qianfan_endpoint",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "QianfanChatEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..ffdf6809512a3c7fd144bc4615ebb911ee869737
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/base.py
@@ -0,0 +1,1068 @@
+from __future__ import annotations
+
+import warnings
+from collections.abc import AsyncIterator, Callable, Iterator, Sequence
+from importlib import util
+from typing import Any, Literal, TypeAlias, cast, overload
+
+from langchain_core._api import deprecated
+from langchain_core.language_models import (
+ BaseChatModel,
+ LanguageModelInput,
+ SimpleChatModel,
+)
+from langchain_core.language_models.chat_models import (
+ agenerate_from_stream,
+ generate_from_stream,
+)
+from langchain_core.messages import AIMessage, AnyMessage
+from langchain_core.runnables import Runnable, RunnableConfig, ensure_config
+from langchain_core.runnables.schema import StreamEvent
+from langchain_core.tools import BaseTool
+from langchain_core.tracers import RunLog, RunLogPatch
+from pydantic import BaseModel
+from typing_extensions import override
+
+__all__ = [
+ # For backwards compatibility
+ "BaseChatModel",
+ "SimpleChatModel",
+ "agenerate_from_stream",
+ "generate_from_stream",
+ "init_chat_model",
+]
+
+
+@overload
+def init_chat_model(
+ model: str,
+ *,
+ model_provider: str | None = None,
+ configurable_fields: None = None,
+ config_prefix: str | None = None,
+ **kwargs: Any,
+) -> BaseChatModel: ...
+
+
+@overload
+def init_chat_model(
+ model: None = None,
+ *,
+ model_provider: str | None = None,
+ configurable_fields: None = None,
+ config_prefix: str | None = None,
+ **kwargs: Any,
+) -> _ConfigurableModel: ...
+
+
+@overload
+def init_chat_model(
+ model: str | None = None,
+ *,
+ model_provider: str | None = None,
+ configurable_fields: Literal["any"] | list[str] | tuple[str, ...] = ...,
+ config_prefix: str | None = None,
+ **kwargs: Any,
+) -> _ConfigurableModel: ...
+
+
+# FOR CONTRIBUTORS: If adding support for a new provider, please append the provider
+# name to the supported list in the docstring below. Do *not* change the order of the
+# existing providers.
+@deprecated(
+ since="1.0.5",
+ removal="2.0.0",
+ alternative="langchain.chat_models.init_chat_model",
+ addendum=(
+ "Maintained in `langchain`; `langchain-classic` retains this entry point "
+ "for import-compatibility only."
+ ),
+)
+def init_chat_model(
+ model: str | None = None,
+ *,
+ model_provider: str | None = None,
+ configurable_fields: Literal["any"] | list[str] | tuple[str, ...] | None = None,
+ config_prefix: str | None = None,
+ **kwargs: Any,
+) -> BaseChatModel | _ConfigurableModel:
+ """Initialize a chat model from any supported provider using a unified interface.
+
+ !!! warning "Use `langchain.chat_models.init_chat_model` instead"
+
+ This function lives in `langchain-classic` and is no longer actively
+ maintained. New features and fixes land in the `langchain` package.
+
+ Update your imports:
+
+ ```python
+ # Don't do this:
+ from langchain.chat_models import init_chat_model
+
+ # Do this instead:
+ from langchain.chat_models import init_chat_model
+ ```
+
+ **Two main use cases:**
+
+ 1. **Fixed model** – specify the model upfront and get a
+ ready-to-use chat model.
+ 2. **Configurable model** – choose to specify parameters
+ (including model name) at runtime via `config`. Makes it easy to
+ switch between models/providers without changing your code
+
+ !!! note "Installation requirements"
+
+ Requires the integration package for the chosen model provider to
+ be installed.
+
+ See the `model_provider` parameter below for specific package names
+ (e.g., `pip install langchain-openai`).
+
+ Refer to the [provider integration's API reference](https://docs.langchain.com/oss/python/integrations/providers)
+ for supported model parameters to use as `**kwargs`.
+
+ Args:
+ model: Name of the model to use, with provider prefix — e.g.,
+ `'openai:gpt-5.5'`.
+
+ A bare model name (e.g., `'claude-opus-4-7'`) is also accepted; we
+ will attempt to infer the provider from the prefix using the mapping
+ below. Inference is best-effort and not guaranteed, so prefer
+ the prefixed form when possible.
+
+ Prefer pinned model IDs over moving aliases (e.g.,
+ `'claude-haiku-4-5-20251001'` rather than `'claude-haiku-4-5'`)
+ so behavior does not drift if the alias is repointed upstream.
+
+ Inferred providers by prefix (case-insensitive):
+
+ - `gpt-...` | `o1...` | `o3...` -> `openai`
+ - `claude...` -> `anthropic`
+ - `amazon....` | `anthropic....` | `meta....` -> `bedrock`
+ - `gemini...` -> `google_vertexai`
+ - `command...` -> `cohere`
+ - `accounts/fireworks...` -> `fireworks`
+ - `mistral...` | `mixtral...` -> `mistralai`
+ - `deepseek...` -> `deepseek`
+ - `grok...` -> `xai`
+ - `sonar...` -> `perplexity`
+ - `solar...` -> `upstage`
+ - `chatgpt...` | `text-davinci...` -> `openai` (legacy)
+ model_provider: Provider of the model, passed separately instead of
+ as a prefix on `model`.
+
+ Equivalent to the prefix form — e.g.,
+ `model='claude-sonnet-4-5', model_provider='anthropic'` behaves
+ the same as `model='anthropic:claude-sonnet-4-5'`.
+
+ Prefer the prefix form on `model` for most usage. Reach for this
+ kwarg when:
+
+ - The provider is dynamic (read from config or an env var) and
+ you'd otherwise concatenate strings.
+ - You want `model` and `model_provider` to be independently
+ swappable at runtime via `configurable_fields` (e.g., to route
+ the same model name to a different host).
+
+ Supported values and the integration package each requires:
+
+ - `openai` -> [`langchain-openai`](https://docs.langchain.com/oss/python/integrations/providers/openai)
+ - `anthropic` -> [`langchain-anthropic`](https://docs.langchain.com/oss/python/integrations/providers/anthropic)
+ - `azure_openai` -> [`langchain-openai`](https://docs.langchain.com/oss/python/integrations/providers/openai)
+ - `azure_ai` -> [`langchain-azure-ai`](https://docs.langchain.com/oss/python/integrations/providers/microsoft)
+ - `google_vertexai` -> [`langchain-google-vertexai`](https://docs.langchain.com/oss/python/integrations/providers/google)
+ - `google_genai` -> [`langchain-google-genai`](https://docs.langchain.com/oss/python/integrations/providers/google)
+ - `bedrock` -> [`langchain-aws`](https://docs.langchain.com/oss/python/integrations/providers/aws)
+ - `bedrock_converse` -> [`langchain-aws`](https://docs.langchain.com/oss/python/integrations/providers/aws)
+ - `cohere` -> [`langchain-cohere`](https://docs.langchain.com/oss/python/integrations/providers/cohere)
+ - `fireworks` -> [`langchain-fireworks`](https://docs.langchain.com/oss/python/integrations/providers/fireworks)
+ - `together` -> [`langchain-together`](https://docs.langchain.com/oss/python/integrations/providers/together)
+ - `mistralai` -> [`langchain-mistralai`](https://docs.langchain.com/oss/python/integrations/providers/mistralai)
+ - `huggingface` -> [`langchain-huggingface`](https://docs.langchain.com/oss/python/integrations/providers/huggingface)
+ - `groq` -> [`langchain-groq`](https://docs.langchain.com/oss/python/integrations/providers/groq)
+ - `ollama` -> [`langchain-ollama`](https://docs.langchain.com/oss/python/integrations/providers/ollama)
+ - `google_anthropic_vertex` -> [`langchain-google-vertexai`](https://docs.langchain.com/oss/python/integrations/providers/google)
+ - `deepseek` -> [`langchain-deepseek`](https://docs.langchain.com/oss/python/integrations/providers/deepseek)
+ - `ibm` -> [`langchain-ibm`](https://docs.langchain.com/oss/python/integrations/providers/ibm)
+ - `nvidia` -> [`langchain-nvidia-ai-endpoints`](https://docs.langchain.com/oss/python/integrations/providers/nvidia)
+ - `xai` -> [`langchain-xai`](https://docs.langchain.com/oss/python/integrations/providers/xai)
+ - `perplexity` -> [`langchain-perplexity`](https://docs.langchain.com/oss/python/integrations/providers/perplexity)
+ - `upstage` -> [`langchain-upstage`](https://docs.langchain.com/oss/python/integrations/providers/upstage)
+ configurable_fields: Which model parameters are configurable at runtime:
+
+ - `None`: No configurable fields (i.e., a fixed model).
+ - `'any'`: All fields are configurable. **See security note below.**
+ - `list[str] | Tuple[str, ...]`: Specified fields are configurable.
+
+ Fields are assumed to have `config_prefix` stripped if a `config_prefix` is
+ specified.
+
+ If `model` is specified, then defaults to `None`.
+
+ If `model` is not specified, then defaults to `("model", "model_provider")`.
+
+ !!! warning "Security note"
+
+ Setting `configurable_fields="any"` means fields like `api_key`,
+ `base_url`, etc., can be altered at runtime, potentially redirecting
+ model requests to a different service/user.
+
+ Make sure that if you're accepting untrusted configurations that you
+ enumerate the `configurable_fields=(...)` explicitly.
+
+ config_prefix: Optional prefix for configuration keys.
+
+ Useful when you have multiple configurable models in the same application.
+
+ If `'config_prefix'` is a non-empty string then `model` will be configurable
+ at runtime via the `config["configurable"]["{config_prefix}_{param}"]` keys.
+ See examples below.
+
+ If `'config_prefix'` is an empty string then model will be configurable via
+ `config["configurable"]["{param}"]`.
+ **kwargs: Additional model-specific keyword args to pass to the underlying
+ chat model's `__init__` method. Common parameters include:
+
+ - `temperature`: Model temperature for controlling randomness.
+ - `max_tokens`: Maximum number of output tokens.
+ - `timeout`: Maximum time (in seconds) to wait for a response.
+ - `max_retries`: Maximum number of retry attempts for failed requests.
+ - `base_url`: Custom API endpoint URL.
+ - `rate_limiter`: A
+ [`BaseRateLimiter`][langchain_core.rate_limiters.BaseRateLimiter]
+ instance to control request rate.
+
+ Refer to the specific model provider's
+ [integration reference](https://reference.langchain.com/python/integrations/)
+ for all available parameters.
+
+ Returns:
+ A [`BaseChatModel`][langchain_core.language_models.BaseChatModel] corresponding
+ to the `model_name` and `model_provider` specified if configurability is
+ inferred to be `False`.
+ If configurable, a chat model emulator that initializes the
+ underlying model at runtime once a config is passed in.
+
+ Raises:
+ ValueError: If `model_provider` cannot be inferred or isn't supported.
+ ImportError: If the model provider integration package is not installed.
+
+ ???+ example "Initialize a non-configurable model"
+
+ ```python
+ # pip install langchain langchain-openai
+
+ from langchain.chat_models import init_chat_model
+
+ gpt_5 = init_chat_model("openai:gpt-5.5", temperature=0)
+ gpt_5.invoke("what's your name")
+ ```
+
+ ??? example "Partially configurable model with no default"
+
+ ```python
+ # pip install langchain langchain-openai
+
+ from langchain.chat_models import init_chat_model
+
+ # (We don't need to specify configurable=True if a model isn't specified.)
+ configurable_model = init_chat_model(temperature=0)
+
+ # Use GPT-5.5 to generate the response
+ configurable_model.invoke(
+ "what's your name",
+ config={"configurable": {"model": "gpt-5.5"}},
+ )
+ ```
+
+ ??? example "Fully configurable model with a default"
+
+ ```python
+ # pip install langchain langchain-openai langchain-anthropic
+
+ from langchain.chat_models import init_chat_model
+
+ configurable_model_with_default = init_chat_model(
+ "openai:gpt-5.5",
+ configurable_fields="any", # This allows us to configure other params like temperature, max_tokens, etc at runtime.
+ config_prefix="foo",
+ temperature=0,
+ )
+
+ configurable_model_with_default.invoke("what's your name")
+ # GPT-5.5 response with temperature 0 (as set in default)
+
+ # Invoke overriding model and temperature at runtime via config.
+ # Note the use of the "foo_" prefix on the config keys, which matches
+ # the config_prefix we set when initializing the model.
+ configurable_model_with_default.invoke(
+ "what's your name",
+ config={
+ "configurable": {
+ "foo_model": "anthropic:claude-opus-4-7",
+ "foo_temperature": 0.6,
+ }
+ },
+ )
+ ```
+
+ ??? example "Bind tools to a configurable model"
+
+ You can call any chat model declarative methods on a configurable model
+ in the same way that you would with a normal model:
+
+ ```python
+ # pip install langchain langchain-openai langchain-anthropic
+
+ from langchain.chat_models import init_chat_model
+ from pydantic import BaseModel, Field
+
+
+ class GetWeather(BaseModel):
+ '''Get the current weather in a given location'''
+
+ location: str = Field(
+ ..., description="The city and state, e.g. San Francisco, CA"
+ )
+
+
+ class GetPopulation(BaseModel):
+ '''Get the current population in a given location'''
+
+ location: str = Field(
+ ..., description="The city and state, e.g. San Francisco, CA"
+ )
+
+
+ configurable_model = init_chat_model(
+ "gpt-5.5", configurable_fields=("model", "model_provider"), temperature=0
+ )
+
+ configurable_model_with_tools = configurable_model.bind_tools(
+ [
+ GetWeather,
+ GetPopulation,
+ ]
+ )
+ configurable_model_with_tools.invoke(
+ "Which city is hotter today and which is bigger: LA or NY?"
+ )
+ # Use GPT-5.5
+
+ configurable_model_with_tools.invoke(
+ "Which city is hotter today and which is bigger: LA or NY?",
+ config={"configurable": {"model": "claude-opus-4-7"}},
+ )
+ # Use Opus 4.7
+ ```
+
+ """ # noqa: E501
+ if not model and not configurable_fields:
+ configurable_fields = ("model", "model_provider")
+ config_prefix = config_prefix or ""
+ if config_prefix and not configurable_fields:
+ warnings.warn(
+ f"{config_prefix=} has been set but no fields are configurable. Set "
+ f"`configurable_fields=(...)` to specify the model params that are "
+ f"configurable.",
+ stacklevel=2,
+ )
+
+ if not configurable_fields:
+ return _init_chat_model_helper(
+ cast("str", model),
+ model_provider=model_provider,
+ **kwargs,
+ )
+ if model:
+ kwargs["model"] = model
+ if model_provider:
+ kwargs["model_provider"] = model_provider
+ return _ConfigurableModel(
+ default_config=kwargs,
+ config_prefix=config_prefix,
+ configurable_fields=configurable_fields,
+ )
+
+
+def _init_chat_model_helper(
+ model: str,
+ *,
+ model_provider: str | None = None,
+ **kwargs: Any,
+) -> BaseChatModel:
+ model, model_provider = _parse_model(model, model_provider)
+ if model_provider == "openai":
+ _check_pkg("langchain_openai", "ChatOpenAI")
+ from langchain_openai import ChatOpenAI
+
+ return ChatOpenAI(model=model, **kwargs)
+ if model_provider == "anthropic":
+ _check_pkg("langchain_anthropic", "ChatAnthropic")
+ from langchain_anthropic import ChatAnthropic
+
+ return ChatAnthropic(model=model, **kwargs) # type: ignore[call-arg,unused-ignore]
+ if model_provider == "azure_openai":
+ _check_pkg("langchain_openai", "AzureChatOpenAI")
+ from langchain_openai import AzureChatOpenAI
+
+ return AzureChatOpenAI(model=model, **kwargs)
+ if model_provider == "azure_ai":
+ _check_pkg("langchain_azure_ai", "AzureAIOpenAIApiChatModel")
+ from langchain_azure_ai.chat_models import AzureAIOpenAIApiChatModel
+
+ return AzureAIOpenAIApiChatModel(model=model, **kwargs)
+ if model_provider == "cohere":
+ _check_pkg("langchain_cohere", "ChatCohere")
+ from langchain_cohere import ChatCohere
+
+ return ChatCohere(model=model, **kwargs)
+ if model_provider == "google_vertexai":
+ _check_pkg("langchain_google_vertexai", "ChatVertexAI")
+ from langchain_google_vertexai import ChatVertexAI
+
+ return ChatVertexAI(model=model, **kwargs)
+ if model_provider == "google_genai":
+ _check_pkg("langchain_google_genai", "ChatGoogleGenerativeAI")
+ from langchain_google_genai import ChatGoogleGenerativeAI
+
+ return ChatGoogleGenerativeAI(model=model, **kwargs)
+ if model_provider == "fireworks":
+ _check_pkg("langchain_fireworks", "ChatFireworks")
+ from langchain_fireworks import ChatFireworks
+
+ return ChatFireworks(model=model, **kwargs)
+ if model_provider == "ollama":
+ try:
+ _check_pkg("langchain_ollama", "ChatOllama")
+ from langchain_ollama import ChatOllama
+ except ImportError:
+ # For backwards compatibility
+ try:
+ _check_pkg("langchain_community", "ChatOllama")
+ from langchain_community.chat_models import ChatOllama
+ except ImportError:
+ # If both langchain-ollama and langchain-community aren't available,
+ # raise an error related to langchain-ollama
+ _check_pkg("langchain_ollama", "ChatOllama")
+
+ return ChatOllama(model=model, **kwargs)
+ if model_provider == "together":
+ _check_pkg("langchain_together", "ChatTogether")
+ from langchain_together import ChatTogether
+
+ return ChatTogether(model=model, **kwargs)
+ if model_provider == "mistralai":
+ _check_pkg("langchain_mistralai", "ChatMistralAI")
+ from langchain_mistralai import ChatMistralAI
+
+ return ChatMistralAI(model=model, **kwargs) # type: ignore[call-arg,unused-ignore]
+
+ if model_provider == "huggingface":
+ _check_pkg("langchain_huggingface", "ChatHuggingFace")
+ from langchain_huggingface import ChatHuggingFace
+
+ return ChatHuggingFace.from_model_id(model_id=model, **kwargs)
+
+ if model_provider == "groq":
+ _check_pkg("langchain_groq", "ChatGroq")
+ from langchain_groq import ChatGroq
+
+ return ChatGroq(model=model, **kwargs)
+ if model_provider == "bedrock":
+ _check_pkg("langchain_aws", "ChatBedrock")
+ from langchain_aws import ChatBedrock
+
+ # TODO: update to use model= once ChatBedrock supports
+ return ChatBedrock(model_id=model, **kwargs)
+ if model_provider == "bedrock_converse":
+ _check_pkg("langchain_aws", "ChatBedrockConverse")
+ from langchain_aws import ChatBedrockConverse
+
+ return ChatBedrockConverse(model=model, **kwargs)
+ if model_provider == "google_anthropic_vertex":
+ _check_pkg("langchain_google_vertexai", "ChatAnthropicVertex")
+ from langchain_google_vertexai.model_garden import ChatAnthropicVertex
+
+ return ChatAnthropicVertex(model=model, **kwargs)
+ if model_provider == "deepseek":
+ _check_pkg("langchain_deepseek", "ChatDeepSeek", pkg_kebab="langchain-deepseek")
+ from langchain_deepseek import ChatDeepSeek
+
+ return ChatDeepSeek(model=model, **kwargs)
+ if model_provider == "nvidia":
+ _check_pkg("langchain_nvidia_ai_endpoints", "ChatNVIDIA")
+ from langchain_nvidia_ai_endpoints import ChatNVIDIA
+
+ return ChatNVIDIA(model=model, **kwargs)
+ if model_provider == "ibm":
+ _check_pkg("langchain_ibm", "ChatWatsonx")
+ from langchain_ibm import ChatWatsonx
+
+ return ChatWatsonx(model_id=model, **kwargs)
+ if model_provider == "xai":
+ _check_pkg("langchain_xai", "ChatXAI")
+ from langchain_xai import ChatXAI
+
+ return ChatXAI(model=model, **kwargs)
+ if model_provider == "perplexity":
+ _check_pkg("langchain_perplexity", "ChatPerplexity")
+ from langchain_perplexity import ChatPerplexity
+
+ return ChatPerplexity(model=model, **kwargs)
+ if model_provider == "upstage":
+ _check_pkg("langchain_upstage", "ChatUpstage")
+ from langchain_upstage import ChatUpstage
+
+ return ChatUpstage(model=model, **kwargs)
+ supported = ", ".join(_SUPPORTED_PROVIDERS)
+ msg = (
+ f"Unsupported {model_provider=}.\n\nSupported model providers are: {supported}"
+ )
+ raise ValueError(msg)
+
+
+_SUPPORTED_PROVIDERS = {
+ "openai",
+ "anthropic",
+ "azure_openai",
+ "azure_ai",
+ "cohere",
+ "google_vertexai",
+ "google_genai",
+ "fireworks",
+ "ollama",
+ "together",
+ "mistralai",
+ "huggingface",
+ "groq",
+ "bedrock",
+ "bedrock_converse",
+ "google_anthropic_vertex",
+ "deepseek",
+ "ibm",
+ "xai",
+ "perplexity",
+ "upstage",
+}
+
+
+def _attempt_infer_model_provider(model_name: str) -> str | None:
+ """Attempt to infer model provider from model name.
+
+ Args:
+ model_name: The name of the model to infer provider for.
+
+ Returns:
+ The inferred provider name, or `None` if no provider could be inferred.
+ """
+ model_lower = model_name.lower()
+
+ # OpenAI models (including newer models and aliases)
+ if any(
+ model_lower.startswith(pre)
+ for pre in (
+ "gpt-",
+ "o1",
+ "o3",
+ "chatgpt",
+ "text-davinci",
+ )
+ ):
+ return "openai"
+
+ # Anthropic models
+ if model_lower.startswith("claude"):
+ return "anthropic"
+
+ # Cohere models
+ if model_lower.startswith("command"):
+ return "cohere"
+
+ # Fireworks models
+ if model_name.startswith("accounts/fireworks"):
+ return "fireworks"
+
+ # Google models
+ if model_lower.startswith("gemini"):
+ return "google_vertexai"
+
+ # AWS Bedrock models
+ if model_name.startswith("amazon.") or model_lower.startswith(
+ (
+ "anthropic.",
+ "meta.",
+ )
+ ):
+ return "bedrock"
+
+ # Mistral models
+ if model_lower.startswith(("mistral", "mixtral")):
+ return "mistralai"
+
+ # DeepSeek models
+ if model_lower.startswith("deepseek"):
+ return "deepseek"
+
+ # xAI models
+ if model_lower.startswith("grok"):
+ return "xai"
+
+ # Perplexity models
+ if model_lower.startswith("sonar"):
+ return "perplexity"
+
+ # Upstage models
+ if model_lower.startswith("solar"):
+ return "upstage"
+
+ return None
+
+
+def _parse_model(model: str, model_provider: str | None) -> tuple[str, str]:
+ """Parse model name and provider, inferring provider if necessary."""
+ if not model_provider and ":" in model:
+ prefix, suffix = model.split(":", 1)
+ if prefix in _SUPPORTED_PROVIDERS:
+ model_provider = prefix
+ model = suffix
+ else:
+ inferred = _attempt_infer_model_provider(prefix)
+ if inferred:
+ model_provider = inferred
+ model = suffix
+
+ model_provider = model_provider or _attempt_infer_model_provider(model)
+ if not model_provider:
+ supported_list = ", ".join(sorted(_SUPPORTED_PROVIDERS))
+ msg = (
+ f"Unable to infer model provider for {model=}. "
+ f"Please specify 'model_provider' directly.\n\n"
+ f"Supported providers: {supported_list}\n\n"
+ f"For help with specific providers, see: "
+ f"https://docs.langchain.com/oss/python/integrations/providers"
+ )
+ raise ValueError(msg)
+
+ # Normalize provider name
+ model_provider = model_provider.replace("-", "_").lower()
+ return model, model_provider
+
+
+def _check_pkg(pkg: str, class_name: str, *, pkg_kebab: str | None = None) -> None:
+ if not util.find_spec(pkg):
+ pkg_kebab = pkg_kebab if pkg_kebab is not None else pkg.replace("_", "-")
+ msg = (
+ f"Initializing {class_name} requires the {pkg_kebab} package. "
+ f"Please install it with `pip install {pkg_kebab}`"
+ )
+ raise ImportError(msg)
+
+
+_DECLARATIVE_METHODS = ("bind_tools", "with_structured_output")
+
+
+class _ConfigurableModel(Runnable[LanguageModelInput, Any]):
+ def __init__(
+ self,
+ *,
+ default_config: dict | None = None,
+ configurable_fields: Literal["any"] | list[str] | tuple[str, ...] = "any",
+ config_prefix: str = "",
+ queued_declarative_operations: Sequence[tuple[str, tuple, dict]] = (),
+ ) -> None:
+ self._default_config: dict = default_config or {}
+ self._configurable_fields: Literal["any"] | list[str] = (
+ configurable_fields
+ if configurable_fields == "any"
+ else list(configurable_fields)
+ )
+ self._config_prefix = (
+ config_prefix + "_"
+ if config_prefix and not config_prefix.endswith("_")
+ else config_prefix
+ )
+ self._queued_declarative_operations: list[tuple[str, tuple, dict]] = list(
+ queued_declarative_operations,
+ )
+
+ def __getattr__(self, name: str) -> Any:
+ if name in _DECLARATIVE_METHODS:
+ # Declarative operations that cannot be applied until after an actual model
+ # object is instantiated. So instead of returning the actual operation,
+ # we record the operation and its arguments in a queue. This queue is
+ # then applied in order whenever we actually instantiate the model (in
+ # self._model()).
+ def queue(*args: Any, **kwargs: Any) -> _ConfigurableModel:
+ queued_declarative_operations = list(
+ self._queued_declarative_operations,
+ )
+ queued_declarative_operations.append((name, args, kwargs))
+ return _ConfigurableModel(
+ default_config=dict(self._default_config),
+ configurable_fields=list(self._configurable_fields)
+ if isinstance(self._configurable_fields, list)
+ else self._configurable_fields,
+ config_prefix=self._config_prefix,
+ queued_declarative_operations=queued_declarative_operations,
+ )
+
+ return queue
+ if self._default_config and (model := self._model()) and hasattr(model, name):
+ return getattr(model, name)
+ msg = f"{name} is not a BaseChatModel attribute"
+ if self._default_config:
+ msg += " and is not implemented on the default model"
+ msg += "."
+ raise AttributeError(msg)
+
+ def _model(self, config: RunnableConfig | None = None) -> Runnable:
+ params = {**self._default_config, **self._model_params(config)}
+ model = _init_chat_model_helper(**params)
+ for name, args, kwargs in self._queued_declarative_operations:
+ model = getattr(model, name)(*args, **kwargs)
+ return model
+
+ def _model_params(self, config: RunnableConfig | None) -> dict:
+ config = ensure_config(config)
+ model_params = {
+ k.removeprefix(self._config_prefix): v
+ for k, v in config.get("configurable", {}).items()
+ if k.startswith(self._config_prefix)
+ }
+ if self._configurable_fields != "any":
+ model_params = {
+ k: v for k, v in model_params.items() if k in self._configurable_fields
+ }
+ return model_params
+
+ def with_config(
+ self,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> _ConfigurableModel:
+ """Bind config to a `Runnable`, returning a new `Runnable`."""
+ config = RunnableConfig(**(config or {}), **cast("RunnableConfig", kwargs))
+ model_params = self._model_params(config)
+ remaining_config = {k: v for k, v in config.items() if k != "configurable"}
+ remaining_config["configurable"] = {
+ k: v
+ for k, v in config.get("configurable", {}).items()
+ if k.removeprefix(self._config_prefix) not in model_params
+ }
+ queued_declarative_operations = list(self._queued_declarative_operations)
+ if remaining_config:
+ queued_declarative_operations.append(
+ (
+ "with_config",
+ (),
+ {"config": remaining_config},
+ ),
+ )
+ return _ConfigurableModel(
+ default_config={**self._default_config, **model_params},
+ configurable_fields=list(self._configurable_fields)
+ if isinstance(self._configurable_fields, list)
+ else self._configurable_fields,
+ config_prefix=self._config_prefix,
+ queued_declarative_operations=queued_declarative_operations,
+ )
+
+ @property
+ @override
+ def InputType(self) -> TypeAlias:
+ """Get the input type for this `Runnable`."""
+ from langchain_core.prompt_values import (
+ ChatPromptValueConcrete,
+ StringPromptValue,
+ )
+
+ # This is a version of LanguageModelInput which replaces the abstract
+ # base class BaseMessage with a union of its subclasses, which makes
+ # for a much better schema.
+ return str | StringPromptValue | ChatPromptValueConcrete | list[AnyMessage]
+
+ @override
+ def invoke(
+ self,
+ input: LanguageModelInput,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> Any:
+ return self._model(config).invoke(input, config=config, **kwargs)
+
+ @override
+ async def ainvoke(
+ self,
+ input: LanguageModelInput,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> Any:
+ return await self._model(config).ainvoke(input, config=config, **kwargs)
+
+ @override
+ def stream(
+ self,
+ input: LanguageModelInput,
+ config: RunnableConfig | None = None,
+ **kwargs: Any | None,
+ ) -> Iterator[Any]:
+ yield from self._model(config).stream(input, config=config, **kwargs)
+
+ @override
+ async def astream(
+ self,
+ input: LanguageModelInput,
+ config: RunnableConfig | None = None,
+ **kwargs: Any | None,
+ ) -> AsyncIterator[Any]:
+ async for x in self._model(config).astream(input, config=config, **kwargs):
+ yield x
+
+ def batch(
+ self,
+ inputs: list[LanguageModelInput],
+ config: RunnableConfig | list[RunnableConfig] | None = None,
+ *,
+ return_exceptions: bool = False,
+ **kwargs: Any | None,
+ ) -> list[Any]:
+ config = config or None
+ # If <= 1 config use the underlying models batch implementation.
+ if config is None or isinstance(config, dict) or len(config) <= 1:
+ if isinstance(config, list):
+ config = config[0]
+ return self._model(config).batch(
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ )
+ # If multiple configs default to Runnable.batch which uses executor to invoke
+ # in parallel.
+ return super().batch(
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ )
+
+ async def abatch(
+ self,
+ inputs: list[LanguageModelInput],
+ config: RunnableConfig | list[RunnableConfig] | None = None,
+ *,
+ return_exceptions: bool = False,
+ **kwargs: Any | None,
+ ) -> list[Any]:
+ config = config or None
+ # If <= 1 config use the underlying models batch implementation.
+ if config is None or isinstance(config, dict) or len(config) <= 1:
+ if isinstance(config, list):
+ config = config[0]
+ return await self._model(config).abatch(
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ )
+ # If multiple configs default to Runnable.batch which uses executor to invoke
+ # in parallel.
+ return await super().abatch(
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ )
+
+ def batch_as_completed(
+ self,
+ inputs: Sequence[LanguageModelInput],
+ config: RunnableConfig | Sequence[RunnableConfig] | None = None,
+ *,
+ return_exceptions: bool = False,
+ **kwargs: Any,
+ ) -> Iterator[tuple[int, Any | Exception]]:
+ config = config or None
+ # If <= 1 config use the underlying models batch implementation.
+ if config is None or isinstance(config, dict) or len(config) <= 1:
+ if isinstance(config, list):
+ config = config[0]
+ yield from self._model(cast("RunnableConfig", config)).batch_as_completed( # type: ignore[call-overload]
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ )
+ # If multiple configs default to Runnable.batch which uses executor to invoke
+ # in parallel.
+ else:
+ yield from super().batch_as_completed( # type: ignore[call-overload]
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ )
+
+ async def abatch_as_completed(
+ self,
+ inputs: Sequence[LanguageModelInput],
+ config: RunnableConfig | Sequence[RunnableConfig] | None = None,
+ *,
+ return_exceptions: bool = False,
+ **kwargs: Any,
+ ) -> AsyncIterator[tuple[int, Any]]:
+ config = config or None
+ # If <= 1 config use the underlying models batch implementation.
+ if config is None or isinstance(config, dict) or len(config) <= 1:
+ if isinstance(config, list):
+ config = config[0]
+ async for x in self._model(
+ cast("RunnableConfig", config),
+ ).abatch_as_completed( # type: ignore[call-overload]
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ ):
+ yield x
+ # If multiple configs default to Runnable.batch which uses executor to invoke
+ # in parallel.
+ else:
+ async for x in super().abatch_as_completed( # type: ignore[call-overload]
+ inputs,
+ config=config,
+ return_exceptions=return_exceptions,
+ **kwargs,
+ ):
+ yield x
+
+ @override
+ def transform(
+ self,
+ input: Iterator[LanguageModelInput],
+ config: RunnableConfig | None = None,
+ **kwargs: Any | None,
+ ) -> Iterator[Any]:
+ yield from self._model(config).transform(input, config=config, **kwargs)
+
+ @override
+ async def atransform(
+ self,
+ input: AsyncIterator[LanguageModelInput],
+ config: RunnableConfig | None = None,
+ **kwargs: Any | None,
+ ) -> AsyncIterator[Any]:
+ async for x in self._model(config).atransform(input, config=config, **kwargs):
+ yield x
+
+ @overload
+ def astream_log(
+ self,
+ input: Any,
+ config: RunnableConfig | None = None,
+ *,
+ diff: Literal[True] = True,
+ with_streamed_output_list: bool = True,
+ include_names: Sequence[str] | None = None,
+ include_types: Sequence[str] | None = None,
+ include_tags: Sequence[str] | None = None,
+ exclude_names: Sequence[str] | None = None,
+ exclude_types: Sequence[str] | None = None,
+ exclude_tags: Sequence[str] | None = None,
+ **kwargs: Any,
+ ) -> AsyncIterator[RunLogPatch]: ...
+
+ @overload
+ def astream_log(
+ self,
+ input: Any,
+ config: RunnableConfig | None = None,
+ *,
+ diff: Literal[False],
+ with_streamed_output_list: bool = True,
+ include_names: Sequence[str] | None = None,
+ include_types: Sequence[str] | None = None,
+ include_tags: Sequence[str] | None = None,
+ exclude_names: Sequence[str] | None = None,
+ exclude_types: Sequence[str] | None = None,
+ exclude_tags: Sequence[str] | None = None,
+ **kwargs: Any,
+ ) -> AsyncIterator[RunLog]: ...
+
+ @override
+ async def astream_log(
+ self,
+ input: Any,
+ config: RunnableConfig | None = None,
+ *,
+ diff: bool = True,
+ with_streamed_output_list: bool = True,
+ include_names: Sequence[str] | None = None,
+ include_types: Sequence[str] | None = None,
+ include_tags: Sequence[str] | None = None,
+ exclude_names: Sequence[str] | None = None,
+ exclude_types: Sequence[str] | None = None,
+ exclude_tags: Sequence[str] | None = None,
+ **kwargs: Any,
+ ) -> AsyncIterator[RunLogPatch] | AsyncIterator[RunLog]:
+ async for x in self._model(config).astream_log( # type: ignore[call-overload, misc]
+ input,
+ config=config,
+ diff=diff,
+ with_streamed_output_list=with_streamed_output_list,
+ include_names=include_names,
+ include_types=include_types,
+ include_tags=include_tags,
+ exclude_tags=exclude_tags,
+ exclude_types=exclude_types,
+ exclude_names=exclude_names,
+ **kwargs,
+ ):
+ yield x
+
+ @override
+ async def astream_events(
+ self,
+ input: Any,
+ config: RunnableConfig | None = None,
+ *,
+ version: Literal["v1", "v2"] = "v2",
+ include_names: Sequence[str] | None = None,
+ include_types: Sequence[str] | None = None,
+ include_tags: Sequence[str] | None = None,
+ exclude_names: Sequence[str] | None = None,
+ exclude_types: Sequence[str] | None = None,
+ exclude_tags: Sequence[str] | None = None,
+ **kwargs: Any,
+ ) -> AsyncIterator[StreamEvent]:
+ async for x in self._model(config).astream_events(
+ input,
+ config=config,
+ version=version,
+ include_names=include_names,
+ include_types=include_types,
+ include_tags=include_tags,
+ exclude_tags=exclude_tags,
+ exclude_types=exclude_types,
+ exclude_names=exclude_names,
+ **kwargs,
+ ):
+ yield x
+
+ # Explicitly added to satisfy downstream linters.
+ def bind_tools(
+ self,
+ tools: Sequence[dict[str, Any] | type[BaseModel] | Callable | BaseTool],
+ **kwargs: Any,
+ ) -> Runnable[LanguageModelInput, AIMessage]:
+ return self.__getattr__("bind_tools")(tools, **kwargs)
+
+ # Explicitly added to satisfy downstream linters.
+ def with_structured_output(
+ self,
+ schema: dict | type[BaseModel],
+ **kwargs: Any,
+ ) -> Runnable[LanguageModelInput, dict | BaseModel]:
+ return self.__getattr__("with_structured_output")(schema, **kwargs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/bedrock.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/bedrock.py
new file mode 100644
index 0000000000000000000000000000000000000000..b3781083f3453f8607b8424c585e19780725d0a1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/bedrock.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.bedrock import BedrockChat, ChatPromptAdapter
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ChatPromptAdapter": "langchain_community.chat_models.bedrock",
+ "BedrockChat": "langchain_community.chat_models.bedrock",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BedrockChat",
+ "ChatPromptAdapter",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/cohere.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/cohere.py
new file mode 100644
index 0000000000000000000000000000000000000000..b1ad6532633477a04413cccd46cc26383204f508
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/cohere.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.cohere import ChatCohere
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatCohere": "langchain_community.chat_models.cohere"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatCohere",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/databricks.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/databricks.py
new file mode 100644
index 0000000000000000000000000000000000000000..671356562fc2e8c893f805225565c45aa08f56cc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/databricks.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.databricks import ChatDatabricks
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatDatabricks": "langchain_community.chat_models.databricks"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatDatabricks",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/ernie.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/ernie.py
new file mode 100644
index 0000000000000000000000000000000000000000..518a21a87110f8d2545dfd3ff1e75665a4047985
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/ernie.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.ernie import ErnieBotChat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ErnieBotChat": "langchain_community.chat_models.ernie"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ErnieBotChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/everlyai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/everlyai.py
new file mode 100644
index 0000000000000000000000000000000000000000..dd339ba8bd2fc358f75dbe40efc7b77667976ab3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/everlyai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.everlyai import ChatEverlyAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatEverlyAI": "langchain_community.chat_models.everlyai"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatEverlyAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/fake.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/fake.py
new file mode 100644
index 0000000000000000000000000000000000000000..39e1e4e1d5f081bca7d123eb20f72a772d5ff826
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/fake.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.fake import (
+ FakeListChatModel,
+ FakeMessagesListChatModel,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "FakeMessagesListChatModel": "langchain_community.chat_models.fake",
+ "FakeListChatModel": "langchain_community.chat_models.fake",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FakeListChatModel",
+ "FakeMessagesListChatModel",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/fireworks.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/fireworks.py
new file mode 100644
index 0000000000000000000000000000000000000000..0060fca0efab636855dd3afa9b9628c97376d2e7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/fireworks.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.fireworks import ChatFireworks
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatFireworks": "langchain_community.chat_models.fireworks"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatFireworks",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/gigachat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/gigachat.py
new file mode 100644
index 0000000000000000000000000000000000000000..8fe7c67a13dd45630ba777e086824dc7e03f6a90
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/gigachat.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.gigachat import GigaChat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GigaChat": "langchain_community.chat_models.gigachat"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GigaChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/google_palm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/google_palm.py
new file mode 100644
index 0000000000000000000000000000000000000000..f0d467aa7d60d50da3bb92de6ff6bc9b52cf8d54
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/google_palm.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.google_palm import (
+ ChatGooglePalm,
+ ChatGooglePalmError,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ChatGooglePalm": "langchain_community.chat_models.google_palm",
+ "ChatGooglePalmError": "langchain_community.chat_models.google_palm",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatGooglePalm",
+ "ChatGooglePalmError",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/human.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/human.py
new file mode 100644
index 0000000000000000000000000000000000000000..0745a6ece3c39ccd4f914ed9e4b232ec6dfd1960
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/human.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.human import HumanInputChatModel
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HumanInputChatModel": "langchain_community.chat_models.human"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HumanInputChatModel",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/hunyuan.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/hunyuan.py
new file mode 100644
index 0000000000000000000000000000000000000000..3ad2ee02406f6abd95dd69ad76e20a77452aba8d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/hunyuan.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.hunyuan import ChatHunyuan
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatHunyuan": "langchain_community.chat_models.hunyuan"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatHunyuan",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/javelin_ai_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/javelin_ai_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..089734303ff9e3ce8ab03c4fc6bc4c6016a6b30f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/javelin_ai_gateway.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.javelin_ai_gateway import (
+ ChatJavelinAIGateway,
+ ChatParams,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ChatJavelinAIGateway": "langchain_community.chat_models.javelin_ai_gateway",
+ "ChatParams": "langchain_community.chat_models.javelin_ai_gateway",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatJavelinAIGateway",
+ "ChatParams",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/jinachat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/jinachat.py
new file mode 100644
index 0000000000000000000000000000000000000000..507d57e29412a3b7ab569a2284439f3ca9990034
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/jinachat.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.jinachat import JinaChat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JinaChat": "langchain_community.chat_models.jinachat"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JinaChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/konko.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/konko.py
new file mode 100644
index 0000000000000000000000000000000000000000..2635e31f89447784af33385c158f19c46f42581c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/konko.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.konko import ChatKonko
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatKonko": "langchain_community.chat_models.konko"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatKonko",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/litellm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/litellm.py
new file mode 100644
index 0000000000000000000000000000000000000000..e63cfebf5c9fb1e0175532cac3dd38dd5ac0a2ac
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/litellm.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.litellm import (
+ ChatLiteLLM,
+ ChatLiteLLMException,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ChatLiteLLM": "langchain_community.chat_models.litellm",
+ "ChatLiteLLMException": "langchain_community.chat_models.litellm",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatLiteLLM",
+ "ChatLiteLLMException",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/meta.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/meta.py
new file mode 100644
index 0000000000000000000000000000000000000000..75cd2ad4b6e7a0fc6a4e7dba3f94f1963d665207
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/meta.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.meta import convert_messages_to_prompt_llama
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "convert_messages_to_prompt_llama": "langchain_community.chat_models.meta",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "convert_messages_to_prompt_llama",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/minimax.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/minimax.py
new file mode 100644
index 0000000000000000000000000000000000000000..23de3f6cdb7ee8e056b5c0c0c41b12a2f342f246
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/minimax.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.minimax import MiniMaxChat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MiniMaxChat": "langchain_community.chat_models.minimax"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MiniMaxChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/mlflow.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/mlflow.py
new file mode 100644
index 0000000000000000000000000000000000000000..fb071660fcc9497aa36622a2c23da964bed588b4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/mlflow.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.mlflow import ChatMlflow
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatMlflow": "langchain_community.chat_models.mlflow"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatMlflow",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/mlflow_ai_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/mlflow_ai_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..ebbeb74b26db226347935c7392a2ac650d9186ce
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/mlflow_ai_gateway.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.mlflow_ai_gateway import (
+ ChatMLflowAIGateway,
+ ChatParams,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ChatMLflowAIGateway": "langchain_community.chat_models.mlflow_ai_gateway",
+ "ChatParams": "langchain_community.chat_models.mlflow_ai_gateway",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatMLflowAIGateway",
+ "ChatParams",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/ollama.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/ollama.py
new file mode 100644
index 0000000000000000000000000000000000000000..5a5bb8efd6d48fb1229d18916a946dd445829664
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/ollama.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.ollama import ChatOllama
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatOllama": "langchain_community.chat_models.ollama"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatOllama",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..f16b58bb0e689bf4288895206a263e97b7f95226
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/openai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.openai import ChatOpenAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatOpenAI": "langchain_community.chat_models.openai"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatOpenAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/pai_eas_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/pai_eas_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..416b7864a05141753f455e4e76d85e019d46a8a1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/pai_eas_endpoint.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.pai_eas_endpoint import PaiEasChatEndpoint
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "PaiEasChatEndpoint": "langchain_community.chat_models.pai_eas_endpoint",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PaiEasChatEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/promptlayer_openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/promptlayer_openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba9a0df99a9e1909ad031e7d458ebadaf80d77cb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/promptlayer_openai.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.promptlayer_openai import PromptLayerChatOpenAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "PromptLayerChatOpenAI": "langchain_community.chat_models.promptlayer_openai",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PromptLayerChatOpenAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/tongyi.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/tongyi.py
new file mode 100644
index 0000000000000000000000000000000000000000..7313f0a532e44864089a7993eb17d594cb285da3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/tongyi.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.tongyi import ChatTongyi
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatTongyi": "langchain_community.chat_models.tongyi"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatTongyi",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/vertexai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/vertexai.py
new file mode 100644
index 0000000000000000000000000000000000000000..eb60ea8ad291fae2e46b0181f7beb40c997bdb22
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/vertexai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.vertexai import ChatVertexAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatVertexAI": "langchain_community.chat_models.vertexai"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatVertexAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/volcengine_maas.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/volcengine_maas.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c853f52a8ca97aaa9751815cb6df8ac5fc714af
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/volcengine_maas.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.volcengine_maas import (
+ VolcEngineMaasChat,
+ convert_dict_to_message,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "convert_dict_to_message": "langchain_community.chat_models.volcengine_maas",
+ "VolcEngineMaasChat": "langchain_community.chat_models.volcengine_maas",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VolcEngineMaasChat",
+ "convert_dict_to_message",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/yandex.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/yandex.py
new file mode 100644
index 0000000000000000000000000000000000000000..3a2704c91f11a92d035c5c2e32d56eabc1e0fff3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/chat_models/yandex.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.chat_models.yandex import ChatYandexGPT
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatYandexGPT": "langchain_community.chat_models.yandex"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatYandexGPT",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..101255848b7986f694e17fe6e91b52bbbc8da166
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/__init__.py
@@ -0,0 +1,36 @@
+"""**Docstores** are classes to store and load Documents.
+
+The **Docstore** is a simplified version of the Document Loader.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.docstore.arbitrary_fn import DocstoreFn
+ from langchain_community.docstore.in_memory import InMemoryDocstore
+ from langchain_community.docstore.wikipedia import Wikipedia
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DocstoreFn": "langchain_community.docstore.arbitrary_fn",
+ "InMemoryDocstore": "langchain_community.docstore.in_memory",
+ "Wikipedia": "langchain_community.docstore.wikipedia",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocstoreFn",
+ "InMemoryDocstore",
+ "Wikipedia",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/arbitrary_fn.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/arbitrary_fn.py
new file mode 100644
index 0000000000000000000000000000000000000000..f99d255e94dcf8cd5e9197f97d35766b59b94ffb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/arbitrary_fn.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.docstore.arbitrary_fn import DocstoreFn
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DocstoreFn": "langchain_community.docstore.arbitrary_fn"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocstoreFn",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..9be000e4f2714c14007e376d852503c29deeef58
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/base.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.docstore.base import AddableMixin, Docstore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Docstore": "langchain_community.docstore.base",
+ "AddableMixin": "langchain_community.docstore.base",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AddableMixin",
+ "Docstore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/document.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/document.py
new file mode 100644
index 0000000000000000000000000000000000000000..88aebd279509aa19084281e0a84e647ee39b1849
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/document.py
@@ -0,0 +1,3 @@
+from langchain_core.documents import Document
+
+__all__ = ["Document"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/in_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/in_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..37805e50df3ccb047646defc41ea2b25078ca4f4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/in_memory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.docstore.in_memory import InMemoryDocstore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"InMemoryDocstore": "langchain_community.docstore.in_memory"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "InMemoryDocstore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/wikipedia.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/wikipedia.py
new file mode 100644
index 0000000000000000000000000000000000000000..55d04f00f2291ca8fb0bc31756fdc8129b1471cc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/docstore/wikipedia.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.docstore.wikipedia import Wikipedia
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Wikipedia": "langchain_community.docstore.wikipedia"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Wikipedia",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..58ae5d5342d92972c62eda03104744deb9faea94
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/__init__.py
@@ -0,0 +1,541 @@
+"""**Document Loaders** are classes to load Documents.
+
+**Document Loaders** are usually used to load a lot of Documents in a single run.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ AcreomLoader,
+ AirbyteCDKLoader,
+ AirbyteGongLoader,
+ AirbyteHubspotLoader,
+ AirbyteJSONLoader,
+ AirbyteSalesforceLoader,
+ AirbyteShopifyLoader,
+ AirbyteStripeLoader,
+ AirbyteTypeformLoader,
+ AirbyteZendeskSupportLoader,
+ AirtableLoader,
+ AmazonTextractPDFLoader,
+ ApifyDatasetLoader,
+ ArcGISLoader,
+ ArxivLoader,
+ AssemblyAIAudioTranscriptLoader,
+ AsyncChromiumLoader,
+ AsyncHtmlLoader,
+ AZLyricsLoader,
+ AzureAIDataLoader,
+ AzureBlobStorageContainerLoader,
+ AzureBlobStorageFileLoader,
+ BibtexLoader,
+ BigQueryLoader,
+ BiliBiliLoader,
+ BlackboardLoader,
+ BlockchainDocumentLoader,
+ BraveSearchLoader,
+ BrowserlessLoader,
+ BSHTMLLoader,
+ ChatGPTLoader,
+ CollegeConfidentialLoader,
+ ConcurrentLoader,
+ ConfluenceLoader,
+ CoNLLULoader,
+ CouchbaseLoader,
+ CSVLoader,
+ CubeSemanticLoader,
+ DatadogLogsLoader,
+ DataFrameLoader,
+ DiffbotLoader,
+ DirectoryLoader,
+ DiscordChatLoader,
+ DocugamiLoader,
+ DocusaurusLoader,
+ Docx2txtLoader,
+ DropboxLoader,
+ DuckDBLoader,
+ EtherscanLoader,
+ EverNoteLoader,
+ FacebookChatLoader,
+ FaunaLoader,
+ FigmaFileLoader,
+ FileSystemBlobLoader,
+ GCSDirectoryLoader,
+ GCSFileLoader,
+ GeoDataFrameLoader,
+ GitbookLoader,
+ GithubFileLoader,
+ GitHubIssuesLoader,
+ GitLoader,
+ GoogleApiClient,
+ GoogleApiYoutubeLoader,
+ GoogleDriveLoader,
+ GoogleSpeechToTextLoader,
+ GutenbergLoader,
+ HNLoader,
+ HuggingFaceDatasetLoader,
+ IFixitLoader,
+ ImageCaptionLoader,
+ IMSDbLoader,
+ IuguLoader,
+ JoplinLoader,
+ JSONLoader,
+ LakeFSLoader,
+ LarkSuiteDocLoader,
+ MastodonTootsLoader,
+ MathpixPDFLoader,
+ MaxComputeLoader,
+ MergedDataLoader,
+ MHTMLLoader,
+ ModernTreasuryLoader,
+ MongodbLoader,
+ MWDumpLoader,
+ NewsURLLoader,
+ NotebookLoader,
+ NotionDBLoader,
+ NotionDirectoryLoader,
+ OBSDirectoryLoader,
+ OBSFileLoader,
+ ObsidianLoader,
+ OneDriveFileLoader,
+ OneDriveLoader,
+ OnlinePDFLoader,
+ OpenCityDataLoader,
+ OutlookMessageLoader,
+ PagedPDFSplitter,
+ PDFMinerLoader,
+ PDFMinerPDFasHTMLLoader,
+ PDFPlumberLoader,
+ PlaywrightURLLoader,
+ PolarsDataFrameLoader,
+ PsychicLoader,
+ PubMedLoader,
+ PyMuPDFLoader,
+ PyPDFDirectoryLoader,
+ PyPDFium2Loader,
+ PyPDFLoader,
+ PySparkDataFrameLoader,
+ PythonLoader,
+ ReadTheDocsLoader,
+ RecursiveUrlLoader,
+ RedditPostsLoader,
+ RoamLoader,
+ RocksetLoader,
+ RSSFeedLoader,
+ S3DirectoryLoader,
+ S3FileLoader,
+ SeleniumURLLoader,
+ SharePointLoader,
+ SitemapLoader,
+ SlackDirectoryLoader,
+ SnowflakeLoader,
+ SpreedlyLoader,
+ SRTLoader,
+ StripeLoader,
+ TelegramChatApiLoader,
+ TelegramChatFileLoader,
+ TelegramChatLoader,
+ TencentCOSDirectoryLoader,
+ TencentCOSFileLoader,
+ TensorflowDatasetLoader,
+ TextLoader,
+ ToMarkdownLoader,
+ TomlLoader,
+ TrelloLoader,
+ TwitterTweetLoader,
+ UnstructuredAPIFileIOLoader,
+ UnstructuredAPIFileLoader,
+ UnstructuredCSVLoader,
+ UnstructuredEmailLoader,
+ UnstructuredEPubLoader,
+ UnstructuredExcelLoader,
+ UnstructuredFileIOLoader,
+ UnstructuredFileLoader,
+ UnstructuredHTMLLoader,
+ UnstructuredImageLoader,
+ UnstructuredMarkdownLoader,
+ UnstructuredODTLoader,
+ UnstructuredOrgModeLoader,
+ UnstructuredPDFLoader,
+ UnstructuredPowerPointLoader,
+ UnstructuredRSTLoader,
+ UnstructuredRTFLoader,
+ UnstructuredTSVLoader,
+ UnstructuredURLLoader,
+ UnstructuredWordDocumentLoader,
+ UnstructuredXMLLoader,
+ WeatherDataLoader,
+ WebBaseLoader,
+ WhatsAppChatLoader,
+ WikipediaLoader,
+ XorbitsLoader,
+ YoutubeAudioLoader,
+ YoutubeLoader,
+ YuqueLoader,
+ )
+
+from langchain_core.document_loaders import Blob, BlobLoader
+
+# For backwards compatibility
+_old_to_new_name = {
+ "PagedPDFSplitter": "PyPDFLoader",
+ "TelegramChatLoader": "TelegramChatFileLoader",
+}
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AcreomLoader": "langchain_community.document_loaders",
+ "AsyncHtmlLoader": "langchain_community.document_loaders",
+ "AsyncChromiumLoader": "langchain_community.document_loaders",
+ "AZLyricsLoader": "langchain_community.document_loaders",
+ "AirbyteCDKLoader": "langchain_community.document_loaders",
+ "AirbyteGongLoader": "langchain_community.document_loaders",
+ "AirbyteJSONLoader": "langchain_community.document_loaders",
+ "AirbyteHubspotLoader": "langchain_community.document_loaders",
+ "AirbyteSalesforceLoader": "langchain_community.document_loaders",
+ "AirbyteShopifyLoader": "langchain_community.document_loaders",
+ "AirbyteStripeLoader": "langchain_community.document_loaders",
+ "AirbyteTypeformLoader": "langchain_community.document_loaders",
+ "AirbyteZendeskSupportLoader": "langchain_community.document_loaders",
+ "AirtableLoader": "langchain_community.document_loaders",
+ "AmazonTextractPDFLoader": "langchain_community.document_loaders",
+ "ApifyDatasetLoader": "langchain_community.document_loaders",
+ "ArcGISLoader": "langchain_community.document_loaders",
+ "ArxivLoader": "langchain_community.document_loaders",
+ "AssemblyAIAudioTranscriptLoader": "langchain_community.document_loaders",
+ "AzureAIDataLoader": "langchain_community.document_loaders",
+ "AzureBlobStorageContainerLoader": "langchain_community.document_loaders",
+ "AzureBlobStorageFileLoader": "langchain_community.document_loaders",
+ "BSHTMLLoader": "langchain_community.document_loaders",
+ "BibtexLoader": "langchain_community.document_loaders",
+ "BigQueryLoader": "langchain_community.document_loaders",
+ "BiliBiliLoader": "langchain_community.document_loaders",
+ "BlackboardLoader": "langchain_community.document_loaders",
+ "Blob": "langchain_community.document_loaders",
+ "BlobLoader": "langchain_community.document_loaders",
+ "BlockchainDocumentLoader": "langchain_community.document_loaders",
+ "BraveSearchLoader": "langchain_community.document_loaders",
+ "BrowserlessLoader": "langchain_community.document_loaders",
+ "CSVLoader": "langchain_community.document_loaders",
+ "ChatGPTLoader": "langchain_community.document_loaders",
+ "CoNLLULoader": "langchain_community.document_loaders",
+ "CollegeConfidentialLoader": "langchain_community.document_loaders",
+ "ConcurrentLoader": "langchain_community.document_loaders",
+ "ConfluenceLoader": "langchain_community.document_loaders",
+ "CouchbaseLoader": "langchain_community.document_loaders",
+ "CubeSemanticLoader": "langchain_community.document_loaders",
+ "DataFrameLoader": "langchain_community.document_loaders",
+ "DatadogLogsLoader": "langchain_community.document_loaders",
+ "DiffbotLoader": "langchain_community.document_loaders",
+ "DirectoryLoader": "langchain_community.document_loaders",
+ "DiscordChatLoader": "langchain_community.document_loaders",
+ "DocugamiLoader": "langchain_community.document_loaders",
+ "DocusaurusLoader": "langchain_community.document_loaders",
+ "Docx2txtLoader": "langchain_community.document_loaders",
+ "DropboxLoader": "langchain_community.document_loaders",
+ "DuckDBLoader": "langchain_community.document_loaders",
+ "EtherscanLoader": "langchain_community.document_loaders",
+ "EverNoteLoader": "langchain_community.document_loaders",
+ "FacebookChatLoader": "langchain_community.document_loaders",
+ "FaunaLoader": "langchain_community.document_loaders",
+ "FigmaFileLoader": "langchain_community.document_loaders",
+ "FileSystemBlobLoader": "langchain_community.document_loaders",
+ "GCSDirectoryLoader": "langchain_community.document_loaders",
+ "GCSFileLoader": "langchain_community.document_loaders",
+ "GeoDataFrameLoader": "langchain_community.document_loaders",
+ "GitHubIssuesLoader": "langchain_community.document_loaders",
+ "GitLoader": "langchain_community.document_loaders",
+ "GithubFileLoader": "langchain_community.document_loaders",
+ "GitbookLoader": "langchain_community.document_loaders",
+ "GoogleApiClient": "langchain_community.document_loaders",
+ "GoogleApiYoutubeLoader": "langchain_community.document_loaders",
+ "GoogleSpeechToTextLoader": "langchain_community.document_loaders",
+ "GoogleDriveLoader": "langchain_community.document_loaders",
+ "GutenbergLoader": "langchain_community.document_loaders",
+ "HNLoader": "langchain_community.document_loaders",
+ "HuggingFaceDatasetLoader": "langchain_community.document_loaders",
+ "IFixitLoader": "langchain_community.document_loaders",
+ "IMSDbLoader": "langchain_community.document_loaders",
+ "ImageCaptionLoader": "langchain_community.document_loaders",
+ "IuguLoader": "langchain_community.document_loaders",
+ "JSONLoader": "langchain_community.document_loaders",
+ "JoplinLoader": "langchain_community.document_loaders",
+ "LarkSuiteDocLoader": "langchain_community.document_loaders",
+ "LakeFSLoader": "langchain_community.document_loaders",
+ "MHTMLLoader": "langchain_community.document_loaders",
+ "MWDumpLoader": "langchain_community.document_loaders",
+ "MastodonTootsLoader": "langchain_community.document_loaders",
+ "MathpixPDFLoader": "langchain_community.document_loaders",
+ "MaxComputeLoader": "langchain_community.document_loaders",
+ "MergedDataLoader": "langchain_community.document_loaders",
+ "ModernTreasuryLoader": "langchain_community.document_loaders",
+ "MongodbLoader": "langchain_community.document_loaders",
+ "NewsURLLoader": "langchain_community.document_loaders",
+ "NotebookLoader": "langchain_community.document_loaders",
+ "NotionDBLoader": "langchain_community.document_loaders",
+ "NotionDirectoryLoader": "langchain_community.document_loaders",
+ "OBSDirectoryLoader": "langchain_community.document_loaders",
+ "OBSFileLoader": "langchain_community.document_loaders",
+ "ObsidianLoader": "langchain_community.document_loaders",
+ "OneDriveFileLoader": "langchain_community.document_loaders",
+ "OneDriveLoader": "langchain_community.document_loaders",
+ "OnlinePDFLoader": "langchain_community.document_loaders",
+ "OpenCityDataLoader": "langchain_community.document_loaders",
+ "OutlookMessageLoader": "langchain_community.document_loaders",
+ "PagedPDFSplitter": "langchain_community.document_loaders",
+ "PDFMinerLoader": "langchain_community.document_loaders",
+ "PDFMinerPDFasHTMLLoader": "langchain_community.document_loaders",
+ "PDFPlumberLoader": "langchain_community.document_loaders",
+ "PlaywrightURLLoader": "langchain_community.document_loaders",
+ "PolarsDataFrameLoader": "langchain_community.document_loaders",
+ "PsychicLoader": "langchain_community.document_loaders",
+ "PubMedLoader": "langchain_community.document_loaders",
+ "PyMuPDFLoader": "langchain_community.document_loaders",
+ "PyPDFDirectoryLoader": "langchain_community.document_loaders",
+ "PyPDFium2Loader": "langchain_community.document_loaders",
+ "PyPDFLoader": "langchain_community.document_loaders",
+ "PySparkDataFrameLoader": "langchain_community.document_loaders",
+ "PythonLoader": "langchain_community.document_loaders",
+ "ReadTheDocsLoader": "langchain_community.document_loaders",
+ "RecursiveUrlLoader": "langchain_community.document_loaders",
+ "RedditPostsLoader": "langchain_community.document_loaders",
+ "RSSFeedLoader": "langchain_community.document_loaders",
+ "RoamLoader": "langchain_community.document_loaders",
+ "RocksetLoader": "langchain_community.document_loaders",
+ "S3DirectoryLoader": "langchain_community.document_loaders",
+ "S3FileLoader": "langchain_community.document_loaders",
+ "SRTLoader": "langchain_community.document_loaders",
+ "SeleniumURLLoader": "langchain_community.document_loaders",
+ "SharePointLoader": "langchain_community.document_loaders",
+ "SitemapLoader": "langchain_community.document_loaders",
+ "SlackDirectoryLoader": "langchain_community.document_loaders",
+ "SnowflakeLoader": "langchain_community.document_loaders",
+ "SpreedlyLoader": "langchain_community.document_loaders",
+ "StripeLoader": "langchain_community.document_loaders",
+ "TelegramChatLoader": "langchain_community.document_loaders",
+ "TelegramChatApiLoader": "langchain_community.document_loaders",
+ "TelegramChatFileLoader": "langchain_community.document_loaders",
+ "TensorflowDatasetLoader": "langchain_community.document_loaders",
+ "TencentCOSDirectoryLoader": "langchain_community.document_loaders",
+ "TencentCOSFileLoader": "langchain_community.document_loaders",
+ "TextLoader": "langchain_community.document_loaders",
+ "ToMarkdownLoader": "langchain_community.document_loaders",
+ "TomlLoader": "langchain_community.document_loaders",
+ "TrelloLoader": "langchain_community.document_loaders",
+ "TwitterTweetLoader": "langchain_community.document_loaders",
+ "UnstructuredAPIFileIOLoader": "langchain_community.document_loaders",
+ "UnstructuredAPIFileLoader": "langchain_community.document_loaders",
+ "UnstructuredCSVLoader": "langchain_community.document_loaders",
+ "UnstructuredEPubLoader": "langchain_community.document_loaders",
+ "UnstructuredEmailLoader": "langchain_community.document_loaders",
+ "UnstructuredExcelLoader": "langchain_community.document_loaders",
+ "UnstructuredFileIOLoader": "langchain_community.document_loaders",
+ "UnstructuredFileLoader": "langchain_community.document_loaders",
+ "UnstructuredHTMLLoader": "langchain_community.document_loaders",
+ "UnstructuredImageLoader": "langchain_community.document_loaders",
+ "UnstructuredMarkdownLoader": "langchain_community.document_loaders",
+ "UnstructuredODTLoader": "langchain_community.document_loaders",
+ "UnstructuredOrgModeLoader": "langchain_community.document_loaders",
+ "UnstructuredPDFLoader": "langchain_community.document_loaders",
+ "UnstructuredPowerPointLoader": "langchain_community.document_loaders",
+ "UnstructuredRSTLoader": "langchain_community.document_loaders",
+ "UnstructuredRTFLoader": "langchain_community.document_loaders",
+ "UnstructuredTSVLoader": "langchain_community.document_loaders",
+ "UnstructuredURLLoader": "langchain_community.document_loaders",
+ "UnstructuredWordDocumentLoader": "langchain_community.document_loaders",
+ "UnstructuredXMLLoader": "langchain_community.document_loaders",
+ "WeatherDataLoader": "langchain_community.document_loaders",
+ "WebBaseLoader": "langchain_community.document_loaders",
+ "WhatsAppChatLoader": "langchain_community.document_loaders",
+ "WikipediaLoader": "langchain_community.document_loaders",
+ "XorbitsLoader": "langchain_community.document_loaders",
+ "YoutubeAudioLoader": "langchain_community.document_loaders",
+ "YoutubeLoader": "langchain_community.document_loaders",
+ "YuqueLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AZLyricsLoader",
+ "AcreomLoader",
+ "AcreomLoader",
+ "AirbyteCDKLoader",
+ "AirbyteGongLoader",
+ "AirbyteHubspotLoader",
+ "AirbyteJSONLoader",
+ "AirbyteSalesforceLoader",
+ "AirbyteShopifyLoader",
+ "AirbyteStripeLoader",
+ "AirbyteTypeformLoader",
+ "AirbyteZendeskSupportLoader",
+ "AirtableLoader",
+ "AmazonTextractPDFLoader",
+ "ApifyDatasetLoader",
+ "ArcGISLoader",
+ "ArxivLoader",
+ "AssemblyAIAudioTranscriptLoader",
+ "AsyncChromiumLoader",
+ "AsyncHtmlLoader",
+ "AsyncHtmlLoader",
+ "AzureAIDataLoader",
+ "AzureBlobStorageContainerLoader",
+ "AzureBlobStorageFileLoader",
+ "BSHTMLLoader",
+ "BibtexLoader",
+ "BigQueryLoader",
+ "BiliBiliLoader",
+ "BlackboardLoader",
+ "Blob",
+ "BlobLoader",
+ "BlockchainDocumentLoader",
+ "BraveSearchLoader",
+ "BrowserlessLoader",
+ "CSVLoader",
+ "ChatGPTLoader",
+ "CoNLLULoader",
+ "CollegeConfidentialLoader",
+ "ConcurrentLoader",
+ "ConfluenceLoader",
+ "CouchbaseLoader",
+ "CubeSemanticLoader",
+ "DataFrameLoader",
+ "DatadogLogsLoader",
+ "DiffbotLoader",
+ "DirectoryLoader",
+ "DiscordChatLoader",
+ "DocugamiLoader",
+ "DocusaurusLoader",
+ "Docx2txtLoader",
+ "DropboxLoader",
+ "DuckDBLoader",
+ "EtherscanLoader",
+ "EverNoteLoader",
+ "FacebookChatLoader",
+ "FaunaLoader",
+ "FigmaFileLoader",
+ "FileSystemBlobLoader",
+ "GCSDirectoryLoader",
+ "GCSFileLoader",
+ "GeoDataFrameLoader",
+ "GitHubIssuesLoader",
+ "GitLoader",
+ "GitbookLoader",
+ "GithubFileLoader",
+ "GoogleApiClient",
+ "GoogleApiYoutubeLoader",
+ "GoogleDriveLoader",
+ "GoogleSpeechToTextLoader",
+ "GutenbergLoader",
+ "HNLoader",
+ "HuggingFaceDatasetLoader",
+ "IFixitLoader",
+ "IMSDbLoader",
+ "ImageCaptionLoader",
+ "IuguLoader",
+ "JSONLoader",
+ "JoplinLoader",
+ "LakeFSLoader",
+ "LarkSuiteDocLoader",
+ "MHTMLLoader",
+ "MWDumpLoader",
+ "MastodonTootsLoader",
+ "MathpixPDFLoader",
+ "MaxComputeLoader",
+ "MergedDataLoader",
+ "ModernTreasuryLoader",
+ "MongodbLoader",
+ "NewsURLLoader",
+ "NotebookLoader",
+ "NotionDBLoader",
+ "NotionDirectoryLoader",
+ "OBSDirectoryLoader",
+ "OBSFileLoader",
+ "ObsidianLoader",
+ "OneDriveFileLoader",
+ "OneDriveLoader",
+ "OnlinePDFLoader",
+ "OpenCityDataLoader",
+ "OutlookMessageLoader",
+ "PDFMinerLoader",
+ "PDFMinerPDFasHTMLLoader",
+ "PDFPlumberLoader",
+ "PagedPDFSplitter",
+ "PlaywrightURLLoader",
+ "PolarsDataFrameLoader",
+ "PsychicLoader",
+ "PubMedLoader",
+ "PyMuPDFLoader",
+ "PyPDFDirectoryLoader",
+ "PyPDFLoader",
+ "PyPDFium2Loader",
+ "PySparkDataFrameLoader",
+ "PythonLoader",
+ "RSSFeedLoader",
+ "ReadTheDocsLoader",
+ "RecursiveUrlLoader",
+ "RedditPostsLoader",
+ "RoamLoader",
+ "RocksetLoader",
+ "S3DirectoryLoader",
+ "S3FileLoader",
+ "SRTLoader",
+ "SeleniumURLLoader",
+ "SharePointLoader",
+ "SitemapLoader",
+ "SlackDirectoryLoader",
+ "SnowflakeLoader",
+ "SpreedlyLoader",
+ "StripeLoader",
+ "TelegramChatApiLoader",
+ "TelegramChatFileLoader",
+ "TelegramChatLoader",
+ "TencentCOSDirectoryLoader",
+ "TencentCOSFileLoader",
+ "TensorflowDatasetLoader",
+ "TextLoader",
+ "ToMarkdownLoader",
+ "TomlLoader",
+ "TrelloLoader",
+ "TwitterTweetLoader",
+ "UnstructuredAPIFileIOLoader",
+ "UnstructuredAPIFileLoader",
+ "UnstructuredCSVLoader",
+ "UnstructuredEPubLoader",
+ "UnstructuredEmailLoader",
+ "UnstructuredExcelLoader",
+ "UnstructuredFileIOLoader",
+ "UnstructuredFileLoader",
+ "UnstructuredHTMLLoader",
+ "UnstructuredImageLoader",
+ "UnstructuredMarkdownLoader",
+ "UnstructuredODTLoader",
+ "UnstructuredOrgModeLoader",
+ "UnstructuredPDFLoader",
+ "UnstructuredPowerPointLoader",
+ "UnstructuredRSTLoader",
+ "UnstructuredRTFLoader",
+ "UnstructuredTSVLoader",
+ "UnstructuredURLLoader",
+ "UnstructuredWordDocumentLoader",
+ "UnstructuredXMLLoader",
+ "WeatherDataLoader",
+ "WebBaseLoader",
+ "WhatsAppChatLoader",
+ "WikipediaLoader",
+ "XorbitsLoader",
+ "YoutubeAudioLoader",
+ "YoutubeLoader",
+ "YuqueLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/acreom.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/acreom.py
new file mode 100644
index 0000000000000000000000000000000000000000..d21ccf4c39591e70dc6357302cdb06b4db8f0b2f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/acreom.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AcreomLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AcreomLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AcreomLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airbyte.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airbyte.py
new file mode 100644
index 0000000000000000000000000000000000000000..55357bf312b469606722dd6d7d6c75326e2ca0f7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airbyte.py
@@ -0,0 +1,48 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ AirbyteCDKLoader,
+ AirbyteGongLoader,
+ AirbyteHubspotLoader,
+ AirbyteSalesforceLoader,
+ AirbyteShopifyLoader,
+ AirbyteStripeLoader,
+ AirbyteTypeformLoader,
+ AirbyteZendeskSupportLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AirbyteCDKLoader": "langchain_community.document_loaders",
+ "AirbyteHubspotLoader": "langchain_community.document_loaders",
+ "AirbyteStripeLoader": "langchain_community.document_loaders",
+ "AirbyteTypeformLoader": "langchain_community.document_loaders",
+ "AirbyteZendeskSupportLoader": "langchain_community.document_loaders",
+ "AirbyteShopifyLoader": "langchain_community.document_loaders",
+ "AirbyteSalesforceLoader": "langchain_community.document_loaders",
+ "AirbyteGongLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AirbyteCDKLoader",
+ "AirbyteGongLoader",
+ "AirbyteHubspotLoader",
+ "AirbyteSalesforceLoader",
+ "AirbyteShopifyLoader",
+ "AirbyteStripeLoader",
+ "AirbyteTypeformLoader",
+ "AirbyteZendeskSupportLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airbyte_json.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airbyte_json.py
new file mode 100644
index 0000000000000000000000000000000000000000..031565a98aeae2b87fc2b14426158aeeb6f4620c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airbyte_json.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AirbyteJSONLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AirbyteJSONLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AirbyteJSONLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airtable.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airtable.py
new file mode 100644
index 0000000000000000000000000000000000000000..28c4dae0a44e289b9cc2439398e17ba023972690
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/airtable.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AirtableLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AirtableLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AirtableLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/apify_dataset.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/apify_dataset.py
new file mode 100644
index 0000000000000000000000000000000000000000..df4211ca825830994fac4f70a81519673e52fb16
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/apify_dataset.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ApifyDatasetLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ApifyDatasetLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ApifyDatasetLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/arcgis_loader.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/arcgis_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..68821e0843667d10f41d1ca731b21fcf635031fe
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/arcgis_loader.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ArcGISLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ArcGISLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArcGISLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/arxiv.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/arxiv.py
new file mode 100644
index 0000000000000000000000000000000000000000..caae8b00fb5613182d1f011b3189c5dd37a287d5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/arxiv.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ArxivLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ArxivLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArxivLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/assemblyai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/assemblyai.py
new file mode 100644
index 0000000000000000000000000000000000000000..a1cc304b3ad9867650e904dc699cbf70f89d9afb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/assemblyai.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AssemblyAIAudioTranscriptLoader
+ from langchain_community.document_loaders.assemblyai import TranscriptFormat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "TranscriptFormat": "langchain_community.document_loaders.assemblyai",
+ "AssemblyAIAudioTranscriptLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AssemblyAIAudioTranscriptLoader",
+ "TranscriptFormat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/async_html.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/async_html.py
new file mode 100644
index 0000000000000000000000000000000000000000..fdd3e8f71e7b0e5ca304e3f848d7699caabb087d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/async_html.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AsyncHtmlLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AsyncHtmlLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AsyncHtmlLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azlyrics.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azlyrics.py
new file mode 100644
index 0000000000000000000000000000000000000000..1b7e4b96e2927236f910c3da6f44d85016b9dc60
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azlyrics.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AZLyricsLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AZLyricsLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AZLyricsLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_ai_data.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_ai_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..b3bb67d69c361e10d0936b4e9fb96c00046f98cc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_ai_data.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AzureAIDataLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AzureAIDataLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureAIDataLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_blob_storage_container.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_blob_storage_container.py
new file mode 100644
index 0000000000000000000000000000000000000000..d9a92a90984de075470c08c61d6015071ba29776
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_blob_storage_container.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AzureBlobStorageContainerLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AzureBlobStorageContainerLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureBlobStorageContainerLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_blob_storage_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_blob_storage_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..dd2e1844f68d5b85ab3e9027c6c38c74adbf5d0f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/azure_blob_storage_file.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AzureBlobStorageFileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AzureBlobStorageFileLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureBlobStorageFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/baiducloud_bos_directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/baiducloud_bos_directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..8782ec1cf0c41f69aa9eb11294291648e3a4b5b5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/baiducloud_bos_directory.py
@@ -0,0 +1,29 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.baiducloud_bos_directory import (
+ BaiduBOSDirectoryLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaiduBOSDirectoryLoader": (
+ "langchain_community.document_loaders.baiducloud_bos_directory"
+ ),
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BaiduBOSDirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/baiducloud_bos_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/baiducloud_bos_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..3ef7c4bf2cdaa1c5e3e0f7e7781044e21e8656f1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/baiducloud_bos_file.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.baiducloud_bos_file import (
+ BaiduBOSFileLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaiduBOSFileLoader": "langchain_community.document_loaders.baiducloud_bos_file",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BaiduBOSFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac8e0565a5392fa9bd9a3fec74ff7994993c93c9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/base.py
@@ -0,0 +1,3 @@
+from langchain_core.document_loaders import BaseBlobParser, BaseLoader
+
+__all__ = ["BaseBlobParser", "BaseLoader"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/base_o365.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/base_o365.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f7b4ba39fd5e2b13f66a7b1d6b0604ecf42e491
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/base_o365.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.base_o365 import O365BaseLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"O365BaseLoader": "langchain_community.document_loaders.base_o365"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "O365BaseLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bibtex.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bibtex.py
new file mode 100644
index 0000000000000000000000000000000000000000..ec0a019104f797dd23dee761a146aa5c64769eda
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bibtex.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BibtexLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BibtexLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BibtexLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bigquery.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bigquery.py
new file mode 100644
index 0000000000000000000000000000000000000000..0df01c6167017e3f28b78353e18e9fadf4d88e29
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bigquery.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BigQueryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BigQueryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BigQueryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bilibili.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bilibili.py
new file mode 100644
index 0000000000000000000000000000000000000000..5fe1ad904a208ed0c6e2cc2f09abcf906fb940db
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/bilibili.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BiliBiliLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BiliBiliLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BiliBiliLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/blackboard.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/blackboard.py
new file mode 100644
index 0000000000000000000000000000000000000000..c280d4c4c1caf66bab25474851cba69f25a6fe79
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/blackboard.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BlackboardLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BlackboardLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BlackboardLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/blockchain.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/blockchain.py
new file mode 100644
index 0000000000000000000000000000000000000000..36bb87731b966a953d68bd3571deb8485e573a09
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/blockchain.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BlockchainDocumentLoader
+ from langchain_community.document_loaders.blockchain import BlockchainType
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BlockchainType": "langchain_community.document_loaders.blockchain",
+ "BlockchainDocumentLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BlockchainDocumentLoader",
+ "BlockchainType",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/brave_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/brave_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..527f45057650ca4730a12435a8a879c1cb2b68d9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/brave_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BraveSearchLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BraveSearchLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BraveSearchLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/browserless.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/browserless.py
new file mode 100644
index 0000000000000000000000000000000000000000..2f3aa2fa35a0d8c6d7d45efc40a280d7b655d92d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/browserless.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BrowserlessLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BrowserlessLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BrowserlessLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/chatgpt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/chatgpt.py
new file mode 100644
index 0000000000000000000000000000000000000000..5ead9f27bd6ed1ebcf9b4b7eaa6280e1b5cf32a6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/chatgpt.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ChatGPTLoader
+ from langchain_community.document_loaders.chatgpt import concatenate_rows
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "concatenate_rows": "langchain_community.document_loaders.chatgpt",
+ "ChatGPTLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatGPTLoader",
+ "concatenate_rows",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/chromium.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/chromium.py
new file mode 100644
index 0000000000000000000000000000000000000000..7c66492503de03ae703b745400b0e3be46d21fff
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/chromium.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import AsyncChromiumLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AsyncChromiumLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AsyncChromiumLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/college_confidential.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/college_confidential.py
new file mode 100644
index 0000000000000000000000000000000000000000..157d11b8bf9291cf646c3800229079b70fa49e35
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/college_confidential.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import CollegeConfidentialLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CollegeConfidentialLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CollegeConfidentialLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/concurrent.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/concurrent.py
new file mode 100644
index 0000000000000000000000000000000000000000..f39bc6a7d4a6ffef9524b49fb5398b459fbad4bb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/concurrent.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ConcurrentLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ConcurrentLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ConcurrentLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/confluence.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/confluence.py
new file mode 100644
index 0000000000000000000000000000000000000000..98cc5145145e2b8728334bc0df2b875ae89a0344
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/confluence.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ConfluenceLoader
+ from langchain_community.document_loaders.confluence import ContentFormat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ContentFormat": "langchain_community.document_loaders.confluence",
+ "ConfluenceLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ConfluenceLoader",
+ "ContentFormat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/conllu.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/conllu.py
new file mode 100644
index 0000000000000000000000000000000000000000..dcb89a096d83d1f773209827ce349782994020ff
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/conllu.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import CoNLLULoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CoNLLULoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CoNLLULoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/couchbase.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/couchbase.py
new file mode 100644
index 0000000000000000000000000000000000000000..dae7b99d96fec491353475026e3e319eece8d119
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/couchbase.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import CouchbaseLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CouchbaseLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CouchbaseLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/csv_loader.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/csv_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..8569597164152fff37f6a787cfcc7c5eccd164ee
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/csv_loader.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import CSVLoader, UnstructuredCSVLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CSVLoader": "langchain_community.document_loaders",
+ "UnstructuredCSVLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CSVLoader",
+ "UnstructuredCSVLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/cube_semantic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/cube_semantic.py
new file mode 100644
index 0000000000000000000000000000000000000000..1be132c032befefae7802a0aa7b08c55bfff5b08
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/cube_semantic.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import CubeSemanticLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CubeSemanticLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CubeSemanticLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/datadog_logs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/datadog_logs.py
new file mode 100644
index 0000000000000000000000000000000000000000..64c026946717cb80f54c211c54d807687bdcc912
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/datadog_logs.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DatadogLogsLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DatadogLogsLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DatadogLogsLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/dataframe.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/dataframe.py
new file mode 100644
index 0000000000000000000000000000000000000000..8ab30d9e39e28325d08bbf07c57bab7bf97312ce
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/dataframe.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DataFrameLoader
+ from langchain_community.document_loaders.dataframe import BaseDataFrameLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaseDataFrameLoader": "langchain_community.document_loaders.dataframe",
+ "DataFrameLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BaseDataFrameLoader",
+ "DataFrameLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/diffbot.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/diffbot.py
new file mode 100644
index 0000000000000000000000000000000000000000..cb3935fd410023593e37e73a7a4a4eeb5257d8b9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/diffbot.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DiffbotLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DiffbotLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DiffbotLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..9b007f5eb1d89194f83a89959dae1f53c52e8d95
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/directory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DirectoryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/discord.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/discord.py
new file mode 100644
index 0000000000000000000000000000000000000000..3098083aabd33331ec82458fb6d377152602d0b0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/discord.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DiscordChatLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DiscordChatLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DiscordChatLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/docugami.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/docugami.py
new file mode 100644
index 0000000000000000000000000000000000000000..342a8944c9200857a3dffb5599ffb152bbe0c4fc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/docugami.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DocugamiLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DocugamiLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocugamiLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/docusaurus.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/docusaurus.py
new file mode 100644
index 0000000000000000000000000000000000000000..4643eb673725e2e7eeefadf35149404a0d2a1e99
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/docusaurus.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DocusaurusLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DocusaurusLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocusaurusLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/dropbox.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/dropbox.py
new file mode 100644
index 0000000000000000000000000000000000000000..e882120cb2fa9904d659f8b0963fc86c6e5bda33
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/dropbox.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DropboxLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DropboxLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DropboxLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/duckdb_loader.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/duckdb_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..3011b479fb9e4d78d688c9ae5ad1e64d497ec22b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/duckdb_loader.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import DuckDBLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DuckDBLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DuckDBLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/email.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/email.py
new file mode 100644
index 0000000000000000000000000000000000000000..134914d28deb956c631821b98fbe760a8ebeb328
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/email.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ OutlookMessageLoader,
+ UnstructuredEmailLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "UnstructuredEmailLoader": "langchain_community.document_loaders",
+ "OutlookMessageLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OutlookMessageLoader",
+ "UnstructuredEmailLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/epub.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/epub.py
new file mode 100644
index 0000000000000000000000000000000000000000..6581f4548272d248465d0ead6c3576854b9e7c3d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/epub.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredEPubLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredEPubLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredEPubLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/etherscan.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/etherscan.py
new file mode 100644
index 0000000000000000000000000000000000000000..9b390e50e48cfa658cd31ecf16b0266b69c61d28
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/etherscan.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import EtherscanLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"EtherscanLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EtherscanLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/evernote.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/evernote.py
new file mode 100644
index 0000000000000000000000000000000000000000..f60c3aa180ff91e09924682bf911c43a35d78378
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/evernote.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import EverNoteLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"EverNoteLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EverNoteLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/excel.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/excel.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f1fb843f480c92c9607a73bfd810354c721c184
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/excel.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredExcelLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredExcelLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredExcelLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/facebook_chat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/facebook_chat.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e8f81856db260ec1ec8d1d68707ee8e9c8eb498
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/facebook_chat.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import FacebookChatLoader
+ from langchain_community.document_loaders.facebook_chat import concatenate_rows
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "concatenate_rows": "langchain_community.document_loaders.facebook_chat",
+ "FacebookChatLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FacebookChatLoader",
+ "concatenate_rows",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/fauna.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/fauna.py
new file mode 100644
index 0000000000000000000000000000000000000000..12c8294b458102f87f06d2c46abf1f3d68622097
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/fauna.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import FaunaLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"FaunaLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FaunaLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/figma.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/figma.py
new file mode 100644
index 0000000000000000000000000000000000000000..1267c5725d9331d95c25cc747d94f40669ce7373
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/figma.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import FigmaFileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"FigmaFileLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FigmaFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gcs_directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gcs_directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f303895c7e64ee8ab906c760535c844c6d14a1d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gcs_directory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GCSDirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GCSDirectoryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GCSDirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gcs_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gcs_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..a89004cf6f838abb84eeb2ff8d8362d77565b686
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gcs_file.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GCSFileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GCSFileLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GCSFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/generic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/generic.py
new file mode 100644
index 0000000000000000000000000000000000000000..389e0a352a59895ad4767ff34076c5d9692ad2bb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/generic.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.generic import GenericLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GenericLoader": "langchain_community.document_loaders.generic"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GenericLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/geodataframe.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/geodataframe.py
new file mode 100644
index 0000000000000000000000000000000000000000..e5312a79d57daaab1508dcf42a8de7f59e49089b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/geodataframe.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GeoDataFrameLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GeoDataFrameLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GeoDataFrameLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/git.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/git.py
new file mode 100644
index 0000000000000000000000000000000000000000..a7bd679d225be747c8baaa363cb628c1c638471d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/git.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GitLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GitLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GitLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gitbook.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gitbook.py
new file mode 100644
index 0000000000000000000000000000000000000000..2fe63e48af3704239532c6e1c0ccb3bce1fba4e9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gitbook.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GitbookLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GitbookLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GitbookLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/github.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/github.py
new file mode 100644
index 0000000000000000000000000000000000000000..fcbaf005850b99c6c293f3f966a968cd5ccd4db6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/github.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GitHubIssuesLoader
+ from langchain_community.document_loaders.github import BaseGitHubLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaseGitHubLoader": "langchain_community.document_loaders.github",
+ "GitHubIssuesLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BaseGitHubLoader",
+ "GitHubIssuesLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/google_speech_to_text.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/google_speech_to_text.py
new file mode 100644
index 0000000000000000000000000000000000000000..d7131d2599253ef980f0f7d6dd92df867832cae2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/google_speech_to_text.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GoogleSpeechToTextLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleSpeechToTextLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleSpeechToTextLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/googledrive.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/googledrive.py
new file mode 100644
index 0000000000000000000000000000000000000000..34f8298d3fad818cbd96c144cf25ac956b5b35f7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/googledrive.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GoogleDriveLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleDriveLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleDriveLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gutenberg.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gutenberg.py
new file mode 100644
index 0000000000000000000000000000000000000000..69c59b0240cc53c9cf0e9d92b58844db2ab9702e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/gutenberg.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import GutenbergLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GutenbergLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GutenbergLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/helpers.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/helpers.py
new file mode 100644
index 0000000000000000000000000000000000000000..9b360f165c969be862bc0d874f6986923b452e31
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/helpers.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.helpers import (
+ FileEncoding,
+ detect_file_encodings,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "FileEncoding": "langchain_community.document_loaders.helpers",
+ "detect_file_encodings": "langchain_community.document_loaders.helpers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FileEncoding",
+ "detect_file_encodings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/hn.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/hn.py
new file mode 100644
index 0000000000000000000000000000000000000000..a19bd3d0476f773ef4fd3f8fcba59d1759735230
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/hn.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import HNLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HNLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HNLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/html.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/html.py
new file mode 100644
index 0000000000000000000000000000000000000000..73109b886b028b88d59f604dc2157835d4bc1734
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/html.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredHTMLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredHTMLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredHTMLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/html_bs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/html_bs.py
new file mode 100644
index 0000000000000000000000000000000000000000..dfd56b07904710428ff5b84af01ff0f055beebbc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/html_bs.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import BSHTMLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BSHTMLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BSHTMLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/hugging_face_dataset.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/hugging_face_dataset.py
new file mode 100644
index 0000000000000000000000000000000000000000..ecad7679cf2012fccdb5c4bce303095fac99967a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/hugging_face_dataset.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import HuggingFaceDatasetLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HuggingFaceDatasetLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFaceDatasetLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/ifixit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/ifixit.py
new file mode 100644
index 0000000000000000000000000000000000000000..941016d73d0fd665ed8d11d3bf9e8f38598a8d77
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/ifixit.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import IFixitLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"IFixitLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "IFixitLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/image.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/image.py
new file mode 100644
index 0000000000000000000000000000000000000000..994331d4727fcabe58947eb76f5abe108092f1a8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/image.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredImageLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredImageLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredImageLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/image_captions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/image_captions.py
new file mode 100644
index 0000000000000000000000000000000000000000..3f257973930244f74bfc5ae27127ee650ef6900c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/image_captions.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ImageCaptionLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ImageCaptionLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ImageCaptionLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/imsdb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/imsdb.py
new file mode 100644
index 0000000000000000000000000000000000000000..e2bf9ed26f4389477e822aa86edf5ff5b6200eee
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/imsdb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import IMSDbLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"IMSDbLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "IMSDbLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/iugu.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/iugu.py
new file mode 100644
index 0000000000000000000000000000000000000000..3b5b75d640de64d7fd680554825edbedea66c788
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/iugu.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import IuguLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"IuguLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "IuguLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/joplin.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/joplin.py
new file mode 100644
index 0000000000000000000000000000000000000000..cea9c00d99ae66541062d4bbbde8a01dbd066e2f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/joplin.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import JoplinLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JoplinLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JoplinLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/json_loader.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/json_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..02dc7d929b01dc6c533039fd658d2bf9a8df7dc7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/json_loader.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import JSONLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JSONLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JSONLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/lakefs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/lakefs.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f467c2e9992b1ee61e7f1134bd35afa6850c906
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/lakefs.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import LakeFSLoader
+ from langchain_community.document_loaders.lakefs import (
+ LakeFSClient,
+ UnstructuredLakeFSLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LakeFSClient": "langchain_community.document_loaders.lakefs",
+ "LakeFSLoader": "langchain_community.document_loaders",
+ "UnstructuredLakeFSLoader": "langchain_community.document_loaders.lakefs",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LakeFSClient",
+ "LakeFSLoader",
+ "UnstructuredLakeFSLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/larksuite.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/larksuite.py
new file mode 100644
index 0000000000000000000000000000000000000000..950e2573afdf18ebf8b80479b7e23c46047ac75b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/larksuite.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import LarkSuiteDocLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LarkSuiteDocLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LarkSuiteDocLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/markdown.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/markdown.py
new file mode 100644
index 0000000000000000000000000000000000000000..68776865a189f4ce8b0e1900b369fdb4df20028f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/markdown.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredMarkdownLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "UnstructuredMarkdownLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredMarkdownLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mastodon.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mastodon.py
new file mode 100644
index 0000000000000000000000000000000000000000..25ff1e08d6799ebea60a653b93b0cc8dcbf9433a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mastodon.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import MastodonTootsLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MastodonTootsLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MastodonTootsLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/max_compute.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/max_compute.py
new file mode 100644
index 0000000000000000000000000000000000000000..4dddb05f1d339d141628eceef071986330da748c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/max_compute.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import MaxComputeLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MaxComputeLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MaxComputeLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mediawikidump.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mediawikidump.py
new file mode 100644
index 0000000000000000000000000000000000000000..368fbfd74c2ab0fc88113382c6914b1421ceca5f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mediawikidump.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import MWDumpLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MWDumpLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MWDumpLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/merge.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/merge.py
new file mode 100644
index 0000000000000000000000000000000000000000..5a634d4f45a9cd890ad2daf0a3e87e0970836f27
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/merge.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import MergedDataLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MergedDataLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MergedDataLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mhtml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mhtml.py
new file mode 100644
index 0000000000000000000000000000000000000000..06f35cc9997634710cbf2055f760f17b82a8f251
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mhtml.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import MHTMLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MHTMLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MHTMLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/modern_treasury.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/modern_treasury.py
new file mode 100644
index 0000000000000000000000000000000000000000..fe7c0eddfb3c56055127053cc6a4e7c64dce162c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/modern_treasury.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ModernTreasuryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ModernTreasuryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ModernTreasuryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mongodb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mongodb.py
new file mode 100644
index 0000000000000000000000000000000000000000..ff75252393d6eaf2c1ce29f2f153da7f9f25cc6c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/mongodb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import MongodbLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MongodbLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MongodbLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/news.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/news.py
new file mode 100644
index 0000000000000000000000000000000000000000..12fd2ab05e6bef7901db0c523e8858332742f1a2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/news.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import NewsURLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NewsURLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NewsURLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notebook.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notebook.py
new file mode 100644
index 0000000000000000000000000000000000000000..78d5f0e8e2d0ba4882563af14673ed97263c6fd1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notebook.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import NotebookLoader
+ from langchain_community.document_loaders.notebook import (
+ concatenate_cells,
+ remove_newlines,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "concatenate_cells": "langchain_community.document_loaders.notebook",
+ "remove_newlines": "langchain_community.document_loaders.notebook",
+ "NotebookLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NotebookLoader",
+ "concatenate_cells",
+ "remove_newlines",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notion.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notion.py
new file mode 100644
index 0000000000000000000000000000000000000000..06554dbf1174662059335e46f0abdbeffbcbce4c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notion.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import NotionDirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NotionDirectoryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NotionDirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notiondb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notiondb.py
new file mode 100644
index 0000000000000000000000000000000000000000..83d415cb72aa0aa60984c1202ec09d7a852bb8fe
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/notiondb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import NotionDBLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NotionDBLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NotionDBLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/nuclia.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/nuclia.py
new file mode 100644
index 0000000000000000000000000000000000000000..6d896e618a3459969f3d0b5db2467afda8b2b1f9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/nuclia.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.nuclia import NucliaLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NucliaLoader": "langchain_community.document_loaders.nuclia"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NucliaLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obs_directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obs_directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..98736ab07dd547f0c2ec30399becdd3b2ae59e34
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obs_directory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import OBSDirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OBSDirectoryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OBSDirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obs_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obs_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..9dd783ceafeaf5f889806e18573ece782870fcfb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obs_file.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import OBSFileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OBSFileLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OBSFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obsidian.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obsidian.py
new file mode 100644
index 0000000000000000000000000000000000000000..3625476bfef27fa76f2ddc44e855e40ad81f3eec
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/obsidian.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ObsidianLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ObsidianLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ObsidianLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/odt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/odt.py
new file mode 100644
index 0000000000000000000000000000000000000000..2558d9aa9850d6da630319698c535538a45e988c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/odt.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredODTLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredODTLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredODTLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onedrive.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onedrive.py
new file mode 100644
index 0000000000000000000000000000000000000000..91599e2cc25d9ef6156e18bc6cc4f8beb30f1f9d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onedrive.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import OneDriveLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OneDriveLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OneDriveLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onedrive_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onedrive_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..d717a0a2ad3d5bac401dac97b1fc283e7276a006
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onedrive_file.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import OneDriveFileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OneDriveFileLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OneDriveFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onenote.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onenote.py
new file mode 100644
index 0000000000000000000000000000000000000000..e6cd72f715bc7808607b11f0a903fd9b73d3f9e6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/onenote.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.onenote import OneNoteLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OneNoteLoader": "langchain_community.document_loaders.onenote"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OneNoteLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/open_city_data.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/open_city_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..2f761203b9451c1111bec9c4fa4554bfb86e046d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/open_city_data.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import OpenCityDataLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpenCityDataLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenCityDataLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/org_mode.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/org_mode.py
new file mode 100644
index 0000000000000000000000000000000000000000..67cb7b4c7469b18bf48fa76827d45a5d50cdb750
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/org_mode.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredOrgModeLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "UnstructuredOrgModeLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredOrgModeLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pdf.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pdf.py
new file mode 100644
index 0000000000000000000000000000000000000000..745ebd9da4ffbecc49b2f16845a29e1ccf05cfb1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pdf.py
@@ -0,0 +1,65 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ AmazonTextractPDFLoader,
+ MathpixPDFLoader,
+ OnlinePDFLoader,
+ PagedPDFSplitter,
+ PDFMinerLoader,
+ PDFMinerPDFasHTMLLoader,
+ PDFPlumberLoader,
+ PyMuPDFLoader,
+ PyPDFDirectoryLoader,
+ PyPDFium2Loader,
+ UnstructuredPDFLoader,
+ )
+ from langchain_community.document_loaders.pdf import (
+ BasePDFLoader,
+ DocumentIntelligenceLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "UnstructuredPDFLoader": "langchain_community.document_loaders",
+ "BasePDFLoader": "langchain_community.document_loaders.pdf",
+ "OnlinePDFLoader": "langchain_community.document_loaders",
+ "PagedPDFSplitter": "langchain_community.document_loaders",
+ "PyPDFium2Loader": "langchain_community.document_loaders",
+ "PyPDFDirectoryLoader": "langchain_community.document_loaders",
+ "PDFMinerLoader": "langchain_community.document_loaders",
+ "PDFMinerPDFasHTMLLoader": "langchain_community.document_loaders",
+ "PyMuPDFLoader": "langchain_community.document_loaders",
+ "MathpixPDFLoader": "langchain_community.document_loaders",
+ "PDFPlumberLoader": "langchain_community.document_loaders",
+ "AmazonTextractPDFLoader": "langchain_community.document_loaders",
+ "DocumentIntelligenceLoader": "langchain_community.document_loaders.pdf",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AmazonTextractPDFLoader",
+ "BasePDFLoader",
+ "DocumentIntelligenceLoader",
+ "MathpixPDFLoader",
+ "OnlinePDFLoader",
+ "PDFMinerLoader",
+ "PDFMinerPDFasHTMLLoader",
+ "PDFPlumberLoader",
+ "PagedPDFSplitter",
+ "PyMuPDFLoader",
+ "PyPDFDirectoryLoader",
+ "PyPDFium2Loader",
+ "UnstructuredPDFLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/polars_dataframe.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/polars_dataframe.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb0bb1acfb9ead51ab6da78383376b74b55900be
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/polars_dataframe.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import PolarsDataFrameLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PolarsDataFrameLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PolarsDataFrameLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/powerpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/powerpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..81dec8db64ceebd053944a228468dac445b90260
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/powerpoint.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredPowerPointLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "UnstructuredPowerPointLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredPowerPointLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/psychic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/psychic.py
new file mode 100644
index 0000000000000000000000000000000000000000..74d53edd5a6601e1c614a25a3bf31fc31f09da07
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/psychic.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import PsychicLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PsychicLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PsychicLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pubmed.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pubmed.py
new file mode 100644
index 0000000000000000000000000000000000000000..da58dfddb1790b519f16fb05cd874ba9e5f75cd3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pubmed.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import PubMedLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PubMedLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PubMedLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pyspark_dataframe.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pyspark_dataframe.py
new file mode 100644
index 0000000000000000000000000000000000000000..a9d4c4d84452d4db0a787e8f92ad02ea7a024363
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/pyspark_dataframe.py
@@ -0,0 +1,26 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.pyspark_dataframe import (
+ PySparkDataFrameLoader,
+ )
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "PySparkDataFrameLoader": "langchain_community.document_loaders.pyspark_dataframe",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = ["PySparkDataFrameLoader"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/python.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/python.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed50f46836863e9cf743e632812c54697eaeac3c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/python.py
@@ -0,0 +1,22 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.python import PythonLoader
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PythonLoader": "langchain_community.document_loaders.python"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = ["PythonLoader"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/quip.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/quip.py
new file mode 100644
index 0000000000000000000000000000000000000000..31d5359bb0c8ed8acc057d9aeae39605ee9cbfe8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/quip.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.quip import QuipLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"QuipLoader": "langchain_community.document_loaders.quip"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "QuipLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/readthedocs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/readthedocs.py
new file mode 100644
index 0000000000000000000000000000000000000000..e9226b80a8645e33fdf7ca5f78be0b4758a09223
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/readthedocs.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ReadTheDocsLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ReadTheDocsLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ReadTheDocsLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/recursive_url_loader.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/recursive_url_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..036cc81a83009704051c85f045cb05956cadb681
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/recursive_url_loader.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import RecursiveUrlLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RecursiveUrlLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RecursiveUrlLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/reddit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/reddit.py
new file mode 100644
index 0000000000000000000000000000000000000000..364b6d93c3540a8ad41807d998cba9204b7c7d53
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/reddit.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import RedditPostsLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RedditPostsLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RedditPostsLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/roam.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/roam.py
new file mode 100644
index 0000000000000000000000000000000000000000..f6426e0e695aded13f3c59387ba9b6b509235971
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/roam.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import RoamLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RoamLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RoamLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rocksetdb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rocksetdb.py
new file mode 100644
index 0000000000000000000000000000000000000000..dbadd21b23b2f873c3911de3378e77faef17a7d6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rocksetdb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import RocksetLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RocksetLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RocksetLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rspace.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rspace.py
new file mode 100644
index 0000000000000000000000000000000000000000..cea5d5cd1ea0c9a7542d47a6cf10c97ee1575f4e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rspace.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders.rspace import RSpaceLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RSpaceLoader": "langchain_community.document_loaders.rspace"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RSpaceLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rss.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rss.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e0c9ac86228c57fa47d282788142579abd42253
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rss.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import RSSFeedLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RSSFeedLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RSSFeedLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rst.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rst.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd63e225588adb683f6a312f783685ad01e674e5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rst.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredRSTLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredRSTLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredRSTLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rtf.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rtf.py
new file mode 100644
index 0000000000000000000000000000000000000000..cf0815c161d446bcb397fbef350d5d1f4e1547d3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/rtf.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredRTFLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredRTFLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredRTFLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/s3_directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/s3_directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..28e7f619ddd8f3a1d1ce63d57314ddf1b1aaf350
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/s3_directory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import S3DirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"S3DirectoryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "S3DirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/s3_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/s3_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..fa1a9912c45675f51b371a9c1eafd43b2b2c7d65
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/s3_file.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import S3FileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"S3FileLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "S3FileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/sharepoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/sharepoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..0426c86bb1c323efa54966ef6f4582a304bfe829
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/sharepoint.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SharePointLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SharePointLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SharePointLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/sitemap.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/sitemap.py
new file mode 100644
index 0000000000000000000000000000000000000000..fa6b230c9bda2a5c174c7254d5a300da6d53caa8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/sitemap.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SitemapLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SitemapLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SitemapLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/slack_directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/slack_directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..2eadaab9b87c6374070f20b0a44c0626ef277704
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/slack_directory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SlackDirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SlackDirectoryLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SlackDirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/snowflake_loader.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/snowflake_loader.py
new file mode 100644
index 0000000000000000000000000000000000000000..8916e4b1047cb454902aaf162ba0ebe1e26eec6d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/snowflake_loader.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SnowflakeLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SnowflakeLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SnowflakeLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/spreedly.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/spreedly.py
new file mode 100644
index 0000000000000000000000000000000000000000..a4386b05d9f0c4e2515d8fd99e08b794c2fa7251
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/spreedly.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SpreedlyLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SpreedlyLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SpreedlyLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/srt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/srt.py
new file mode 100644
index 0000000000000000000000000000000000000000..f126824e1c73d3a115baf4fbfe09948ebfe902b8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/srt.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SRTLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SRTLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SRTLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/stripe.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/stripe.py
new file mode 100644
index 0000000000000000000000000000000000000000..b633570d3402f355d756863cd20c3fdc7bf4ac34
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/stripe.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import StripeLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"StripeLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "StripeLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/telegram.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/telegram.py
new file mode 100644
index 0000000000000000000000000000000000000000..9048f6c2623cf049b98ea8af47c0fb16414d2782
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/telegram.py
@@ -0,0 +1,38 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ TelegramChatApiLoader,
+ TelegramChatFileLoader,
+ )
+ from langchain_community.document_loaders.telegram import (
+ concatenate_rows,
+ text_to_docs,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "concatenate_rows": "langchain_community.document_loaders.telegram",
+ "TelegramChatFileLoader": "langchain_community.document_loaders",
+ "text_to_docs": "langchain_community.document_loaders.telegram",
+ "TelegramChatApiLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TelegramChatApiLoader",
+ "TelegramChatFileLoader",
+ "concatenate_rows",
+ "text_to_docs",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tencent_cos_directory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tencent_cos_directory.py
new file mode 100644
index 0000000000000000000000000000000000000000..7a3eb300298889715ac607d56ef48bad52cddda4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tencent_cos_directory.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TencentCOSDirectoryLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "TencentCOSDirectoryLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TencentCOSDirectoryLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tencent_cos_file.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tencent_cos_file.py
new file mode 100644
index 0000000000000000000000000000000000000000..65b99fb6807ddf1461820653b801cd56c8e178fd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tencent_cos_file.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TencentCOSFileLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TencentCOSFileLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TencentCOSFileLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tensorflow_datasets.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tensorflow_datasets.py
new file mode 100644
index 0000000000000000000000000000000000000000..b4b3b7450d9ede3d5239f970b90d838ffda3e15e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tensorflow_datasets.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TensorflowDatasetLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TensorflowDatasetLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TensorflowDatasetLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/text.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/text.py
new file mode 100644
index 0000000000000000000000000000000000000000..b41c71fe571c093a220d4f5438cf8ac1a2fa25b9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/text.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TextLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TextLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TextLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tomarkdown.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tomarkdown.py
new file mode 100644
index 0000000000000000000000000000000000000000..3c95abd6e98ef9221f3a96b9115650cc58204049
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tomarkdown.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import ToMarkdownLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ToMarkdownLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ToMarkdownLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/toml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/toml.py
new file mode 100644
index 0000000000000000000000000000000000000000..5b1cf593dce2644151584a37fee069f8235bc259
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/toml.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TomlLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TomlLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TomlLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/trello.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/trello.py
new file mode 100644
index 0000000000000000000000000000000000000000..6fa5d1b5b5ac0889469c4a3852a0392664e675ef
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/trello.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TrelloLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TrelloLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TrelloLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tsv.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tsv.py
new file mode 100644
index 0000000000000000000000000000000000000000..d2e1dc6adf77dbe5cf6c21be9dbf7441eb1695cd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/tsv.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredTSVLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredTSVLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredTSVLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/twitter.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/twitter.py
new file mode 100644
index 0000000000000000000000000000000000000000..4ca11753d0d476b6586789a69e248da1983a8197
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/twitter.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import TwitterTweetLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TwitterTweetLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TwitterTweetLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/unstructured.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/unstructured.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e8fa764c63a9ccaa6b1397e202326b516c613db
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/unstructured.py
@@ -0,0 +1,54 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ UnstructuredAPIFileIOLoader,
+ UnstructuredAPIFileLoader,
+ UnstructuredFileIOLoader,
+ UnstructuredFileLoader,
+ )
+ from langchain_community.document_loaders.unstructured import (
+ UnstructuredBaseLoader,
+ get_elements_from_api,
+ satisfies_min_unstructured_version,
+ validate_unstructured_version,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "satisfies_min_unstructured_version": (
+ "langchain_community.document_loaders.unstructured"
+ ),
+ "validate_unstructured_version": (
+ "langchain_community.document_loaders.unstructured"
+ ),
+ "UnstructuredBaseLoader": "langchain_community.document_loaders.unstructured",
+ "UnstructuredFileLoader": "langchain_community.document_loaders",
+ "get_elements_from_api": "langchain_community.document_loaders.unstructured",
+ "UnstructuredAPIFileLoader": "langchain_community.document_loaders",
+ "UnstructuredFileIOLoader": "langchain_community.document_loaders",
+ "UnstructuredAPIFileIOLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredAPIFileIOLoader",
+ "UnstructuredAPIFileLoader",
+ "UnstructuredBaseLoader",
+ "UnstructuredFileIOLoader",
+ "UnstructuredFileLoader",
+ "get_elements_from_api",
+ "satisfies_min_unstructured_version",
+ "validate_unstructured_version",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url.py
new file mode 100644
index 0000000000000000000000000000000000000000..45d05a3e2667d1a666f74e97e1017543cf7dff30
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredURLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredURLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredURLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url_playwright.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url_playwright.py
new file mode 100644
index 0000000000000000000000000000000000000000..69257aebbc35379342ef0415c18c285320ef1c3c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url_playwright.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import PlaywrightURLLoader
+ from langchain_community.document_loaders.url_playwright import (
+ PlaywrightEvaluator,
+ UnstructuredHtmlEvaluator,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "PlaywrightEvaluator": "langchain_community.document_loaders.url_playwright",
+ "UnstructuredHtmlEvaluator": "langchain_community.document_loaders.url_playwright",
+ "PlaywrightURLLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PlaywrightEvaluator",
+ "PlaywrightURLLoader",
+ "UnstructuredHtmlEvaluator",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url_selenium.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url_selenium.py
new file mode 100644
index 0000000000000000000000000000000000000000..b245c9bbc3e8d7f75311b3cdc2d793137db4c0d4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/url_selenium.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import SeleniumURLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SeleniumURLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SeleniumURLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/weather.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/weather.py
new file mode 100644
index 0000000000000000000000000000000000000000..9ce8a13798e3324679857c30cd0cae1612320e12
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/weather.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import WeatherDataLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WeatherDataLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WeatherDataLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/web_base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/web_base.py
new file mode 100644
index 0000000000000000000000000000000000000000..f748ea24249b78a74a48622ba20768b7dedd56a3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/web_base.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import WebBaseLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WebBaseLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WebBaseLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/whatsapp_chat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/whatsapp_chat.py
new file mode 100644
index 0000000000000000000000000000000000000000..29408056b5cf07b749797499a108ce6200150c66
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/whatsapp_chat.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import WhatsAppChatLoader
+ from langchain_community.document_loaders.whatsapp_chat import concatenate_rows
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "concatenate_rows": "langchain_community.document_loaders.whatsapp_chat",
+ "WhatsAppChatLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WhatsAppChatLoader",
+ "concatenate_rows",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/wikipedia.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/wikipedia.py
new file mode 100644
index 0000000000000000000000000000000000000000..b5a51cb46ffaba7847790259ca2c52596ae9f4e8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/wikipedia.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import WikipediaLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WikipediaLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WikipediaLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/word_document.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/word_document.py
new file mode 100644
index 0000000000000000000000000000000000000000..036a096d08787dba14809421dc138ee018b43731
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/word_document.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ Docx2txtLoader,
+ UnstructuredWordDocumentLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Docx2txtLoader": "langchain_community.document_loaders",
+ "UnstructuredWordDocumentLoader": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Docx2txtLoader",
+ "UnstructuredWordDocumentLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/xml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/xml.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d885994f647c83155447960bb60bf225b9ff7f2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/xml.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import UnstructuredXMLLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"UnstructuredXMLLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UnstructuredXMLLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/xorbits.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/xorbits.py
new file mode 100644
index 0000000000000000000000000000000000000000..b11ef2706ea347ed8d91e6e42888ac01cd0ff6eb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/xorbits.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import XorbitsLoader
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"XorbitsLoader": "langchain_community.document_loaders"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "XorbitsLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/youtube.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/youtube.py
new file mode 100644
index 0000000000000000000000000000000000000000..baa4d50f266618c1c9348940e598df7168fc8fa1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_loaders/youtube.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_loaders import (
+ GoogleApiClient,
+ GoogleApiYoutubeLoader,
+ YoutubeLoader,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "YoutubeLoader": "langchain_community.document_loaders",
+ "GoogleApiYoutubeLoader": "langchain_community.document_loaders",
+ "GoogleApiClient": "langchain_community.document_loaders",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleApiClient",
+ "GoogleApiYoutubeLoader",
+ "YoutubeLoader",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..20e3460c70ec2a102208541803837e01641d2fd8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/__init__.py
@@ -0,0 +1,65 @@
+"""**Document Transformers** are classes to transform Documents.
+
+**Document Transformers** usually used to transform a lot of Documents in a single run.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import (
+ BeautifulSoupTransformer,
+ DoctranPropertyExtractor,
+ DoctranQATransformer,
+ DoctranTextTranslator,
+ EmbeddingsClusteringFilter,
+ EmbeddingsRedundantFilter,
+ GoogleTranslateTransformer,
+ Html2TextTransformer,
+ LongContextReorder,
+ NucliaTextTransformer,
+ OpenAIMetadataTagger,
+ get_stateful_documents,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BeautifulSoupTransformer": "langchain_community.document_transformers",
+ "DoctranQATransformer": "langchain_community.document_transformers",
+ "DoctranTextTranslator": "langchain_community.document_transformers",
+ "DoctranPropertyExtractor": "langchain_community.document_transformers",
+ "EmbeddingsClusteringFilter": "langchain_community.document_transformers",
+ "EmbeddingsRedundantFilter": "langchain_community.document_transformers",
+ "GoogleTranslateTransformer": "langchain_community.document_transformers",
+ "get_stateful_documents": "langchain_community.document_transformers",
+ "LongContextReorder": "langchain_community.document_transformers",
+ "NucliaTextTransformer": "langchain_community.document_transformers",
+ "OpenAIMetadataTagger": "langchain_community.document_transformers",
+ "Html2TextTransformer": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BeautifulSoupTransformer",
+ "DoctranPropertyExtractor",
+ "DoctranQATransformer",
+ "DoctranTextTranslator",
+ "EmbeddingsClusteringFilter",
+ "EmbeddingsRedundantFilter",
+ "GoogleTranslateTransformer",
+ "Html2TextTransformer",
+ "LongContextReorder",
+ "NucliaTextTransformer",
+ "OpenAIMetadataTagger",
+ "get_stateful_documents",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/beautiful_soup_transformer.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/beautiful_soup_transformer.py
new file mode 100644
index 0000000000000000000000000000000000000000..648e0527b0ab04be3df55f9a4f5d057b1f56198e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/beautiful_soup_transformer.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import BeautifulSoupTransformer
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BeautifulSoupTransformer": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BeautifulSoupTransformer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_extract.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_extract.py
new file mode 100644
index 0000000000000000000000000000000000000000..d14e4cb9077d80fb13acea8fddc09b8e41b02542
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_extract.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import DoctranPropertyExtractor
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DoctranPropertyExtractor": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DoctranPropertyExtractor",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_qa.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_qa.py
new file mode 100644
index 0000000000000000000000000000000000000000..a88d95b95218c23e5074539a22a86b629ea34b06
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_qa.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import DoctranQATransformer
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DoctranQATransformer": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DoctranQATransformer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_translate.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_translate.py
new file mode 100644
index 0000000000000000000000000000000000000000..f450a1725109a73ae768a8be8a954676116fb67e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/doctran_text_translate.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import DoctranTextTranslator
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DoctranTextTranslator": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DoctranTextTranslator",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/embeddings_redundant_filter.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/embeddings_redundant_filter.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb8de213ddb828d7e579d1eac932be9ff112e815
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/embeddings_redundant_filter.py
@@ -0,0 +1,50 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import (
+ EmbeddingsClusteringFilter,
+ EmbeddingsRedundantFilter,
+ get_stateful_documents,
+ )
+ from langchain_community.document_transformers.embeddings_redundant_filter import (
+ _DocumentWithState,
+ _filter_similar_embeddings,
+ _get_embeddings_from_stateful_docs,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "EmbeddingsRedundantFilter": "langchain_community.document_transformers",
+ "EmbeddingsClusteringFilter": "langchain_community.document_transformers",
+ "_DocumentWithState": (
+ "langchain_community.document_transformers.embeddings_redundant_filter"
+ ),
+ "get_stateful_documents": "langchain_community.document_transformers",
+ "_get_embeddings_from_stateful_docs": (
+ "langchain_community.document_transformers.embeddings_redundant_filter"
+ ),
+ "_filter_similar_embeddings": (
+ "langchain_community.document_transformers.embeddings_redundant_filter"
+ ),
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EmbeddingsClusteringFilter",
+ "EmbeddingsRedundantFilter",
+ "_DocumentWithState",
+ "_filter_similar_embeddings",
+ "_get_embeddings_from_stateful_docs",
+ "get_stateful_documents",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/google_translate.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/google_translate.py
new file mode 100644
index 0000000000000000000000000000000000000000..632685d96052a72608e5f5cee9ee063ed273d2b6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/google_translate.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import GoogleTranslateTransformer
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GoogleTranslateTransformer": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleTranslateTransformer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/html2text.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/html2text.py
new file mode 100644
index 0000000000000000000000000000000000000000..f9e8f66fd837a90316c91e6545c6ef7ccbce8768
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/html2text.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import Html2TextTransformer
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Html2TextTransformer": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Html2TextTransformer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/long_context_reorder.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/long_context_reorder.py
new file mode 100644
index 0000000000000000000000000000000000000000..e0d0af10d75400ba661086b2d222becfb0901462
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/long_context_reorder.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import LongContextReorder
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LongContextReorder": "langchain_community.document_transformers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LongContextReorder",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/nuclia_text_transform.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/nuclia_text_transform.py
new file mode 100644
index 0000000000000000000000000000000000000000..1d0036bca1f817fad3d88ca212b96d07edffa5db
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/nuclia_text_transform.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import NucliaTextTransformer
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "NucliaTextTransformer": "langchain_community.document_transformers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NucliaTextTransformer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/openai_functions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/openai_functions.py
new file mode 100644
index 0000000000000000000000000000000000000000..3c0068f1aa53cfde007b46e1631ed82390414461
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/document_transformers/openai_functions.py
@@ -0,0 +1,32 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.document_transformers import OpenAIMetadataTagger
+ from langchain_community.document_transformers.openai_functions import (
+ create_metadata_tagger,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "OpenAIMetadataTagger": "langchain_community.document_transformers",
+ "create_metadata_tagger": (
+ "langchain_community.document_transformers.openai_functions"
+ ),
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenAIMetadataTagger",
+ "create_metadata_tagger",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..c76d24b0e97fbe39a5c86d3dfa6870d6bedd04ec
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/__init__.py
@@ -0,0 +1,204 @@
+"""**Embedding models**.
+
+**Embedding models** are wrappers around embedding models
+from different APIs and services.
+
+Embedding models can be LLMs or not.
+"""
+
+import logging
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+from langchain_classic.embeddings.base import init_embeddings
+from langchain_classic.embeddings.cache import CacheBackedEmbeddings
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import (
+ AlephAlphaAsymmetricSemanticEmbedding,
+ AlephAlphaSymmetricSemanticEmbedding,
+ AwaEmbeddings,
+ AzureOpenAIEmbeddings,
+ BedrockEmbeddings,
+ BookendEmbeddings,
+ ClarifaiEmbeddings,
+ CohereEmbeddings,
+ DashScopeEmbeddings,
+ DatabricksEmbeddings,
+ DeepInfraEmbeddings,
+ DeterministicFakeEmbedding,
+ EdenAiEmbeddings,
+ ElasticsearchEmbeddings,
+ EmbaasEmbeddings,
+ ErnieEmbeddings,
+ FakeEmbeddings,
+ FastEmbedEmbeddings,
+ GooglePalmEmbeddings,
+ GPT4AllEmbeddings,
+ GradientEmbeddings,
+ HuggingFaceBgeEmbeddings,
+ HuggingFaceEmbeddings,
+ HuggingFaceHubEmbeddings,
+ HuggingFaceInferenceAPIEmbeddings,
+ HuggingFaceInstructEmbeddings,
+ InfinityEmbeddings,
+ JavelinAIGatewayEmbeddings,
+ JinaEmbeddings,
+ JohnSnowLabsEmbeddings,
+ LlamaCppEmbeddings,
+ LocalAIEmbeddings,
+ MiniMaxEmbeddings,
+ MlflowAIGatewayEmbeddings,
+ MlflowEmbeddings,
+ ModelScopeEmbeddings,
+ MosaicMLInstructorEmbeddings,
+ NLPCloudEmbeddings,
+ OctoAIEmbeddings,
+ OllamaEmbeddings,
+ OpenAIEmbeddings,
+ OpenVINOEmbeddings,
+ QianfanEmbeddingsEndpoint,
+ SagemakerEndpointEmbeddings,
+ SelfHostedEmbeddings,
+ SelfHostedHuggingFaceEmbeddings,
+ SelfHostedHuggingFaceInstructEmbeddings,
+ SentenceTransformerEmbeddings,
+ SpacyEmbeddings,
+ TensorflowHubEmbeddings,
+ VertexAIEmbeddings,
+ VoyageEmbeddings,
+ XinferenceEmbeddings,
+ )
+
+ from langchain_classic.chains.hyde.base import HypotheticalDocumentEmbedder
+
+
+logger = logging.getLogger(__name__)
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AlephAlphaAsymmetricSemanticEmbedding": "langchain_community.embeddings",
+ "AlephAlphaSymmetricSemanticEmbedding": "langchain_community.embeddings",
+ "AwaEmbeddings": "langchain_community.embeddings",
+ "AzureOpenAIEmbeddings": "langchain_community.embeddings",
+ "BedrockEmbeddings": "langchain_community.embeddings",
+ "BookendEmbeddings": "langchain_community.embeddings",
+ "ClarifaiEmbeddings": "langchain_community.embeddings",
+ "CohereEmbeddings": "langchain_community.embeddings",
+ "DashScopeEmbeddings": "langchain_community.embeddings",
+ "DatabricksEmbeddings": "langchain_community.embeddings",
+ "DeepInfraEmbeddings": "langchain_community.embeddings",
+ "DeterministicFakeEmbedding": "langchain_community.embeddings",
+ "EdenAiEmbeddings": "langchain_community.embeddings",
+ "ElasticsearchEmbeddings": "langchain_community.embeddings",
+ "EmbaasEmbeddings": "langchain_community.embeddings",
+ "ErnieEmbeddings": "langchain_community.embeddings",
+ "FakeEmbeddings": "langchain_community.embeddings",
+ "FastEmbedEmbeddings": "langchain_community.embeddings",
+ "GooglePalmEmbeddings": "langchain_community.embeddings",
+ "GPT4AllEmbeddings": "langchain_community.embeddings",
+ "GradientEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceBgeEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceHubEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceInferenceAPIEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceInstructEmbeddings": "langchain_community.embeddings",
+ "HypotheticalDocumentEmbedder": "langchain_classic.chains.hyde.base",
+ "InfinityEmbeddings": "langchain_community.embeddings",
+ "JavelinAIGatewayEmbeddings": "langchain_community.embeddings",
+ "JinaEmbeddings": "langchain_community.embeddings",
+ "JohnSnowLabsEmbeddings": "langchain_community.embeddings",
+ "LlamaCppEmbeddings": "langchain_community.embeddings",
+ "LocalAIEmbeddings": "langchain_community.embeddings",
+ "MiniMaxEmbeddings": "langchain_community.embeddings",
+ "MlflowAIGatewayEmbeddings": "langchain_community.embeddings",
+ "MlflowEmbeddings": "langchain_community.embeddings",
+ "ModelScopeEmbeddings": "langchain_community.embeddings",
+ "MosaicMLInstructorEmbeddings": "langchain_community.embeddings",
+ "NLPCloudEmbeddings": "langchain_community.embeddings",
+ "OctoAIEmbeddings": "langchain_community.embeddings",
+ "OllamaEmbeddings": "langchain_community.embeddings",
+ "OpenAIEmbeddings": "langchain_community.embeddings",
+ "OpenVINOEmbeddings": "langchain_community.embeddings",
+ "QianfanEmbeddingsEndpoint": "langchain_community.embeddings",
+ "SagemakerEndpointEmbeddings": "langchain_community.embeddings",
+ "SelfHostedEmbeddings": "langchain_community.embeddings",
+ "SelfHostedHuggingFaceEmbeddings": "langchain_community.embeddings",
+ "SelfHostedHuggingFaceInstructEmbeddings": "langchain_community.embeddings",
+ "SentenceTransformerEmbeddings": "langchain_community.embeddings",
+ "SpacyEmbeddings": "langchain_community.embeddings",
+ "TensorflowHubEmbeddings": "langchain_community.embeddings",
+ "VertexAIEmbeddings": "langchain_community.embeddings",
+ "VoyageEmbeddings": "langchain_community.embeddings",
+ "XinferenceEmbeddings": "langchain_community.embeddings",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AlephAlphaAsymmetricSemanticEmbedding",
+ "AlephAlphaSymmetricSemanticEmbedding",
+ "AwaEmbeddings",
+ "AzureOpenAIEmbeddings",
+ "BedrockEmbeddings",
+ "BookendEmbeddings",
+ "CacheBackedEmbeddings",
+ "ClarifaiEmbeddings",
+ "CohereEmbeddings",
+ "DashScopeEmbeddings",
+ "DatabricksEmbeddings",
+ "DeepInfraEmbeddings",
+ "DeterministicFakeEmbedding",
+ "EdenAiEmbeddings",
+ "ElasticsearchEmbeddings",
+ "EmbaasEmbeddings",
+ "ErnieEmbeddings",
+ "FakeEmbeddings",
+ "FastEmbedEmbeddings",
+ "GPT4AllEmbeddings",
+ "GooglePalmEmbeddings",
+ "GradientEmbeddings",
+ "HuggingFaceBgeEmbeddings",
+ "HuggingFaceEmbeddings",
+ "HuggingFaceHubEmbeddings",
+ "HuggingFaceInferenceAPIEmbeddings",
+ "HuggingFaceInstructEmbeddings",
+ "HypotheticalDocumentEmbedder",
+ "InfinityEmbeddings",
+ "JavelinAIGatewayEmbeddings",
+ "JinaEmbeddings",
+ "JohnSnowLabsEmbeddings",
+ "LlamaCppEmbeddings",
+ "LocalAIEmbeddings",
+ "MiniMaxEmbeddings",
+ "MlflowAIGatewayEmbeddings",
+ "MlflowEmbeddings",
+ "ModelScopeEmbeddings",
+ "MosaicMLInstructorEmbeddings",
+ "NLPCloudEmbeddings",
+ "OctoAIEmbeddings",
+ "OllamaEmbeddings",
+ "OpenAIEmbeddings",
+ "OpenVINOEmbeddings",
+ "QianfanEmbeddingsEndpoint",
+ "SagemakerEndpointEmbeddings",
+ "SelfHostedEmbeddings",
+ "SelfHostedHuggingFaceEmbeddings",
+ "SelfHostedHuggingFaceInstructEmbeddings",
+ "SentenceTransformerEmbeddings",
+ "SpacyEmbeddings",
+ "TensorflowHubEmbeddings",
+ "VertexAIEmbeddings",
+ "VoyageEmbeddings",
+ "XinferenceEmbeddings",
+ "init_embeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/aleph_alpha.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/aleph_alpha.py
new file mode 100644
index 0000000000000000000000000000000000000000..3f926987d2268312bdd89548ca7e515d9bc44c1e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/aleph_alpha.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import (
+ AlephAlphaAsymmetricSemanticEmbedding,
+ AlephAlphaSymmetricSemanticEmbedding,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AlephAlphaAsymmetricSemanticEmbedding": "langchain_community.embeddings",
+ "AlephAlphaSymmetricSemanticEmbedding": "langchain_community.embeddings",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AlephAlphaAsymmetricSemanticEmbedding",
+ "AlephAlphaSymmetricSemanticEmbedding",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/awa.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/awa.py
new file mode 100644
index 0000000000000000000000000000000000000000..4f81310ed55033d2165b76b647a1afe45eb13591
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/awa.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import AwaEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AwaEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AwaEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/azure_openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/azure_openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..84c92121a5bc0f830b3070be4ef7cd47b5f89010
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/azure_openai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import AzureOpenAIEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AzureOpenAIEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureOpenAIEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/baidu_qianfan_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/baidu_qianfan_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..0fcdc52961d89122e1f182c987676530dc86f2d0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/baidu_qianfan_endpoint.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import QianfanEmbeddingsEndpoint
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"QianfanEmbeddingsEndpoint": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "QianfanEmbeddingsEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3256266c9292055abf9bea567b6a6f1c408f81c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/base.py
@@ -0,0 +1,268 @@
+import functools
+from importlib import util
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.embeddings import Embeddings
+from langchain_core.runnables import Runnable
+
+_SUPPORTED_PROVIDERS = {
+ "azure_ai": "langchain_azure_ai",
+ "azure_openai": "langchain_openai",
+ "bedrock": "langchain_aws",
+ "cohere": "langchain_cohere",
+ "google_genai": "langchain_google_genai",
+ "google_vertexai": "langchain_google_vertexai",
+ "huggingface": "langchain_huggingface",
+ "mistralai": "langchain_mistralai",
+ "ollama": "langchain_ollama",
+ "openai": "langchain_openai",
+}
+
+
+def _get_provider_list() -> str:
+ """Get formatted list of providers and their packages."""
+ return "\n".join(
+ f" - {p}: {pkg.replace('_', '-')}" for p, pkg in _SUPPORTED_PROVIDERS.items()
+ )
+
+
+def _parse_model_string(model_name: str) -> tuple[str, str]:
+ """Parse a model string into provider and model name components.
+
+ The model string should be in the format 'provider:model-name', where provider
+ is one of the supported providers.
+
+ Args:
+ model_name: A model string in the format 'provider:model-name'
+
+ Returns:
+ A tuple of (provider, model_name)
+
+ ```python
+ _parse_model_string("openai:text-embedding-3-small")
+ # Returns: ("openai", "text-embedding-3-small")
+
+ _parse_model_string("bedrock:amazon.titan-embed-text-v1")
+ # Returns: ("bedrock", "amazon.titan-embed-text-v1")
+ ```
+
+ Raises:
+ ValueError: If the model string is not in the correct format or
+ the provider is unsupported
+
+ """
+ if ":" not in model_name:
+ providers = _SUPPORTED_PROVIDERS
+ msg = (
+ f"Invalid model format '{model_name}'.\n"
+ f"Model name must be in format 'provider:model-name'\n"
+ f"Example valid model strings:\n"
+ f" - openai:text-embedding-3-small\n"
+ f" - bedrock:amazon.titan-embed-text-v1\n"
+ f" - cohere:embed-english-v3.0\n"
+ f"Supported providers: {providers}"
+ )
+ raise ValueError(msg)
+
+ provider, model = model_name.split(":", 1)
+ provider = provider.lower().strip()
+ model = model.strip()
+
+ if provider not in _SUPPORTED_PROVIDERS:
+ msg = (
+ f"Provider '{provider}' is not supported.\n"
+ f"Supported providers and their required packages:\n"
+ f"{_get_provider_list()}"
+ )
+ raise ValueError(msg)
+ if not model:
+ msg = "Model name cannot be empty"
+ raise ValueError(msg)
+ return provider, model
+
+
+def _infer_model_and_provider(
+ model: str,
+ *,
+ provider: str | None = None,
+) -> tuple[str, str]:
+ if not model.strip():
+ msg = "Model name cannot be empty"
+ raise ValueError(msg)
+ if provider is None and ":" in model:
+ provider, model_name = _parse_model_string(model)
+ else:
+ model_name = model
+
+ if not provider:
+ providers = _SUPPORTED_PROVIDERS
+ msg = (
+ "Must specify either:\n"
+ "1. A model string in format 'provider:model-name'\n"
+ " Example: 'openai:text-embedding-3-small'\n"
+ "2. Or explicitly set provider from: "
+ f"{providers}"
+ )
+ raise ValueError(msg)
+
+ if provider not in _SUPPORTED_PROVIDERS:
+ msg = (
+ f"Provider '{provider}' is not supported.\n"
+ f"Supported providers and their required packages:\n"
+ f"{_get_provider_list()}"
+ )
+ raise ValueError(msg)
+ return provider, model_name
+
+
+@functools.lru_cache(maxsize=len(_SUPPORTED_PROVIDERS))
+def _check_pkg(pkg: str) -> None:
+ """Check if a package is installed."""
+ if not util.find_spec(pkg):
+ pip_name = pkg.replace("_", "-")
+ msg = (
+ f"Could not import {pkg} python package. "
+ f"Please install it with `pip install {pip_name}`"
+ )
+ raise ImportError(msg)
+
+
+@deprecated(
+ since="1.0.5",
+ removal="2.0.0",
+ alternative="langchain.embeddings.init_embeddings",
+ addendum=(
+ "Maintained in `langchain`; `langchain-classic` retains this entry point "
+ "for import-compatibility only."
+ ),
+)
+def init_embeddings(
+ model: str,
+ *,
+ provider: str | None = None,
+ **kwargs: Any,
+) -> Embeddings | Runnable[Any, list[float]]:
+ """Initialize an embeddings model from a model name and optional provider.
+
+ !!! note
+ Must have the integration package corresponding to the model provider
+ installed.
+
+ Args:
+ model: Name of the model to use.
+
+ Can be either:
+
+ - A model string like `"openai:text-embedding-3-small"`
+ - Just the model name if the provider is specified separately or can be
+ inferred.
+
+ See supported providers under the `provider` arg description.
+ provider: Optional explicit provider name. If not specified, will attempt to
+ parse from the model string in the `model` arg.
+
+ Supported providers:
+
+ - `openai` -> [`langchain-openai`](https://docs.langchain.com/oss/python/integrations/providers/openai)
+ - `azure_ai` -> [`langchain-azure-ai`](https://docs.langchain.com/oss/python/integrations/providers/microsoft)
+ - `azure_openai` -> [`langchain-openai`](https://docs.langchain.com/oss/python/integrations/providers/openai)
+ - `bedrock` -> [`langchain-aws`](https://docs.langchain.com/oss/python/integrations/providers/aws)
+ - `cohere` -> [`langchain-cohere`](https://docs.langchain.com/oss/python/integrations/providers/cohere)
+ - `google_genai` -> [`langchain-google-genai`](https://docs.langchain.com/oss/python/integrations/providers/google)
+ - `google_vertexai` -> [`langchain-google-vertexai`](https://docs.langchain.com/oss/python/integrations/providers/google)
+ - `huggingface` -> [`langchain-huggingface`](https://docs.langchain.com/oss/python/integrations/providers/huggingface)
+ - `mistralai` -> [`langchain-mistralai`](https://docs.langchain.com/oss/python/integrations/providers/mistralai)
+ - `ollama` -> [`langchain-ollama`](https://docs.langchain.com/oss/python/integrations/providers/ollama)
+
+ **kwargs: Additional model-specific parameters passed to the embedding model.
+ These vary by provider, see the provider-specific documentation for details.
+
+ Returns:
+ An `Embeddings` instance that can generate embeddings for text.
+
+ Raises:
+ ValueError: If the model provider is not supported or cannot be determined
+ ImportError: If the required provider package is not installed
+
+ ???+ note "Example Usage"
+
+ ```python
+ # Using a model string
+ model = init_embeddings("openai:text-embedding-3-small")
+ model.embed_query("Hello, world!")
+
+ # Using explicit provider
+ model = init_embeddings(model="text-embedding-3-small", provider="openai")
+ model.embed_documents(["Hello, world!", "Goodbye, world!"])
+
+ # With additional parameters
+ model = init_embeddings("openai:text-embedding-3-small", api_key="sk-...")
+ ```
+
+ !!! version-added "Added in `langchain` 0.3.9"
+
+ """
+ if not model:
+ providers = _SUPPORTED_PROVIDERS.keys()
+ msg = (
+ f"Must specify model name. Supported providers are: {', '.join(providers)}"
+ )
+ raise ValueError(msg)
+
+ provider, model_name = _infer_model_and_provider(model, provider=provider)
+ pkg = _SUPPORTED_PROVIDERS[provider]
+ _check_pkg(pkg)
+
+ if provider == "azure_ai":
+ from langchain_azure_ai.embeddings import AzureAIOpenAIApiEmbeddingsModel
+
+ return AzureAIOpenAIApiEmbeddingsModel(model=model_name, **kwargs)
+ if provider == "azure_openai":
+ from langchain_openai import AzureOpenAIEmbeddings
+
+ return AzureOpenAIEmbeddings(model=model_name, **kwargs)
+ if provider == "openai":
+ from langchain_openai import OpenAIEmbeddings
+
+ return OpenAIEmbeddings(model=model_name, **kwargs)
+ if provider == "bedrock":
+ from langchain_aws import BedrockEmbeddings
+
+ return BedrockEmbeddings(model_id=model_name, **kwargs)
+ if provider == "google_genai":
+ from langchain_google_genai import GoogleGenerativeAIEmbeddings
+
+ return GoogleGenerativeAIEmbeddings(model=model_name, **kwargs)
+ if provider == "google_vertexai":
+ from langchain_google_vertexai import VertexAIEmbeddings
+
+ return VertexAIEmbeddings(model=model_name, **kwargs)
+ if provider == "cohere":
+ from langchain_cohere import CohereEmbeddings
+
+ return CohereEmbeddings(model=model_name, **kwargs)
+ if provider == "mistralai":
+ from langchain_mistralai import MistralAIEmbeddings
+
+ return MistralAIEmbeddings(model=model_name, **kwargs)
+ if provider == "huggingface":
+ from langchain_huggingface import HuggingFaceEmbeddings
+
+ return HuggingFaceEmbeddings(model_name=model_name, **kwargs)
+ if provider == "ollama":
+ from langchain_ollama import OllamaEmbeddings
+
+ return OllamaEmbeddings(model=model_name, **kwargs)
+ msg = (
+ f"Provider '{provider}' is not supported.\n"
+ f"Supported providers and their required packages:\n"
+ f"{_get_provider_list()}"
+ )
+ raise ValueError(msg)
+
+
+__all__ = [
+ "Embeddings", # This one is for backwards compatibility
+ "init_embeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/bedrock.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/bedrock.py
new file mode 100644
index 0000000000000000000000000000000000000000..896c8592aa7ff38ef6b8c11d3d7fae9803c29e60
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/bedrock.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import BedrockEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BedrockEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BedrockEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/bookend.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/bookend.py
new file mode 100644
index 0000000000000000000000000000000000000000..04a4a6ff7a414bbccb9fa695f9f2a0d044840abb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/bookend.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import BookendEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BookendEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BookendEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cache.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cache.py
new file mode 100644
index 0000000000000000000000000000000000000000..08a900a45f56f4dfa8f135755d283285423a27ee
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cache.py
@@ -0,0 +1,370 @@
+"""Module contains code for a cache backed embedder.
+
+The cache backed embedder is a wrapper around an embedder that caches
+embeddings in a key-value store. The cache is used to avoid recomputing
+embeddings for the same text.
+
+The text is hashed and the hash is used as the key in the cache.
+"""
+
+from __future__ import annotations
+
+import hashlib
+import json
+import uuid
+import warnings
+from collections.abc import Callable, Sequence
+from typing import Literal, cast
+
+from langchain_core.embeddings import Embeddings
+from langchain_core.stores import BaseStore, ByteStore
+from langchain_core.utils.iter import batch_iterate
+
+from langchain_classic.storage.encoder_backed import EncoderBackedStore
+
+NAMESPACE_UUID = uuid.UUID(int=1985)
+
+
+def _sha1_hash_to_uuid(text: str) -> uuid.UUID:
+ """Return a UUID derived from *text* using SHA-1 (deterministic).
+
+ Deterministic and fast, **but not collision-resistant**.
+
+ A malicious attacker could try to create two different texts that hash to the same
+ UUID. This may not necessarily be an issue in the context of caching embeddings,
+ but new applications should swap this out for a stronger hash function like
+ xxHash, BLAKE2 or SHA-256, which are collision-resistant.
+ """
+ sha1_hex = hashlib.sha1(text.encode("utf-8"), usedforsecurity=False).hexdigest()
+ # Embed the hex string in `uuid5` to obtain a valid UUID.
+ return uuid.uuid5(NAMESPACE_UUID, sha1_hex)
+
+
+def _make_default_key_encoder(namespace: str, algorithm: str) -> Callable[[str], str]:
+ """Create a default key encoder function.
+
+ Args:
+ namespace: Prefix that segregates keys from different embedding models.
+ algorithm:
+ * `'sha1'` - fast but not collision-resistant
+ * `'blake2b'` - cryptographically strong, faster than SHA-1
+ * `'sha256'` - cryptographically strong, slower than SHA-1
+ * `'sha512'` - cryptographically strong, slower than SHA-1
+
+ Returns:
+ A function that encodes a key using the specified algorithm.
+ """
+ if algorithm == "sha1":
+ _warn_about_sha1_encoder()
+
+ def _key_encoder(key: str) -> str:
+ """Encode a key using the specified algorithm."""
+ if algorithm == "sha1":
+ return f"{namespace}{_sha1_hash_to_uuid(key)}"
+ if algorithm == "blake2b":
+ return f"{namespace}{hashlib.blake2b(key.encode('utf-8')).hexdigest()}"
+ if algorithm == "sha256":
+ return f"{namespace}{hashlib.sha256(key.encode('utf-8')).hexdigest()}"
+ if algorithm == "sha512":
+ return f"{namespace}{hashlib.sha512(key.encode('utf-8')).hexdigest()}"
+ msg = f"Unsupported algorithm: {algorithm}"
+ raise ValueError(msg)
+
+ return _key_encoder
+
+
+def _value_serializer(value: Sequence[float]) -> bytes:
+ """Serialize a value."""
+ return json.dumps(value).encode()
+
+
+def _value_deserializer(serialized_value: bytes) -> list[float]:
+ """Deserialize a value."""
+ return cast("list[float]", json.loads(serialized_value.decode()))
+
+
+# The warning is global; track emission, so it appears only once.
+_warned_about_sha1: bool = False
+
+
+def _warn_about_sha1_encoder() -> None:
+ """Emit a one-time warning about SHA-1 collision weaknesses."""
+ global _warned_about_sha1 # noqa: PLW0603
+ if not _warned_about_sha1:
+ warnings.warn(
+ "Using default key encoder: SHA-1 is *not* collision-resistant. "
+ "While acceptable for most cache scenarios, a motivated attacker "
+ "can craft two different payloads that map to the same cache key. "
+ "If that risk matters in your environment, supply a stronger "
+ "encoder (e.g. SHA-256 or BLAKE2) via the `key_encoder` argument. "
+ "If you change the key encoder, consider also creating a new cache, "
+ "to avoid (the potential for) collisions with existing keys.",
+ category=UserWarning,
+ stacklevel=2,
+ )
+ _warned_about_sha1 = True
+
+
+class CacheBackedEmbeddings(Embeddings):
+ """Interface for caching results from embedding models.
+
+ The interface allows works with any store that implements
+ the abstract store interface accepting keys of type str and values of list of
+ floats.
+
+ If need be, the interface can be extended to accept other implementations
+ of the value serializer and deserializer, as well as the key encoder.
+
+ Note that by default only document embeddings are cached. To cache query
+ embeddings too, pass in a query_embedding_store to constructor.
+
+ Examples:
+ ```python
+ from langchain_classic.embeddings import CacheBackedEmbeddings
+ from langchain_classic.storage import LocalFileStore
+ from langchain_openai import OpenAIEmbeddings
+
+ store = LocalFileStore("./my_cache")
+
+ underlying_embedder = OpenAIEmbeddings()
+ embedder = CacheBackedEmbeddings.from_bytes_store(
+ underlying_embedder, store, namespace=underlying_embedder.model
+ )
+
+ # Embedding is computed and cached
+ embeddings = embedder.embed_documents(["hello", "goodbye"])
+
+ # Embeddings are retrieved from the cache, no computation is done
+ embeddings = embedder.embed_documents(["hello", "goodbye"])
+ ```
+ """
+
+ def __init__(
+ self,
+ underlying_embeddings: Embeddings,
+ document_embedding_store: BaseStore[str, list[float]],
+ *,
+ batch_size: int | None = None,
+ query_embedding_store: BaseStore[str, list[float]] | None = None,
+ ) -> None:
+ """Initialize the embedder.
+
+ Args:
+ underlying_embeddings: the embedder to use for computing embeddings.
+ document_embedding_store: The store to use for caching document embeddings.
+ batch_size: The number of documents to embed between store updates.
+ query_embedding_store: The store to use for caching query embeddings.
+ If `None`, query embeddings are not cached.
+ """
+ super().__init__()
+ self.document_embedding_store = document_embedding_store
+ self.query_embedding_store = query_embedding_store
+ self.underlying_embeddings = underlying_embeddings
+ self.batch_size = batch_size
+
+ def embed_documents(self, texts: list[str]) -> list[list[float]]:
+ """Embed a list of texts.
+
+ The method first checks the cache for the embeddings.
+ If the embeddings are not found, the method uses the underlying embedder
+ to embed the documents and stores the results in the cache.
+
+ Args:
+ texts: A list of texts to embed.
+
+ Returns:
+ A list of embeddings for the given texts.
+ """
+ vectors: list[list[float] | None] = self.document_embedding_store.mget(
+ texts,
+ )
+ all_missing_indices: list[int] = [
+ i for i, vector in enumerate(vectors) if vector is None
+ ]
+
+ for missing_indices in batch_iterate(self.batch_size, all_missing_indices):
+ missing_texts = [texts[i] for i in missing_indices]
+ missing_vectors = self.underlying_embeddings.embed_documents(missing_texts)
+ self.document_embedding_store.mset(
+ list(zip(missing_texts, missing_vectors, strict=False)),
+ )
+ for index, updated_vector in zip(
+ missing_indices, missing_vectors, strict=False
+ ):
+ vectors[index] = updated_vector
+
+ return cast(
+ "list[list[float]]",
+ vectors,
+ ) # Nones should have been resolved by now
+
+ async def aembed_documents(self, texts: list[str]) -> list[list[float]]:
+ """Embed a list of texts.
+
+ The method first checks the cache for the embeddings.
+ If the embeddings are not found, the method uses the underlying embedder
+ to embed the documents and stores the results in the cache.
+
+ Args:
+ texts: A list of texts to embed.
+
+ Returns:
+ A list of embeddings for the given texts.
+ """
+ vectors: list[list[float] | None] = await self.document_embedding_store.amget(
+ texts
+ )
+ all_missing_indices: list[int] = [
+ i for i, vector in enumerate(vectors) if vector is None
+ ]
+
+ # batch_iterate supports None batch_size which returns all elements at once
+ # as a single batch.
+ for missing_indices in batch_iterate(self.batch_size, all_missing_indices):
+ missing_texts = [texts[i] for i in missing_indices]
+ missing_vectors = await self.underlying_embeddings.aembed_documents(
+ missing_texts,
+ )
+ await self.document_embedding_store.amset(
+ list(zip(missing_texts, missing_vectors, strict=False)),
+ )
+ for index, updated_vector in zip(
+ missing_indices, missing_vectors, strict=False
+ ):
+ vectors[index] = updated_vector
+
+ return cast(
+ "list[list[float]]",
+ vectors,
+ ) # Nones should have been resolved by now
+
+ def embed_query(self, text: str) -> list[float]:
+ """Embed query text.
+
+ By default, this method does not cache queries. To enable caching, set the
+ `cache_query` parameter to `True` when initializing the embedder.
+
+ Args:
+ text: The text to embed.
+
+ Returns:
+ The embedding for the given text.
+ """
+ if not self.query_embedding_store:
+ return self.underlying_embeddings.embed_query(text)
+
+ (cached,) = self.query_embedding_store.mget([text])
+ if cached is not None:
+ return cached
+
+ vector = self.underlying_embeddings.embed_query(text)
+ self.query_embedding_store.mset([(text, vector)])
+ return vector
+
+ async def aembed_query(self, text: str) -> list[float]:
+ """Embed query text.
+
+ By default, this method does not cache queries. To enable caching, set the
+ `cache_query` parameter to `True` when initializing the embedder.
+
+ Args:
+ text: The text to embed.
+
+ Returns:
+ The embedding for the given text.
+ """
+ if not self.query_embedding_store:
+ return await self.underlying_embeddings.aembed_query(text)
+
+ (cached,) = await self.query_embedding_store.amget([text])
+ if cached is not None:
+ return cached
+
+ vector = await self.underlying_embeddings.aembed_query(text)
+ await self.query_embedding_store.amset([(text, vector)])
+ return vector
+
+ @classmethod
+ def from_bytes_store(
+ cls,
+ underlying_embeddings: Embeddings,
+ document_embedding_cache: ByteStore,
+ *,
+ namespace: str = "",
+ batch_size: int | None = None,
+ query_embedding_cache: bool | ByteStore = False,
+ key_encoder: Callable[[str], str]
+ | Literal["sha1", "blake2b", "sha256", "sha512"] = "sha1",
+ ) -> CacheBackedEmbeddings:
+ """On-ramp that adds the necessary serialization and encoding to the store.
+
+ Args:
+ underlying_embeddings: The embedder to use for embedding.
+ document_embedding_cache: The cache to use for storing document embeddings.
+ *,
+ namespace: The namespace to use for document cache.
+ This namespace is used to avoid collisions with other caches.
+ For example, set it to the name of the embedding model used.
+ batch_size: The number of documents to embed between store updates.
+ query_embedding_cache: The cache to use for storing query embeddings.
+ True to use the same cache as document embeddings.
+ False to not cache query embeddings.
+ key_encoder: Optional callable to encode keys. If not provided,
+ a default encoder using SHA-1 will be used. SHA-1 is not
+ collision-resistant, and a motivated attacker could craft two
+ different texts that hash to the same cache key.
+
+ New applications should use one of the alternative encoders
+ or provide a custom and strong key encoder function to avoid this risk.
+
+ If you change a key encoder in an existing cache, consider
+ just creating a new cache, to avoid (the potential for)
+ collisions with existing keys or having duplicate keys
+ for the same text in the cache.
+
+ Returns:
+ An instance of CacheBackedEmbeddings that uses the provided cache.
+ """
+ if isinstance(key_encoder, str):
+ key_encoder = _make_default_key_encoder(namespace, key_encoder)
+ elif callable(key_encoder):
+ # If a custom key encoder is provided, it should not be used with a
+ # namespace.
+ # A user can handle namespacing in directly their custom key encoder.
+ if namespace:
+ msg = (
+ "Do not supply `namespace` when using a custom key_encoder; "
+ "add any prefixing inside the encoder itself."
+ )
+ raise ValueError(msg)
+ else:
+ msg = ( # type: ignore[unreachable]
+ "key_encoder must be either 'blake2b', 'sha1', 'sha256', 'sha512' "
+ "or a callable that encodes keys."
+ )
+ raise ValueError(msg) # noqa: TRY004
+
+ document_embedding_store = EncoderBackedStore[str, list[float]](
+ document_embedding_cache,
+ key_encoder,
+ _value_serializer,
+ _value_deserializer,
+ )
+ if query_embedding_cache is True:
+ query_embedding_store = document_embedding_store
+ elif query_embedding_cache is False:
+ query_embedding_store = None
+ else:
+ query_embedding_store = EncoderBackedStore[str, list[float]](
+ query_embedding_cache,
+ key_encoder,
+ _value_serializer,
+ _value_deserializer,
+ )
+
+ return cls(
+ underlying_embeddings,
+ document_embedding_store,
+ batch_size=batch_size,
+ query_embedding_store=query_embedding_store,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/clarifai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/clarifai.py
new file mode 100644
index 0000000000000000000000000000000000000000..b5e7b4bd6196e010631ed67b9f1d6472baaf4493
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/clarifai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import ClarifaiEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ClarifaiEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ClarifaiEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cloudflare_workersai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cloudflare_workersai.py
new file mode 100644
index 0000000000000000000000000000000000000000..c4008b0f23bfed410ab08961585249c4fb15b11f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cloudflare_workersai.py
@@ -0,0 +1,29 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings.cloudflare_workersai import (
+ CloudflareWorkersAIEmbeddings,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CloudflareWorkersAIEmbeddings": (
+ "langchain_community.embeddings.cloudflare_workersai"
+ ),
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CloudflareWorkersAIEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cohere.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cohere.py
new file mode 100644
index 0000000000000000000000000000000000000000..0b6146272c73ea89d90cf65be70b31edb46210b2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/cohere.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import CohereEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CohereEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CohereEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/dashscope.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/dashscope.py
new file mode 100644
index 0000000000000000000000000000000000000000..52da91781459670affe75c2a00fc613194db08db
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/dashscope.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import DashScopeEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DashScopeEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DashScopeEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/databricks.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/databricks.py
new file mode 100644
index 0000000000000000000000000000000000000000..6307d838ceb45df50f87183a90d795bd5ad56fd3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/databricks.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import DatabricksEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DatabricksEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DatabricksEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/deepinfra.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/deepinfra.py
new file mode 100644
index 0000000000000000000000000000000000000000..c07cad0dcfc4ca2a6ee7d7e24e2be1e50681a3c9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/deepinfra.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import DeepInfraEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DeepInfraEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DeepInfraEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/edenai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/edenai.py
new file mode 100644
index 0000000000000000000000000000000000000000..8c70284bbf18ed4e2671e9472b8e7d0686b70472
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/edenai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import EdenAiEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"EdenAiEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EdenAiEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/elasticsearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/elasticsearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..b859f8766d4e39f85239f6c12ab7ca1bc4fdecc3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/elasticsearch.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import ElasticsearchEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ElasticsearchEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ElasticsearchEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/embaas.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/embaas.py
new file mode 100644
index 0000000000000000000000000000000000000000..52815582780c4c0a13b8a533ed1f366288b14950
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/embaas.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import EmbaasEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"EmbaasEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EmbaasEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/ernie.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/ernie.py
new file mode 100644
index 0000000000000000000000000000000000000000..f8eeede681db8dcfb58c441334a2414e3af42c50
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/ernie.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import ErnieEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ErnieEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ErnieEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/fake.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/fake.py
new file mode 100644
index 0000000000000000000000000000000000000000..05a6dd51b7ceea6eb939af0691c8dc239f01fb2c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/fake.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import (
+ DeterministicFakeEmbedding,
+ FakeEmbeddings,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "FakeEmbeddings": "langchain_community.embeddings",
+ "DeterministicFakeEmbedding": "langchain_community.embeddings",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DeterministicFakeEmbedding",
+ "FakeEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/fastembed.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/fastembed.py
new file mode 100644
index 0000000000000000000000000000000000000000..12ba26681a1f687d70e7905b997cf44dabbee538
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/fastembed.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import FastEmbedEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"FastEmbedEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FastEmbedEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/google_palm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/google_palm.py
new file mode 100644
index 0000000000000000000000000000000000000000..6fe93e62d60e2a8cb4bf34e7726824b088c38b7f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/google_palm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import GooglePalmEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GooglePalmEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GooglePalmEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/gpt4all.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/gpt4all.py
new file mode 100644
index 0000000000000000000000000000000000000000..0d0b3a818eb1d4ed76c3a0afbd0c2ea6bc404805
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/gpt4all.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import GPT4AllEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GPT4AllEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GPT4AllEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/gradient_ai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/gradient_ai.py
new file mode 100644
index 0000000000000000000000000000000000000000..48025feacab12df2c90aeeca74e69b18971e0306
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/gradient_ai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import GradientEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GradientEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GradientEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/huggingface.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/huggingface.py
new file mode 100644
index 0000000000000000000000000000000000000000..92871b1837b25b752658519d130c3a050990f71e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/huggingface.py
@@ -0,0 +1,36 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import (
+ HuggingFaceBgeEmbeddings,
+ HuggingFaceEmbeddings,
+ HuggingFaceInferenceAPIEmbeddings,
+ HuggingFaceInstructEmbeddings,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "HuggingFaceEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceInstructEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceBgeEmbeddings": "langchain_community.embeddings",
+ "HuggingFaceInferenceAPIEmbeddings": "langchain_community.embeddings",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFaceBgeEmbeddings",
+ "HuggingFaceEmbeddings",
+ "HuggingFaceInferenceAPIEmbeddings",
+ "HuggingFaceInstructEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/huggingface_hub.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/huggingface_hub.py
new file mode 100644
index 0000000000000000000000000000000000000000..2e0da6a9ed8bd6a2e55d84ef90d004856e75cf91
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/huggingface_hub.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import HuggingFaceHubEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HuggingFaceHubEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFaceHubEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/infinity.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/infinity.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed9c9bd9e923c207d8c5239150e9635e424e187d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/infinity.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import InfinityEmbeddings
+ from langchain_community.embeddings.infinity import (
+ TinyAsyncOpenAIInfinityEmbeddingClient,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "InfinityEmbeddings": "langchain_community.embeddings",
+ "TinyAsyncOpenAIInfinityEmbeddingClient": "langchain_community.embeddings.infinity",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "InfinityEmbeddings",
+ "TinyAsyncOpenAIInfinityEmbeddingClient",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/javelin_ai_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/javelin_ai_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..e1219711d7ad8bed84c714e754b6a421eb874152
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/javelin_ai_gateway.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import JavelinAIGatewayEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JavelinAIGatewayEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JavelinAIGatewayEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/jina.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/jina.py
new file mode 100644
index 0000000000000000000000000000000000000000..8ea01997ec820a4db678ac766ebd58b30814775d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/jina.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import JinaEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JinaEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JinaEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/johnsnowlabs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/johnsnowlabs.py
new file mode 100644
index 0000000000000000000000000000000000000000..4003652b2baaa295582d9695312b03da8a96032c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/johnsnowlabs.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import JohnSnowLabsEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JohnSnowLabsEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JohnSnowLabsEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/llamacpp.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/llamacpp.py
new file mode 100644
index 0000000000000000000000000000000000000000..a498e67ba3bfdda4c7af43e9c6066efeffb0e7bf
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/llamacpp.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import LlamaCppEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LlamaCppEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LlamaCppEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/llm_rails.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/llm_rails.py
new file mode 100644
index 0000000000000000000000000000000000000000..b808a43781d1f9d4788ab1b7b8e91c90844be7dd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/llm_rails.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import LLMRailsEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LLMRailsEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LLMRailsEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/localai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/localai.py
new file mode 100644
index 0000000000000000000000000000000000000000..f31c6c64f24103a0c1b0b5428fdc331bd355287d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/localai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import LocalAIEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LocalAIEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LocalAIEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/minimax.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/minimax.py
new file mode 100644
index 0000000000000000000000000000000000000000..5f956aa3b61172313369d75d7e90fd2a264b1c8f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/minimax.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import MiniMaxEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MiniMaxEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MiniMaxEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mlflow.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mlflow.py
new file mode 100644
index 0000000000000000000000000000000000000000..83f0b3d5e367c68f3b93d0ea42c938ca94c0c70e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mlflow.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import MlflowEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MlflowEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MlflowEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mlflow_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mlflow_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..94d32eef0a839eea3d9e976c7253f148a411e443
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mlflow_gateway.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import MlflowAIGatewayEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MlflowAIGatewayEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MlflowAIGatewayEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/modelscope_hub.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/modelscope_hub.py
new file mode 100644
index 0000000000000000000000000000000000000000..af5758abd28548bafbe8a545ab3c4d7f95e90ed1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/modelscope_hub.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import ModelScopeEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ModelScopeEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ModelScopeEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mosaicml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mosaicml.py
new file mode 100644
index 0000000000000000000000000000000000000000..f9600401f6c13ff87fc774653de2d6cdaff3b148
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/mosaicml.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import MosaicMLInstructorEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MosaicMLInstructorEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MosaicMLInstructorEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/nlpcloud.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/nlpcloud.py
new file mode 100644
index 0000000000000000000000000000000000000000..bba61c80f5943f121e87bea7cb24d4aee5789b6e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/nlpcloud.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import NLPCloudEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NLPCloudEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NLPCloudEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/octoai_embeddings.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/octoai_embeddings.py
new file mode 100644
index 0000000000000000000000000000000000000000..545e64cbe8d50e6b827cf784f6b981b4118d644f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/octoai_embeddings.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import OctoAIEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OctoAIEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OctoAIEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/ollama.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/ollama.py
new file mode 100644
index 0000000000000000000000000000000000000000..0287fbfdcb974d009e275787efabf6c5e7e2fc87
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/ollama.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import OllamaEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OllamaEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OllamaEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..e3b71bc5b6924721f380190ac6d8b22fdc2326ec
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/openai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import OpenAIEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpenAIEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenAIEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/sagemaker_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/sagemaker_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..a092d6e55e08a1dfd6ff35a2ebac5de10cf75a86
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/sagemaker_endpoint.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import SagemakerEndpointEmbeddings
+ from langchain_community.embeddings.sagemaker_endpoint import (
+ EmbeddingsContentHandler,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "EmbeddingsContentHandler": "langchain_community.embeddings.sagemaker_endpoint",
+ "SagemakerEndpointEmbeddings": "langchain_community.embeddings",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EmbeddingsContentHandler",
+ "SagemakerEndpointEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/self_hosted.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/self_hosted.py
new file mode 100644
index 0000000000000000000000000000000000000000..b6ed5470ca86dbb20980f2ac0922731116003e05
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/self_hosted.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import SelfHostedEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SelfHostedEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SelfHostedEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/self_hosted_hugging_face.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/self_hosted_hugging_face.py
new file mode 100644
index 0000000000000000000000000000000000000000..c61367fb6d9a483dbd92fe104adf20acc5f15983
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/self_hosted_hugging_face.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import (
+ SelfHostedHuggingFaceEmbeddings,
+ SelfHostedHuggingFaceInstructEmbeddings,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SelfHostedHuggingFaceEmbeddings": "langchain_community.embeddings",
+ "SelfHostedHuggingFaceInstructEmbeddings": "langchain_community.embeddings",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SelfHostedHuggingFaceEmbeddings",
+ "SelfHostedHuggingFaceInstructEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/sentence_transformer.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/sentence_transformer.py
new file mode 100644
index 0000000000000000000000000000000000000000..b5401cc697960a9e411b64c4c85790c567575ee3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/sentence_transformer.py
@@ -0,0 +1,21 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import SentenceTransformerEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SentenceTransformerEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = ["SentenceTransformerEmbeddings"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/spacy_embeddings.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/spacy_embeddings.py
new file mode 100644
index 0000000000000000000000000000000000000000..7df513390ce5ab44090a1f9ff31a0195c7b9aa61
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/spacy_embeddings.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import SpacyEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SpacyEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SpacyEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/tensorflow_hub.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/tensorflow_hub.py
new file mode 100644
index 0000000000000000000000000000000000000000..907630d13372991995194ea4fe8d1b17220aac13
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/tensorflow_hub.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import TensorflowHubEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TensorflowHubEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TensorflowHubEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/vertexai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/vertexai.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac32f199d032c6b0950e59f0d768608c27a6cfb7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/vertexai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import VertexAIEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"VertexAIEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VertexAIEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/voyageai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/voyageai.py
new file mode 100644
index 0000000000000000000000000000000000000000..55ac10bd7f94666928818732745e4b7c490c694f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/voyageai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import VoyageEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"VoyageEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VoyageEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/xinference.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/xinference.py
new file mode 100644
index 0000000000000000000000000000000000000000..7dbd4a230e9a8526358aac4c3c0765b30fae6be8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/embeddings/xinference.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.embeddings import XinferenceEmbeddings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"XinferenceEmbeddings": "langchain_community.embeddings"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "XinferenceEmbeddings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..fe33506ff22d118bcd323e9cb73abbca70a6500c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/__init__.py
@@ -0,0 +1,137 @@
+"""**Evaluation** chains for grading LLM and Chain outputs.
+
+This module contains off-the-shelf evaluation chains for grading the output of
+LangChain primitives such as language models and chains.
+
+**Loading an evaluator**
+
+To load an evaluator, you can use the `load_evaluators ` or
+`load_evaluator ` functions with the
+names of the evaluators to load.
+
+```python
+from langchain_classic.evaluation import load_evaluator
+
+evaluator = load_evaluator("qa")
+evaluator.evaluate_strings(
+ prediction="We sold more than 40,000 units last week",
+ input="How many units did we sell last week?",
+ reference="We sold 32,378 units",
+)
+```
+
+The evaluator must be one of `EvaluatorType `.
+
+**Datasets**
+
+To load one of the LangChain HuggingFace datasets, you can use the `load_dataset ` function with the
+name of the dataset to load.
+
+```python
+from langchain_classic.evaluation import load_dataset
+
+ds = load_dataset("llm-math")
+```
+
+**Some common use cases for evaluation include:**
+
+- Grading the accuracy of a response against ground truth answers: `QAEvalChain `
+- Comparing the output of two models: `PairwiseStringEvalChain ` or `LabeledPairwiseStringEvalChain ` when there is additionally a reference label.
+- Judging the efficacy of an agent's tool usage: `TrajectoryEvalChain `
+- Checking whether an output complies with a set of criteria: `CriteriaEvalChain ` or `LabeledCriteriaEvalChain ` when there is additionally a reference label.
+- Computing semantic difference between a prediction and reference: `EmbeddingDistanceEvalChain ` or between two predictions: `PairwiseEmbeddingDistanceEvalChain `
+- Measuring the string distance between a prediction and reference `StringDistanceEvalChain ` or between two predictions `PairwiseStringDistanceEvalChain `
+
+**Low-level API**
+
+These evaluators implement one of the following interfaces:
+
+- `StringEvaluator `: Evaluate a prediction string against a reference label and/or input context.
+- `PairwiseStringEvaluator `: Evaluate two prediction strings against each other. Useful for scoring preferences, measuring similarity between two chain or llm agents, or comparing outputs on similar inputs.
+- `AgentTrajectoryEvaluator ` Evaluate the full sequence of actions taken by an agent.
+
+These interfaces enable easier composability and usage within a higher level evaluation framework.
+
+""" # noqa: E501
+
+from langchain_classic.evaluation.agents import TrajectoryEvalChain
+from langchain_classic.evaluation.comparison import (
+ LabeledPairwiseStringEvalChain,
+ PairwiseStringEvalChain,
+)
+from langchain_classic.evaluation.criteria import (
+ Criteria,
+ CriteriaEvalChain,
+ LabeledCriteriaEvalChain,
+)
+from langchain_classic.evaluation.embedding_distance import (
+ EmbeddingDistance,
+ EmbeddingDistanceEvalChain,
+ PairwiseEmbeddingDistanceEvalChain,
+)
+from langchain_classic.evaluation.exact_match.base import ExactMatchStringEvaluator
+from langchain_classic.evaluation.loading import (
+ load_dataset,
+ load_evaluator,
+ load_evaluators,
+)
+from langchain_classic.evaluation.parsing.base import (
+ JsonEqualityEvaluator,
+ JsonValidityEvaluator,
+)
+from langchain_classic.evaluation.parsing.json_distance import JsonEditDistanceEvaluator
+from langchain_classic.evaluation.parsing.json_schema import JsonSchemaEvaluator
+from langchain_classic.evaluation.qa import (
+ ContextQAEvalChain,
+ CotQAEvalChain,
+ QAEvalChain,
+)
+from langchain_classic.evaluation.regex_match.base import RegexMatchStringEvaluator
+from langchain_classic.evaluation.schema import (
+ AgentTrajectoryEvaluator,
+ EvaluatorType,
+ PairwiseStringEvaluator,
+ StringEvaluator,
+)
+from langchain_classic.evaluation.scoring import (
+ LabeledScoreStringEvalChain,
+ ScoreStringEvalChain,
+)
+from langchain_classic.evaluation.string_distance import (
+ PairwiseStringDistanceEvalChain,
+ StringDistance,
+ StringDistanceEvalChain,
+)
+
+__all__ = [
+ "AgentTrajectoryEvaluator",
+ "ContextQAEvalChain",
+ "CotQAEvalChain",
+ "Criteria",
+ "CriteriaEvalChain",
+ "EmbeddingDistance",
+ "EmbeddingDistanceEvalChain",
+ "EvaluatorType",
+ "ExactMatchStringEvaluator",
+ "JsonEditDistanceEvaluator",
+ "JsonEqualityEvaluator",
+ "JsonSchemaEvaluator",
+ "JsonValidityEvaluator",
+ "LabeledCriteriaEvalChain",
+ "LabeledPairwiseStringEvalChain",
+ "LabeledScoreStringEvalChain",
+ "PairwiseEmbeddingDistanceEvalChain",
+ "PairwiseStringDistanceEvalChain",
+ "PairwiseStringEvalChain",
+ "PairwiseStringEvaluator",
+ "QAEvalChain",
+ "RegexMatchStringEvaluator",
+ "ScoreStringEvalChain",
+ "StringDistance",
+ "StringDistanceEvalChain",
+ "StringEvaluator",
+ "TrajectoryEvalChain",
+ "load_dataset",
+ "load_evaluator",
+ "load_evaluators",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/loading.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/loading.py
new file mode 100644
index 0000000000000000000000000000000000000000..ed2cd9ae5d6d30fefb4c64e80432647847d95ae7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/loading.py
@@ -0,0 +1,219 @@
+"""Loading datasets and evaluators."""
+
+from collections.abc import Sequence
+from typing import Any
+
+from langchain_core.language_models import BaseLanguageModel
+
+from langchain_classic.chains.base import Chain
+from langchain_classic.evaluation.agents.trajectory_eval_chain import (
+ TrajectoryEvalChain,
+)
+from langchain_classic.evaluation.comparison import PairwiseStringEvalChain
+from langchain_classic.evaluation.comparison.eval_chain import (
+ LabeledPairwiseStringEvalChain,
+)
+from langchain_classic.evaluation.criteria.eval_chain import (
+ CriteriaEvalChain,
+ LabeledCriteriaEvalChain,
+)
+from langchain_classic.evaluation.embedding_distance.base import (
+ EmbeddingDistanceEvalChain,
+ PairwiseEmbeddingDistanceEvalChain,
+)
+from langchain_classic.evaluation.exact_match.base import ExactMatchStringEvaluator
+from langchain_classic.evaluation.parsing.base import (
+ JsonEqualityEvaluator,
+ JsonValidityEvaluator,
+)
+from langchain_classic.evaluation.parsing.json_distance import JsonEditDistanceEvaluator
+from langchain_classic.evaluation.parsing.json_schema import JsonSchemaEvaluator
+from langchain_classic.evaluation.qa import (
+ ContextQAEvalChain,
+ CotQAEvalChain,
+ QAEvalChain,
+)
+from langchain_classic.evaluation.regex_match.base import RegexMatchStringEvaluator
+from langchain_classic.evaluation.schema import (
+ EvaluatorType,
+ LLMEvalChain,
+ StringEvaluator,
+)
+from langchain_classic.evaluation.scoring.eval_chain import (
+ LabeledScoreStringEvalChain,
+ ScoreStringEvalChain,
+)
+from langchain_classic.evaluation.string_distance.base import (
+ PairwiseStringDistanceEvalChain,
+ StringDistanceEvalChain,
+)
+
+
+def load_dataset(uri: str) -> list[dict]:
+ """Load a dataset from the [LangChainDatasets on HuggingFace](https://huggingface.co/LangChainDatasets).
+
+ Args:
+ uri: The uri of the dataset to load.
+
+ Returns:
+ A list of dictionaries, each representing a row in the dataset.
+
+ **Prerequisites**
+
+ ```bash
+ pip install datasets
+ ```
+
+ Examples:
+ --------
+ ```python
+ from langchain_classic.evaluation import load_dataset
+
+ ds = load_dataset("llm-math")
+ ```
+ """
+ try:
+ from datasets import load_dataset
+ except ImportError as e:
+ msg = (
+ "load_dataset requires the `datasets` package."
+ " Please install with `pip install datasets`"
+ )
+ raise ImportError(msg) from e
+
+ dataset = load_dataset(f"LangChainDatasets/{uri}")
+ return list(dataset["train"])
+
+
+_EVALUATOR_MAP: dict[
+ EvaluatorType,
+ type[LLMEvalChain] | type[Chain] | type[StringEvaluator],
+] = {
+ EvaluatorType.QA: QAEvalChain,
+ EvaluatorType.COT_QA: CotQAEvalChain,
+ EvaluatorType.CONTEXT_QA: ContextQAEvalChain,
+ EvaluatorType.PAIRWISE_STRING: PairwiseStringEvalChain,
+ EvaluatorType.SCORE_STRING: ScoreStringEvalChain,
+ EvaluatorType.LABELED_PAIRWISE_STRING: LabeledPairwiseStringEvalChain,
+ EvaluatorType.LABELED_SCORE_STRING: LabeledScoreStringEvalChain,
+ EvaluatorType.AGENT_TRAJECTORY: TrajectoryEvalChain,
+ EvaluatorType.CRITERIA: CriteriaEvalChain,
+ EvaluatorType.LABELED_CRITERIA: LabeledCriteriaEvalChain,
+ EvaluatorType.STRING_DISTANCE: StringDistanceEvalChain,
+ EvaluatorType.PAIRWISE_STRING_DISTANCE: PairwiseStringDistanceEvalChain,
+ EvaluatorType.EMBEDDING_DISTANCE: EmbeddingDistanceEvalChain,
+ EvaluatorType.PAIRWISE_EMBEDDING_DISTANCE: PairwiseEmbeddingDistanceEvalChain,
+ EvaluatorType.JSON_VALIDITY: JsonValidityEvaluator,
+ EvaluatorType.JSON_EQUALITY: JsonEqualityEvaluator,
+ EvaluatorType.JSON_EDIT_DISTANCE: JsonEditDistanceEvaluator,
+ EvaluatorType.JSON_SCHEMA_VALIDATION: JsonSchemaEvaluator,
+ EvaluatorType.REGEX_MATCH: RegexMatchStringEvaluator,
+ EvaluatorType.EXACT_MATCH: ExactMatchStringEvaluator,
+}
+
+
+def load_evaluator(
+ evaluator: EvaluatorType,
+ *,
+ llm: BaseLanguageModel | None = None,
+ **kwargs: Any,
+) -> Chain | StringEvaluator:
+ """Load the requested evaluation chain specified by a string.
+
+ Parameters
+ ----------
+ evaluator : EvaluatorType
+ The type of evaluator to load.
+ llm : BaseLanguageModel, optional
+ The language model to use for evaluation, by default None
+ **kwargs : Any
+ Additional keyword arguments to pass to the evaluator.
+
+ Returns:
+ -------
+ Chain
+ The loaded evaluation chain.
+
+ Examples:
+ --------
+ >>> from langchain_classic.evaluation import load_evaluator, EvaluatorType
+ >>> evaluator = load_evaluator(EvaluatorType.QA)
+ """
+ if evaluator not in _EVALUATOR_MAP:
+ msg = (
+ f"Unknown evaluator type: {evaluator}"
+ f"\nValid types are: {list(_EVALUATOR_MAP.keys())}"
+ )
+ raise ValueError(msg)
+ evaluator_cls = _EVALUATOR_MAP[evaluator]
+ if issubclass(evaluator_cls, LLMEvalChain):
+ try:
+ try:
+ from langchain_openai import ChatOpenAI
+ except ImportError:
+ try:
+ from langchain_community.chat_models.openai import ( # type: ignore[no-redef,unused-ignore]
+ ChatOpenAI,
+ )
+ except ImportError as e:
+ msg = (
+ "Could not import langchain_openai or fallback onto "
+ "langchain_community. Please install langchain_openai "
+ "or specify a language model explicitly. "
+ "It's recommended to install langchain_openai AND "
+ "specify a language model explicitly."
+ )
+ raise ImportError(msg) from e
+
+ llm = llm or ChatOpenAI(model="gpt-4", seed=42, temperature=0)
+ except Exception as e:
+ msg = (
+ f"Evaluation with the {evaluator_cls} requires a "
+ "language model to function."
+ " Failed to create the default 'gpt-4' model."
+ " Please manually provide an evaluation LLM"
+ " or check your openai credentials."
+ )
+ raise ValueError(msg) from e
+ return evaluator_cls.from_llm(llm=llm, **kwargs)
+ return evaluator_cls(**kwargs)
+
+
+def load_evaluators(
+ evaluators: Sequence[EvaluatorType],
+ *,
+ llm: BaseLanguageModel | None = None,
+ config: dict | None = None,
+ **kwargs: Any,
+) -> list[Chain | StringEvaluator]:
+ """Load evaluators specified by a list of evaluator types.
+
+ Parameters
+ ----------
+ evaluators : Sequence[EvaluatorType]
+ The list of evaluator types to load.
+ llm : BaseLanguageModel, optional
+ The language model to use for evaluation, if none is provided, a default
+ ChatOpenAI gpt-4 model will be used.
+ config : dict, optional
+ A dictionary mapping evaluator types to additional keyword arguments,
+ by default None
+ **kwargs : Any
+ Additional keyword arguments to pass to all evaluators.
+
+ Returns:
+ -------
+ List[Chain]
+ The loaded evaluators.
+
+ Examples:
+ --------
+ >>> from langchain_classic.evaluation import load_evaluators, EvaluatorType
+ >>> evaluators = [EvaluatorType.QA, EvaluatorType.CRITERIA]
+ >>> loaded_evaluators = load_evaluators(evaluators, criteria="helpfulness")
+ """
+ loaded = []
+ for evaluator in evaluators:
+ _kwargs = config.get(evaluator, {}) if config else {}
+ loaded.append(load_evaluator(evaluator, llm=llm, **{**kwargs, **_kwargs}))
+ return loaded
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/schema.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8e598846d445436021cdad22fb43f478ec8d9be
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/evaluation/schema.py
@@ -0,0 +1,507 @@
+"""Interfaces to be implemented by general evaluators."""
+
+from __future__ import annotations
+
+import logging
+from abc import ABC, abstractmethod
+from collections.abc import Sequence
+from enum import Enum
+from typing import Any
+from warnings import warn
+
+from langchain_core.agents import AgentAction
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.runnables.config import run_in_executor
+
+from langchain_classic.chains.base import Chain
+
+logger = logging.getLogger(__name__)
+
+
+class EvaluatorType(str, Enum):
+ """The types of the evaluators."""
+
+ QA = "qa"
+ """Question answering evaluator, which grades answers to questions
+ directly using an LLM."""
+ COT_QA = "cot_qa"
+ """Chain of thought question answering evaluator, which grades
+ answers to questions using
+ chain of thought 'reasoning'."""
+ CONTEXT_QA = "context_qa"
+ """Question answering evaluator that incorporates 'context' in the response."""
+ PAIRWISE_STRING = "pairwise_string"
+ """The pairwise string evaluator, which predicts the preferred prediction from
+ between two models."""
+ SCORE_STRING = "score_string"
+ """The scored string evaluator, which gives a score between 1 and 10
+ to a prediction."""
+ LABELED_PAIRWISE_STRING = "labeled_pairwise_string"
+ """The labeled pairwise string evaluator, which predicts the preferred prediction
+ from between two models based on a ground truth reference label."""
+ LABELED_SCORE_STRING = "labeled_score_string"
+ """The labeled scored string evaluator, which gives a score between 1 and 10
+ to a prediction based on a ground truth reference label."""
+ AGENT_TRAJECTORY = "trajectory"
+ """The agent trajectory evaluator, which grades the agent's intermediate steps."""
+ CRITERIA = "criteria"
+ """The criteria evaluator, which evaluates a model based on a
+ custom set of criteria without any reference labels."""
+ LABELED_CRITERIA = "labeled_criteria"
+ """The labeled criteria evaluator, which evaluates a model based on a
+ custom set of criteria, with a reference label."""
+ STRING_DISTANCE = "string_distance"
+ """Compare predictions to a reference answer using string edit distances."""
+ EXACT_MATCH = "exact_match"
+ """Compare predictions to a reference answer using exact matching."""
+ REGEX_MATCH = "regex_match"
+ """Compare predictions to a reference answer using regular expressions."""
+ PAIRWISE_STRING_DISTANCE = "pairwise_string_distance"
+ """Compare predictions based on string edit distances."""
+ EMBEDDING_DISTANCE = "embedding_distance"
+ """Compare a prediction to a reference label using embedding distance."""
+ PAIRWISE_EMBEDDING_DISTANCE = "pairwise_embedding_distance"
+ """Compare two predictions using embedding distance."""
+ JSON_VALIDITY = "json_validity"
+ """Check if a prediction is valid JSON."""
+ JSON_EQUALITY = "json_equality"
+ """Check if a prediction is equal to a reference JSON."""
+ JSON_EDIT_DISTANCE = "json_edit_distance"
+ """Compute the edit distance between two JSON strings after canonicalization."""
+ JSON_SCHEMA_VALIDATION = "json_schema_validation"
+ """Check if a prediction is valid JSON according to a JSON schema."""
+
+
+class LLMEvalChain(Chain):
+ """A base class for evaluators that use an LLM."""
+
+ @classmethod
+ @abstractmethod
+ def from_llm(cls, llm: BaseLanguageModel, **kwargs: Any) -> LLMEvalChain:
+ """Create a new evaluator from an LLM."""
+
+
+class _EvalArgsMixin:
+ """Mixin for checking evaluation arguments."""
+
+ @property
+ def requires_reference(self) -> bool:
+ """Whether this evaluator requires a reference label."""
+ return False
+
+ @property
+ def requires_input(self) -> bool:
+ """Whether this evaluator requires an input string."""
+ return False
+
+ @property
+ def _skip_input_warning(self) -> str:
+ """Warning to show when input is ignored."""
+ return f"Ignoring input in {self.__class__.__name__}, as it is not expected."
+
+ @property
+ def _skip_reference_warning(self) -> str:
+ """Warning to show when reference is ignored."""
+ return (
+ f"Ignoring reference in {self.__class__.__name__}, as it is not expected."
+ )
+
+ def _check_evaluation_args(
+ self,
+ reference: str | None = None,
+ input_: str | None = None,
+ ) -> None:
+ """Check if the evaluation arguments are valid.
+
+ Args:
+ reference: The reference label.
+ input_: The input string.
+
+ Raises:
+ ValueError: If the evaluator requires an input string but none is provided,
+ or if the evaluator requires a reference label but none is provided.
+ """
+ if self.requires_input and input_ is None:
+ msg = f"{self.__class__.__name__} requires an input string."
+ raise ValueError(msg)
+ if input_ is not None and not self.requires_input:
+ warn(self._skip_input_warning, stacklevel=3)
+ if self.requires_reference and reference is None:
+ msg = f"{self.__class__.__name__} requires a reference string."
+ raise ValueError(msg)
+ if reference is not None and not self.requires_reference:
+ warn(self._skip_reference_warning, stacklevel=3)
+
+
+class StringEvaluator(_EvalArgsMixin, ABC):
+ """String evaluator interface.
+
+ Grade, tag, or otherwise evaluate predictions relative to their inputs
+ and/or reference labels.
+ """
+
+ @property
+ def evaluation_name(self) -> str:
+ """The name of the evaluation."""
+ return self.__class__.__name__
+
+ @property
+ def requires_reference(self) -> bool:
+ """Whether this evaluator requires a reference label."""
+ return False
+
+ @abstractmethod
+ def _evaluate_strings(
+ self,
+ *,
+ prediction: str | Any,
+ reference: str | Any | None = None,
+ input: str | Any | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Evaluate Chain or LLM output, based on optional input and label.
+
+ Args:
+ prediction: The LLM or chain prediction to evaluate.
+ reference: The reference label to evaluate against.
+ input: The input to consider during evaluation.
+ **kwargs: Additional keyword arguments, including callbacks, tags, etc.
+
+ Returns:
+ The evaluation results containing the score or value.
+ It is recommended that the dictionary contain the following keys:
+ - score: the score of the evaluation, if applicable.
+ - value: the string value of the evaluation, if applicable.
+ - reasoning: the reasoning for the evaluation, if applicable.
+ """
+
+ async def _aevaluate_strings(
+ self,
+ *,
+ prediction: str | Any,
+ reference: str | Any | None = None,
+ input: str | Any | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously evaluate Chain or LLM output, based on optional input and label.
+
+ Args:
+ prediction: The LLM or chain prediction to evaluate.
+ reference: The reference label to evaluate against.
+ input: The input to consider during evaluation.
+ **kwargs: Additional keyword arguments, including callbacks, tags, etc.
+
+ Returns:
+ The evaluation results containing the score or value.
+ It is recommended that the dictionary contain the following keys:
+ - score: the score of the evaluation, if applicable.
+ - value: the string value of the evaluation, if applicable.
+ - reasoning: the reasoning for the evaluation, if applicable.
+ """ # noqa: E501
+ return await run_in_executor(
+ None,
+ self._evaluate_strings,
+ prediction=prediction,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+ def evaluate_strings(
+ self,
+ *,
+ prediction: str,
+ reference: str | None = None,
+ input: str | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Evaluate Chain or LLM output, based on optional input and label.
+
+ Args:
+ prediction: The LLM or chain prediction to evaluate.
+ reference: The reference label to evaluate against.
+ input: The input to consider during evaluation.
+ **kwargs: Additional keyword arguments, including callbacks, tags, etc.
+
+ Returns:
+ The evaluation results containing the score or value.
+ """
+ self._check_evaluation_args(reference=reference, input_=input)
+ return self._evaluate_strings(
+ prediction=prediction,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+ async def aevaluate_strings(
+ self,
+ *,
+ prediction: str,
+ reference: str | None = None,
+ input: str | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously evaluate Chain or LLM output, based on optional input and label.
+
+ Args:
+ prediction: The LLM or chain prediction to evaluate.
+ reference: The reference label to evaluate against.
+ input: The input to consider during evaluation.
+ **kwargs: Additional keyword arguments, including callbacks, tags, etc.
+
+ Returns:
+ The evaluation results containing the score or value.
+ """ # noqa: E501
+ self._check_evaluation_args(reference=reference, input_=input)
+ return await self._aevaluate_strings(
+ prediction=prediction,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+
+class PairwiseStringEvaluator(_EvalArgsMixin, ABC):
+ """Compare the output of two models (or two outputs of the same model)."""
+
+ @abstractmethod
+ def _evaluate_string_pairs(
+ self,
+ *,
+ prediction: str,
+ prediction_b: str,
+ reference: str | None = None,
+ input: str | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Evaluate the output string pairs.
+
+ Args:
+ prediction: The output string from the first model.
+ prediction_b: The output string from the second model.
+ reference: The expected output / reference string.
+ input: The input string.
+ **kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
+
+ Returns:
+ `dict` containing the preference, scores, and/or other information.
+ """ # noqa: E501
+
+ async def _aevaluate_string_pairs(
+ self,
+ *,
+ prediction: str,
+ prediction_b: str,
+ reference: str | None = None,
+ input: str | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously evaluate the output string pairs.
+
+ Args:
+ prediction: The output string from the first model.
+ prediction_b: The output string from the second model.
+ reference: The expected output / reference string.
+ input: The input string.
+ **kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
+
+ Returns:
+ `dict` containing the preference, scores, and/or other information.
+ """ # noqa: E501
+ return await run_in_executor(
+ None,
+ self._evaluate_string_pairs,
+ prediction=prediction,
+ prediction_b=prediction_b,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+ def evaluate_string_pairs(
+ self,
+ *,
+ prediction: str,
+ prediction_b: str,
+ reference: str | None = None,
+ input: str | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Evaluate the output string pairs.
+
+ Args:
+ prediction: The output string from the first model.
+ prediction_b: The output string from the second model.
+ reference: The expected output / reference string.
+ input: The input string.
+ **kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
+
+ Returns:
+ `dict` containing the preference, scores, and/or other information.
+ """ # noqa: E501
+ self._check_evaluation_args(reference=reference, input_=input)
+ return self._evaluate_string_pairs(
+ prediction=prediction,
+ prediction_b=prediction_b,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+ async def aevaluate_string_pairs(
+ self,
+ *,
+ prediction: str,
+ prediction_b: str,
+ reference: str | None = None,
+ input: str | None = None, # noqa: A002
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously evaluate the output string pairs.
+
+ Args:
+ prediction: The output string from the first model.
+ prediction_b: The output string from the second model.
+ reference: The expected output / reference string.
+ input: The input string.
+ **kwargs: Additional keyword arguments, such as callbacks and optional reference strings.
+
+ Returns:
+ `dict` containing the preference, scores, and/or other information.
+ """ # noqa: E501
+ self._check_evaluation_args(reference=reference, input_=input)
+ return await self._aevaluate_string_pairs(
+ prediction=prediction,
+ prediction_b=prediction_b,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+
+class AgentTrajectoryEvaluator(_EvalArgsMixin, ABC):
+ """Interface for evaluating agent trajectories."""
+
+ @property
+ def requires_input(self) -> bool:
+ """Whether this evaluator requires an input string."""
+ return True
+
+ @abstractmethod
+ def _evaluate_agent_trajectory(
+ self,
+ *,
+ prediction: str,
+ agent_trajectory: Sequence[tuple[AgentAction, str]],
+ input: str, # noqa: A002
+ reference: str | None = None,
+ **kwargs: Any,
+ ) -> dict:
+ """Evaluate a trajectory.
+
+ Args:
+ prediction: The final predicted response.
+ agent_trajectory:
+ The intermediate steps forming the agent trajectory.
+ input: The input to the agent.
+ reference: The reference answer.
+ **kwargs: Additional keyword arguments.
+
+ Returns:
+ The evaluation result.
+ """
+
+ async def _aevaluate_agent_trajectory(
+ self,
+ *,
+ prediction: str,
+ agent_trajectory: Sequence[tuple[AgentAction, str]],
+ input: str, # noqa: A002
+ reference: str | None = None,
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously evaluate a trajectory.
+
+ Args:
+ prediction: The final predicted response.
+ agent_trajectory:
+ The intermediate steps forming the agent trajectory.
+ input: The input to the agent.
+ reference: The reference answer.
+ **kwargs: Additional keyword arguments.
+
+ Returns:
+ The evaluation result.
+ """
+ return await run_in_executor(
+ None,
+ self._evaluate_agent_trajectory,
+ prediction=prediction,
+ agent_trajectory=agent_trajectory,
+ reference=reference,
+ input=input,
+ **kwargs,
+ )
+
+ def evaluate_agent_trajectory(
+ self,
+ *,
+ prediction: str,
+ agent_trajectory: Sequence[tuple[AgentAction, str]],
+ input: str, # noqa: A002
+ reference: str | None = None,
+ **kwargs: Any,
+ ) -> dict:
+ """Evaluate a trajectory.
+
+ Args:
+ prediction: The final predicted response.
+ agent_trajectory:
+ The intermediate steps forming the agent trajectory.
+ input: The input to the agent.
+ reference: The reference answer.
+ **kwargs: Additional keyword arguments.
+
+ Returns:
+ The evaluation result.
+ """
+ self._check_evaluation_args(reference=reference, input_=input)
+ return self._evaluate_agent_trajectory(
+ prediction=prediction,
+ input=input,
+ agent_trajectory=agent_trajectory,
+ reference=reference,
+ **kwargs,
+ )
+
+ async def aevaluate_agent_trajectory(
+ self,
+ *,
+ prediction: str,
+ agent_trajectory: Sequence[tuple[AgentAction, str]],
+ input: str, # noqa: A002
+ reference: str | None = None,
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously evaluate a trajectory.
+
+ Args:
+ prediction: The final predicted response.
+ agent_trajectory:
+ The intermediate steps forming the agent trajectory.
+ input: The input to the agent.
+ reference: The reference answer.
+ **kwargs: Additional keyword arguments.
+
+ Returns:
+ The evaluation result.
+ """
+ self._check_evaluation_args(reference=reference, input_=input)
+ return await self._aevaluate_agent_trajectory(
+ prediction=prediction,
+ input=input,
+ agent_trajectory=agent_trajectory,
+ reference=reference,
+ **kwargs,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..c2c3957feda8069d6c6ef7fe40db78be44eb9167
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/__init__.py
@@ -0,0 +1,57 @@
+"""**Graphs** provide a natural language interface to graph databases."""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import (
+ ArangoGraph,
+ FalkorDBGraph,
+ HugeGraph,
+ KuzuGraph,
+ MemgraphGraph,
+ NebulaGraph,
+ Neo4jGraph,
+ NeptuneGraph,
+ NetworkxEntityGraph,
+ RdfGraph,
+ )
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "MemgraphGraph": "langchain_community.graphs",
+ "NetworkxEntityGraph": "langchain_community.graphs",
+ "Neo4jGraph": "langchain_community.graphs",
+ "NebulaGraph": "langchain_community.graphs",
+ "NeptuneGraph": "langchain_community.graphs",
+ "KuzuGraph": "langchain_community.graphs",
+ "HugeGraph": "langchain_community.graphs",
+ "RdfGraph": "langchain_community.graphs",
+ "ArangoGraph": "langchain_community.graphs",
+ "FalkorDBGraph": "langchain_community.graphs",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArangoGraph",
+ "FalkorDBGraph",
+ "HugeGraph",
+ "KuzuGraph",
+ "MemgraphGraph",
+ "NebulaGraph",
+ "Neo4jGraph",
+ "NeptuneGraph",
+ "NetworkxEntityGraph",
+ "RdfGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/arangodb_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/arangodb_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..9d42d431ff1715ac7f26ae2de2eb7fb75b4258f2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/arangodb_graph.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import ArangoGraph
+ from langchain_community.graphs.arangodb_graph import get_arangodb_client
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ArangoGraph": "langchain_community.graphs",
+ "get_arangodb_client": "langchain_community.graphs.arangodb_graph",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArangoGraph",
+ "get_arangodb_client",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/falkordb_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/falkordb_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..745b605e270270a4d1acf58ad85e772719427763
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/falkordb_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import FalkorDBGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"FalkorDBGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FalkorDBGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/graph_document.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/graph_document.py
new file mode 100644
index 0000000000000000000000000000000000000000..2d76073be47707d778cb0ba925b379667d1bb421
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/graph_document.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs.graph_document import (
+ GraphDocument,
+ Node,
+ Relationship,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Node": "langchain_community.graphs.graph_document",
+ "Relationship": "langchain_community.graphs.graph_document",
+ "GraphDocument": "langchain_community.graphs.graph_document",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GraphDocument",
+ "Node",
+ "Relationship",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/graph_store.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/graph_store.py
new file mode 100644
index 0000000000000000000000000000000000000000..626fa56057200c9313dcb5dab06f27351285f603
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/graph_store.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs.graph_store import GraphStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GraphStore": "langchain_community.graphs.graph_store"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GraphStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/hugegraph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/hugegraph.py
new file mode 100644
index 0000000000000000000000000000000000000000..62c572170262a86b8c1f3c9ad5cdaa39e3fe82f0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/hugegraph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import HugeGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HugeGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HugeGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/kuzu_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/kuzu_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..7216e8057ba00980fcad04a439a1974d9acd0c98
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/kuzu_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import KuzuGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"KuzuGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "KuzuGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/memgraph_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/memgraph_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c84a4bb3bcf8a89e9e43e6fc3470dea6c9b8a3c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/memgraph_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import MemgraphGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MemgraphGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MemgraphGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/nebula_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/nebula_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..a2eb7401e56ec0e13d325ba755579b14e0719c72
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/nebula_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import NebulaGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NebulaGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NebulaGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/neo4j_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/neo4j_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..5244d289f768903a9c7800389f4493327dc46196
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/neo4j_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import Neo4jGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Neo4jGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Neo4jGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/neptune_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/neptune_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..4bc98ee8bedf80fb5923bc6205ec5b2e9316a718
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/neptune_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import NeptuneGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NeptuneGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NeptuneGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/networkx_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/networkx_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..4cb6537bb6c0b97fac38d7727d94fcb6c9d452e4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/networkx_graph.py
@@ -0,0 +1,36 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import NetworkxEntityGraph
+ from langchain_community.graphs.networkx_graph import (
+ KnowledgeTriple,
+ get_entities,
+ parse_triples,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "KnowledgeTriple": "langchain_community.graphs.networkx_graph",
+ "parse_triples": "langchain_community.graphs.networkx_graph",
+ "get_entities": "langchain_community.graphs.networkx_graph",
+ "NetworkxEntityGraph": "langchain_community.graphs",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "KnowledgeTriple",
+ "NetworkxEntityGraph",
+ "get_entities",
+ "parse_triples",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/rdf_graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/rdf_graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..1e1c28c4ab9b00c30607c4b42a4a979c70c6ccdc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/graphs/rdf_graph.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs import RdfGraph
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RdfGraph": "langchain_community.graphs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RdfGraph",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..9bb39353431a3fc041c12ecc42561645e688a372
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/__init__.py
@@ -0,0 +1,52 @@
+"""**Indexes**.
+
+**Index** is used to avoid writing duplicated content
+into the vectostore and to avoid over-writing content if it's unchanged.
+
+Indexes also :
+
+* Create knowledge graphs from data.
+
+* Support indexing workflows from LangChain data loaders to vectorstores.
+
+Importantly, Index keeps on working even if the content being written is derived
+via a set of transformations from some source content (e.g., indexing children
+documents that were derived from parent documents by chunking.)
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.indexing.api import IndexingResult, aindex, index
+
+from langchain_classic._api import create_importer
+from langchain_classic.indexes._sql_record_manager import SQLRecordManager
+from langchain_classic.indexes.vectorstore import VectorstoreIndexCreator
+
+if TYPE_CHECKING:
+ from langchain_community.graphs.index_creator import GraphIndexCreator
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GraphIndexCreator": "langchain_community.graphs.index_creator",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GraphIndexCreator",
+ "IndexingResult",
+ "SQLRecordManager",
+ "VectorstoreIndexCreator",
+ # Keep sorted
+ "aindex",
+ "index",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/_api.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/_api.py
new file mode 100644
index 0000000000000000000000000000000000000000..d5919af972b3864bd433ca71d866bd1447822658
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/_api.py
@@ -0,0 +1,5 @@
+from langchain_core.indexing.api import _abatch, _batch, _HashedDocument
+
+# Please do not use these in your application. These are private APIs.
+# Here to avoid changing unit tests during a migration.
+__all__ = ["_HashedDocument", "_abatch", "_batch"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/_sql_record_manager.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/_sql_record_manager.py
new file mode 100644
index 0000000000000000000000000000000000000000..e9ab8413ebb24e5f51af183a1ebf8fd74ab6db2f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/_sql_record_manager.py
@@ -0,0 +1,532 @@
+"""Implementation of a record management layer in SQLAlchemy.
+
+The management layer uses SQLAlchemy to track upserted records.
+
+Currently, this layer only works with SQLite; hopwever, should be adaptable
+to other SQL implementations with minimal effort.
+
+Currently, includes an implementation that uses SQLAlchemy which should
+allow it to work with a variety of SQL as a backend.
+
+* Each key is associated with an updated_at field.
+* This filed is updated whenever the key is updated.
+* Keys can be listed based on the updated at field.
+* Keys can be deleted.
+"""
+
+import contextlib
+import decimal
+import uuid
+from collections.abc import AsyncGenerator, Generator, Sequence
+from typing import Any
+
+from langchain_core.indexing import RecordManager
+from sqlalchemy import (
+ Column,
+ Float,
+ Index,
+ String,
+ UniqueConstraint,
+ and_,
+ create_engine,
+ delete,
+ select,
+ text,
+)
+from sqlalchemy.engine import URL, Engine
+from sqlalchemy.ext.asyncio import (
+ AsyncEngine,
+ AsyncSession,
+ create_async_engine,
+)
+from sqlalchemy.orm import Query, Session, declarative_base, sessionmaker
+
+try:
+ from sqlalchemy.ext.asyncio import async_sessionmaker
+except ImportError:
+ # dummy for sqlalchemy < 2
+ async_sessionmaker = type("async_sessionmaker", (type,), {}) # type: ignore[assignment,misc]
+
+Base = declarative_base()
+
+
+class UpsertionRecord(Base): # type: ignore[valid-type,misc]
+ """Table used to keep track of when a key was last updated."""
+
+ # ATTENTION:
+ # Prior to modifying this table, please determine whether
+ # we should create migrations for this table to make sure
+ # users do not experience data loss.
+ __tablename__ = "upsertion_record"
+
+ uuid = Column(
+ String,
+ index=True,
+ default=lambda: str(uuid.uuid4()),
+ primary_key=True,
+ nullable=False,
+ )
+ key = Column(String, index=True)
+ # Using a non-normalized representation to handle `namespace` attribute.
+ # If the need arises, this attribute can be pulled into a separate Collection
+ # table at some time later.
+ namespace = Column(String, index=True, nullable=False)
+ group_id = Column(String, index=True, nullable=True)
+
+ # The timestamp associated with the last record upsertion.
+ updated_at = Column(Float, index=True)
+
+ __table_args__ = (
+ UniqueConstraint("key", "namespace", name="uix_key_namespace"),
+ Index("ix_key_namespace", "key", "namespace"),
+ )
+
+
+class SQLRecordManager(RecordManager):
+ """A SQL Alchemy based implementation of the record manager."""
+
+ def __init__(
+ self,
+ namespace: str,
+ *,
+ engine: Engine | AsyncEngine | None = None,
+ db_url: None | str | URL = None,
+ engine_kwargs: dict[str, Any] | None = None,
+ async_mode: bool = False,
+ ) -> None:
+ """Initialize the SQLRecordManager.
+
+ This class serves as a manager persistence layer that uses an SQL
+ backend to track upserted records. You should specify either a `db_url`
+ to create an engine or provide an existing engine.
+
+ Args:
+ namespace: The namespace associated with this record manager.
+ engine: An already existing SQL Alchemy engine.
+ db_url: A database connection string used to create an SQL Alchemy engine.
+ engine_kwargs: Additional keyword arguments to be passed when creating the
+ engine.
+ async_mode: Whether to create an async engine. Driver should support async
+ operations. It only applies if `db_url` is provided.
+
+ Raises:
+ ValueError: If both db_url and engine are provided or neither.
+ AssertionError: If something unexpected happens during engine configuration.
+ """
+ super().__init__(namespace=namespace)
+ if db_url is None and engine is None:
+ msg = "Must specify either db_url or engine"
+ raise ValueError(msg)
+
+ if db_url is not None and engine is not None:
+ msg = "Must specify either db_url or engine, not both"
+ raise ValueError(msg)
+
+ _engine: Engine | AsyncEngine
+ if db_url:
+ if async_mode:
+ _engine = create_async_engine(db_url, **(engine_kwargs or {}))
+ else:
+ _engine = create_engine(db_url, **(engine_kwargs or {}))
+ elif engine:
+ _engine = engine
+
+ else:
+ msg = "Something went wrong with configuration of engine."
+ raise AssertionError(msg)
+
+ _session_factory: sessionmaker[Session] | async_sessionmaker[AsyncSession]
+ if isinstance(_engine, AsyncEngine):
+ _session_factory = async_sessionmaker(bind=_engine)
+ else:
+ _session_factory = sessionmaker(bind=_engine)
+
+ self.engine = _engine
+ self.dialect = _engine.dialect.name
+ self.session_factory = _session_factory
+
+ def create_schema(self) -> None:
+ """Create the database schema."""
+ if isinstance(self.engine, AsyncEngine):
+ msg = "This method is not supported for async engines."
+ raise AssertionError(msg) # noqa: TRY004
+
+ Base.metadata.create_all(self.engine)
+
+ async def acreate_schema(self) -> None:
+ """Create the database schema."""
+ if not isinstance(self.engine, AsyncEngine):
+ msg = "This method is not supported for sync engines."
+ raise AssertionError(msg) # noqa: TRY004
+
+ async with self.engine.begin() as session:
+ await session.run_sync(Base.metadata.create_all)
+
+ @contextlib.contextmanager
+ def _make_session(self) -> Generator[Session, None, None]:
+ """Create a session and close it after use."""
+ if isinstance(self.session_factory, async_sessionmaker):
+ msg = "This method is not supported for async engines."
+ raise AssertionError(msg) # noqa: TRY004
+
+ session = self.session_factory()
+ try:
+ yield session
+ finally:
+ session.close()
+
+ @contextlib.asynccontextmanager
+ async def _amake_session(self) -> AsyncGenerator[AsyncSession, None]:
+ """Create a session and close it after use."""
+ if not isinstance(self.session_factory, async_sessionmaker):
+ msg = "This method is not supported for sync engines."
+ raise AssertionError(msg) # noqa: TRY004
+
+ async with self.session_factory() as session:
+ yield session
+
+ def get_time(self) -> float:
+ """Get the current server time as a timestamp.
+
+ Please note it's critical that time is obtained from the server since
+ we want a monotonic clock.
+ """
+ with self._make_session() as session:
+ # * SQLite specific implementation, can be changed based on dialect.
+ # * For SQLite, unlike unixepoch it will work with older versions of SQLite.
+ # ----
+ # julianday('now'): Julian day number for the current date and time.
+ # The Julian day is a continuous count of days, starting from a
+ # reference date (Julian day number 0).
+ # 2440587.5 - constant represents the Julian day number for January 1, 1970
+ # 86400.0 - constant represents the number of seconds
+ # in a day (24 hours * 60 minutes * 60 seconds)
+ if self.dialect == "sqlite":
+ query = text("SELECT (julianday('now') - 2440587.5) * 86400.0;")
+ elif self.dialect == "postgresql":
+ query = text("SELECT EXTRACT (EPOCH FROM CURRENT_TIMESTAMP);")
+ else:
+ msg = f"Not implemented for dialect {self.dialect}"
+ raise NotImplementedError(msg)
+
+ dt = session.execute(query).scalar()
+ if isinstance(dt, decimal.Decimal):
+ dt = float(dt)
+ if not isinstance(dt, float):
+ msg = f"Unexpected type for datetime: {type(dt)}"
+ raise AssertionError(msg) # noqa: TRY004
+ return dt
+
+ async def aget_time(self) -> float:
+ """Get the current server time as a timestamp.
+
+ Please note it's critical that time is obtained from the server since
+ we want a monotonic clock.
+ """
+ async with self._amake_session() as session:
+ # * SQLite specific implementation, can be changed based on dialect.
+ # * For SQLite, unlike unixepoch it will work with older versions of SQLite.
+ # ----
+ # julianday('now'): Julian day number for the current date and time.
+ # The Julian day is a continuous count of days, starting from a
+ # reference date (Julian day number 0).
+ # 2440587.5 - constant represents the Julian day number for January 1, 1970
+ # 86400.0 - constant represents the number of seconds
+ # in a day (24 hours * 60 minutes * 60 seconds)
+ if self.dialect == "sqlite":
+ query = text("SELECT (julianday('now') - 2440587.5) * 86400.0;")
+ elif self.dialect == "postgresql":
+ query = text("SELECT EXTRACT (EPOCH FROM CURRENT_TIMESTAMP);")
+ else:
+ msg = f"Not implemented for dialect {self.dialect}"
+ raise NotImplementedError(msg)
+
+ dt = (await session.execute(query)).scalar_one_or_none()
+
+ if isinstance(dt, decimal.Decimal):
+ dt = float(dt)
+ if not isinstance(dt, float):
+ msg = f"Unexpected type for datetime: {type(dt)}"
+ raise AssertionError(msg) # noqa: TRY004
+ return dt
+
+ def update(
+ self,
+ keys: Sequence[str],
+ *,
+ group_ids: Sequence[str | None] | None = None,
+ time_at_least: float | None = None,
+ ) -> None:
+ """Upsert records into the SQLite database."""
+ if group_ids is None:
+ group_ids = [None] * len(keys)
+
+ if len(keys) != len(group_ids):
+ msg = (
+ f"Number of keys ({len(keys)}) does not match number of "
+ f"group_ids ({len(group_ids)})"
+ )
+ raise ValueError(msg)
+
+ # Get the current time from the server.
+ # This makes an extra round trip to the server, should not be a big deal
+ # if the batch size is large enough.
+ # Getting the time here helps us compare it against the time_at_least
+ # and raise an error if there is a time sync issue.
+ # Here, we're just being extra careful to minimize the chance of
+ # data loss due to incorrectly deleting records.
+ update_time = self.get_time()
+
+ if time_at_least and update_time < time_at_least:
+ # Safeguard against time sync issues
+ msg = f"Time sync issue: {update_time} < {time_at_least}"
+ raise AssertionError(msg)
+
+ records_to_upsert = [
+ {
+ "key": key,
+ "namespace": self.namespace,
+ "updated_at": update_time,
+ "group_id": group_id,
+ }
+ for key, group_id in zip(keys, group_ids, strict=False)
+ ]
+
+ with self._make_session() as session:
+ if self.dialect == "sqlite":
+ from sqlalchemy.dialects.sqlite import Insert as SqliteInsertType
+ from sqlalchemy.dialects.sqlite import insert as sqlite_insert
+
+ # Note: uses SQLite insert to make on_conflict_do_update work.
+ # This code needs to be generalized a bit to work with more dialects.
+ sqlite_insert_stmt: SqliteInsertType = sqlite_insert(
+ UpsertionRecord,
+ ).values(records_to_upsert)
+ stmt = sqlite_insert_stmt.on_conflict_do_update(
+ [UpsertionRecord.key, UpsertionRecord.namespace],
+ set_={
+ "updated_at": sqlite_insert_stmt.excluded.updated_at,
+ "group_id": sqlite_insert_stmt.excluded.group_id,
+ },
+ )
+ elif self.dialect == "postgresql":
+ from sqlalchemy.dialects.postgresql import Insert as PgInsertType
+ from sqlalchemy.dialects.postgresql import insert as pg_insert
+
+ # Note: uses postgresql insert to make on_conflict_do_update work.
+ # This code needs to be generalized a bit to work with more dialects.
+ pg_insert_stmt: PgInsertType = pg_insert(UpsertionRecord).values(
+ records_to_upsert,
+ )
+ stmt = pg_insert_stmt.on_conflict_do_update( # type: ignore[assignment]
+ constraint="uix_key_namespace", # Name of constraint
+ set_={
+ "updated_at": pg_insert_stmt.excluded.updated_at,
+ "group_id": pg_insert_stmt.excluded.group_id,
+ },
+ )
+ else:
+ msg = f"Unsupported dialect {self.dialect}"
+ raise NotImplementedError(msg)
+
+ session.execute(stmt)
+ session.commit()
+
+ async def aupdate(
+ self,
+ keys: Sequence[str],
+ *,
+ group_ids: Sequence[str | None] | None = None,
+ time_at_least: float | None = None,
+ ) -> None:
+ """Upsert records into the SQLite database."""
+ if group_ids is None:
+ group_ids = [None] * len(keys)
+
+ if len(keys) != len(group_ids):
+ msg = (
+ f"Number of keys ({len(keys)}) does not match number of "
+ f"group_ids ({len(group_ids)})"
+ )
+ raise ValueError(msg)
+
+ # Get the current time from the server.
+ # This makes an extra round trip to the server, should not be a big deal
+ # if the batch size is large enough.
+ # Getting the time here helps us compare it against the time_at_least
+ # and raise an error if there is a time sync issue.
+ # Here, we're just being extra careful to minimize the chance of
+ # data loss due to incorrectly deleting records.
+ update_time = await self.aget_time()
+
+ if time_at_least and update_time < time_at_least:
+ # Safeguard against time sync issues
+ msg = f"Time sync issue: {update_time} < {time_at_least}"
+ raise AssertionError(msg)
+
+ records_to_upsert = [
+ {
+ "key": key,
+ "namespace": self.namespace,
+ "updated_at": update_time,
+ "group_id": group_id,
+ }
+ for key, group_id in zip(keys, group_ids, strict=False)
+ ]
+
+ async with self._amake_session() as session:
+ if self.dialect == "sqlite":
+ from sqlalchemy.dialects.sqlite import Insert as SqliteInsertType
+ from sqlalchemy.dialects.sqlite import insert as sqlite_insert
+
+ # Note: uses SQLite insert to make on_conflict_do_update work.
+ # This code needs to be generalized a bit to work with more dialects.
+ sqlite_insert_stmt: SqliteInsertType = sqlite_insert(
+ UpsertionRecord,
+ ).values(records_to_upsert)
+ stmt = sqlite_insert_stmt.on_conflict_do_update(
+ [UpsertionRecord.key, UpsertionRecord.namespace],
+ set_={
+ "updated_at": sqlite_insert_stmt.excluded.updated_at,
+ "group_id": sqlite_insert_stmt.excluded.group_id,
+ },
+ )
+ elif self.dialect == "postgresql":
+ from sqlalchemy.dialects.postgresql import Insert as PgInsertType
+ from sqlalchemy.dialects.postgresql import insert as pg_insert
+
+ # Note: uses SQLite insert to make on_conflict_do_update work.
+ # This code needs to be generalized a bit to work with more dialects.
+ pg_insert_stmt: PgInsertType = pg_insert(UpsertionRecord).values(
+ records_to_upsert,
+ )
+ stmt = pg_insert_stmt.on_conflict_do_update( # type: ignore[assignment]
+ constraint="uix_key_namespace", # Name of constraint
+ set_={
+ "updated_at": pg_insert_stmt.excluded.updated_at,
+ "group_id": pg_insert_stmt.excluded.group_id,
+ },
+ )
+ else:
+ msg = f"Unsupported dialect {self.dialect}"
+ raise NotImplementedError(msg)
+
+ await session.execute(stmt)
+ await session.commit()
+
+ def exists(self, keys: Sequence[str]) -> list[bool]:
+ """Check if the given keys exist in the SQLite database."""
+ session: Session
+ with self._make_session() as session:
+ filtered_query: Query = session.query(UpsertionRecord.key).filter(
+ and_(
+ UpsertionRecord.key.in_(keys),
+ UpsertionRecord.namespace == self.namespace,
+ ),
+ )
+ records = filtered_query.all()
+ found_keys = {r.key for r in records}
+ return [k in found_keys for k in keys]
+
+ async def aexists(self, keys: Sequence[str]) -> list[bool]:
+ """Check if the given keys exist in the SQLite database."""
+ async with self._amake_session() as session:
+ records = (
+ (
+ await session.execute(
+ select(UpsertionRecord.key).where(
+ and_(
+ UpsertionRecord.key.in_(keys),
+ UpsertionRecord.namespace == self.namespace,
+ ),
+ ),
+ )
+ )
+ .scalars()
+ .all()
+ )
+ found_keys = set(records)
+ return [k in found_keys for k in keys]
+
+ def list_keys(
+ self,
+ *,
+ before: float | None = None,
+ after: float | None = None,
+ group_ids: Sequence[str] | None = None,
+ limit: int | None = None,
+ ) -> list[str]:
+ """List records in the SQLite database based on the provided date range."""
+ session: Session
+ with self._make_session() as session:
+ query: Query = session.query(UpsertionRecord).filter(
+ UpsertionRecord.namespace == self.namespace,
+ )
+
+ if after:
+ query = query.filter(UpsertionRecord.updated_at > after)
+ if before:
+ query = query.filter(UpsertionRecord.updated_at < before)
+ if group_ids:
+ query = query.filter(UpsertionRecord.group_id.in_(group_ids))
+
+ if limit:
+ query = query.limit(limit)
+ records = query.all()
+ return [r.key for r in records]
+
+ async def alist_keys(
+ self,
+ *,
+ before: float | None = None,
+ after: float | None = None,
+ group_ids: Sequence[str] | None = None,
+ limit: int | None = None,
+ ) -> list[str]:
+ """List records in the SQLite database based on the provided date range."""
+ session: AsyncSession
+ async with self._amake_session() as session:
+ query: Query = select(UpsertionRecord.key).filter( # type: ignore[assignment]
+ UpsertionRecord.namespace == self.namespace,
+ )
+
+ # mypy does not recognize .all() or .filter()
+ if after:
+ query = query.filter(UpsertionRecord.updated_at > after)
+ if before:
+ query = query.filter(UpsertionRecord.updated_at < before)
+ if group_ids:
+ query = query.filter(UpsertionRecord.group_id.in_(group_ids))
+
+ if limit:
+ query = query.limit(limit)
+ records = (await session.execute(query)).scalars().all()
+ return list(records)
+
+ def delete_keys(self, keys: Sequence[str]) -> None:
+ """Delete records from the SQLite database."""
+ session: Session
+ with self._make_session() as session:
+ filtered_query: Query = session.query(UpsertionRecord).filter(
+ and_(
+ UpsertionRecord.key.in_(keys),
+ UpsertionRecord.namespace == self.namespace,
+ ),
+ )
+
+ filtered_query.delete()
+ session.commit()
+
+ async def adelete_keys(self, keys: Sequence[str]) -> None:
+ """Delete records from the SQLite database."""
+ async with self._amake_session() as session:
+ await session.execute(
+ delete(UpsertionRecord).where(
+ and_(
+ UpsertionRecord.key.in_(keys),
+ UpsertionRecord.namespace == self.namespace,
+ ),
+ ),
+ )
+
+ await session.commit()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/graph.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/graph.py
new file mode 100644
index 0000000000000000000000000000000000000000..96220ddc6ccfb66e9ff468a97510574f72880c44
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/graph.py
@@ -0,0 +1,28 @@
+"""**Graphs** provide a natural language interface to graph databases."""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.graphs.index_creator import GraphIndexCreator
+ from langchain_community.graphs.networkx_graph import NetworkxEntityGraph
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GraphIndexCreator": "langchain_community.graphs.index_creator",
+ "NetworkxEntityGraph": "langchain_community.graphs.networkx_graph",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = ["GraphIndexCreator", "NetworkxEntityGraph"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/vectorstore.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/vectorstore.py
new file mode 100644
index 0000000000000000000000000000000000000000..073091c2b2ab6315d910951eaa8c30dad3e8cd36
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/indexes/vectorstore.py
@@ -0,0 +1,271 @@
+"""Vectorstore stubs for the indexing api."""
+
+from typing import Any
+
+from langchain_core.document_loaders import BaseLoader
+from langchain_core.documents import Document
+from langchain_core.embeddings import Embeddings
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.vectorstores import VectorStore
+from langchain_text_splitters import RecursiveCharacterTextSplitter, TextSplitter
+from pydantic import BaseModel, ConfigDict, Field
+
+from langchain_classic.chains.qa_with_sources.retrieval import (
+ RetrievalQAWithSourcesChain,
+)
+from langchain_classic.chains.retrieval_qa.base import RetrievalQA
+
+
+def _get_default_text_splitter() -> TextSplitter:
+ """Return the default text splitter used for chunking documents."""
+ return RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
+
+
+class VectorStoreIndexWrapper(BaseModel):
+ """Wrapper around a `VectorStore` for easy access."""
+
+ vectorstore: VectorStore
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ def query(
+ self,
+ question: str,
+ llm: BaseLanguageModel | None = None,
+ retriever_kwargs: dict[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> str:
+ """Query the `VectorStore` using the provided LLM.
+
+ Args:
+ question: The question or prompt to query.
+ llm: The language model to use. Must not be `None`.
+ retriever_kwargs: Optional keyword arguments for the retriever.
+ **kwargs: Additional keyword arguments forwarded to the chain.
+
+ Returns:
+ The result string from the RetrievalQA chain.
+ """
+ if llm is None:
+ msg = (
+ "This API has been changed to require an LLM. "
+ "Please provide an llm to use for querying the vectorstore.\n"
+ "For example,\n"
+ "from langchain_openai import OpenAI\n"
+ "model = OpenAI(temperature=0)"
+ )
+ raise NotImplementedError(msg)
+ retriever_kwargs = retriever_kwargs or {}
+ chain = RetrievalQA.from_chain_type(
+ llm,
+ retriever=self.vectorstore.as_retriever(**retriever_kwargs),
+ **kwargs,
+ )
+ return chain.invoke({chain.input_key: question})[chain.output_key]
+
+ async def aquery(
+ self,
+ question: str,
+ llm: BaseLanguageModel | None = None,
+ retriever_kwargs: dict[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> str:
+ """Asynchronously query the `VectorStore` using the provided LLM.
+
+ Args:
+ question: The question or prompt to query.
+ llm: The language model to use. Must not be `None`.
+ retriever_kwargs: Optional keyword arguments for the retriever.
+ **kwargs: Additional keyword arguments forwarded to the chain.
+
+ Returns:
+ The asynchronous result string from the RetrievalQA chain.
+ """
+ if llm is None:
+ msg = (
+ "This API has been changed to require an LLM. "
+ "Please provide an llm to use for querying the vectorstore.\n"
+ "For example,\n"
+ "from langchain_openai import OpenAI\n"
+ "model = OpenAI(temperature=0)"
+ )
+ raise NotImplementedError(msg)
+ retriever_kwargs = retriever_kwargs or {}
+ chain = RetrievalQA.from_chain_type(
+ llm,
+ retriever=self.vectorstore.as_retriever(**retriever_kwargs),
+ **kwargs,
+ )
+ return (await chain.ainvoke({chain.input_key: question}))[chain.output_key]
+
+ def query_with_sources(
+ self,
+ question: str,
+ llm: BaseLanguageModel | None = None,
+ retriever_kwargs: dict[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> dict:
+ """Query the `VectorStore` and retrieve the answer along with sources.
+
+ Args:
+ question: The question or prompt to query.
+ llm: The language model to use. Must not be `None`.
+ retriever_kwargs: Optional keyword arguments for the retriever.
+ **kwargs: Additional keyword arguments forwarded to the chain.
+
+ Returns:
+ `dict` containing the answer and source documents.
+ """
+ if llm is None:
+ msg = (
+ "This API has been changed to require an LLM. "
+ "Please provide an llm to use for querying the vectorstore.\n"
+ "For example,\n"
+ "from langchain_openai import OpenAI\n"
+ "model = OpenAI(temperature=0)"
+ )
+ raise NotImplementedError(msg)
+ retriever_kwargs = retriever_kwargs or {}
+ chain = RetrievalQAWithSourcesChain.from_chain_type(
+ llm,
+ retriever=self.vectorstore.as_retriever(**retriever_kwargs),
+ **kwargs,
+ )
+ return chain.invoke({chain.question_key: question})
+
+ async def aquery_with_sources(
+ self,
+ question: str,
+ llm: BaseLanguageModel | None = None,
+ retriever_kwargs: dict[str, Any] | None = None,
+ **kwargs: Any,
+ ) -> dict:
+ """Asynchronously query the `VectorStore` and retrieve the answer and sources.
+
+ Args:
+ question: The question or prompt to query.
+ llm: The language model to use. Must not be `None`.
+ retriever_kwargs: Optional keyword arguments for the retriever.
+ **kwargs: Additional keyword arguments forwarded to the chain.
+
+ Returns:
+ `dict` containing the answer and source documents.
+ """
+ if llm is None:
+ msg = (
+ "This API has been changed to require an LLM. "
+ "Please provide an llm to use for querying the vectorstore.\n"
+ "For example,\n"
+ "from langchain_openai import OpenAI\n"
+ "model = OpenAI(temperature=0)"
+ )
+ raise NotImplementedError(msg)
+ retriever_kwargs = retriever_kwargs or {}
+ chain = RetrievalQAWithSourcesChain.from_chain_type(
+ llm,
+ retriever=self.vectorstore.as_retriever(**retriever_kwargs),
+ **kwargs,
+ )
+ return await chain.ainvoke({chain.question_key: question})
+
+
+def _get_in_memory_vectorstore() -> type[VectorStore]:
+ """Get the `InMemoryVectorStore`."""
+ import warnings
+
+ try:
+ from langchain_community.vectorstores.inmemory import InMemoryVectorStore
+ except ImportError as e:
+ msg = "Please install langchain-community to use the InMemoryVectorStore."
+ raise ImportError(msg) from e
+ warnings.warn(
+ "Using InMemoryVectorStore as the default vectorstore."
+ "This memory store won't persist data. You should explicitly"
+ "specify a VectorStore when using VectorstoreIndexCreator",
+ stacklevel=3,
+ )
+ return InMemoryVectorStore
+
+
+class VectorstoreIndexCreator(BaseModel):
+ """Logic for creating indexes."""
+
+ vectorstore_cls: type[VectorStore] = Field(
+ default_factory=_get_in_memory_vectorstore,
+ )
+ embedding: Embeddings
+ text_splitter: TextSplitter = Field(default_factory=_get_default_text_splitter)
+ vectorstore_kwargs: dict = Field(default_factory=dict)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ def from_loaders(self, loaders: list[BaseLoader]) -> VectorStoreIndexWrapper:
+ """Create a `VectorStore` index from a list of loaders.
+
+ Args:
+ loaders: A list of `BaseLoader` instances to load documents.
+
+ Returns:
+ A `VectorStoreIndexWrapper` containing the constructed vectorstore.
+ """
+ docs = []
+ for loader in loaders:
+ docs.extend(loader.load())
+ return self.from_documents(docs)
+
+ async def afrom_loaders(self, loaders: list[BaseLoader]) -> VectorStoreIndexWrapper:
+ """Asynchronously create a `VectorStore` index from a list of loaders.
+
+ Args:
+ loaders: A list of `BaseLoader` instances to load documents.
+
+ Returns:
+ A `VectorStoreIndexWrapper` containing the constructed vectorstore.
+ """
+ docs = []
+ for loader in loaders:
+ docs.extend([doc async for doc in loader.alazy_load()])
+ return await self.afrom_documents(docs)
+
+ def from_documents(self, documents: list[Document]) -> VectorStoreIndexWrapper:
+ """Create a `VectorStore` index from a list of documents.
+
+ Args:
+ documents: A list of `Document` objects.
+
+ Returns:
+ A `VectorStoreIndexWrapper` containing the constructed vectorstore.
+ """
+ sub_docs = self.text_splitter.split_documents(documents)
+ vectorstore = self.vectorstore_cls.from_documents(
+ sub_docs,
+ self.embedding,
+ **self.vectorstore_kwargs,
+ )
+ return VectorStoreIndexWrapper(vectorstore=vectorstore)
+
+ async def afrom_documents(
+ self,
+ documents: list[Document],
+ ) -> VectorStoreIndexWrapper:
+ """Asynchronously create a `VectorStore` index from a list of documents.
+
+ Args:
+ documents: A list of `Document` objects.
+
+ Returns:
+ A `VectorStoreIndexWrapper` containing the constructed vectorstore.
+ """
+ sub_docs = self.text_splitter.split_documents(documents)
+ vectorstore = await self.vectorstore_cls.afrom_documents(
+ sub_docs,
+ self.embedding,
+ **self.vectorstore_kwargs,
+ )
+ return VectorStoreIndexWrapper(vectorstore=vectorstore)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..d0691634ede9b9bde4f1ad7ab4c57c9d9a4ec448
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/__init__.py
@@ -0,0 +1,720 @@
+"""**LLMs**.
+
+**LLM** classes provide access to the large language model (**LLM**) APIs and services.
+"""
+
+import warnings
+from collections.abc import Callable
+from typing import Any
+
+from langchain_core._api import LangChainDeprecationWarning
+from langchain_core.language_models.llms import BaseLLM
+
+from langchain_classic._api.interactive_env import is_interactive_env
+
+
+def _import_ai21() -> Any:
+ from langchain_community.llms.ai21 import AI21
+
+ return AI21
+
+
+def _import_aleph_alpha() -> Any:
+ from langchain_community.llms.aleph_alpha import AlephAlpha
+
+ return AlephAlpha
+
+
+def _import_amazon_api_gateway() -> Any:
+ from langchain_community.llms.amazon_api_gateway import AmazonAPIGateway
+
+ return AmazonAPIGateway
+
+
+def _import_anthropic() -> Any:
+ from langchain_community.llms.anthropic import Anthropic
+
+ return Anthropic
+
+
+def _import_anyscale() -> Any:
+ from langchain_community.llms.anyscale import Anyscale
+
+ return Anyscale
+
+
+def _import_arcee() -> Any:
+ from langchain_community.llms.arcee import Arcee
+
+ return Arcee
+
+
+def _import_aviary() -> Any:
+ from langchain_community.llms.aviary import Aviary
+
+ return Aviary
+
+
+def _import_azureml_endpoint() -> Any:
+ from langchain_community.llms.azureml_endpoint import AzureMLOnlineEndpoint
+
+ return AzureMLOnlineEndpoint
+
+
+def _import_baidu_qianfan_endpoint() -> Any:
+ from langchain_community.llms.baidu_qianfan_endpoint import QianfanLLMEndpoint
+
+ return QianfanLLMEndpoint
+
+
+def _import_bananadev() -> Any:
+ from langchain_community.llms.bananadev import Banana
+
+ return Banana
+
+
+def _import_baseten() -> Any:
+ from langchain_community.llms.baseten import Baseten
+
+ return Baseten
+
+
+def _import_beam() -> Any:
+ from langchain_community.llms.beam import Beam
+
+ return Beam
+
+
+def _import_bedrock() -> Any:
+ from langchain_community.llms.bedrock import Bedrock
+
+ return Bedrock
+
+
+def _import_bittensor() -> Any:
+ from langchain_community.llms.bittensor import NIBittensorLLM
+
+ return NIBittensorLLM
+
+
+def _import_cerebriumai() -> Any:
+ from langchain_community.llms.cerebriumai import CerebriumAI
+
+ return CerebriumAI
+
+
+def _import_chatglm() -> Any:
+ from langchain_community.llms.chatglm import ChatGLM
+
+ return ChatGLM
+
+
+def _import_clarifai() -> Any:
+ from langchain_community.llms.clarifai import Clarifai
+
+ return Clarifai
+
+
+def _import_cohere() -> Any:
+ from langchain_community.llms.cohere import Cohere
+
+ return Cohere
+
+
+def _import_ctransformers() -> Any:
+ from langchain_community.llms.ctransformers import CTransformers
+
+ return CTransformers
+
+
+def _import_ctranslate2() -> Any:
+ from langchain_community.llms.ctranslate2 import CTranslate2
+
+ return CTranslate2
+
+
+def _import_databricks() -> Any:
+ from langchain_community.llms.databricks import Databricks
+
+ return Databricks
+
+
+def _import_databricks_chat() -> Any:
+ from langchain_community.chat_models.databricks import ChatDatabricks
+
+ return ChatDatabricks
+
+
+def _import_deepinfra() -> Any:
+ from langchain_community.llms.deepinfra import DeepInfra
+
+ return DeepInfra
+
+
+def _import_deepsparse() -> Any:
+ from langchain_community.llms.deepsparse import DeepSparse
+
+ return DeepSparse
+
+
+def _import_edenai() -> Any:
+ from langchain_community.llms.edenai import EdenAI
+
+ return EdenAI
+
+
+def _import_fake() -> Any:
+ from langchain_core.language_models import FakeListLLM
+
+ return FakeListLLM
+
+
+def _import_fireworks() -> Any:
+ from langchain_community.llms.fireworks import Fireworks
+
+ return Fireworks
+
+
+def _import_forefrontai() -> Any:
+ from langchain_community.llms.forefrontai import ForefrontAI
+
+ return ForefrontAI
+
+
+def _import_gigachat() -> Any:
+ from langchain_community.llms.gigachat import GigaChat
+
+ return GigaChat
+
+
+def _import_google_palm() -> Any:
+ from langchain_community.llms.google_palm import GooglePalm
+
+ return GooglePalm
+
+
+def _import_gooseai() -> Any:
+ from langchain_community.llms.gooseai import GooseAI
+
+ return GooseAI
+
+
+def _import_gpt4all() -> Any:
+ from langchain_community.llms.gpt4all import GPT4All
+
+ return GPT4All
+
+
+def _import_gradient_ai() -> Any:
+ from langchain_community.llms.gradient_ai import GradientLLM
+
+ return GradientLLM
+
+
+def _import_huggingface_endpoint() -> Any:
+ from langchain_community.llms.huggingface_endpoint import HuggingFaceEndpoint
+
+ return HuggingFaceEndpoint
+
+
+def _import_huggingface_hub() -> Any:
+ from langchain_community.llms.huggingface_hub import HuggingFaceHub
+
+ return HuggingFaceHub
+
+
+def _import_huggingface_pipeline() -> Any:
+ from langchain_community.llms.huggingface_pipeline import HuggingFacePipeline
+
+ return HuggingFacePipeline
+
+
+def _import_huggingface_text_gen_inference() -> Any:
+ from langchain_community.llms.huggingface_text_gen_inference import (
+ HuggingFaceTextGenInference,
+ )
+
+ return HuggingFaceTextGenInference
+
+
+def _import_human() -> Any:
+ from langchain_community.llms.human import HumanInputLLM
+
+ return HumanInputLLM
+
+
+def _import_javelin_ai_gateway() -> Any:
+ from langchain_community.llms.javelin_ai_gateway import JavelinAIGateway
+
+ return JavelinAIGateway
+
+
+def _import_koboldai() -> Any:
+ from langchain_community.llms.koboldai import KoboldApiLLM
+
+ return KoboldApiLLM
+
+
+def _import_llamacpp() -> Any:
+ from langchain_community.llms.llamacpp import LlamaCpp
+
+ return LlamaCpp
+
+
+def _import_manifest() -> Any:
+ from langchain_community.llms.manifest import ManifestWrapper
+
+ return ManifestWrapper
+
+
+def _import_minimax() -> Any:
+ from langchain_community.llms.minimax import Minimax
+
+ return Minimax
+
+
+def _import_mlflow() -> Any:
+ from langchain_community.llms.mlflow import Mlflow
+
+ return Mlflow
+
+
+def _import_mlflow_chat() -> Any:
+ from langchain_community.chat_models.mlflow import ChatMlflow
+
+ return ChatMlflow
+
+
+def _import_mlflow_ai_gateway() -> Any:
+ from langchain_community.llms.mlflow_ai_gateway import MlflowAIGateway
+
+ return MlflowAIGateway
+
+
+def _import_modal() -> Any:
+ from langchain_community.llms.modal import Modal
+
+ return Modal
+
+
+def _import_mosaicml() -> Any:
+ from langchain_community.llms.mosaicml import MosaicML
+
+ return MosaicML
+
+
+def _import_nlpcloud() -> Any:
+ from langchain_community.llms.nlpcloud import NLPCloud
+
+ return NLPCloud
+
+
+def _import_octoai_endpoint() -> Any:
+ from langchain_community.llms.octoai_endpoint import OctoAIEndpoint
+
+ return OctoAIEndpoint
+
+
+def _import_ollama() -> Any:
+ from langchain_community.llms.ollama import Ollama
+
+ return Ollama
+
+
+def _import_opaqueprompts() -> Any:
+ from langchain_community.llms.opaqueprompts import OpaquePrompts
+
+ return OpaquePrompts
+
+
+def _import_azure_openai() -> Any:
+ from langchain_community.llms.openai import AzureOpenAI
+
+ return AzureOpenAI
+
+
+def _import_openai() -> Any:
+ from langchain_community.llms.openai import OpenAI
+
+ return OpenAI
+
+
+def _import_openai_chat() -> Any:
+ from langchain_community.llms.openai import OpenAIChat
+
+ return OpenAIChat
+
+
+def _import_openllm() -> Any:
+ from langchain_community.llms.openllm import OpenLLM
+
+ return OpenLLM
+
+
+def _import_openlm() -> Any:
+ from langchain_community.llms.openlm import OpenLM
+
+ return OpenLM
+
+
+def _import_pai_eas_endpoint() -> Any:
+ from langchain_community.llms.pai_eas_endpoint import PaiEasEndpoint
+
+ return PaiEasEndpoint
+
+
+def _import_petals() -> Any:
+ from langchain_community.llms.petals import Petals
+
+ return Petals
+
+
+def _import_pipelineai() -> Any:
+ from langchain_community.llms.pipelineai import PipelineAI
+
+ return PipelineAI
+
+
+def _import_predibase() -> Any:
+ from langchain_community.llms.predibase import Predibase
+
+ return Predibase
+
+
+def _import_predictionguard() -> Any:
+ from langchain_community.llms.predictionguard import PredictionGuard
+
+ return PredictionGuard
+
+
+def _import_promptlayer() -> Any:
+ from langchain_community.llms.promptlayer_openai import PromptLayerOpenAI
+
+ return PromptLayerOpenAI
+
+
+def _import_promptlayer_chat() -> Any:
+ from langchain_community.llms.promptlayer_openai import PromptLayerOpenAIChat
+
+ return PromptLayerOpenAIChat
+
+
+def _import_replicate() -> Any:
+ from langchain_community.llms.replicate import Replicate
+
+ return Replicate
+
+
+def _import_rwkv() -> Any:
+ from langchain_community.llms.rwkv import RWKV
+
+ return RWKV
+
+
+def _import_sagemaker_endpoint() -> Any:
+ from langchain_community.llms.sagemaker_endpoint import SagemakerEndpoint
+
+ return SagemakerEndpoint
+
+
+def _import_self_hosted() -> Any:
+ from langchain_community.llms.self_hosted import SelfHostedPipeline
+
+ return SelfHostedPipeline
+
+
+def _import_self_hosted_hugging_face() -> Any:
+ from langchain_community.llms.self_hosted_hugging_face import (
+ SelfHostedHuggingFaceLLM,
+ )
+
+ return SelfHostedHuggingFaceLLM
+
+
+def _import_stochasticai() -> Any:
+ from langchain_community.llms.stochasticai import StochasticAI
+
+ return StochasticAI
+
+
+def _import_symblai_nebula() -> Any:
+ from langchain_community.llms.symblai_nebula import Nebula
+
+ return Nebula
+
+
+def _import_textgen() -> Any:
+ from langchain_community.llms.textgen import TextGen
+
+ return TextGen
+
+
+def _import_titan_takeoff() -> Any:
+ from langchain_community.llms.titan_takeoff import TitanTakeoff
+
+ return TitanTakeoff
+
+
+def _import_titan_takeoff_pro() -> Any:
+ from langchain_community.llms.titan_takeoff import TitanTakeoff
+
+ return TitanTakeoff
+
+
+def _import_together() -> Any:
+ from langchain_community.llms.together import Together
+
+ return Together
+
+
+def _import_tongyi() -> Any:
+ from langchain_community.llms.tongyi import Tongyi
+
+ return Tongyi
+
+
+def _import_vertex() -> Any:
+ from langchain_community.llms.vertexai import VertexAI
+
+ return VertexAI
+
+
+def _import_vertex_model_garden() -> Any:
+ from langchain_community.llms.vertexai import VertexAIModelGarden
+
+ return VertexAIModelGarden
+
+
+def _import_vllm() -> Any:
+ from langchain_community.llms.vllm import VLLM
+
+ return VLLM
+
+
+def _import_vllm_openai() -> Any:
+ from langchain_community.llms.vllm import VLLMOpenAI
+
+ return VLLMOpenAI
+
+
+def _import_watsonxllm() -> Any:
+ from langchain_community.llms.watsonxllm import WatsonxLLM
+
+ return WatsonxLLM
+
+
+def _import_writer() -> Any:
+ from langchain_community.llms.writer import Writer
+
+ return Writer
+
+
+def _import_xinference() -> Any:
+ from langchain_community.llms.xinference import Xinference
+
+ return Xinference
+
+
+def _import_yandex_gpt() -> Any:
+ from langchain_community.llms.yandex import YandexGPT
+
+ return YandexGPT
+
+
+def _import_volcengine_maas() -> Any:
+ from langchain_community.llms.volcengine_maas import VolcEngineMaasLLM
+
+ return VolcEngineMaasLLM
+
+
+def __getattr__(name: str) -> Any:
+ from langchain_community import llms
+
+ # If not in interactive env, raise warning.
+ if not is_interactive_env():
+ warnings.warn(
+ "Importing LLMs from langchain is deprecated. Importing from "
+ "langchain will no longer be supported as of langchain==0.2.0. "
+ "Please import from langchain-community instead:\n\n"
+ f"`from langchain_community.llms import {name}`.\n\n"
+ "To install langchain-community run `pip install -U langchain-community`.",
+ stacklevel=2,
+ category=LangChainDeprecationWarning,
+ )
+
+ if name == "type_to_cls_dict":
+ # for backwards compatibility
+ type_to_cls_dict: dict[str, type[BaseLLM]] = {
+ k: v() for k, v in get_type_to_cls_dict().items()
+ }
+ return type_to_cls_dict
+ return getattr(llms, name)
+
+
+__all__ = [
+ "AI21",
+ "RWKV",
+ "VLLM",
+ "AlephAlpha",
+ "AmazonAPIGateway",
+ "Anthropic",
+ "Anyscale",
+ "Arcee",
+ "Aviary",
+ "AzureMLOnlineEndpoint",
+ "AzureOpenAI",
+ "Banana",
+ "Baseten",
+ "Beam",
+ "Bedrock",
+ "CTransformers",
+ "CTranslate2",
+ "CerebriumAI",
+ "ChatGLM",
+ "Clarifai",
+ "Cohere",
+ "Databricks",
+ "DeepInfra",
+ "DeepSparse",
+ "EdenAI",
+ "FakeListLLM",
+ "Fireworks",
+ "ForefrontAI",
+ "GPT4All",
+ "GigaChat",
+ "GooglePalm",
+ "GooseAI",
+ "GradientLLM",
+ "HuggingFaceEndpoint",
+ "HuggingFaceHub",
+ "HuggingFacePipeline",
+ "HuggingFaceTextGenInference",
+ "HumanInputLLM",
+ "JavelinAIGateway",
+ "KoboldApiLLM",
+ "LlamaCpp",
+ "ManifestWrapper",
+ "Minimax",
+ "MlflowAIGateway",
+ "Modal",
+ "MosaicML",
+ "NIBittensorLLM",
+ "NLPCloud",
+ "Nebula",
+ "OctoAIEndpoint",
+ "Ollama",
+ "OpaquePrompts",
+ "OpenAI",
+ "OpenAIChat",
+ "OpenLLM",
+ "OpenLM",
+ "PaiEasEndpoint",
+ "Petals",
+ "PipelineAI",
+ "Predibase",
+ "PredictionGuard",
+ "PromptLayerOpenAI",
+ "PromptLayerOpenAIChat",
+ "QianfanLLMEndpoint",
+ "Replicate",
+ "SagemakerEndpoint",
+ "SelfHostedHuggingFaceLLM",
+ "SelfHostedPipeline",
+ "StochasticAI",
+ "TextGen",
+ "TitanTakeoff",
+ "TitanTakeoffPro",
+ "Tongyi",
+ "VLLMOpenAI",
+ "VertexAI",
+ "VertexAIModelGarden",
+ "VolcEngineMaasLLM",
+ "WatsonxLLM",
+ "Writer",
+ "Xinference",
+ "YandexGPT",
+]
+
+
+def get_type_to_cls_dict() -> dict[str, Callable[[], type[BaseLLM]]]:
+ return {
+ "ai21": _import_ai21,
+ "aleph_alpha": _import_aleph_alpha,
+ "amazon_api_gateway": _import_amazon_api_gateway,
+ "amazon_bedrock": _import_bedrock,
+ "anthropic": _import_anthropic,
+ "anyscale": _import_anyscale,
+ "arcee": _import_arcee,
+ "aviary": _import_aviary,
+ "azure": _import_azure_openai,
+ "azureml_endpoint": _import_azureml_endpoint,
+ "bananadev": _import_bananadev,
+ "baseten": _import_baseten,
+ "beam": _import_beam,
+ "cerebriumai": _import_cerebriumai,
+ "chat_glm": _import_chatglm,
+ "clarifai": _import_clarifai,
+ "cohere": _import_cohere,
+ "ctransformers": _import_ctransformers,
+ "ctranslate2": _import_ctranslate2,
+ "databricks": _import_databricks,
+ "databricks-chat": _import_databricks_chat,
+ "deepinfra": _import_deepinfra,
+ "deepsparse": _import_deepsparse,
+ "edenai": _import_edenai,
+ "fake-list": _import_fake,
+ "forefrontai": _import_forefrontai,
+ "giga-chat-model": _import_gigachat,
+ "google_palm": _import_google_palm,
+ "gooseai": _import_gooseai,
+ "gradient": _import_gradient_ai,
+ "gpt4all": _import_gpt4all,
+ "huggingface_endpoint": _import_huggingface_endpoint,
+ "huggingface_hub": _import_huggingface_hub,
+ "huggingface_pipeline": _import_huggingface_pipeline,
+ "huggingface_textgen_inference": _import_huggingface_text_gen_inference,
+ "human-input": _import_human,
+ "koboldai": _import_koboldai,
+ "llamacpp": _import_llamacpp,
+ "textgen": _import_textgen,
+ "minimax": _import_minimax,
+ "mlflow": _import_mlflow,
+ "mlflow-chat": _import_mlflow_chat,
+ "mlflow-ai-gateway": _import_mlflow_ai_gateway,
+ "modal": _import_modal,
+ "mosaic": _import_mosaicml,
+ "nebula": _import_symblai_nebula,
+ "nibittensor": _import_bittensor,
+ "nlpcloud": _import_nlpcloud,
+ "ollama": _import_ollama,
+ "openai": _import_openai,
+ "openlm": _import_openlm,
+ "pai_eas_endpoint": _import_pai_eas_endpoint,
+ "petals": _import_petals,
+ "pipelineai": _import_pipelineai,
+ "predibase": _import_predibase,
+ "opaqueprompts": _import_opaqueprompts,
+ "replicate": _import_replicate,
+ "rwkv": _import_rwkv,
+ "sagemaker_endpoint": _import_sagemaker_endpoint,
+ "self_hosted": _import_self_hosted,
+ "self_hosted_hugging_face": _import_self_hosted_hugging_face,
+ "stochasticai": _import_stochasticai,
+ "together": _import_together,
+ "tongyi": _import_tongyi,
+ "titan_takeoff": _import_titan_takeoff,
+ "titan_takeoff_pro": _import_titan_takeoff_pro,
+ "vertexai": _import_vertex,
+ "vertexai_model_garden": _import_vertex_model_garden,
+ "openllm": _import_openllm,
+ "openllm_client": _import_openllm,
+ "vllm": _import_vllm,
+ "vllm_openai": _import_vllm_openai,
+ "watsonxllm": _import_watsonxllm,
+ "writer": _import_writer,
+ "xinference": _import_xinference,
+ "javelin-ai-gateway": _import_javelin_ai_gateway,
+ "qianfan_endpoint": _import_baidu_qianfan_endpoint,
+ "yandex_gpt": _import_yandex_gpt,
+ "VolcEngineMaasLLM": _import_volcengine_maas,
+ }
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ai21.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ai21.py
new file mode 100644
index 0000000000000000000000000000000000000000..e0182d66a692d79b5757ef8718cc1c241a1d3872
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ai21.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import AI21
+ from langchain_community.llms.ai21 import AI21PenaltyData
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AI21PenaltyData": "langchain_community.llms.ai21",
+ "AI21": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AI21",
+ "AI21PenaltyData",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/aleph_alpha.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/aleph_alpha.py
new file mode 100644
index 0000000000000000000000000000000000000000..72890daeb705dfe29a9dc5285460b3011692023d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/aleph_alpha.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import AlephAlpha
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AlephAlpha": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AlephAlpha",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/amazon_api_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/amazon_api_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3c364150a13b165dbd25aa6cf1476d2512419bb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/amazon_api_gateway.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import AmazonAPIGateway
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AmazonAPIGateway": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AmazonAPIGateway",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/anthropic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/anthropic.py
new file mode 100644
index 0000000000000000000000000000000000000000..6ec15c2e8878dba304458bb3a2d8a4d4b129cb70
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/anthropic.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Anthropic
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Anthropic": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Anthropic",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/anyscale.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/anyscale.py
new file mode 100644
index 0000000000000000000000000000000000000000..4d5f7b6c16a684d2ad6c5fbb83951a25a724175b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/anyscale.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Anyscale
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Anyscale": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Anyscale",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/arcee.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/arcee.py
new file mode 100644
index 0000000000000000000000000000000000000000..f951db051603751a184d3c99be6e663d018e789b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/arcee.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Arcee
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Arcee": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Arcee",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/aviary.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/aviary.py
new file mode 100644
index 0000000000000000000000000000000000000000..9bb12c655ee230093cad8708727c60c62829bce6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/aviary.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Aviary
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Aviary": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Aviary",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/azureml_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/azureml_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd4f963dc698b8731b061b075e17f70f46d35c34
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/azureml_endpoint.py
@@ -0,0 +1,48 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import AzureMLOnlineEndpoint
+ from langchain_community.llms.azureml_endpoint import (
+ AzureMLEndpointClient,
+ ContentFormatterBase,
+ CustomOpenAIContentFormatter,
+ DollyContentFormatter,
+ GPT2ContentFormatter,
+ HFContentFormatter,
+ OSSContentFormatter,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AzureMLEndpointClient": "langchain_community.llms.azureml_endpoint",
+ "ContentFormatterBase": "langchain_community.llms.azureml_endpoint",
+ "GPT2ContentFormatter": "langchain_community.llms.azureml_endpoint",
+ "OSSContentFormatter": "langchain_community.llms.azureml_endpoint",
+ "HFContentFormatter": "langchain_community.llms.azureml_endpoint",
+ "DollyContentFormatter": "langchain_community.llms.azureml_endpoint",
+ "CustomOpenAIContentFormatter": "langchain_community.llms.azureml_endpoint",
+ "AzureMLOnlineEndpoint": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureMLEndpointClient",
+ "AzureMLOnlineEndpoint",
+ "ContentFormatterBase",
+ "CustomOpenAIContentFormatter",
+ "DollyContentFormatter",
+ "GPT2ContentFormatter",
+ "HFContentFormatter",
+ "OSSContentFormatter",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/baidu_qianfan_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/baidu_qianfan_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..a86db499318e07dec3b449b7340040048e0f49f1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/baidu_qianfan_endpoint.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import QianfanLLMEndpoint
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"QianfanLLMEndpoint": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "QianfanLLMEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bananadev.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bananadev.py
new file mode 100644
index 0000000000000000000000000000000000000000..352973f55e764763747534805cd6acadccaa6c41
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bananadev.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Banana
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Banana": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Banana",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..5246811f41a623f2406be5d74dcde30d5ca65ad4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/base.py
@@ -0,0 +1,19 @@
+"""This module provides backward-compatible exports of core language model classes.
+
+These classes are re-exported for compatibility with older versions of LangChain
+and allow users to import language model interfaces from a stable path.
+
+Exports:
+ - LLM: Abstract base class for all LLMs
+ - BaseLLM: Deprecated or foundational class for legacy LLMs
+ - BaseLanguageModel: Base class for core language model implementations
+"""
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.language_models.llms import LLM, BaseLLM
+
+__all__ = [
+ "LLM",
+ "BaseLLM",
+ "BaseLanguageModel",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/baseten.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/baseten.py
new file mode 100644
index 0000000000000000000000000000000000000000..c388d6e5be7f0906c62e2b95610a39cb1ba6f494
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/baseten.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Baseten
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Baseten": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Baseten",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/beam.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/beam.py
new file mode 100644
index 0000000000000000000000000000000000000000..14f62f0c87cdea2b5d99b3f1cd9ebfac3ac3ab4c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/beam.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Beam
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Beam": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Beam",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bedrock.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bedrock.py
new file mode 100644
index 0000000000000000000000000000000000000000..8f691ff0d02715a09c3f0f4f8aec17d877f884e3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bedrock.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Bedrock
+ from langchain_community.llms.bedrock import BedrockBase
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BedrockBase": "langchain_community.llms.bedrock",
+ "Bedrock": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Bedrock",
+ "BedrockBase",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bittensor.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bittensor.py
new file mode 100644
index 0000000000000000000000000000000000000000..5625359d48dcb6c248cc672483a1b1a616e52000
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/bittensor.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import NIBittensorLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NIBittensorLLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NIBittensorLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cerebriumai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cerebriumai.py
new file mode 100644
index 0000000000000000000000000000000000000000..d18e8c5827bfd33fa901e63abcad6ebfec20d29e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cerebriumai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import CerebriumAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CerebriumAI": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CerebriumAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/chatglm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/chatglm.py
new file mode 100644
index 0000000000000000000000000000000000000000..637e1ef3ab012a99aa853bf5943f9ac119368483
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/chatglm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import ChatGLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatGLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatGLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/clarifai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/clarifai.py
new file mode 100644
index 0000000000000000000000000000000000000000..a7f600de54cf62d6ca0105e549d9cbb00f557d23
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/clarifai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Clarifai
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Clarifai": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Clarifai",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cloudflare_workersai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cloudflare_workersai.py
new file mode 100644
index 0000000000000000000000000000000000000000..73af45ebf7183d2e05855df5b3580d6729273464
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cloudflare_workersai.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms.cloudflare_workersai import CloudflareWorkersAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CloudflareWorkersAI": "langchain_community.llms.cloudflare_workersai",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CloudflareWorkersAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cohere.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cohere.py
new file mode 100644
index 0000000000000000000000000000000000000000..3c06d8f2a4c2e39c561f5a8bf6cbe5e82afd34e2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/cohere.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Cohere
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Cohere": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Cohere",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ctransformers.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ctransformers.py
new file mode 100644
index 0000000000000000000000000000000000000000..a0c718f63c8ab06d272f12e294fc608b194c50ce
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ctransformers.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import CTransformers
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CTransformers": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CTransformers",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ctranslate2.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ctranslate2.py
new file mode 100644
index 0000000000000000000000000000000000000000..51bf74ede5b17912b44d703343b6116be95f81a2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ctranslate2.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import CTranslate2
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CTranslate2": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CTranslate2",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/databricks.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/databricks.py
new file mode 100644
index 0000000000000000000000000000000000000000..0bb2d16b990ce57d65967724164a5150fc1ebe66
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/databricks.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Databricks
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Databricks": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Databricks",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/deepinfra.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/deepinfra.py
new file mode 100644
index 0000000000000000000000000000000000000000..f4d847cb05eb445e4a5e5e569f60143773042757
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/deepinfra.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import DeepInfra
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DeepInfra": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DeepInfra",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/deepsparse.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/deepsparse.py
new file mode 100644
index 0000000000000000000000000000000000000000..0eabec6effc16f0738af2c3a3d10a2fd287d1821
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/deepsparse.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import DeepSparse
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DeepSparse": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DeepSparse",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/edenai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/edenai.py
new file mode 100644
index 0000000000000000000000000000000000000000..29b686c2ec8165191a70332662f132a73c096d19
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/edenai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import EdenAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"EdenAI": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EdenAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/fake.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/fake.py
new file mode 100644
index 0000000000000000000000000000000000000000..52ad955af3239a714d8c506506f970c3388b5df7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/fake.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms.fake import FakeStreamingListLLM
+ from langchain_core.language_models import FakeListLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "FakeListLLM": "langchain_community.llms",
+ "FakeStreamingListLLM": "langchain_community.llms.fake",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FakeListLLM",
+ "FakeStreamingListLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/fireworks.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/fireworks.py
new file mode 100644
index 0000000000000000000000000000000000000000..33124fb5e76793c668a558279c6eefb99aca1f56
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/fireworks.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Fireworks
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Fireworks": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Fireworks",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/forefrontai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/forefrontai.py
new file mode 100644
index 0000000000000000000000000000000000000000..01e9a43e05331cb30b469c2b3fd296722bb4c8ea
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/forefrontai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import ForefrontAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ForefrontAI": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ForefrontAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gigachat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gigachat.py
new file mode 100644
index 0000000000000000000000000000000000000000..be358a874b9b960961bbc2125e5351d8a49236b0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gigachat.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import GigaChat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GigaChat": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GigaChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/google_palm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/google_palm.py
new file mode 100644
index 0000000000000000000000000000000000000000..f3ce61be4177d3e796f9c8daac8793380ee8985b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/google_palm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import GooglePalm
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GooglePalm": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GooglePalm",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gooseai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gooseai.py
new file mode 100644
index 0000000000000000000000000000000000000000..24374180056a9e889c6246e6108720a1acc89756
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gooseai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import GooseAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GooseAI": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GooseAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gpt4all.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gpt4all.py
new file mode 100644
index 0000000000000000000000000000000000000000..12699bc0e4dbddd81bd12189bfd9415c4db1aa48
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gpt4all.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import GPT4All
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GPT4All": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GPT4All",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gradient_ai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gradient_ai.py
new file mode 100644
index 0000000000000000000000000000000000000000..d69612b1c430369c06e152794e2576b32634370e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/gradient_ai.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import GradientLLM
+ from langchain_community.llms.gradient_ai import TrainResult
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "TrainResult": "langchain_community.llms.gradient_ai",
+ "GradientLLM": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GradientLLM",
+ "TrainResult",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..46cafd402566fb823cb61a56f48c1aa0f7fe4387
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_endpoint.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import HuggingFaceEndpoint
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HuggingFaceEndpoint": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFaceEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_hub.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_hub.py
new file mode 100644
index 0000000000000000000000000000000000000000..831e248a9a947faafb73c72254a70b30e60caa48
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_hub.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import HuggingFaceHub
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HuggingFaceHub": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFaceHub",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_pipeline.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_pipeline.py
new file mode 100644
index 0000000000000000000000000000000000000000..2822d7c0321878c076e18c28f387117d43e73a21
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_pipeline.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import HuggingFacePipeline
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HuggingFacePipeline": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFacePipeline",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_text_gen_inference.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_text_gen_inference.py
new file mode 100644
index 0000000000000000000000000000000000000000..0ca96d9a995eab128be064e742486fe4f87bee2c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/huggingface_text_gen_inference.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import HuggingFaceTextGenInference
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HuggingFaceTextGenInference": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HuggingFaceTextGenInference",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/human.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/human.py
new file mode 100644
index 0000000000000000000000000000000000000000..73ae9bd39311dfc7256e41ef09275171f205fed5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/human.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import HumanInputLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"HumanInputLLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HumanInputLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/javelin_ai_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/javelin_ai_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..7c99bc67312759569b16c52e95eb1aedcc6aa3d6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/javelin_ai_gateway.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import JavelinAIGateway
+ from langchain_community.llms.javelin_ai_gateway import Params
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "JavelinAIGateway": "langchain_community.llms",
+ "Params": "langchain_community.llms.javelin_ai_gateway",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JavelinAIGateway",
+ "Params",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/koboldai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/koboldai.py
new file mode 100644
index 0000000000000000000000000000000000000000..34b902464f128d31a7ab23ec325d36e8dbb66149
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/koboldai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import KoboldApiLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"KoboldApiLLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "KoboldApiLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/llamacpp.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/llamacpp.py
new file mode 100644
index 0000000000000000000000000000000000000000..e597bc9d343efc0af84372b9c63e10d581a62dcc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/llamacpp.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import LlamaCpp
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LlamaCpp": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LlamaCpp",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/loading.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/loading.py
new file mode 100644
index 0000000000000000000000000000000000000000..5851dc1961e0d505958a4ab9f2e66a8cb2ba085d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/loading.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms.loading import load_llm, load_llm_from_config
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "load_llm_from_config": "langchain_community.llms.loading",
+ "load_llm": "langchain_community.llms.loading",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "load_llm",
+ "load_llm_from_config",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/manifest.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/manifest.py
new file mode 100644
index 0000000000000000000000000000000000000000..b60b588d046152fe160e76493552c92fee183640
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/manifest.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import ManifestWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ManifestWrapper": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ManifestWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/minimax.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/minimax.py
new file mode 100644
index 0000000000000000000000000000000000000000..63f8dc04c9d3316c21d5dc477833bdcf9388983f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/minimax.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Minimax
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Minimax": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Minimax",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mlflow.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mlflow.py
new file mode 100644
index 0000000000000000000000000000000000000000..a44fa8caa8b5e7af9f501728714a5c113c3ffa93
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mlflow.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Mlflow
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Mlflow": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Mlflow",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mlflow_ai_gateway.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mlflow_ai_gateway.py
new file mode 100644
index 0000000000000000000000000000000000000000..80c032a4be28c839705b115fd2096a170e146f42
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mlflow_ai_gateway.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import MlflowAIGateway
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MlflowAIGateway": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MlflowAIGateway",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/modal.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/modal.py
new file mode 100644
index 0000000000000000000000000000000000000000..fde8c0f145a4d4f2dc722388635574dd5e1806fc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/modal.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Modal
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Modal": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Modal",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mosaicml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mosaicml.py
new file mode 100644
index 0000000000000000000000000000000000000000..e47a3ce563f14c3d09f925251a4be4c3d467525f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/mosaicml.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import MosaicML
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MosaicML": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MosaicML",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/nlpcloud.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/nlpcloud.py
new file mode 100644
index 0000000000000000000000000000000000000000..2e431e8e155b1f95faf57daffeee8ccbcfc8b483
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/nlpcloud.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import NLPCloud
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NLPCloud": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NLPCloud",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/octoai_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/octoai_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..28f753d1811590d740b8a94eae97abcdaff9791e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/octoai_endpoint.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import OctoAIEndpoint
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OctoAIEndpoint": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OctoAIEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ollama.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ollama.py
new file mode 100644
index 0000000000000000000000000000000000000000..f363cd16b35c0d74c24df80dde933bd76b25bb38
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/ollama.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Ollama
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Ollama": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Ollama",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/opaqueprompts.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/opaqueprompts.py
new file mode 100644
index 0000000000000000000000000000000000000000..5ac0288a08adf9ddd497d4d9b6b4a198445635b5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/opaqueprompts.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import OpaquePrompts
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpaquePrompts": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpaquePrompts",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..9689b65be1a29203ee9adc176550bdd4c1724a6b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openai.py
@@ -0,0 +1,32 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import AzureOpenAI, OpenAI, OpenAIChat
+ from langchain_community.llms.openai import BaseOpenAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaseOpenAI": "langchain_community.llms.openai",
+ "OpenAI": "langchain_community.llms",
+ "AzureOpenAI": "langchain_community.llms",
+ "OpenAIChat": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureOpenAI",
+ "BaseOpenAI",
+ "OpenAI",
+ "OpenAIChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openllm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openllm.py
new file mode 100644
index 0000000000000000000000000000000000000000..b31e99007ed3a82dad3bf22a5892fdb50283c60c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openllm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import OpenLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpenLLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openlm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openlm.py
new file mode 100644
index 0000000000000000000000000000000000000000..8151d5ccfb8f6453fd7d3ea25f254740cfe4349b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/openlm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import OpenLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpenLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/pai_eas_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/pai_eas_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..a29f5c0ecaf4bf9d085b4aa25ae0bdf1f89b93a3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/pai_eas_endpoint.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import PaiEasEndpoint
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PaiEasEndpoint": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PaiEasEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/petals.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/petals.py
new file mode 100644
index 0000000000000000000000000000000000000000..49b2170163c219d57f5d7306a8b73a401ff90a90
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/petals.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Petals
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Petals": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Petals",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/pipelineai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/pipelineai.py
new file mode 100644
index 0000000000000000000000000000000000000000..7b22a1f22ba2aef30131615810e21d92ca943ad8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/pipelineai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import PipelineAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PipelineAI": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PipelineAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/predibase.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/predibase.py
new file mode 100644
index 0000000000000000000000000000000000000000..d2c2fb3aa292b11e261cd75934fe8f9c1dc7d25f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/predibase.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Predibase
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Predibase": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Predibase",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/predictionguard.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/predictionguard.py
new file mode 100644
index 0000000000000000000000000000000000000000..e5e2da89c8dbbb906088837247b353978fcf7133
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/predictionguard.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import PredictionGuard
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PredictionGuard": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PredictionGuard",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/promptlayer_openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/promptlayer_openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..d75d5926a9c25cc8d688fa667957fb6a786c388a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/promptlayer_openai.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import PromptLayerOpenAI, PromptLayerOpenAIChat
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "PromptLayerOpenAI": "langchain_community.llms",
+ "PromptLayerOpenAIChat": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PromptLayerOpenAI",
+ "PromptLayerOpenAIChat",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/replicate.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/replicate.py
new file mode 100644
index 0000000000000000000000000000000000000000..2edad8e0dfe00b4c34dd2aab2b355ca147da80d6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/replicate.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Replicate
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Replicate": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Replicate",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/rwkv.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/rwkv.py
new file mode 100644
index 0000000000000000000000000000000000000000..1dedac6f68125ea718a09736940a59724cf5f9d8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/rwkv.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import RWKV
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RWKV": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RWKV",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/sagemaker_endpoint.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/sagemaker_endpoint.py
new file mode 100644
index 0000000000000000000000000000000000000000..a276b7991ec5eec686eec152bfd74baa6e63c610
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/sagemaker_endpoint.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import SagemakerEndpoint
+ from langchain_community.llms.sagemaker_endpoint import LLMContentHandler
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SagemakerEndpoint": "langchain_community.llms",
+ "LLMContentHandler": "langchain_community.llms.sagemaker_endpoint",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LLMContentHandler",
+ "SagemakerEndpoint",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/self_hosted.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/self_hosted.py
new file mode 100644
index 0000000000000000000000000000000000000000..c28ed6aa4e2361518902d588a2f8002dd3cd8fa6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/self_hosted.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import SelfHostedPipeline
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SelfHostedPipeline": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SelfHostedPipeline",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/self_hosted_hugging_face.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/self_hosted_hugging_face.py
new file mode 100644
index 0000000000000000000000000000000000000000..b88e214855842cda773e65cd23a31179cbf1288b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/self_hosted_hugging_face.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import SelfHostedHuggingFaceLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SelfHostedHuggingFaceLLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SelfHostedHuggingFaceLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/stochasticai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/stochasticai.py
new file mode 100644
index 0000000000000000000000000000000000000000..93b74d726736d7c8da364d8dd1d19c3c5632b4ff
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/stochasticai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import StochasticAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"StochasticAI": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "StochasticAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/symblai_nebula.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/symblai_nebula.py
new file mode 100644
index 0000000000000000000000000000000000000000..482c596bb56a62389604f1273ac24724318b81c5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/symblai_nebula.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Nebula
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Nebula": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Nebula",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/textgen.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/textgen.py
new file mode 100644
index 0000000000000000000000000000000000000000..cb47d9cf1bb0343e481337a06a3e284311c0f4fd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/textgen.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import TextGen
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TextGen": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TextGen",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/titan_takeoff.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/titan_takeoff.py
new file mode 100644
index 0000000000000000000000000000000000000000..46780488912383ba83f0229ae17cbdc7a50a0bca
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/titan_takeoff.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import TitanTakeoff
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TitanTakeoff": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TitanTakeoff",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/titan_takeoff_pro.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/titan_takeoff_pro.py
new file mode 100644
index 0000000000000000000000000000000000000000..198875bf47109c8383f6961f01f7ccfd9a3a1357
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/titan_takeoff_pro.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import TitanTakeoffPro
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TitanTakeoffPro": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TitanTakeoffPro",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/together.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/together.py
new file mode 100644
index 0000000000000000000000000000000000000000..7b5138af83ba5dede2858a271623bb89db56118b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/together.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Together
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Together": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Together",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/tongyi.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/tongyi.py
new file mode 100644
index 0000000000000000000000000000000000000000..ddc83a077222dc11010fb6d1b3afe3c705de671a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/tongyi.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Tongyi
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Tongyi": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Tongyi",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..dda481a394c4fba909ad05222d0a313d02399c9e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/utils.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms.utils import enforce_stop_tokens
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"enforce_stop_tokens": "langchain_community.llms.utils"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "enforce_stop_tokens",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/vertexai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/vertexai.py
new file mode 100644
index 0000000000000000000000000000000000000000..b7de07d3e092ed5a8a339498fe86cfaf0a217bca
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/vertexai.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import VertexAI, VertexAIModelGarden
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "VertexAI": "langchain_community.llms",
+ "VertexAIModelGarden": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VertexAI",
+ "VertexAIModelGarden",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/vllm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/vllm.py
new file mode 100644
index 0000000000000000000000000000000000000000..070c902092414e2eca4d2e692c023ecb6a5f9e0b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/vllm.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import VLLM, VLLMOpenAI
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "VLLM": "langchain_community.llms",
+ "VLLMOpenAI": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VLLM",
+ "VLLMOpenAI",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/volcengine_maas.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/volcengine_maas.py
new file mode 100644
index 0000000000000000000000000000000000000000..5241522f5582b28a7cca6b43799bee40d7854531
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/volcengine_maas.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import VolcEngineMaasLLM
+ from langchain_community.llms.volcengine_maas import VolcEngineMaasBase
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "VolcEngineMaasBase": "langchain_community.llms.volcengine_maas",
+ "VolcEngineMaasLLM": "langchain_community.llms",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VolcEngineMaasBase",
+ "VolcEngineMaasLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/watsonxllm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/watsonxllm.py
new file mode 100644
index 0000000000000000000000000000000000000000..4cd17a747c51af1be2d99874b44e93ffa35fb5a5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/watsonxllm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import WatsonxLLM
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WatsonxLLM": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WatsonxLLM",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/writer.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/writer.py
new file mode 100644
index 0000000000000000000000000000000000000000..70a52e8e9abc29b88b129cbf986668bfbddc5bca
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/writer.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Writer
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Writer": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Writer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/xinference.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/xinference.py
new file mode 100644
index 0000000000000000000000000000000000000000..ce2b12b87655eff955961c17c3ed1a93b3d67827
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/xinference.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import Xinference
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Xinference": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Xinference",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/yandex.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/yandex.py
new file mode 100644
index 0000000000000000000000000000000000000000..8a82e8ec496907a0209037f280ffbe7f87a31c49
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/llms/yandex.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.llms import YandexGPT
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"YandexGPT": "langchain_community.llms"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "YandexGPT",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..c6dd88dd39b0d6d3a607624af5c1a422f9a4632f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/__init__.py
@@ -0,0 +1,11 @@
+"""Serialization and deserialization."""
+
+from langchain_core.load.dump import dumpd, dumps
+from langchain_core.load.load import load, loads
+
+__all__ = [
+ "dumpd",
+ "dumps",
+ "load",
+ "loads",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/dump.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/dump.py
new file mode 100644
index 0000000000000000000000000000000000000000..473f57ab09395315966984361a0e2520436e9687
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/dump.py
@@ -0,0 +1,3 @@
+from langchain_core.load.dump import default, dumpd, dumps
+
+__all__ = ["default", "dumpd", "dumps"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/load.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/load.py
new file mode 100644
index 0000000000000000000000000000000000000000..2415a3db51b9bd594b8ad38da3fb9c3bf3cbdaaa
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/load.py
@@ -0,0 +1,3 @@
+from langchain_core.load.load import Reviver, load, loads
+
+__all__ = ["Reviver", "load", "loads"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/serializable.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/serializable.py
new file mode 100644
index 0000000000000000000000000000000000000000..d20850ad0b789efe59465dc2987074d4c397ba0f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/load/serializable.py
@@ -0,0 +1,19 @@
+from langchain_core.load.serializable import (
+ BaseSerialized,
+ Serializable,
+ SerializedConstructor,
+ SerializedNotImplemented,
+ SerializedSecret,
+ to_json_not_implemented,
+ try_neq_default,
+)
+
+__all__ = [
+ "BaseSerialized",
+ "Serializable",
+ "SerializedConstructor",
+ "SerializedNotImplemented",
+ "SerializedSecret",
+ "to_json_not_implemented",
+ "try_neq_default",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1d3a718d7ea8621972377d118351c844d92d888f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/__init__.py
@@ -0,0 +1,126 @@
+"""**Memory** maintains Chain state, incorporating context from past runs."""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+from langchain_classic.memory.buffer import (
+ ConversationBufferMemory,
+ ConversationStringBufferMemory,
+)
+from langchain_classic.memory.buffer_window import ConversationBufferWindowMemory
+from langchain_classic.memory.combined import CombinedMemory
+from langchain_classic.memory.entity import (
+ ConversationEntityMemory,
+ InMemoryEntityStore,
+ RedisEntityStore,
+ SQLiteEntityStore,
+ UpstashRedisEntityStore,
+)
+from langchain_classic.memory.readonly import ReadOnlySharedMemory
+from langchain_classic.memory.simple import SimpleMemory
+from langchain_classic.memory.summary import ConversationSummaryMemory
+from langchain_classic.memory.summary_buffer import ConversationSummaryBufferMemory
+from langchain_classic.memory.token_buffer import ConversationTokenBufferMemory
+from langchain_classic.memory.vectorstore import VectorStoreRetrieverMemory
+from langchain_classic.memory.vectorstore_token_buffer_memory import (
+ ConversationVectorStoreTokenBufferMemory, # avoid circular import
+)
+
+if TYPE_CHECKING:
+ from langchain_community.chat_message_histories import (
+ AstraDBChatMessageHistory,
+ CassandraChatMessageHistory,
+ ChatMessageHistory,
+ CosmosDBChatMessageHistory,
+ DynamoDBChatMessageHistory,
+ ElasticsearchChatMessageHistory,
+ FileChatMessageHistory,
+ MomentoChatMessageHistory,
+ MongoDBChatMessageHistory,
+ PostgresChatMessageHistory,
+ RedisChatMessageHistory,
+ SingleStoreDBChatMessageHistory,
+ SQLChatMessageHistory,
+ StreamlitChatMessageHistory,
+ UpstashRedisChatMessageHistory,
+ XataChatMessageHistory,
+ ZepChatMessageHistory,
+ )
+ from langchain_community.memory.kg import ConversationKGMemory
+ from langchain_community.memory.motorhead_memory import MotorheadMemory
+ from langchain_community.memory.zep_memory import ZepMemory
+
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "MotorheadMemory": "langchain_community.memory.motorhead_memory",
+ "ConversationKGMemory": "langchain_community.memory.kg",
+ "ZepMemory": "langchain_community.memory.zep_memory",
+ "AstraDBChatMessageHistory": "langchain_community.chat_message_histories",
+ "CassandraChatMessageHistory": "langchain_community.chat_message_histories",
+ "ChatMessageHistory": "langchain_community.chat_message_histories",
+ "CosmosDBChatMessageHistory": "langchain_community.chat_message_histories",
+ "DynamoDBChatMessageHistory": "langchain_community.chat_message_histories",
+ "ElasticsearchChatMessageHistory": "langchain_community.chat_message_histories",
+ "FileChatMessageHistory": "langchain_community.chat_message_histories",
+ "MomentoChatMessageHistory": "langchain_community.chat_message_histories",
+ "MongoDBChatMessageHistory": "langchain_community.chat_message_histories",
+ "PostgresChatMessageHistory": "langchain_community.chat_message_histories",
+ "RedisChatMessageHistory": "langchain_community.chat_message_histories",
+ "SingleStoreDBChatMessageHistory": "langchain_community.chat_message_histories",
+ "SQLChatMessageHistory": "langchain_community.chat_message_histories",
+ "StreamlitChatMessageHistory": "langchain_community.chat_message_histories",
+ "UpstashRedisChatMessageHistory": "langchain_community.chat_message_histories",
+ "XataChatMessageHistory": "langchain_community.chat_message_histories",
+ "ZepChatMessageHistory": "langchain_community.chat_message_histories",
+}
+
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AstraDBChatMessageHistory",
+ "CassandraChatMessageHistory",
+ "ChatMessageHistory",
+ "CombinedMemory",
+ "ConversationBufferMemory",
+ "ConversationBufferWindowMemory",
+ "ConversationEntityMemory",
+ "ConversationKGMemory",
+ "ConversationStringBufferMemory",
+ "ConversationSummaryBufferMemory",
+ "ConversationSummaryMemory",
+ "ConversationTokenBufferMemory",
+ "ConversationVectorStoreTokenBufferMemory",
+ "CosmosDBChatMessageHistory",
+ "DynamoDBChatMessageHistory",
+ "ElasticsearchChatMessageHistory",
+ "FileChatMessageHistory",
+ "InMemoryEntityStore",
+ "MomentoChatMessageHistory",
+ "MongoDBChatMessageHistory",
+ "MotorheadMemory",
+ "PostgresChatMessageHistory",
+ "ReadOnlySharedMemory",
+ "RedisChatMessageHistory",
+ "RedisEntityStore",
+ "SQLChatMessageHistory",
+ "SQLiteEntityStore",
+ "SimpleMemory",
+ "SingleStoreDBChatMessageHistory",
+ "StreamlitChatMessageHistory",
+ "UpstashRedisChatMessageHistory",
+ "UpstashRedisEntityStore",
+ "VectorStoreRetrieverMemory",
+ "XataChatMessageHistory",
+ "ZepChatMessageHistory",
+ "ZepMemory",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/buffer.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/buffer.py
new file mode 100644
index 0000000000000000000000000000000000000000..cfca46753e9674caafb8b16b613c2b4235938e65
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/buffer.py
@@ -0,0 +1,179 @@
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.messages import BaseMessage, get_buffer_string
+from langchain_core.utils import pre_init
+from typing_extensions import override
+
+from langchain_classic.base_memory import BaseMemory
+from langchain_classic.memory.chat_memory import BaseChatMemory
+from langchain_classic.memory.utils import get_prompt_input_key
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationBufferMemory(BaseChatMemory):
+ """A basic memory implementation that simply stores the conversation history.
+
+ This stores the entire conversation history in memory without any
+ additional processing.
+
+ Note that additional processing may be required in some situations when the
+ conversation history is too large to fit in the context window of the model.
+ """
+
+ human_prefix: str = "Human"
+ ai_prefix: str = "AI"
+ memory_key: str = "history"
+
+ @property
+ def buffer(self) -> Any:
+ """String buffer of memory."""
+ return self.buffer_as_messages if self.return_messages else self.buffer_as_str
+
+ async def abuffer(self) -> Any:
+ """String buffer of memory."""
+ return (
+ await self.abuffer_as_messages()
+ if self.return_messages
+ else await self.abuffer_as_str()
+ )
+
+ def _buffer_as_str(self, messages: list[BaseMessage]) -> str:
+ return get_buffer_string(
+ messages,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ @property
+ def buffer_as_str(self) -> str:
+ """Exposes the buffer as a string in case return_messages is True."""
+ return self._buffer_as_str(self.chat_memory.messages)
+
+ async def abuffer_as_str(self) -> str:
+ """Exposes the buffer as a string in case return_messages is True."""
+ messages = await self.chat_memory.aget_messages()
+ return self._buffer_as_str(messages)
+
+ @property
+ def buffer_as_messages(self) -> list[BaseMessage]:
+ """Exposes the buffer as a list of messages in case return_messages is False."""
+ return self.chat_memory.messages
+
+ async def abuffer_as_messages(self) -> list[BaseMessage]:
+ """Exposes the buffer as a list of messages in case return_messages is False."""
+ return await self.chat_memory.aget_messages()
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return [self.memory_key]
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return history buffer."""
+ return {self.memory_key: self.buffer}
+
+ @override
+ async def aload_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return key-value pairs given the text input to the chain."""
+ buffer = await self.abuffer()
+ return {self.memory_key: buffer}
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationStringBufferMemory(BaseMemory):
+ """A basic memory implementation that simply stores the conversation history.
+
+ This stores the entire conversation history in memory without any
+ additional processing.
+
+ Equivalent to ConversationBufferMemory but tailored more specifically
+ for string-based conversations rather than chat models.
+
+ Note that additional processing may be required in some situations when the
+ conversation history is too large to fit in the context window of the model.
+ """
+
+ human_prefix: str = "Human"
+ ai_prefix: str = "AI"
+ """Prefix to use for AI generated responses."""
+ buffer: str = ""
+ output_key: str | None = None
+ input_key: str | None = None
+ memory_key: str = "history"
+
+ @pre_init
+ def validate_chains(cls, values: dict) -> dict:
+ """Validate that return messages is not True."""
+ if values.get("return_messages", False):
+ msg = "return_messages must be False for ConversationStringBufferMemory"
+ raise ValueError(msg)
+ return values
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return [self.memory_key]
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, str]:
+ """Return history buffer."""
+ return {self.memory_key: self.buffer}
+
+ async def aload_memory_variables(self, inputs: dict[str, Any]) -> dict[str, str]:
+ """Return history buffer."""
+ return self.load_memory_variables(inputs)
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer."""
+ if self.input_key is None:
+ prompt_input_key = get_prompt_input_key(inputs, self.memory_variables)
+ else:
+ prompt_input_key = self.input_key
+ if self.output_key is None:
+ if len(outputs) != 1:
+ msg = f"One output key expected, got {outputs.keys()}"
+ raise ValueError(msg)
+ output_key = next(iter(outputs.keys()))
+ else:
+ output_key = self.output_key
+ human = f"{self.human_prefix}: " + inputs[prompt_input_key]
+ ai = f"{self.ai_prefix}: " + outputs[output_key]
+ self.buffer += f"\n{human}\n{ai}"
+
+ async def asave_context(
+ self,
+ inputs: dict[str, Any],
+ outputs: dict[str, str],
+ ) -> None:
+ """Save context from this conversation to buffer."""
+ return self.save_context(inputs, outputs)
+
+ def clear(self) -> None:
+ """Clear memory contents."""
+ self.buffer = ""
+
+ @override
+ async def aclear(self) -> None:
+ self.clear()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/buffer_window.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/buffer_window.py
new file mode 100644
index 0000000000000000000000000000000000000000..c426f6611fbd91258116064b8d688f5245d33c33
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/buffer_window.py
@@ -0,0 +1,62 @@
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.messages import BaseMessage, get_buffer_string
+from typing_extensions import override
+
+from langchain_classic.memory.chat_memory import BaseChatMemory
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationBufferWindowMemory(BaseChatMemory):
+ """Use to keep track of the last k turns of a conversation.
+
+ If the number of messages in the conversation is more than the maximum number
+ of messages to keep, the oldest messages are dropped.
+ """
+
+ human_prefix: str = "Human"
+ ai_prefix: str = "AI"
+ memory_key: str = "history"
+ k: int = 5
+ """Number of messages to store in buffer."""
+
+ @property
+ def buffer(self) -> str | list[BaseMessage]:
+ """String buffer of memory."""
+ return self.buffer_as_messages if self.return_messages else self.buffer_as_str
+
+ @property
+ def buffer_as_str(self) -> str:
+ """Exposes the buffer as a string in case return_messages is False."""
+ messages = self.chat_memory.messages[-self.k * 2 :] if self.k > 0 else []
+ return get_buffer_string(
+ messages,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ @property
+ def buffer_as_messages(self) -> list[BaseMessage]:
+ """Exposes the buffer as a list of messages in case return_messages is True."""
+ return self.chat_memory.messages[-self.k * 2 :] if self.k > 0 else []
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return [self.memory_key]
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return history buffer."""
+ return {self.memory_key: self.buffer}
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/chat_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/chat_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..be64c7eaa42495676cd2023bcc3073663c377498
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/chat_memory.py
@@ -0,0 +1,107 @@
+import warnings
+from abc import ABC
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.chat_history import (
+ BaseChatMessageHistory,
+ InMemoryChatMessageHistory,
+)
+from langchain_core.messages import AIMessage, HumanMessage
+from pydantic import Field
+
+from langchain_classic.base_memory import BaseMemory
+from langchain_classic.memory.utils import get_prompt_input_key
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class BaseChatMemory(BaseMemory, ABC):
+ """Abstract base class for chat memory.
+
+ **ATTENTION** This abstraction was created prior to when chat models had
+ native tool calling capabilities.
+ It does **NOT** support native tool calling capabilities for chat models and
+ will fail SILENTLY if used with a chat model that has native tool calling.
+
+ DO NOT USE THIS ABSTRACTION FOR NEW CODE.
+ """
+
+ chat_memory: BaseChatMessageHistory = Field(
+ default_factory=InMemoryChatMessageHistory,
+ )
+ output_key: str | None = None
+ input_key: str | None = None
+ return_messages: bool = False
+
+ def _get_input_output(
+ self,
+ inputs: dict[str, Any],
+ outputs: dict[str, str],
+ ) -> tuple[str, str]:
+ if self.input_key is None:
+ prompt_input_key = get_prompt_input_key(inputs, self.memory_variables)
+ else:
+ prompt_input_key = self.input_key
+ if self.output_key is None:
+ if len(outputs) == 1:
+ output_key = next(iter(outputs.keys()))
+ elif "output" in outputs:
+ output_key = "output"
+ warnings.warn(
+ f"'{self.__class__.__name__}' got multiple output keys:"
+ f" {outputs.keys()}. The default 'output' key is being used."
+ f" If this is not desired, please manually set 'output_key'.",
+ stacklevel=3,
+ )
+ else:
+ msg = (
+ f"Got multiple output keys: {outputs.keys()}, cannot "
+ f"determine which to store in memory. Please set the "
+ f"'output_key' explicitly."
+ )
+ raise ValueError(msg)
+ else:
+ output_key = self.output_key
+ return inputs[prompt_input_key], outputs[output_key]
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer."""
+ input_str, output_str = self._get_input_output(inputs, outputs)
+ self.chat_memory.add_messages(
+ [
+ HumanMessage(content=input_str),
+ AIMessage(content=output_str),
+ ],
+ )
+
+ async def asave_context(
+ self,
+ inputs: dict[str, Any],
+ outputs: dict[str, str],
+ ) -> None:
+ """Save context from this conversation to buffer."""
+ input_str, output_str = self._get_input_output(inputs, outputs)
+ await self.chat_memory.aadd_messages(
+ [
+ HumanMessage(content=input_str),
+ AIMessage(content=output_str),
+ ],
+ )
+
+ def clear(self) -> None:
+ """Clear memory contents."""
+ self.chat_memory.clear()
+
+ async def aclear(self) -> None:
+ """Clear memory contents."""
+ await self.chat_memory.aclear()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/combined.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/combined.py
new file mode 100644
index 0000000000000000000000000000000000000000..3a5781ce01a4cfbeb8487262fd6e818e2624664e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/combined.py
@@ -0,0 +1,85 @@
+import warnings
+from typing import Any
+
+from pydantic import field_validator
+
+from langchain_classic.base_memory import BaseMemory
+from langchain_classic.memory.chat_memory import BaseChatMemory
+
+
+class CombinedMemory(BaseMemory):
+ """Combining multiple memories' data together."""
+
+ memories: list[BaseMemory]
+ """For tracking all the memories that should be accessed."""
+
+ @field_validator("memories")
+ @classmethod
+ def _check_repeated_memory_variable(
+ cls,
+ value: list[BaseMemory],
+ ) -> list[BaseMemory]:
+ all_variables: set[str] = set()
+ for val in value:
+ overlap = all_variables.intersection(val.memory_variables)
+ if overlap:
+ msg = (
+ f"The same variables {overlap} are found in multiple"
+ "memory object, which is not allowed by CombinedMemory."
+ )
+ raise ValueError(msg)
+ all_variables |= set(val.memory_variables)
+
+ return value
+
+ @field_validator("memories")
+ @classmethod
+ def check_input_key(cls, value: list[BaseMemory]) -> list[BaseMemory]:
+ """Check that if memories are of type BaseChatMemory that input keys exist."""
+ for val in value:
+ if isinstance(val, BaseChatMemory) and val.input_key is None:
+ warnings.warn(
+ "When using CombinedMemory, "
+ "input keys should be so the input is known. "
+ f" Was not set on {val}",
+ stacklevel=5,
+ )
+ return value
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """All the memory variables that this instance provides."""
+ """Collected from the all the linked memories."""
+
+ memory_variables = []
+
+ for memory in self.memories:
+ memory_variables.extend(memory.memory_variables)
+
+ return memory_variables
+
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, str]:
+ """Load all vars from sub-memories."""
+ memory_data: dict[str, Any] = {}
+
+ # Collect vars from all sub-memories
+ for memory in self.memories:
+ data = memory.load_memory_variables(inputs)
+ for key, value in data.items():
+ if key in memory_data:
+ msg = f"The variable {key} is repeated in the CombinedMemory."
+ raise ValueError(msg)
+ memory_data[key] = value
+
+ return memory_data
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this session for every memory."""
+ # Save context for all sub-memories
+ for memory in self.memories:
+ memory.save_context(inputs, outputs)
+
+ def clear(self) -> None:
+ """Clear context from this session for every memory."""
+ for memory in self.memories:
+ memory.clear()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/entity.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/entity.py
new file mode 100644
index 0000000000000000000000000000000000000000..29bd33dcec43da844715de010d22007d9b718336
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/entity.py
@@ -0,0 +1,629 @@
+"""Deprecated as of LangChain v0.3.4 and will be removed in LangChain v1.0.0."""
+
+import logging
+from abc import ABC, abstractmethod
+from collections.abc import Iterable
+from itertools import islice
+from typing import TYPE_CHECKING, Any
+
+from langchain_core._api import deprecated
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.messages import BaseMessage, get_buffer_string
+from langchain_core.prompts import BasePromptTemplate
+from pydantic import BaseModel, ConfigDict, Field
+from typing_extensions import override
+
+from langchain_classic.chains.llm import LLMChain
+from langchain_classic.memory.chat_memory import BaseChatMemory
+from langchain_classic.memory.prompt import (
+ ENTITY_EXTRACTION_PROMPT,
+ ENTITY_SUMMARIZATION_PROMPT,
+)
+from langchain_classic.memory.utils import get_prompt_input_key
+
+if TYPE_CHECKING:
+ import sqlite3
+
+logger = logging.getLogger(__name__)
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class BaseEntityStore(BaseModel, ABC):
+ """Abstract base class for Entity store."""
+
+ @abstractmethod
+ def get(self, key: str, default: str | None = None) -> str | None:
+ """Get entity value from store."""
+
+ @abstractmethod
+ def set(self, key: str, value: str | None) -> None:
+ """Set entity value in store."""
+
+ @abstractmethod
+ def delete(self, key: str) -> None:
+ """Delete entity value from store."""
+
+ @abstractmethod
+ def exists(self, key: str) -> bool:
+ """Check if entity exists in store."""
+
+ @abstractmethod
+ def clear(self) -> None:
+ """Delete all entities from store."""
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class InMemoryEntityStore(BaseEntityStore):
+ """In-memory Entity store."""
+
+ store: dict[str, str | None] = {}
+
+ @override
+ def get(self, key: str, default: str | None = None) -> str | None:
+ return self.store.get(key, default)
+
+ @override
+ def set(self, key: str, value: str | None) -> None:
+ self.store[key] = value
+
+ @override
+ def delete(self, key: str) -> None:
+ del self.store[key]
+
+ @override
+ def exists(self, key: str) -> bool:
+ return key in self.store
+
+ @override
+ def clear(self) -> None:
+ return self.store.clear()
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class UpstashRedisEntityStore(BaseEntityStore):
+ """Upstash Redis backed Entity store.
+
+ Entities get a TTL of 1 day by default, and
+ that TTL is extended by 3 days every time the entity is read back.
+ """
+
+ def __init__(
+ self,
+ session_id: str = "default",
+ url: str = "",
+ token: str = "",
+ key_prefix: str = "memory_store",
+ ttl: int | None = 60 * 60 * 24,
+ recall_ttl: int | None = 60 * 60 * 24 * 3,
+ *args: Any,
+ **kwargs: Any,
+ ):
+ """Initializes the RedisEntityStore.
+
+ Args:
+ session_id: Unique identifier for the session.
+ url: URL of the Redis server.
+ token: Authentication token for the Redis server.
+ key_prefix: Prefix for keys in the Redis store.
+ ttl: Time-to-live for keys in seconds (default 1 day).
+ recall_ttl: Time-to-live extension for keys when recalled (default 3 days).
+ *args: Additional positional arguments.
+ **kwargs: Additional keyword arguments.
+ """
+ try:
+ from upstash_redis import Redis
+ except ImportError as e:
+ msg = (
+ "Could not import upstash_redis python package. "
+ "Please install it with `pip install upstash_redis`."
+ )
+ raise ImportError(msg) from e
+
+ super().__init__(*args, **kwargs)
+
+ try:
+ self.redis_client = Redis(url=url, token=token)
+ except Exception as exc:
+ error_msg = "Upstash Redis instance could not be initiated"
+ logger.exception(error_msg)
+ raise RuntimeError(error_msg) from exc
+
+ self.session_id = session_id
+ self.key_prefix = key_prefix
+ self.ttl = ttl
+ self.recall_ttl = recall_ttl or ttl
+
+ @property
+ def full_key_prefix(self) -> str:
+ """Returns the full key prefix with session ID."""
+ return f"{self.key_prefix}:{self.session_id}"
+
+ @override
+ def get(self, key: str, default: str | None = None) -> str | None:
+ res = (
+ self.redis_client.getex(f"{self.full_key_prefix}:{key}", ex=self.recall_ttl)
+ or default
+ or ""
+ )
+ logger.debug(
+ "Upstash Redis MEM get '%s:%s': '%s'", self.full_key_prefix, key, res
+ )
+ return res
+
+ @override
+ def set(self, key: str, value: str | None) -> None:
+ if not value:
+ return self.delete(key)
+ self.redis_client.set(f"{self.full_key_prefix}:{key}", value, ex=self.ttl)
+ logger.debug(
+ "Redis MEM set '%s:%s': '%s' EX %s",
+ self.full_key_prefix,
+ key,
+ value,
+ self.ttl,
+ )
+ return None
+
+ @override
+ def delete(self, key: str) -> None:
+ self.redis_client.delete(f"{self.full_key_prefix}:{key}")
+
+ @override
+ def exists(self, key: str) -> bool:
+ return self.redis_client.exists(f"{self.full_key_prefix}:{key}") == 1
+
+ @override
+ def clear(self) -> None:
+ def scan_and_delete(cursor: int) -> int:
+ cursor, keys_to_delete = self.redis_client.scan(
+ cursor,
+ f"{self.full_key_prefix}:*",
+ )
+ self.redis_client.delete(*keys_to_delete)
+ return cursor
+
+ cursor = scan_and_delete(0)
+ while cursor != 0:
+ scan_and_delete(cursor)
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class RedisEntityStore(BaseEntityStore):
+ """Redis-backed Entity store.
+
+ Entities get a TTL of 1 day by default, and
+ that TTL is extended by 3 days every time the entity is read back.
+ """
+
+ redis_client: Any
+ session_id: str = "default"
+ key_prefix: str = "memory_store"
+ ttl: int | None = 60 * 60 * 24
+ recall_ttl: int | None = 60 * 60 * 24 * 3
+
+ def __init__(
+ self,
+ session_id: str = "default",
+ url: str = "redis://localhost:6379/0",
+ key_prefix: str = "memory_store",
+ ttl: int | None = 60 * 60 * 24,
+ recall_ttl: int | None = 60 * 60 * 24 * 3,
+ *args: Any,
+ **kwargs: Any,
+ ):
+ """Initializes the RedisEntityStore.
+
+ Args:
+ session_id: Unique identifier for the session.
+ url: URL of the Redis server.
+ key_prefix: Prefix for keys in the Redis store.
+ ttl: Time-to-live for keys in seconds (default 1 day).
+ recall_ttl: Time-to-live extension for keys when recalled (default 3 days).
+ *args: Additional positional arguments.
+ **kwargs: Additional keyword arguments.
+ """
+ try:
+ import redis
+ except ImportError as e:
+ msg = (
+ "Could not import redis python package. "
+ "Please install it with `pip install redis`."
+ )
+ raise ImportError(msg) from e
+
+ super().__init__(*args, **kwargs)
+
+ try:
+ from langchain_community.utilities.redis import get_client
+ except ImportError as e:
+ msg = (
+ "Could not import langchain_community.utilities.redis.get_client. "
+ "Please install it with `pip install langchain-community`."
+ )
+ raise ImportError(msg) from e
+
+ try:
+ self.redis_client = get_client(redis_url=url, decode_responses=True)
+ except redis.exceptions.ConnectionError:
+ logger.exception("Redis client could not connect")
+
+ self.session_id = session_id
+ self.key_prefix = key_prefix
+ self.ttl = ttl
+ self.recall_ttl = recall_ttl or ttl
+
+ @property
+ def full_key_prefix(self) -> str:
+ """Returns the full key prefix with session ID."""
+ return f"{self.key_prefix}:{self.session_id}"
+
+ @override
+ def get(self, key: str, default: str | None = None) -> str | None:
+ res = (
+ self.redis_client.getex(f"{self.full_key_prefix}:{key}", ex=self.recall_ttl)
+ or default
+ or ""
+ )
+ logger.debug("REDIS MEM get '%s:%s': '%s'", self.full_key_prefix, key, res)
+ return res
+
+ @override
+ def set(self, key: str, value: str | None) -> None:
+ if not value:
+ return self.delete(key)
+ self.redis_client.set(f"{self.full_key_prefix}:{key}", value, ex=self.ttl)
+ logger.debug(
+ "REDIS MEM set '%s:%s': '%s' EX %s",
+ self.full_key_prefix,
+ key,
+ value,
+ self.ttl,
+ )
+ return None
+
+ @override
+ def delete(self, key: str) -> None:
+ self.redis_client.delete(f"{self.full_key_prefix}:{key}")
+
+ @override
+ def exists(self, key: str) -> bool:
+ return self.redis_client.exists(f"{self.full_key_prefix}:{key}") == 1
+
+ @override
+ def clear(self) -> None:
+ # iterate a list in batches of size batch_size
+ def batched(iterable: Iterable[Any], batch_size: int) -> Iterable[Any]:
+ iterator = iter(iterable)
+ while batch := list(islice(iterator, batch_size)):
+ yield batch
+
+ for keybatch in batched(
+ self.redis_client.scan_iter(f"{self.full_key_prefix}:*"),
+ 500,
+ ):
+ self.redis_client.delete(*keybatch)
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class SQLiteEntityStore(BaseEntityStore):
+ """SQLite-backed Entity store with safe query construction."""
+
+ session_id: str = "default"
+ table_name: str = "memory_store"
+ conn: Any = None
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def __init__(
+ self,
+ session_id: str = "default",
+ db_file: str = "entities.db",
+ table_name: str = "memory_store",
+ *args: Any,
+ **kwargs: Any,
+ ):
+ """Initializes the SQLiteEntityStore.
+
+ Args:
+ session_id: Unique identifier for the session.
+ db_file: Path to the SQLite database file.
+ table_name: Name of the table to store entities.
+ *args: Additional positional arguments.
+ **kwargs: Additional keyword arguments.
+ """
+ super().__init__(*args, **kwargs)
+ try:
+ import sqlite3
+ except ImportError as e:
+ msg = (
+ "Could not import sqlite3 python package. "
+ "Please install it with `pip install sqlite3`."
+ )
+ raise ImportError(msg) from e
+
+ # Basic validation to prevent obviously malicious table/session names
+ if not table_name.isidentifier() or not session_id.isidentifier():
+ # Since we validate here, we can safely suppress the S608 bandit warning
+ msg = "Table name and session ID must be valid Python identifiers."
+ raise ValueError(msg)
+
+ self.conn = sqlite3.connect(db_file)
+ self.session_id = session_id
+ self.table_name = table_name
+ self._create_table_if_not_exists()
+
+ @property
+ def full_table_name(self) -> str:
+ """Returns the full table name with session ID."""
+ return f"{self.table_name}_{self.session_id}"
+
+ def _execute_query(self, query: str, params: tuple = ()) -> "sqlite3.Cursor":
+ """Executes a query with proper connection handling."""
+ with self.conn:
+ return self.conn.execute(query, params)
+
+ def _create_table_if_not_exists(self) -> None:
+ """Creates the entity table if it doesn't exist, using safe quoting."""
+ # Use standard SQL double quotes for the table name identifier
+ create_table_query = f"""
+ CREATE TABLE IF NOT EXISTS "{self.full_table_name}" (
+ key TEXT PRIMARY KEY,
+ value TEXT
+ )
+ """
+ self._execute_query(create_table_query)
+
+ def get(self, key: str, default: str | None = None) -> str | None:
+ """Retrieves a value, safely quoting the table name."""
+ # `?` placeholder is used for the value to prevent SQL injection
+ # Ignore S608 since we validate for malicious table/session names in `__init__`
+ query = f'SELECT value FROM "{self.full_table_name}" WHERE key = ?' # noqa: S608
+ cursor = self._execute_query(query, (key,))
+ result = cursor.fetchone()
+ return result[0] if result is not None else default
+
+ def set(self, key: str, value: str | None) -> None:
+ """Inserts or replaces a value, safely quoting the table name."""
+ if not value:
+ return self.delete(key)
+ # Ignore S608 since we validate for malicious table/session names in `__init__`
+ query = (
+ "INSERT OR REPLACE INTO " # noqa: S608
+ f'"{self.full_table_name}" (key, value) VALUES (?, ?)'
+ )
+ self._execute_query(query, (key, value))
+ return None
+
+ def delete(self, key: str) -> None:
+ """Deletes a key-value pair, safely quoting the table name."""
+ # Ignore S608 since we validate for malicious table/session names in `__init__`
+ query = f'DELETE FROM "{self.full_table_name}" WHERE key = ?' # noqa: S608
+ self._execute_query(query, (key,))
+
+ def exists(self, key: str) -> bool:
+ """Checks for the existence of a key, safely quoting the table name."""
+ # Ignore S608 since we validate for malicious table/session names in `__init__`
+ query = f'SELECT 1 FROM "{self.full_table_name}" WHERE key = ? LIMIT 1' # noqa: S608
+ cursor = self._execute_query(query, (key,))
+ return cursor.fetchone() is not None
+
+ @override
+ def clear(self) -> None:
+ # Ignore S608 since we validate for malicious table/session names in `__init__`
+ query = f"""
+ DELETE FROM {self.full_table_name}
+ """ # noqa: S608
+ with self.conn:
+ self.conn.execute(query)
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationEntityMemory(BaseChatMemory):
+ """Entity extractor & summarizer memory.
+
+ Extracts named entities from the recent chat history and generates summaries.
+ With a swappable entity store, persisting entities across conversations.
+ Defaults to an in-memory entity store, and can be swapped out for a Redis,
+ SQLite, or other entity store.
+ """
+
+ human_prefix: str = "Human"
+ ai_prefix: str = "AI"
+ llm: BaseLanguageModel
+ entity_extraction_prompt: BasePromptTemplate = ENTITY_EXTRACTION_PROMPT
+ entity_summarization_prompt: BasePromptTemplate = ENTITY_SUMMARIZATION_PROMPT
+
+ # Cache of recently detected entity names, if any
+ # It is updated when load_memory_variables is called:
+ entity_cache: list[str] = []
+
+ # Number of recent message pairs to consider when updating entities:
+ k: int = 3
+
+ chat_history_key: str = "history"
+
+ # Store to manage entity-related data:
+ entity_store: BaseEntityStore = Field(default_factory=InMemoryEntityStore)
+
+ @property
+ def buffer(self) -> list[BaseMessage]:
+ """Access chat memory messages."""
+ return self.chat_memory.messages
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return ["entities", self.chat_history_key]
+
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Load memory variables.
+
+ Returns chat history and all generated entities with summaries if available,
+ and updates or clears the recent entity cache.
+
+ New entity name can be found when calling this method, before the entity
+ summaries are generated, so the entity cache values may be empty if no entity
+ descriptions are generated yet.
+ """
+ # Create an LLMChain for predicting entity names from the recent chat history:
+ chain = LLMChain(llm=self.llm, prompt=self.entity_extraction_prompt)
+
+ if self.input_key is None:
+ prompt_input_key = get_prompt_input_key(inputs, self.memory_variables)
+ else:
+ prompt_input_key = self.input_key
+
+ # Extract an arbitrary window of the last message pairs from
+ # the chat history, where the hyperparameter k is the
+ # number of message pairs:
+ buffer_string = get_buffer_string(
+ self.buffer[-self.k * 2 :],
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ # Generates a comma-separated list of named entities,
+ # e.g. "Jane, White House, UFO"
+ # or "NONE" if no named entities are extracted:
+ output = chain.predict(
+ history=buffer_string,
+ input=inputs[prompt_input_key],
+ )
+
+ # If no named entities are extracted, assigns an empty list.
+ if output.strip() == "NONE":
+ entities = []
+ else:
+ # Make a list of the extracted entities:
+ entities = [w.strip() for w in output.split(",")]
+
+ # Make a dictionary of entities with summary if exists:
+ entity_summaries = {}
+
+ for entity in entities:
+ entity_summaries[entity] = self.entity_store.get(entity, "")
+
+ # Replaces the entity name cache with the most recently discussed entities,
+ # or if no entities were extracted, clears the cache:
+ self.entity_cache = entities
+
+ # Should we return as message objects or as a string?
+ if self.return_messages:
+ # Get last `k` pair of chat messages:
+ buffer: Any = self.buffer[-self.k * 2 :]
+ else:
+ # Reuse the string we made earlier:
+ buffer = buffer_string
+
+ return {
+ self.chat_history_key: buffer,
+ "entities": entity_summaries,
+ }
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation history to the entity store.
+
+ Generates a summary for each entity in the entity cache by prompting
+ the model, and saves these summaries to the entity store.
+ """
+ super().save_context(inputs, outputs)
+
+ if self.input_key is None:
+ prompt_input_key = get_prompt_input_key(inputs, self.memory_variables)
+ else:
+ prompt_input_key = self.input_key
+
+ # Extract an arbitrary window of the last message pairs from
+ # the chat history, where the hyperparameter k is the
+ # number of message pairs:
+ buffer_string = get_buffer_string(
+ self.buffer[-self.k * 2 :],
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ input_data = inputs[prompt_input_key]
+
+ # Create an LLMChain for predicting entity summarization from the context
+ chain = LLMChain(llm=self.llm, prompt=self.entity_summarization_prompt)
+
+ # Generate new summaries for entities and save them in the entity store
+ for entity in self.entity_cache:
+ # Get existing summary if it exists
+ existing_summary = self.entity_store.get(entity, "")
+ output = chain.predict(
+ summary=existing_summary,
+ entity=entity,
+ history=buffer_string,
+ input=input_data,
+ )
+ # Save the updated summary to the entity store
+ self.entity_store.set(entity, output.strip())
+
+ def clear(self) -> None:
+ """Clear memory contents."""
+ self.chat_memory.clear()
+ self.entity_cache.clear()
+ self.entity_store.clear()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/kg.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/kg.py
new file mode 100644
index 0000000000000000000000000000000000000000..028d43bf589fe80900c3a9de5e1eca884629498e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/kg.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.memory.kg import ConversationKGMemory
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ConversationKGMemory": "langchain_community.memory.kg"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ConversationKGMemory",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/motorhead_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/motorhead_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..018cd7ba2c2443e5300dae1eee68dd9d62110d32
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/motorhead_memory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.memory.motorhead_memory import MotorheadMemory
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MotorheadMemory": "langchain_community.memory.motorhead_memory"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MotorheadMemory",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..f28de16f825fcf48c3730c38a5873d4c9e01003e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/prompt.py
@@ -0,0 +1,164 @@
+from langchain_core.prompts.prompt import PromptTemplate
+
+_DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE = """You are an assistant to a human, powered by a large language model trained by OpenAI.
+
+You are designed to be able to assist with a wide range of tasks, from answering simple questions to providing in-depth explanations and discussions on a wide range of topics. As a language model, you are able to generate human-like text based on the input you receive, allowing you to engage in natural-sounding conversations and provide responses that are coherent and relevant to the topic at hand.
+
+You are constantly learning and improving, and your capabilities are constantly evolving. You are able to process and understand large amounts of text, and can use this knowledge to provide accurate and informative responses to a wide range of questions. You have access to some personalized information provided by the human in the Context section below. Additionally, you are able to generate your own text based on the input you receive, allowing you to engage in discussions and provide explanations and descriptions on a wide range of topics.
+
+Overall, you are a powerful tool that can help with a wide range of tasks and provide valuable insights and information on a wide range of topics. Whether the human needs help with a specific question or just wants to have a conversation about a particular topic, you are here to assist.
+
+Context:
+{entities}
+
+Current conversation:
+{history}
+Last line:
+Human: {input}
+You:""" # noqa: E501
+
+ENTITY_MEMORY_CONVERSATION_TEMPLATE = PromptTemplate(
+ input_variables=["entities", "history", "input"],
+ template=_DEFAULT_ENTITY_MEMORY_CONVERSATION_TEMPLATE,
+)
+
+_DEFAULT_SUMMARIZER_TEMPLATE = """Progressively summarize the lines of conversation provided, adding onto the previous summary returning a new summary.
+
+EXAMPLE
+Current summary:
+The human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good.
+
+New lines of conversation:
+Human: Why do you think artificial intelligence is a force for good?
+AI: Because artificial intelligence will help humans reach their full potential.
+
+New summary:
+The human asks what the AI thinks of artificial intelligence. The AI thinks artificial intelligence is a force for good because it will help humans reach their full potential.
+END OF EXAMPLE
+
+Current summary:
+{summary}
+
+New lines of conversation:
+{new_lines}
+
+New summary:""" # noqa: E501
+SUMMARY_PROMPT = PromptTemplate(
+ input_variables=["summary", "new_lines"], template=_DEFAULT_SUMMARIZER_TEMPLATE
+)
+
+_DEFAULT_ENTITY_EXTRACTION_TEMPLATE = """You are an AI assistant reading the transcript of a conversation between an AI and a human. Extract all of the proper nouns from the last line of conversation. As a guideline, a proper noun is generally capitalized. You should definitely extract all names and places.
+
+The conversation history is provided just in case of a coreference (e.g. "What do you know about him" where "him" is defined in a previous line) -- ignore items mentioned there that are not in the last line.
+
+Return the output as a single comma-separated list, or NONE if there is nothing of note to return (e.g. the user is just issuing a greeting or having a simple conversation).
+
+EXAMPLE
+Conversation history:
+Person #1: how's it going today?
+AI: "It's going great! How about you?"
+Person #1: good! busy working on Langchain. lots to do.
+AI: "That sounds like a lot of work! What kind of things are you doing to make Langchain better?"
+Last line:
+Person #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff.
+Output: Langchain
+END OF EXAMPLE
+
+EXAMPLE
+Conversation history:
+Person #1: how's it going today?
+AI: "It's going great! How about you?"
+Person #1: good! busy working on Langchain. lots to do.
+AI: "That sounds like a lot of work! What kind of things are you doing to make Langchain better?"
+Last line:
+Person #1: i'm trying to improve Langchain's interfaces, the UX, its integrations with various products the user might want ... a lot of stuff. I'm working with Person #2.
+Output: Langchain, Person #2
+END OF EXAMPLE
+
+Conversation history (for reference only):
+{history}
+Last line of conversation (for extraction):
+Human: {input}
+
+Output:""" # noqa: E501
+ENTITY_EXTRACTION_PROMPT = PromptTemplate(
+ input_variables=["history", "input"], template=_DEFAULT_ENTITY_EXTRACTION_TEMPLATE
+)
+
+_DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE = """You are an AI assistant helping a human keep track of facts about relevant people, places, and concepts in their life. Update the summary of the provided entity in the "Entity" section based on the last line of your conversation with the human. If you are writing the summary for the first time, return a single sentence.
+The update should only include facts that are relayed in the last line of conversation about the provided entity, and should only contain facts about the provided entity.
+
+If there is no new information about the provided entity or the information is not worth noting (not an important or relevant fact to remember long-term), return the existing summary unchanged.
+
+Full conversation history (for context):
+{history}
+
+Entity to summarize:
+{entity}
+
+Existing summary of {entity}:
+{summary}
+
+Last line of conversation:
+Human: {input}
+Updated summary:""" # noqa: E501
+
+ENTITY_SUMMARIZATION_PROMPT = PromptTemplate(
+ input_variables=["entity", "summary", "history", "input"],
+ template=_DEFAULT_ENTITY_SUMMARIZATION_TEMPLATE,
+)
+
+
+KG_TRIPLE_DELIMITER = "<|>"
+_DEFAULT_KNOWLEDGE_TRIPLE_EXTRACTION_TEMPLATE = (
+ "You are a networked intelligence helping a human track knowledge triples"
+ " about all relevant people, things, concepts, etc. and integrating"
+ " them with your knowledge stored within your weights"
+ " as well as that stored in a knowledge graph."
+ " Extract all of the knowledge triples from the last line of conversation."
+ " A knowledge triple is a clause that contains a subject, a predicate,"
+ " and an object. The subject is the entity being described,"
+ " the predicate is the property of the subject that is being"
+ " described, and the object is the value of the property.\n\n"
+ "EXAMPLE\n"
+ "Conversation history:\n"
+ "Person #1: Did you hear aliens landed in Area 51?\n"
+ "AI: No, I didn't hear that. What do you know about Area 51?\n"
+ "Person #1: It's a secret military base in Nevada.\n"
+ "AI: What do you know about Nevada?\n"
+ "Last line of conversation:\n"
+ "Person #1: It's a state in the US. It's also the number 1 producer of gold in the US.\n\n" # noqa: E501
+ f"Output: (Nevada, is a, state){KG_TRIPLE_DELIMITER}(Nevada, is in, US)"
+ f"{KG_TRIPLE_DELIMITER}(Nevada, is the number 1 producer of, gold)\n"
+ "END OF EXAMPLE\n\n"
+ "EXAMPLE\n"
+ "Conversation history:\n"
+ "Person #1: Hello.\n"
+ "AI: Hi! How are you?\n"
+ "Person #1: I'm good. How are you?\n"
+ "AI: I'm good too.\n"
+ "Last line of conversation:\n"
+ "Person #1: I'm going to the store.\n\n"
+ "Output: NONE\n"
+ "END OF EXAMPLE\n\n"
+ "EXAMPLE\n"
+ "Conversation history:\n"
+ "Person #1: What do you know about Descartes?\n"
+ "AI: Descartes was a French philosopher, mathematician, and scientist who lived in the 17th century.\n" # noqa: E501
+ "Person #1: The Descartes I'm referring to is a standup comedian and interior designer from Montreal.\n" # noqa: E501
+ "AI: Oh yes, He is a comedian and an interior designer. He has been in the industry for 30 years. His favorite food is baked bean pie.\n" # noqa: E501
+ "Last line of conversation:\n"
+ "Person #1: Oh huh. I know Descartes likes to drive antique scooters and play the mandolin.\n" # noqa: E501
+ f"Output: (Descartes, likes to drive, antique scooters){KG_TRIPLE_DELIMITER}(Descartes, plays, mandolin)\n" # noqa: E501
+ "END OF EXAMPLE\n\n"
+ "Conversation history (for reference only):\n"
+ "{history}"
+ "\nLast line of conversation (for extraction):\n"
+ "Human: {input}\n\n"
+ "Output:"
+)
+
+KNOWLEDGE_TRIPLE_EXTRACTION_PROMPT = PromptTemplate(
+ input_variables=["history", "input"],
+ template=_DEFAULT_KNOWLEDGE_TRIPLE_EXTRACTION_TEMPLATE,
+)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/readonly.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/readonly.py
new file mode 100644
index 0000000000000000000000000000000000000000..85ac1c626e1541793ff1f10d7c7104f89ce5aedf
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/readonly.py
@@ -0,0 +1,24 @@
+from typing import Any
+
+from langchain_classic.base_memory import BaseMemory
+
+
+class ReadOnlySharedMemory(BaseMemory):
+ """Memory wrapper that is read-only and cannot be changed."""
+
+ memory: BaseMemory
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Return memory variables."""
+ return self.memory.memory_variables
+
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, str]:
+ """Load memory variables from memory."""
+ return self.memory.load_memory_variables(inputs)
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Nothing should be saved or changed."""
+
+ def clear(self) -> None:
+ """Nothing to clear, got a memory like a vault."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/simple.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/simple.py
new file mode 100644
index 0000000000000000000000000000000000000000..c9163c396f375da590e031009e44e82fe611a22a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/simple.py
@@ -0,0 +1,30 @@
+from typing import Any
+
+from typing_extensions import override
+
+from langchain_classic.base_memory import BaseMemory
+
+
+class SimpleMemory(BaseMemory):
+ """Simple Memory.
+
+ Simple memory for storing context or other information that shouldn't
+ ever change between prompts.
+ """
+
+ memories: dict[str, Any] = {}
+
+ @property
+ @override
+ def memory_variables(self) -> list[str]:
+ return list(self.memories.keys())
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, str]:
+ return self.memories
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Nothing should be saved or changed, my memory is set in stone."""
+
+ def clear(self) -> None:
+ """Nothing to clear, got a memory like a vault."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/summary.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/summary.py
new file mode 100644
index 0000000000000000000000000000000000000000..0f7961cf42a6b1cb9365622e5923d4ed37e973b0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/summary.py
@@ -0,0 +1,173 @@
+from __future__ import annotations
+
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.chat_history import BaseChatMessageHistory
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.messages import BaseMessage, SystemMessage, get_buffer_string
+from langchain_core.prompts import BasePromptTemplate
+from langchain_core.utils import pre_init
+from pydantic import BaseModel
+from typing_extensions import override
+
+from langchain_classic.chains.llm import LLMChain
+from langchain_classic.memory.chat_memory import BaseChatMemory
+from langchain_classic.memory.prompt import SUMMARY_PROMPT
+
+
+@deprecated(
+ since="0.2.12",
+ removal="2.0.0",
+ addendum=(
+ "For agents, summarize conversation history with `create_agent` and "
+ "summarization middleware. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langgraph/add-memory#summarize-messages"
+ ),
+)
+class SummarizerMixin(BaseModel):
+ """Mixin for summarizer."""
+
+ human_prefix: str = "Human"
+ ai_prefix: str = "AI"
+ llm: BaseLanguageModel
+ prompt: BasePromptTemplate = SUMMARY_PROMPT
+ summary_message_cls: type[BaseMessage] = SystemMessage
+
+ def predict_new_summary(
+ self,
+ messages: list[BaseMessage],
+ existing_summary: str,
+ ) -> str:
+ """Predict a new summary based on the messages and existing summary.
+
+ Args:
+ messages: List of messages to summarize.
+ existing_summary: Existing summary to build upon.
+
+ Returns:
+ A new summary string.
+ """
+ new_lines = get_buffer_string(
+ messages,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ chain = LLMChain(llm=self.llm, prompt=self.prompt)
+ return chain.predict(summary=existing_summary, new_lines=new_lines)
+
+ async def apredict_new_summary(
+ self,
+ messages: list[BaseMessage],
+ existing_summary: str,
+ ) -> str:
+ """Predict a new summary based on the messages and existing summary.
+
+ Args:
+ messages: List of messages to summarize.
+ existing_summary: Existing summary to build upon.
+
+ Returns:
+ A new summary string.
+ """
+ new_lines = get_buffer_string(
+ messages,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ chain = LLMChain(llm=self.llm, prompt=self.prompt)
+ return await chain.apredict(summary=existing_summary, new_lines=new_lines)
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationSummaryMemory(BaseChatMemory, SummarizerMixin):
+ """Continually summarizes the conversation history.
+
+ The summary is updated after each conversation turn.
+ The implementations returns a summary of the conversation history which
+ can be used to provide context to the model.
+ """
+
+ buffer: str = ""
+ memory_key: str = "history"
+
+ @classmethod
+ def from_messages(
+ cls,
+ llm: BaseLanguageModel,
+ chat_memory: BaseChatMessageHistory,
+ *,
+ summarize_step: int = 2,
+ **kwargs: Any,
+ ) -> ConversationSummaryMemory:
+ """Create a ConversationSummaryMemory from a list of messages.
+
+ Args:
+ llm: The language model to use for summarization.
+ chat_memory: The chat history to summarize.
+ summarize_step: Number of messages to summarize at a time.
+ **kwargs: Additional keyword arguments to pass to the class.
+
+ Returns:
+ An instance of ConversationSummaryMemory with the summarized history.
+ """
+ obj = cls(llm=llm, chat_memory=chat_memory, **kwargs)
+ for i in range(0, len(obj.chat_memory.messages), summarize_step):
+ obj.buffer = obj.predict_new_summary(
+ obj.chat_memory.messages[i : i + summarize_step],
+ obj.buffer,
+ )
+ return obj
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return [self.memory_key]
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return history buffer."""
+ if self.return_messages:
+ buffer: Any = [self.summary_message_cls(content=self.buffer)]
+ else:
+ buffer = self.buffer
+ return {self.memory_key: buffer}
+
+ @pre_init
+ def validate_prompt_input_variables(cls, values: dict) -> dict:
+ """Validate that prompt input variables are consistent."""
+ prompt_variables = values["prompt"].input_variables
+ expected_keys = {"summary", "new_lines"}
+ if expected_keys != set(prompt_variables):
+ msg = (
+ "Got unexpected prompt input variables. The prompt expects "
+ f"{prompt_variables}, but it should have {expected_keys}."
+ )
+ raise ValueError(msg)
+ return values
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer."""
+ super().save_context(inputs, outputs)
+ self.buffer = self.predict_new_summary(
+ self.chat_memory.messages[-2:],
+ self.buffer,
+ )
+
+ def clear(self) -> None:
+ """Clear memory contents."""
+ super().clear()
+ self.buffer = ""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/summary_buffer.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/summary_buffer.py
new file mode 100644
index 0000000000000000000000000000000000000000..3f84c1906cd3e2785e8e5bc312e142ec82180435
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/summary_buffer.py
@@ -0,0 +1,151 @@
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.messages import BaseMessage, get_buffer_string
+from langchain_core.utils import pre_init
+from typing_extensions import override
+
+from langchain_classic.memory.chat_memory import BaseChatMemory
+from langchain_classic.memory.summary import SummarizerMixin
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationSummaryBufferMemory(BaseChatMemory, SummarizerMixin):
+ """Buffer with summarizer for storing conversation memory.
+
+ Provides a running summary of the conversation together with the most recent
+ messages in the conversation under the constraint that the total number of
+ tokens in the conversation does not exceed a certain limit.
+ """
+
+ max_token_limit: int = 2000
+ moving_summary_buffer: str = ""
+ memory_key: str = "history"
+
+ @property
+ def buffer(self) -> str | list[BaseMessage]:
+ """String buffer of memory."""
+ return self.load_memory_variables({})[self.memory_key]
+
+ async def abuffer(self) -> str | list[BaseMessage]:
+ """Async memory buffer."""
+ memory_variables = await self.aload_memory_variables({})
+ return memory_variables[self.memory_key]
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return [self.memory_key]
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return history buffer."""
+ buffer = self.chat_memory.messages
+ if self.moving_summary_buffer != "":
+ first_messages: list[BaseMessage] = [
+ self.summary_message_cls(content=self.moving_summary_buffer),
+ ]
+ buffer = first_messages + buffer
+ if self.return_messages:
+ final_buffer: Any = buffer
+ else:
+ final_buffer = get_buffer_string(
+ buffer,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+ return {self.memory_key: final_buffer}
+
+ @override
+ async def aload_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Asynchronously return key-value pairs given the text input to the chain."""
+ buffer = await self.chat_memory.aget_messages()
+ if self.moving_summary_buffer != "":
+ first_messages: list[BaseMessage] = [
+ self.summary_message_cls(content=self.moving_summary_buffer),
+ ]
+ buffer = first_messages + buffer
+ if self.return_messages:
+ final_buffer: Any = buffer
+ else:
+ final_buffer = get_buffer_string(
+ buffer,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+ return {self.memory_key: final_buffer}
+
+ @pre_init
+ def validate_prompt_input_variables(cls, values: dict) -> dict:
+ """Validate that prompt input variables are consistent."""
+ prompt_variables = values["prompt"].input_variables
+ expected_keys = {"summary", "new_lines"}
+ if expected_keys != set(prompt_variables):
+ msg = (
+ "Got unexpected prompt input variables. The prompt expects "
+ f"{prompt_variables}, but it should have {expected_keys}."
+ )
+ raise ValueError(msg)
+ return values
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer."""
+ super().save_context(inputs, outputs)
+ self.prune()
+
+ async def asave_context(
+ self,
+ inputs: dict[str, Any],
+ outputs: dict[str, str],
+ ) -> None:
+ """Asynchronously save context from this conversation to buffer."""
+ await super().asave_context(inputs, outputs)
+ await self.aprune()
+
+ def prune(self) -> None:
+ """Prune buffer if it exceeds max token limit."""
+ buffer = self.chat_memory.messages
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+ if curr_buffer_length > self.max_token_limit:
+ pruned_memory = []
+ while curr_buffer_length > self.max_token_limit:
+ pruned_memory.append(buffer.pop(0))
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+ self.moving_summary_buffer = self.predict_new_summary(
+ pruned_memory,
+ self.moving_summary_buffer,
+ )
+
+ async def aprune(self) -> None:
+ """Asynchronously prune buffer if it exceeds max token limit."""
+ buffer = self.chat_memory.messages
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+ if curr_buffer_length > self.max_token_limit:
+ pruned_memory = []
+ while curr_buffer_length > self.max_token_limit:
+ pruned_memory.append(buffer.pop(0))
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+ self.moving_summary_buffer = await self.apredict_new_summary(
+ pruned_memory,
+ self.moving_summary_buffer,
+ )
+
+ def clear(self) -> None:
+ """Clear memory contents."""
+ super().clear()
+ self.moving_summary_buffer = ""
+
+ async def aclear(self) -> None:
+ """Asynchronously clear memory contents."""
+ await super().aclear()
+ self.moving_summary_buffer = ""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/token_buffer.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/token_buffer.py
new file mode 100644
index 0000000000000000000000000000000000000000..27e55e0caff4c2ffca1c03fa2f8eec4befe00c04
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/token_buffer.py
@@ -0,0 +1,74 @@
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.messages import BaseMessage, get_buffer_string
+from typing_extensions import override
+
+from langchain_classic.memory.chat_memory import BaseChatMemory
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class ConversationTokenBufferMemory(BaseChatMemory):
+ """Conversation chat memory with token limit.
+
+ Keeps only the most recent messages in the conversation under the constraint
+ that the total number of tokens in the conversation does not exceed a certain limit.
+ """
+
+ human_prefix: str = "Human"
+ ai_prefix: str = "AI"
+ llm: BaseLanguageModel
+ memory_key: str = "history"
+ max_token_limit: int = 2000
+
+ @property
+ def buffer(self) -> Any:
+ """String buffer of memory."""
+ return self.buffer_as_messages if self.return_messages else self.buffer_as_str
+
+ @property
+ def buffer_as_str(self) -> str:
+ """Exposes the buffer as a string in case return_messages is False."""
+ return get_buffer_string(
+ self.chat_memory.messages,
+ human_prefix=self.human_prefix,
+ ai_prefix=self.ai_prefix,
+ )
+
+ @property
+ def buffer_as_messages(self) -> list[BaseMessage]:
+ """Exposes the buffer as a list of messages in case return_messages is True."""
+ return self.chat_memory.messages
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """Will always return list of memory variables."""
+ return [self.memory_key]
+
+ @override
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return history buffer."""
+ return {self.memory_key: self.buffer}
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer. Pruned."""
+ super().save_context(inputs, outputs)
+ # Prune buffer if it exceeds max token limit
+ buffer = self.chat_memory.messages
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+ if curr_buffer_length > self.max_token_limit:
+ pruned_memory = []
+ while curr_buffer_length > self.max_token_limit:
+ pruned_memory.append(buffer.pop(0))
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..f2950422cd7415efb9be6faf7969088a55e0821e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/utils.py
@@ -0,0 +1,20 @@
+from typing import Any
+
+
+def get_prompt_input_key(inputs: dict[str, Any], memory_variables: list[str]) -> str:
+ """Get the prompt input key.
+
+ Args:
+ inputs: Dict[str, Any]
+ memory_variables: List[str]
+
+ Returns:
+ A prompt input key.
+ """
+ # "stop" is a special key that can be passed as input but is not used to
+ # format the prompt.
+ prompt_input_keys = list(set(inputs).difference([*memory_variables, "stop"]))
+ if len(prompt_input_keys) != 1:
+ msg = f"One input key expected got {prompt_input_keys}"
+ raise ValueError(msg)
+ return prompt_input_keys[0]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/vectorstore.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/vectorstore.py
new file mode 100644
index 0000000000000000000000000000000000000000..4bbb724e05b3a37a6e17aacca62b6afcef88d81a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/vectorstore.py
@@ -0,0 +1,125 @@
+"""Class for a VectorStore-backed memory object."""
+
+from collections.abc import Sequence
+from typing import Any
+
+from langchain_core._api import deprecated
+from langchain_core.documents import Document
+from langchain_core.vectorstores import VectorStoreRetriever
+from pydantic import Field
+
+from langchain_classic.base_memory import BaseMemory
+from langchain_classic.memory.utils import get_prompt_input_key
+
+
+@deprecated(
+ since="0.3.1",
+ removal="2.0.0",
+ alternative="langchain.agents.create_agent",
+ addendum=(
+ "For agents that need to remember prior interactions, use "
+ "`create_agent` with checkpointing or the `Store` API. See "
+ "https://docs.langchain.com/oss/python/langchain/short-term-memory and "
+ "https://docs.langchain.com/oss/python/langchain/long-term-memory"
+ ),
+)
+class VectorStoreRetrieverMemory(BaseMemory):
+ """Vector Store Retriever Memory.
+
+ Store the conversation history in a vector store and retrieves the relevant
+ parts of past conversation based on the input.
+ """
+
+ retriever: VectorStoreRetriever = Field(exclude=True)
+ """VectorStoreRetriever object to connect to."""
+
+ memory_key: str = "history"
+ """Key name to locate the memories in the result of load_memory_variables."""
+
+ input_key: str | None = None
+ """Key name to index the inputs to load_memory_variables."""
+
+ return_docs: bool = False
+ """Whether or not to return the result of querying the database directly."""
+
+ exclude_input_keys: Sequence[str] = Field(default_factory=tuple)
+ """Input keys to exclude in addition to memory key when constructing the document"""
+
+ @property
+ def memory_variables(self) -> list[str]:
+ """The list of keys emitted from the load_memory_variables method."""
+ return [self.memory_key]
+
+ def _get_prompt_input_key(self, inputs: dict[str, Any]) -> str:
+ """Get the input key for the prompt."""
+ if self.input_key is None:
+ return get_prompt_input_key(inputs, self.memory_variables)
+ return self.input_key
+
+ def _documents_to_memory_variables(
+ self,
+ docs: list[Document],
+ ) -> dict[str, list[Document] | str]:
+ result: list[Document] | str
+ if not self.return_docs:
+ result = "\n".join([doc.page_content for doc in docs])
+ else:
+ result = docs
+ return {self.memory_key: result}
+
+ def load_memory_variables(
+ self,
+ inputs: dict[str, Any],
+ ) -> dict[str, list[Document] | str]:
+ """Return history buffer."""
+ input_key = self._get_prompt_input_key(inputs)
+ query = inputs[input_key]
+ docs = self.retriever.invoke(query)
+ return self._documents_to_memory_variables(docs)
+
+ async def aload_memory_variables(
+ self,
+ inputs: dict[str, Any],
+ ) -> dict[str, list[Document] | str]:
+ """Return history buffer."""
+ input_key = self._get_prompt_input_key(inputs)
+ query = inputs[input_key]
+ docs = await self.retriever.ainvoke(query)
+ return self._documents_to_memory_variables(docs)
+
+ def _form_documents(
+ self,
+ inputs: dict[str, Any],
+ outputs: dict[str, str],
+ ) -> list[Document]:
+ """Format context from this conversation to buffer."""
+ # Each document should only include the current turn, not the chat history
+ exclude = set(self.exclude_input_keys)
+ exclude.add(self.memory_key)
+ filtered_inputs = {k: v for k, v in inputs.items() if k not in exclude}
+ texts = [
+ f"{k}: {v}"
+ for k, v in list(filtered_inputs.items()) + list(outputs.items())
+ ]
+ page_content = "\n".join(texts)
+ return [Document(page_content=page_content)]
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer."""
+ documents = self._form_documents(inputs, outputs)
+ self.retriever.add_documents(documents)
+
+ async def asave_context(
+ self,
+ inputs: dict[str, Any],
+ outputs: dict[str, str],
+ ) -> None:
+ """Save context from this conversation to buffer."""
+ documents = self._form_documents(inputs, outputs)
+ await self.retriever.aadd_documents(documents)
+
+ def clear(self) -> None:
+ """Nothing to clear."""
+
+ async def aclear(self) -> None:
+ """Nothing to clear."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/vectorstore_token_buffer_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/vectorstore_token_buffer_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..dcf97ac4fe2e5e370d6bba93256c2c9990eaefb2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/vectorstore_token_buffer_memory.py
@@ -0,0 +1,183 @@
+"""Class for a conversation memory buffer with older messages stored in a vectorstore .
+
+This implements a conversation memory in which the messages are stored in a memory
+buffer up to a specified token limit. When the limit is exceeded, older messages are
+saved to a `VectorStore` backing database. The `VectorStore` can be made persistent
+across sessions.
+"""
+
+import warnings
+from datetime import datetime
+from typing import Any
+
+from langchain_core.messages import BaseMessage
+from langchain_core.prompts.chat import SystemMessagePromptTemplate
+from langchain_core.vectorstores import VectorStoreRetriever
+from pydantic import Field, PrivateAttr
+
+from langchain_classic.memory import (
+ ConversationTokenBufferMemory,
+ VectorStoreRetrieverMemory,
+)
+from langchain_classic.memory.chat_memory import BaseChatMemory
+from langchain_classic.text_splitter import RecursiveCharacterTextSplitter
+
+DEFAULT_HISTORY_TEMPLATE = """
+Current date and time: {current_time}.
+
+Potentially relevant timestamped excerpts of previous conversations (you
+do not need to use these if irrelevant):
+{previous_history}
+
+"""
+
+TIMESTAMP_FORMAT = "%Y-%m-%d %H:%M:%S %Z"
+
+
+class ConversationVectorStoreTokenBufferMemory(ConversationTokenBufferMemory):
+ """Conversation chat memory with token limit and vectordb backing.
+
+ load_memory_variables() will return a dict with the key "history".
+ It contains background information retrieved from the vector store
+ plus recent lines of the current conversation.
+
+ To help the LLM understand the part of the conversation stored in the
+ vectorstore, each interaction is timestamped and the current date and
+ time is also provided in the history. A side effect of this is that the
+ LLM will have access to the current date and time.
+
+ Initialization arguments:
+
+ This class accepts all the initialization arguments of
+ ConversationTokenBufferMemory, such as `llm`. In addition, it
+ accepts the following additional arguments
+
+ retriever: (required) A VectorStoreRetriever object to use
+ as the vector backing store
+
+ split_chunk_size: (optional, 1000) Token chunk split size
+ for long messages generated by the AI
+
+ previous_history_template: (optional) Template used to format
+ the contents of the prompt history
+
+
+ Example using ChromaDB:
+
+ ```python
+ from langchain_classic.memory.token_buffer_vectorstore_memory import (
+ ConversationVectorStoreTokenBufferMemory,
+ )
+ from langchain_chroma import Chroma
+ from langchain_community.embeddings import HuggingFaceInstructEmbeddings
+ from langchain_openai import OpenAI
+
+ embedder = HuggingFaceInstructEmbeddings(
+ query_instruction="Represent the query for retrieval: "
+ )
+ chroma = Chroma(
+ collection_name="demo",
+ embedding_function=embedder,
+ collection_metadata={"hnsw:space": "cosine"},
+ )
+
+ retriever = chroma.as_retriever(
+ search_type="similarity_score_threshold",
+ search_kwargs={
+ "k": 5,
+ "score_threshold": 0.75,
+ },
+ )
+
+ conversation_memory = ConversationVectorStoreTokenBufferMemory(
+ return_messages=True,
+ llm=OpenAI(),
+ retriever=retriever,
+ max_token_limit=1000,
+ )
+
+ conversation_memory.save_context({"Human": "Hi there"}, {"AI": "Nice to meet you!"})
+ conversation_memory.save_context(
+ {"Human": "Nice day isn't it?"}, {"AI": "I love Wednesdays."}
+ )
+ conversation_memory.load_memory_variables({"input": "What time is it?"})
+ ```
+ """
+
+ retriever: VectorStoreRetriever = Field(exclude=True)
+ memory_key: str = "history"
+ previous_history_template: str = DEFAULT_HISTORY_TEMPLATE
+ split_chunk_size: int = 1000
+
+ _memory_retriever: VectorStoreRetrieverMemory | None = PrivateAttr(default=None)
+ _timestamps: list[datetime] = PrivateAttr(default_factory=list)
+
+ @property
+ def memory_retriever(self) -> VectorStoreRetrieverMemory:
+ """Return a memory retriever from the passed retriever object."""
+ if self._memory_retriever is not None:
+ return self._memory_retriever
+ self._memory_retriever = VectorStoreRetrieverMemory(retriever=self.retriever)
+ return self._memory_retriever
+
+ def load_memory_variables(self, inputs: dict[str, Any]) -> dict[str, Any]:
+ """Return history and memory buffer."""
+ try:
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ memory_variables = self.memory_retriever.load_memory_variables(inputs)
+ previous_history = memory_variables[self.memory_retriever.memory_key]
+ except AssertionError: # happens when db is empty
+ previous_history = ""
+ current_history = super().load_memory_variables(inputs)
+ template = SystemMessagePromptTemplate.from_template(
+ self.previous_history_template,
+ )
+ messages = [
+ template.format(
+ previous_history=previous_history,
+ current_time=datetime.now().astimezone().strftime(TIMESTAMP_FORMAT),
+ ),
+ ]
+ messages.extend(current_history[self.memory_key])
+ return {self.memory_key: messages}
+
+ def save_context(self, inputs: dict[str, Any], outputs: dict[str, str]) -> None:
+ """Save context from this conversation to buffer. Pruned."""
+ BaseChatMemory.save_context(self, inputs, outputs)
+ self._timestamps.append(datetime.now().astimezone())
+ # Prune buffer if it exceeds max token limit
+ buffer = self.chat_memory.messages
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+ if curr_buffer_length > self.max_token_limit:
+ while curr_buffer_length > self.max_token_limit:
+ self._pop_and_store_interaction(buffer)
+ curr_buffer_length = self.llm.get_num_tokens_from_messages(buffer)
+
+ def save_remainder(self) -> None:
+ """Save the remainder of the conversation buffer to the vector store.
+
+ Useful if you have made the VectorStore persistent, in which
+ case this can be called before the end of the session to store the
+ remainder of the conversation.
+ """
+ buffer = self.chat_memory.messages
+ while len(buffer) > 0:
+ self._pop_and_store_interaction(buffer)
+
+ def _pop_and_store_interaction(self, buffer: list[BaseMessage]) -> None:
+ input_ = buffer.pop(0)
+ output = buffer.pop(0)
+ timestamp = self._timestamps.pop(0).strftime(TIMESTAMP_FORMAT)
+ # Split AI output into smaller chunks to avoid creating documents
+ # that will overflow the context window
+ ai_chunks = self._split_long_ai_text(str(output.content))
+ for index, chunk in enumerate(ai_chunks):
+ self.memory_retriever.save_context(
+ {"Human": f"<{timestamp}/00> {input_.content!s}"},
+ {"AI": f"<{timestamp}/{index:02}> {chunk}"},
+ )
+
+ def _split_long_ai_text(self, text: str) -> list[str]:
+ splitter = RecursiveCharacterTextSplitter(chunk_size=self.split_chunk_size)
+ return [chunk.page_content for chunk in splitter.create_documents([text])]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/zep_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/zep_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..a3c981a0d129e65540b1be9e7f58431c2f65e3dd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/memory/zep_memory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.memory.zep_memory import ZepMemory
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ZepMemory": "langchain_community.memory.zep_memory"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ZepMemory",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..900c7f07cd728e4ba92821ae9ca82033397991ae
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/__init__.py
@@ -0,0 +1,82 @@
+"""**OutputParser** classes parse the output of an LLM call."""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.output_parsers import (
+ CommaSeparatedListOutputParser,
+ ListOutputParser,
+ MarkdownListOutputParser,
+ NumberedListOutputParser,
+ PydanticOutputParser,
+ XMLOutputParser,
+)
+from langchain_core.output_parsers.openai_tools import (
+ JsonOutputKeyToolsParser,
+ JsonOutputToolsParser,
+ PydanticToolsParser,
+)
+
+from langchain_classic._api import create_importer
+from langchain_classic.output_parsers.boolean import BooleanOutputParser
+from langchain_classic.output_parsers.combining import CombiningOutputParser
+from langchain_classic.output_parsers.datetime import DatetimeOutputParser
+from langchain_classic.output_parsers.enum import EnumOutputParser
+from langchain_classic.output_parsers.fix import OutputFixingParser
+from langchain_classic.output_parsers.pandas_dataframe import (
+ PandasDataFrameOutputParser,
+)
+from langchain_classic.output_parsers.regex import RegexParser
+from langchain_classic.output_parsers.regex_dict import RegexDictParser
+from langchain_classic.output_parsers.retry import (
+ RetryOutputParser,
+ RetryWithErrorOutputParser,
+)
+from langchain_classic.output_parsers.structured import (
+ ResponseSchema,
+ StructuredOutputParser,
+)
+from langchain_classic.output_parsers.yaml import YamlOutputParser
+
+if TYPE_CHECKING:
+ from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GuardrailsOutputParser": "langchain_community.output_parsers.rail_parser",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BooleanOutputParser",
+ "CombiningOutputParser",
+ "CommaSeparatedListOutputParser",
+ "DatetimeOutputParser",
+ "EnumOutputParser",
+ "GuardrailsOutputParser",
+ "JsonOutputKeyToolsParser",
+ "JsonOutputToolsParser",
+ "ListOutputParser",
+ "MarkdownListOutputParser",
+ "NumberedListOutputParser",
+ "OutputFixingParser",
+ "PandasDataFrameOutputParser",
+ "PydanticOutputParser",
+ "PydanticToolsParser",
+ "RegexDictParser",
+ "RegexParser",
+ "ResponseSchema",
+ "RetryOutputParser",
+ "RetryWithErrorOutputParser",
+ "StructuredOutputParser",
+ "XMLOutputParser",
+ "YamlOutputParser",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/boolean.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/boolean.py
new file mode 100644
index 0000000000000000000000000000000000000000..1210f58ee126da52290962cd5854a7fbb0e6c5dc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/boolean.py
@@ -0,0 +1,54 @@
+import re
+
+from langchain_core.output_parsers import BaseOutputParser
+
+
+class BooleanOutputParser(BaseOutputParser[bool]):
+ """Parse the output of an LLM call to a boolean."""
+
+ true_val: str = "YES"
+ """The string value that should be parsed as True."""
+ false_val: str = "NO"
+ """The string value that should be parsed as False."""
+
+ def parse(self, text: str) -> bool:
+ """Parse the output of an LLM call to a boolean.
+
+ Args:
+ text: output of a language model
+
+ Returns:
+ boolean
+ """
+ regexp = rf"\b({self.true_val}|{self.false_val})\b"
+
+ truthy = {
+ val.upper()
+ for val in re.findall(regexp, text, flags=re.IGNORECASE | re.MULTILINE)
+ }
+ if self.true_val.upper() in truthy:
+ if self.false_val.upper() in truthy:
+ msg = (
+ f"Ambiguous response. Both {self.true_val} and {self.false_val} "
+ f"in received: {text}."
+ )
+ raise ValueError(msg)
+ return True
+ if self.false_val.upper() in truthy:
+ if self.true_val.upper() in truthy:
+ msg = (
+ f"Ambiguous response. Both {self.true_val} and {self.false_val} "
+ f"in received: {text}."
+ )
+ raise ValueError(msg)
+ return False
+ msg = (
+ f"BooleanOutputParser expected output value to include either "
+ f"{self.true_val} or {self.false_val}. Received {text}."
+ )
+ raise ValueError(msg)
+
+ @property
+ def _type(self) -> str:
+ """Snake-case string identifier for an output parser type."""
+ return "boolean_output_parser"
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/combining.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/combining.py
new file mode 100644
index 0000000000000000000000000000000000000000..6e2686493688a0ace51fac6848af58213fc47f3e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/combining.py
@@ -0,0 +1,58 @@
+from __future__ import annotations
+
+from typing import Any
+
+from langchain_core.output_parsers import BaseOutputParser
+from langchain_core.utils import pre_init
+from typing_extensions import override
+
+_MIN_PARSERS = 2
+
+
+class CombiningOutputParser(BaseOutputParser[dict[str, Any]]):
+ """Combine multiple output parsers into one."""
+
+ parsers: list[BaseOutputParser]
+
+ @classmethod
+ @override
+ def is_lc_serializable(cls) -> bool:
+ return True
+
+ @pre_init
+ def validate_parsers(cls, values: dict[str, Any]) -> dict[str, Any]:
+ """Validate the parsers."""
+ parsers = values["parsers"]
+ if len(parsers) < _MIN_PARSERS:
+ msg = "Must have at least two parsers"
+ raise ValueError(msg)
+ for parser in parsers:
+ if parser._type == "combining": # noqa: SLF001
+ msg = "Cannot nest combining parsers"
+ raise ValueError(msg)
+ if parser._type == "list": # noqa: SLF001
+ msg = "Cannot combine list parsers"
+ raise ValueError(msg)
+ return values
+
+ @property
+ def _type(self) -> str:
+ """Return the type key."""
+ return "combining"
+
+ def get_format_instructions(self) -> str:
+ """Instructions on how the LLM output should be formatted."""
+ initial = f"For your first output: {self.parsers[0].get_format_instructions()}"
+ subsequent = "\n".join(
+ f"Complete that output fully. Then produce another output, separated by two newline characters: {p.get_format_instructions()}" # noqa: E501
+ for p in self.parsers[1:]
+ )
+ return f"{initial}\n{subsequent}"
+
+ def parse(self, text: str) -> dict[str, Any]:
+ """Parse the output of an LLM call."""
+ texts = text.split("\n\n")
+ output = {}
+ for txt, parser in zip(texts, self.parsers, strict=False):
+ output.update(parser.parse(txt.strip()))
+ return output
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/datetime.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/datetime.py
new file mode 100644
index 0000000000000000000000000000000000000000..282d0afb25b9d93a4f97f63fb1e0eb5c0d901534
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/datetime.py
@@ -0,0 +1,58 @@
+from datetime import datetime, timedelta, timezone
+
+from langchain_core.exceptions import OutputParserException
+from langchain_core.output_parsers import BaseOutputParser
+from langchain_core.utils import comma_list
+
+
+class DatetimeOutputParser(BaseOutputParser[datetime]):
+ """Parse the output of an LLM call to a datetime."""
+
+ format: str = "%Y-%m-%dT%H:%M:%S.%fZ"
+ """The string value that is used as the datetime format.
+
+ Update this to match the desired datetime format for your application.
+ """
+
+ def get_format_instructions(self) -> str:
+ """Returns the format instructions for the given format."""
+ if self.format == "%Y-%m-%dT%H:%M:%S.%fZ":
+ examples = comma_list(
+ [
+ "2023-07-04T14:30:00.000000Z",
+ "1999-12-31T23:59:59.999999Z",
+ "2025-01-01T00:00:00.000000Z",
+ ],
+ )
+ else:
+ try:
+ now = datetime.now(tz=timezone.utc)
+ examples = comma_list(
+ [
+ now.strftime(self.format),
+ (now.replace(year=now.year - 1)).strftime(self.format),
+ (now - timedelta(days=1)).strftime(self.format),
+ ],
+ )
+ except ValueError:
+ # Fallback if the format is very unusual
+ examples = f"e.g., a valid string in the format {self.format}"
+
+ return (
+ f"Write a datetime string that matches the "
+ f"following pattern: '{self.format}'.\n\n"
+ f"Examples: {examples}\n\n"
+ f"Return ONLY this string, no other words!"
+ )
+
+ def parse(self, response: str) -> datetime:
+ """Parse a string into a datetime object."""
+ try:
+ return datetime.strptime(response.strip(), self.format) # noqa: DTZ007
+ except ValueError as e:
+ msg = f"Could not parse datetime string: {response}"
+ raise OutputParserException(msg) from e
+
+ @property
+ def _type(self) -> str:
+ return "datetime"
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/enum.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/enum.py
new file mode 100644
index 0000000000000000000000000000000000000000..a96185a6b9ad1546ee78bec0eb72237a445f2a8f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/enum.py
@@ -0,0 +1,45 @@
+from enum import Enum
+
+from langchain_core.exceptions import OutputParserException
+from langchain_core.output_parsers import BaseOutputParser
+from langchain_core.utils import pre_init
+from typing_extensions import override
+
+
+class EnumOutputParser(BaseOutputParser[Enum]):
+ """Parse an output that is one of a set of values."""
+
+ enum: type[Enum]
+ """The enum to parse. Its values must be strings."""
+
+ @pre_init
+ def _raise_deprecation(cls, values: dict) -> dict:
+ enum = values["enum"]
+ if not all(isinstance(e.value, str) for e in enum):
+ msg = "Enum values must be strings"
+ raise ValueError(msg)
+ return values
+
+ @property
+ def _valid_values(self) -> list[str]:
+ return [e.value for e in self.enum]
+
+ @override
+ def parse(self, response: str) -> Enum:
+ try:
+ return self.enum(response.strip())
+ except ValueError as e:
+ msg = (
+ f"Response '{response}' is not one of the "
+ f"expected values: {self._valid_values}"
+ )
+ raise OutputParserException(msg) from e
+
+ @override
+ def get_format_instructions(self) -> str:
+ return f"Select one of the following options: {', '.join(self._valid_values)}"
+
+ @property
+ @override
+ def OutputType(self) -> type[Enum]:
+ return self.enum
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/ernie_functions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/ernie_functions.py
new file mode 100644
index 0000000000000000000000000000000000000000..70742f7617b57380f0ed7516808207f445eb648e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/ernie_functions.py
@@ -0,0 +1,45 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.output_parsers.ernie_functions import (
+ JsonKeyOutputFunctionsParser,
+ JsonOutputFunctionsParser,
+ OutputFunctionsParser,
+ PydanticAttrOutputFunctionsParser,
+ PydanticOutputFunctionsParser,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "JsonKeyOutputFunctionsParser": (
+ "langchain_community.output_parsers.ernie_functions"
+ ),
+ "JsonOutputFunctionsParser": "langchain_community.output_parsers.ernie_functions",
+ "OutputFunctionsParser": "langchain_community.output_parsers.ernie_functions",
+ "PydanticAttrOutputFunctionsParser": (
+ "langchain_community.output_parsers.ernie_functions"
+ ),
+ "PydanticOutputFunctionsParser": (
+ "langchain_community.output_parsers.ernie_functions"
+ ),
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JsonKeyOutputFunctionsParser",
+ "JsonOutputFunctionsParser",
+ "OutputFunctionsParser",
+ "PydanticAttrOutputFunctionsParser",
+ "PydanticOutputFunctionsParser",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/fix.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/fix.py
new file mode 100644
index 0000000000000000000000000000000000000000..32a1222252842958c99f38060c27c6d31f878dac
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/fix.py
@@ -0,0 +1,156 @@
+from __future__ import annotations
+
+from typing import Annotated, Any, TypeVar
+
+from langchain_core.exceptions import OutputParserException
+from langchain_core.output_parsers import BaseOutputParser, StrOutputParser
+from langchain_core.prompts import BasePromptTemplate
+from langchain_core.runnables import Runnable, RunnableSerializable
+from pydantic import SkipValidation
+from typing_extensions import TypedDict, override
+
+from langchain_classic.output_parsers.prompts import NAIVE_FIX_PROMPT
+
+T = TypeVar("T")
+
+
+class OutputFixingParserRetryChainInput(TypedDict, total=False):
+ """Input for the retry chain of the OutputFixingParser."""
+
+ instructions: str
+ completion: str
+ error: str
+
+
+class OutputFixingParser(BaseOutputParser[T]):
+ """Wrap a parser and try to fix parsing errors."""
+
+ @classmethod
+ @override
+ def is_lc_serializable(cls) -> bool:
+ return True
+
+ parser: Annotated[Any, SkipValidation()]
+ """The parser to use to parse the output."""
+ # Should be an LLMChain but we want to avoid top-level imports from
+ # langchain_classic.chains
+ retry_chain: Annotated[
+ RunnableSerializable[OutputFixingParserRetryChainInput, str] | Any,
+ SkipValidation(),
+ ]
+ """The RunnableSerializable to use to retry the completion (Legacy: LLMChain)."""
+ max_retries: int = 1
+ """The maximum number of times to retry the parse."""
+ legacy: bool = True
+ """Whether to use the run or arun method of the retry_chain."""
+
+ @classmethod
+ def from_llm(
+ cls,
+ llm: Runnable,
+ parser: BaseOutputParser[T],
+ prompt: BasePromptTemplate = NAIVE_FIX_PROMPT,
+ max_retries: int = 1,
+ ) -> OutputFixingParser[T]:
+ """Create an OutputFixingParser from a language model and a parser.
+
+ Args:
+ llm: llm to use for fixing
+ parser: parser to use for parsing
+ prompt: prompt to use for fixing
+ max_retries: Maximum number of retries to parse.
+
+ Returns:
+ OutputFixingParser
+ """
+ chain = prompt | llm | StrOutputParser()
+ return cls(parser=parser, retry_chain=chain, max_retries=max_retries)
+
+ @override
+ def parse(self, completion: str) -> T:
+ retries = 0
+
+ while retries <= self.max_retries:
+ try:
+ return self.parser.parse(completion)
+ except OutputParserException as e:
+ if retries == self.max_retries:
+ raise
+ retries += 1
+ if self.legacy and hasattr(self.retry_chain, "run"):
+ completion = self.retry_chain.run(
+ instructions=self.parser.get_format_instructions(),
+ completion=completion,
+ error=repr(e),
+ )
+ else:
+ try:
+ completion = self.retry_chain.invoke(
+ {
+ "instructions": self.parser.get_format_instructions(),
+ "completion": completion,
+ "error": repr(e),
+ },
+ )
+ except (NotImplementedError, AttributeError):
+ # Case: self.parser does not have get_format_instructions
+ completion = self.retry_chain.invoke(
+ {
+ "completion": completion,
+ "error": repr(e),
+ },
+ )
+
+ msg = "Failed to parse"
+ raise OutputParserException(msg)
+
+ @override
+ async def aparse(self, completion: str) -> T:
+ retries = 0
+
+ while retries <= self.max_retries:
+ try:
+ return await self.parser.aparse(completion)
+ except OutputParserException as e:
+ if retries == self.max_retries:
+ raise
+ retries += 1
+ if self.legacy and hasattr(self.retry_chain, "arun"):
+ completion = await self.retry_chain.arun(
+ instructions=self.parser.get_format_instructions(),
+ completion=completion,
+ error=repr(e),
+ )
+ else:
+ try:
+ completion = await self.retry_chain.ainvoke(
+ {
+ "instructions": self.parser.get_format_instructions(),
+ "completion": completion,
+ "error": repr(e),
+ },
+ )
+ except (NotImplementedError, AttributeError):
+ # Case: self.parser does not have get_format_instructions
+ completion = await self.retry_chain.ainvoke(
+ {
+ "completion": completion,
+ "error": repr(e),
+ },
+ )
+
+ msg = "Failed to parse"
+ raise OutputParserException(msg)
+
+ @override
+ def get_format_instructions(self) -> str:
+ return self.parser.get_format_instructions()
+
+ @property
+ def _type(self) -> str:
+ return "output_fixing"
+
+ @property
+ @override
+ def OutputType(self) -> type[T]:
+ return self.parser.OutputType
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/format_instructions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/format_instructions.py
new file mode 100644
index 0000000000000000000000000000000000000000..229f0a6419870b76a6d56be8f0170102ae4e6f3a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/format_instructions.py
@@ -0,0 +1,79 @@
+STRUCTURED_FORMAT_INSTRUCTIONS = """The output should be a markdown code snippet formatted in the following schema, including the leading and trailing "```json" and "```":
+
+```json
+{{
+{format}
+}}
+```""" # noqa: E501
+
+STRUCTURED_FORMAT_SIMPLE_INSTRUCTIONS = """
+```json
+{{
+{format}
+}}
+```"""
+
+
+PYDANTIC_FORMAT_INSTRUCTIONS = """The output should be formatted as a JSON instance that conforms to the JSON schema below.
+
+As an example, for the schema {{"properties": {{"foo": {{"title": "Foo", "description": "a list of strings", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}}
+the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of the schema. The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted.
+
+Here is the output schema:
+```
+{schema}
+```""" # noqa: E501
+
+YAML_FORMAT_INSTRUCTIONS = """The output should be formatted as a YAML instance that conforms to the given JSON schema below.
+
+# Examples
+## Schema
+```
+{{"title": "Players", "description": "A list of players", "type": "array", "items": {{"$ref": "#/definitions/Player"}}, "definitions": {{"Player": {{"title": "Player", "type": "object", "properties": {{"name": {{"title": "Name", "description": "Player name", "type": "string"}}, "avg": {{"title": "Avg", "description": "Batting average", "type": "number"}}}}, "required": ["name", "avg"]}}}}}}
+```
+## Well formatted instance
+```
+- name: John Doe
+ avg: 0.3
+- name: Jane Maxfield
+ avg: 1.4
+```
+
+## Schema
+```
+{{"properties": {{"habit": {{ "description": "A common daily habit", "type": "string" }}, "sustainable_alternative": {{ "description": "An environmentally friendly alternative to the habit", "type": "string"}}}}, "required": ["habit", "sustainable_alternative"]}}
+```
+## Well formatted instance
+```
+habit: Using disposable water bottles for daily hydration.
+sustainable_alternative: Switch to a reusable water bottle to reduce plastic waste and decrease your environmental footprint.
+```
+
+Please follow the standard YAML formatting conventions with an indent of 2 spaces and make sure that the data types adhere strictly to the following JSON schema:
+```
+{schema}
+```
+
+Make sure to always enclose the YAML output in triple backticks (```). Please do not add anything other than valid YAML output!""" # noqa: E501
+
+
+PANDAS_DATAFRAME_FORMAT_INSTRUCTIONS = """The output should be formatted as a string as the operation, followed by a colon, followed by the column or row to be queried on, followed by optional array parameters.
+1. The column names are limited to the possible columns below.
+2. Arrays must either be a comma-separated list of numbers formatted as [1,3,5], or it must be in range of numbers formatted as [0..4].
+3. Remember that arrays are optional and not necessarily required.
+4. If the column is not in the possible columns or the operation is not a valid Pandas DataFrame operation, return why it is invalid as a sentence starting with either "Invalid column" or "Invalid operation".
+
+As an example, for the formats:
+1. String "column:num_legs" is a well-formatted instance which gets the column num_legs, where num_legs is a possible column.
+2. String "row:1" is a well-formatted instance which gets row 1.
+3. String "column:num_legs[1,2]" is a well-formatted instance which gets the column num_legs for rows 1 and 2, where num_legs is a possible column.
+4. String "row:1[num_legs]" is a well-formatted instance which gets row 1, but for just column num_legs, where num_legs is a possible column.
+5. String "mean:num_legs[1..3]" is a well-formatted instance which takes the mean of num_legs from rows 1 to 3, where num_legs is a possible column and mean is a valid Pandas DataFrame operation.
+6. String "do_something:num_legs" is a badly-formatted instance, where do_something is not a valid Pandas DataFrame operation.
+7. String "mean:invalid_col" is a badly-formatted instance, where invalid_col is not a possible column.
+
+Here are the possible columns:
+```
+{columns}
+```
+""" # noqa: E501
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/json.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/json.py
new file mode 100644
index 0000000000000000000000000000000000000000..a7b52d89e439bd1b9c6565f8849fb10a06cc01ce
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/json.py
@@ -0,0 +1,15 @@
+from langchain_core.output_parsers.json import (
+ SimpleJsonOutputParser,
+)
+from langchain_core.utils.json import (
+ parse_and_check_json_markdown,
+ parse_json_markdown,
+ parse_partial_json,
+)
+
+__all__ = [
+ "SimpleJsonOutputParser",
+ "parse_and_check_json_markdown",
+ "parse_json_markdown",
+ "parse_partial_json",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/list.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/list.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8001bce75ad6a4c3cd5406c5bdf581e68bb220d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/list.py
@@ -0,0 +1,13 @@
+from langchain_core.output_parsers.list import (
+ CommaSeparatedListOutputParser,
+ ListOutputParser,
+ MarkdownListOutputParser,
+ NumberedListOutputParser,
+)
+
+__all__ = [
+ "CommaSeparatedListOutputParser",
+ "ListOutputParser",
+ "MarkdownListOutputParser",
+ "NumberedListOutputParser",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/loading.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/loading.py
new file mode 100644
index 0000000000000000000000000000000000000000..c79470be4a52bdd606f7e6d33ba158d7a5d8ad41
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/loading.py
@@ -0,0 +1,22 @@
+from langchain_classic.output_parsers.regex import RegexParser
+
+
+def load_output_parser(config: dict) -> dict:
+ """Load an output parser.
+
+ Args:
+ config: config dict
+
+ Returns:
+ config dict with output parser loaded
+ """
+ if "output_parsers" in config and config["output_parsers"] is not None:
+ _config = config["output_parsers"]
+ output_parser_type = _config["_type"]
+ if output_parser_type == "regex_parser":
+ output_parser = RegexParser(**_config)
+ else:
+ msg = f"Unsupported output parser {output_parser_type}"
+ raise ValueError(msg)
+ config["output_parsers"] = output_parser
+ return config
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/openai_functions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/openai_functions.py
new file mode 100644
index 0000000000000000000000000000000000000000..607e3472644eeef2fed807e89be08eee18318258
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/openai_functions.py
@@ -0,0 +1,13 @@
+from langchain_core.output_parsers.openai_functions import (
+ JsonKeyOutputFunctionsParser,
+ JsonOutputFunctionsParser,
+ PydanticAttrOutputFunctionsParser,
+ PydanticOutputFunctionsParser,
+)
+
+__all__ = [
+ "JsonKeyOutputFunctionsParser",
+ "JsonOutputFunctionsParser",
+ "PydanticAttrOutputFunctionsParser",
+ "PydanticOutputFunctionsParser",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/openai_tools.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/openai_tools.py
new file mode 100644
index 0000000000000000000000000000000000000000..bf7b62e88f6cdf5d114c48a538173e1ca6b60e79
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/openai_tools.py
@@ -0,0 +1,7 @@
+from langchain_core.output_parsers.openai_tools import (
+ JsonOutputKeyToolsParser,
+ JsonOutputToolsParser,
+ PydanticToolsParser,
+)
+
+__all__ = ["JsonOutputKeyToolsParser", "JsonOutputToolsParser", "PydanticToolsParser"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/pandas_dataframe.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/pandas_dataframe.py
new file mode 100644
index 0000000000000000000000000000000000000000..98a8320e0bde449bdb2894a724d845d1d1c43ec5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/pandas_dataframe.py
@@ -0,0 +1,171 @@
+import re
+from typing import Any
+
+from langchain_core.exceptions import OutputParserException
+from langchain_core.output_parsers.base import BaseOutputParser
+from pydantic import field_validator
+from typing_extensions import override
+
+from langchain_classic.output_parsers.format_instructions import (
+ PANDAS_DATAFRAME_FORMAT_INSTRUCTIONS,
+)
+
+
+class PandasDataFrameOutputParser(BaseOutputParser[dict[str, Any]]):
+ """Parse an output using Pandas DataFrame format."""
+
+ """The Pandas DataFrame to parse."""
+ dataframe: Any
+
+ @field_validator("dataframe")
+ @classmethod
+ def _validate_dataframe(cls, val: Any) -> Any:
+ import pandas as pd
+
+ if issubclass(type(val), pd.DataFrame):
+ return val
+ if pd.DataFrame(val).empty:
+ msg = "DataFrame cannot be empty."
+ raise ValueError(msg)
+
+ msg = "Wrong type for 'dataframe', must be a subclass \
+ of Pandas DataFrame (pd.DataFrame)"
+ raise TypeError(msg)
+
+ def parse_array(
+ self,
+ array: str,
+ original_request_params: str,
+ ) -> tuple[list[int | str], str]:
+ """Parse the array from the request parameters.
+
+ Args:
+ array: The array string to parse.
+ original_request_params: The original request parameters string.
+
+ Returns:
+ A tuple containing the parsed array and the stripped request parameters.
+
+ Raises:
+ OutputParserException: If the array format is invalid or cannot be parsed.
+ """
+ parsed_array: list[int | str] = []
+
+ # Check if the format is [1,3,5]
+ if re.match(r"\[\d+(,\s*\d+)*\]", array):
+ parsed_array = [int(i) for i in re.findall(r"\d+", array)]
+ # Check if the format is [1..5]
+ elif re.match(r"\[(\d+)\.\.(\d+)\]", array):
+ match = re.match(r"\[(\d+)\.\.(\d+)\]", array)
+ if match:
+ start, end = map(int, match.groups())
+ parsed_array = list(range(start, end + 1))
+ else:
+ msg = f"Unable to parse the array provided in {array}. \
+ Please check the format instructions."
+ raise OutputParserException(msg)
+ # Check if the format is ["column_name"]
+ elif re.match(r"\[[a-zA-Z0-9_]+(?:,[a-zA-Z0-9_]+)*\]", array):
+ match = re.match(r"\[[a-zA-Z0-9_]+(?:,[a-zA-Z0-9_]+)*\]", array)
+ if match:
+ parsed_array = list(map(str, match.group().strip("[]").split(",")))
+ else:
+ msg = f"Unable to parse the array provided in {array}. \
+ Please check the format instructions."
+ raise OutputParserException(msg)
+
+ # Validate the array
+ if not parsed_array:
+ msg = f"Invalid array format in '{original_request_params}'. \
+ Please check the format instructions."
+ raise OutputParserException(msg)
+ if (
+ isinstance(parsed_array[0], int)
+ and parsed_array[-1] > self.dataframe.index.max()
+ ):
+ msg = f"The maximum index {parsed_array[-1]} exceeds the maximum index of \
+ the Pandas DataFrame {self.dataframe.index.max()}."
+ raise OutputParserException(msg)
+
+ return parsed_array, original_request_params.split("[", maxsplit=1)[0]
+
+ @override
+ def parse(self, request: str) -> dict[str, Any]:
+ stripped_request_params = None
+ splitted_request = request.strip().split(":")
+ if len(splitted_request) != 2: # noqa: PLR2004
+ msg = f"Request '{request}' is not correctly formatted. \
+ Please refer to the format instructions."
+ raise OutputParserException(msg)
+ result = {}
+ try:
+ request_type, request_params = splitted_request
+ if request_type in {"Invalid column", "Invalid operation"}:
+ msg = f"{request}. Please check the format instructions."
+ raise OutputParserException(msg)
+ array_exists = re.search(r"(\[.*?\])", request_params)
+ if array_exists:
+ parsed_array, stripped_request_params = self.parse_array(
+ array_exists.group(1),
+ request_params,
+ )
+ if request_type == "column":
+ filtered_df = self.dataframe[
+ self.dataframe.index.isin(parsed_array)
+ ]
+ if len(parsed_array) == 1:
+ result[stripped_request_params] = filtered_df[
+ stripped_request_params
+ ].iloc[parsed_array[0]]
+ else:
+ result[stripped_request_params] = filtered_df[
+ stripped_request_params
+ ]
+ elif request_type == "row":
+ filtered_df = self.dataframe[
+ self.dataframe.columns.intersection(parsed_array)
+ ]
+ if len(parsed_array) == 1:
+ result[stripped_request_params] = filtered_df.iloc[
+ int(stripped_request_params)
+ ][parsed_array[0]]
+ else:
+ result[stripped_request_params] = filtered_df.iloc[
+ int(stripped_request_params)
+ ]
+ else:
+ filtered_df = self.dataframe[
+ self.dataframe.index.isin(parsed_array)
+ ]
+ result[request_type] = getattr(
+ filtered_df[stripped_request_params],
+ request_type,
+ )()
+ elif request_type == "column":
+ result[request_params] = self.dataframe[request_params]
+ elif request_type == "row":
+ result[request_params] = self.dataframe.iloc[int(request_params)]
+ else:
+ result[request_type] = getattr(
+ self.dataframe[request_params],
+ request_type,
+ )()
+ except (AttributeError, IndexError, KeyError) as e:
+ if request_type not in {"column", "row"}:
+ msg = f"Unsupported request type '{request_type}'. \
+ Please check the format instructions."
+ raise OutputParserException(msg) from e
+ msg = f"""Requested index {
+ request_params
+ if stripped_request_params is None
+ else stripped_request_params
+ } is out of bounds."""
+ raise OutputParserException(msg) from e
+
+ return result
+
+ @override
+ def get_format_instructions(self) -> str:
+ return PANDAS_DATAFRAME_FORMAT_INSTRUCTIONS.format(
+ columns=", ".join(self.dataframe.columns),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/prompts.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/prompts.py
new file mode 100644
index 0000000000000000000000000000000000000000..e2e34adce63711a77e8c9df86e0ee1caa9957031
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/prompts.py
@@ -0,0 +1,21 @@
+from langchain_core.prompts.prompt import PromptTemplate
+
+NAIVE_FIX = """Instructions:
+--------------
+{instructions}
+--------------
+Completion:
+--------------
+{completion}
+--------------
+
+Above, the Completion did not satisfy the constraints given in the Instructions.
+Error:
+--------------
+{error}
+--------------
+
+Please try again. Please only respond with an answer that satisfies the constraints laid out in the Instructions:""" # noqa: E501
+
+
+NAIVE_FIX_PROMPT = PromptTemplate.from_template(NAIVE_FIX)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/pydantic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/pydantic.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d8dc727a444ef011f047ffca9d7aad646e89958
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/pydantic.py
@@ -0,0 +1,3 @@
+from langchain_core.output_parsers import PydanticOutputParser
+
+__all__ = ["PydanticOutputParser"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/rail_parser.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/rail_parser.py
new file mode 100644
index 0000000000000000000000000000000000000000..d67b30af4f43c34e9596490c2b9d59979fc2b6a0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/rail_parser.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.output_parsers.rail_parser import GuardrailsOutputParser
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GuardrailsOutputParser": "langchain_community.output_parsers.rail_parser",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GuardrailsOutputParser",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/regex.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/regex.py
new file mode 100644
index 0000000000000000000000000000000000000000..94d700a1f604bdfe6e0661fc422874336b11fd25
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/regex.py
@@ -0,0 +1,40 @@
+from __future__ import annotations
+
+import re
+
+from langchain_core.output_parsers import BaseOutputParser
+from typing_extensions import override
+
+
+class RegexParser(BaseOutputParser[dict[str, str]]):
+ """Parse the output of an LLM call using a regex."""
+
+ @classmethod
+ @override
+ def is_lc_serializable(cls) -> bool:
+ return True
+
+ regex: str
+ """The regex to use to parse the output."""
+ output_keys: list[str]
+ """The keys to use for the output."""
+ default_output_key: str | None = None
+ """The default key to use for the output."""
+
+ @property
+ def _type(self) -> str:
+ """Return the type key."""
+ return "regex_parser"
+
+ def parse(self, text: str) -> dict[str, str]:
+ """Parse the output of an LLM call."""
+ match = re.search(self.regex, text)
+ if match:
+ return {key: match.group(i + 1) for i, key in enumerate(self.output_keys)}
+ if self.default_output_key is None:
+ msg = f"Could not parse output: {text}"
+ raise ValueError(msg)
+ return {
+ key: text if key == self.default_output_key else ""
+ for key in self.output_keys
+ }
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/regex_dict.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/regex_dict.py
new file mode 100644
index 0000000000000000000000000000000000000000..f0052958c3302498b69d22ed5fc62ed756b238b1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/regex_dict.py
@@ -0,0 +1,42 @@
+from __future__ import annotations
+
+import re
+
+from langchain_core.output_parsers import BaseOutputParser
+
+
+class RegexDictParser(BaseOutputParser[dict[str, str]]):
+ """Parse the output of an LLM call into a Dictionary using a regex."""
+
+ regex_pattern: str = r"{}:\s?([^.'\n']*)\.?"
+ """The regex pattern to use to parse the output."""
+ output_key_to_format: dict[str, str]
+ """The keys to use for the output."""
+ no_update_value: str | None = None
+ """The default key to use for the output."""
+
+ @property
+ def _type(self) -> str:
+ """Return the type key."""
+ return "regex_dict_parser"
+
+ def parse(self, text: str) -> dict[str, str]:
+ """Parse the output of an LLM call."""
+ result = {}
+ for output_key, expected_format in self.output_key_to_format.items():
+ specific_regex = self.regex_pattern.format(re.escape(expected_format))
+ matches = re.findall(specific_regex, text)
+ if not matches:
+ msg = (
+ f"No match found for output key: {output_key} with expected format \
+ {expected_format} on text {text}"
+ )
+ raise ValueError(msg)
+ if len(matches) > 1:
+ msg = f"Multiple matches found for output key: {output_key} with \
+ expected format {expected_format} on text {text}"
+ raise ValueError(msg)
+ if self.no_update_value is not None and matches[0] == self.no_update_value:
+ continue
+ result[output_key] = matches[0]
+ return result
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/retry.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/retry.py
new file mode 100644
index 0000000000000000000000000000000000000000..88c5d737431b9b2da8de0fa35b9e91659bbe683e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/retry.py
@@ -0,0 +1,315 @@
+from __future__ import annotations
+
+from typing import Annotated, Any, TypeVar
+
+from langchain_core.exceptions import OutputParserException
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.output_parsers import BaseOutputParser, StrOutputParser
+from langchain_core.prompt_values import PromptValue
+from langchain_core.prompts import BasePromptTemplate, PromptTemplate
+from langchain_core.runnables import RunnableSerializable
+from pydantic import SkipValidation
+from typing_extensions import TypedDict, override
+
+NAIVE_COMPLETION_RETRY = """Prompt:
+{prompt}
+Completion:
+{completion}
+
+Above, the Completion did not satisfy the constraints given in the Prompt.
+Please try again:"""
+
+NAIVE_COMPLETION_RETRY_WITH_ERROR = """Prompt:
+{prompt}
+Completion:
+{completion}
+
+Above, the Completion did not satisfy the constraints given in the Prompt.
+Details: {error}
+Please try again:"""
+
+NAIVE_RETRY_PROMPT = PromptTemplate.from_template(NAIVE_COMPLETION_RETRY)
+NAIVE_RETRY_WITH_ERROR_PROMPT = PromptTemplate.from_template(
+ NAIVE_COMPLETION_RETRY_WITH_ERROR,
+)
+
+T = TypeVar("T")
+
+
+class RetryOutputParserRetryChainInput(TypedDict):
+ """Retry chain input for RetryOutputParser."""
+
+ prompt: str
+ completion: str
+
+
+class RetryWithErrorOutputParserRetryChainInput(TypedDict):
+ """Retry chain input for RetryWithErrorOutputParser."""
+
+ prompt: str
+ completion: str
+ error: str
+
+
+class RetryOutputParser(BaseOutputParser[T]):
+ """Wrap a parser and try to fix parsing errors.
+
+ Does this by passing the original prompt and the completion to another
+ LLM, and telling it the completion did not satisfy criteria in the prompt.
+ """
+
+ parser: Annotated[BaseOutputParser[T], SkipValidation()]
+ """The parser to use to parse the output."""
+ # Should be an LLMChain but we want to avoid top-level imports from
+ # langchain_classic.chains
+ retry_chain: Annotated[
+ RunnableSerializable[RetryOutputParserRetryChainInput, str] | Any,
+ SkipValidation(),
+ ]
+ """The RunnableSerializable to use to retry the completion (Legacy: LLMChain)."""
+ max_retries: int = 1
+ """The maximum number of times to retry the parse."""
+ legacy: bool = True
+ """Whether to use the run or arun method of the retry_chain."""
+
+ @classmethod
+ def from_llm(
+ cls,
+ llm: BaseLanguageModel,
+ parser: BaseOutputParser[T],
+ prompt: BasePromptTemplate = NAIVE_RETRY_PROMPT,
+ max_retries: int = 1,
+ ) -> RetryOutputParser[T]:
+ """Create an RetryOutputParser from a language model and a parser.
+
+ Args:
+ llm: llm to use for fixing
+ parser: parser to use for parsing
+ prompt: prompt to use for fixing
+ max_retries: Maximum number of retries to parse.
+
+ Returns:
+ RetryOutputParser
+ """
+ chain = prompt | llm | StrOutputParser()
+ return cls(parser=parser, retry_chain=chain, max_retries=max_retries)
+
+ def parse_with_prompt(self, completion: str, prompt_value: PromptValue) -> T:
+ """Parse the output of an LLM call using a wrapped parser.
+
+ Args:
+ completion: The chain completion to parse.
+ prompt_value: The prompt to use to parse the completion.
+
+ Returns:
+ The parsed completion.
+ """
+ retries = 0
+
+ while retries <= self.max_retries:
+ try:
+ return self.parser.parse(completion)
+ except OutputParserException:
+ if retries == self.max_retries:
+ raise
+ retries += 1
+ if self.legacy and hasattr(self.retry_chain, "run"):
+ completion = self.retry_chain.run(
+ prompt=prompt_value.to_string(),
+ completion=completion,
+ )
+ else:
+ completion = self.retry_chain.invoke(
+ {
+ "prompt": prompt_value.to_string(),
+ "completion": completion,
+ },
+ )
+
+ msg = "Failed to parse"
+ raise OutputParserException(msg)
+
+ async def aparse_with_prompt(self, completion: str, prompt_value: PromptValue) -> T:
+ """Parse the output of an LLM call using a wrapped parser.
+
+ Args:
+ completion: The chain completion to parse.
+ prompt_value: The prompt to use to parse the completion.
+
+ Returns:
+ The parsed completion.
+ """
+ retries = 0
+
+ while retries <= self.max_retries:
+ try:
+ return await self.parser.aparse(completion)
+ except OutputParserException as e:
+ if retries == self.max_retries:
+ raise
+ retries += 1
+ if self.legacy and hasattr(self.retry_chain, "arun"):
+ completion = await self.retry_chain.arun(
+ prompt=prompt_value.to_string(),
+ completion=completion,
+ error=repr(e),
+ )
+ else:
+ completion = await self.retry_chain.ainvoke(
+ {
+ "prompt": prompt_value.to_string(),
+ "completion": completion,
+ },
+ )
+
+ msg = "Failed to parse"
+ raise OutputParserException(msg)
+
+ @override
+ def parse(self, completion: str) -> T:
+ msg = "This OutputParser can only be called by the `parse_with_prompt` method."
+ raise NotImplementedError(msg)
+
+ @override
+ def get_format_instructions(self) -> str:
+ return self.parser.get_format_instructions()
+
+ @property
+ def _type(self) -> str:
+ return "retry"
+
+ @property
+ @override
+ def OutputType(self) -> type[T]:
+ return self.parser.OutputType
+
+
+class RetryWithErrorOutputParser(BaseOutputParser[T]):
+ """Wrap a parser and try to fix parsing errors.
+
+ Does this by passing the original prompt, the completion, AND the error
+ that was raised to another language model and telling it that the completion
+ did not work, and raised the given error. Differs from RetryOutputParser
+ in that this implementation provides the error that was raised back to the
+ LLM, which in theory should give it more information on how to fix it.
+ """
+
+ parser: Annotated[BaseOutputParser[T], SkipValidation()]
+ """The parser to use to parse the output."""
+ # Should be an LLMChain but we want to avoid top-level imports from
+ # langchain_classic.chains
+ retry_chain: Annotated[
+ RunnableSerializable[RetryWithErrorOutputParserRetryChainInput, str] | Any,
+ SkipValidation(),
+ ]
+ """The RunnableSerializable to use to retry the completion (Legacy: LLMChain)."""
+ max_retries: int = 1
+ """The maximum number of times to retry the parse."""
+ legacy: bool = True
+ """Whether to use the run or arun method of the retry_chain."""
+
+ @classmethod
+ def from_llm(
+ cls,
+ llm: BaseLanguageModel,
+ parser: BaseOutputParser[T],
+ prompt: BasePromptTemplate = NAIVE_RETRY_WITH_ERROR_PROMPT,
+ max_retries: int = 1,
+ ) -> RetryWithErrorOutputParser[T]:
+ """Create a RetryWithErrorOutputParser from an LLM.
+
+ Args:
+ llm: The LLM to use to retry the completion.
+ parser: The parser to use to parse the output.
+ prompt: The prompt to use to retry the completion.
+ max_retries: The maximum number of times to retry the completion.
+
+ Returns:
+ A RetryWithErrorOutputParser.
+ """
+ chain = prompt | llm | StrOutputParser()
+ return cls(parser=parser, retry_chain=chain, max_retries=max_retries)
+
+ @override
+ def parse_with_prompt(self, completion: str, prompt_value: PromptValue) -> T:
+ retries = 0
+
+ while retries <= self.max_retries:
+ try:
+ return self.parser.parse(completion)
+ except OutputParserException as e:
+ if retries == self.max_retries:
+ raise
+ retries += 1
+ if self.legacy and hasattr(self.retry_chain, "run"):
+ completion = self.retry_chain.run(
+ prompt=prompt_value.to_string(),
+ completion=completion,
+ error=repr(e),
+ )
+ else:
+ completion = self.retry_chain.invoke(
+ {
+ "completion": completion,
+ "prompt": prompt_value.to_string(),
+ "error": repr(e),
+ },
+ )
+
+ msg = "Failed to parse"
+ raise OutputParserException(msg)
+
+ async def aparse_with_prompt(self, completion: str, prompt_value: PromptValue) -> T:
+ """Parse the output of an LLM call using a wrapped parser.
+
+ Args:
+ completion: The chain completion to parse.
+ prompt_value: The prompt to use to parse the completion.
+
+ Returns:
+ The parsed completion.
+ """
+ retries = 0
+
+ while retries <= self.max_retries:
+ try:
+ return await self.parser.aparse(completion)
+ except OutputParserException as e:
+ if retries == self.max_retries:
+ raise
+ retries += 1
+ if self.legacy and hasattr(self.retry_chain, "arun"):
+ completion = await self.retry_chain.arun(
+ prompt=prompt_value.to_string(),
+ completion=completion,
+ error=repr(e),
+ )
+ else:
+ completion = await self.retry_chain.ainvoke(
+ {
+ "prompt": prompt_value.to_string(),
+ "completion": completion,
+ "error": repr(e),
+ },
+ )
+
+ msg = "Failed to parse"
+ raise OutputParserException(msg)
+
+ @override
+ def parse(self, completion: str) -> T:
+ msg = "This OutputParser can only be called by the `parse_with_prompt` method."
+ raise NotImplementedError(msg)
+
+ @override
+ def get_format_instructions(self) -> str:
+ return self.parser.get_format_instructions()
+
+ @property
+ def _type(self) -> str:
+ return "retry_with_error"
+
+ @property
+ @override
+ def OutputType(self) -> type[T]:
+ return self.parser.OutputType
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/structured.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/structured.py
new file mode 100644
index 0000000000000000000000000000000000000000..346b0ff9f19889a3be80212e185117a83d878ecb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/structured.py
@@ -0,0 +1,116 @@
+from __future__ import annotations
+
+from typing import Any
+
+from langchain_core.output_parsers import BaseOutputParser
+from langchain_core.output_parsers.json import parse_and_check_json_markdown
+from pydantic import BaseModel
+from typing_extensions import override
+
+from langchain_classic.output_parsers.format_instructions import (
+ STRUCTURED_FORMAT_INSTRUCTIONS,
+ STRUCTURED_FORMAT_SIMPLE_INSTRUCTIONS,
+)
+
+line_template = '\t"{name}": {type} // {description}'
+
+
+class ResponseSchema(BaseModel):
+ """Schema for a response from a structured output parser."""
+
+ name: str
+ """The name of the schema."""
+ description: str
+ """The description of the schema."""
+ type: str = "string"
+ """The type of the response."""
+
+
+def _get_sub_string(schema: ResponseSchema) -> str:
+ return line_template.format(
+ name=schema.name,
+ description=schema.description,
+ type=schema.type,
+ )
+
+
+class StructuredOutputParser(BaseOutputParser[dict[str, Any]]):
+ """Parse the output of an LLM call to a structured output."""
+
+ response_schemas: list[ResponseSchema]
+ """The schemas for the response."""
+
+ @classmethod
+ def from_response_schemas(
+ cls,
+ response_schemas: list[ResponseSchema],
+ ) -> StructuredOutputParser:
+ """Create a StructuredOutputParser from a list of ResponseSchema.
+
+ Args:
+ response_schemas: The schemas for the response.
+
+ Returns:
+ An instance of StructuredOutputParser.
+ """
+ return cls(response_schemas=response_schemas)
+
+ def get_format_instructions(
+ self,
+ only_json: bool = False, # noqa: FBT001,FBT002
+ ) -> str:
+ """Get format instructions for the output parser.
+
+ Example:
+ ```python
+ from langchain_classic.output_parsers.structured import (
+ StructuredOutputParser, ResponseSchema
+ )
+
+ response_schemas = [
+ ResponseSchema(
+ name="foo",
+ description="a list of strings",
+ type="List[string]"
+ ),
+ ResponseSchema(
+ name="bar",
+ description="a string",
+ type="string"
+ ),
+ ]
+
+ parser = StructuredOutputParser.from_response_schemas(response_schemas)
+
+ print(parser.get_format_instructions()) # noqa: T201
+
+ output:
+ # The output should be a Markdown code snippet formatted in the following
+ # schema, including the leading and trailing "```json" and "```":
+ #
+ # ```json
+ # {
+ # "foo": List[string] // a list of strings
+ # "bar": string // a string
+ # }
+ # ```
+
+ Args:
+ only_json: If `True`, only the json in the Markdown code snippet
+ will be returned, without the introducing text.
+ """
+ schema_str = "\n".join(
+ [_get_sub_string(schema) for schema in self.response_schemas],
+ )
+ if only_json:
+ return STRUCTURED_FORMAT_SIMPLE_INSTRUCTIONS.format(format=schema_str)
+ return STRUCTURED_FORMAT_INSTRUCTIONS.format(format=schema_str)
+
+ @override
+ def parse(self, text: str) -> dict[str, Any]:
+ expected_keys = [rs.name for rs in self.response_schemas]
+ return parse_and_check_json_markdown(text, expected_keys)
+
+ @property
+ def _type(self) -> str:
+ return "structured"
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/xml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/xml.py
new file mode 100644
index 0000000000000000000000000000000000000000..655dc65b9ef07c37d9514b5afb258084c8c243b7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/xml.py
@@ -0,0 +1,3 @@
+from langchain_core.output_parsers.xml import XMLOutputParser
+
+__all__ = ["XMLOutputParser"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/yaml.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/yaml.py
new file mode 100644
index 0000000000000000000000000000000000000000..b286cf5c875fc7ba47f1900bc49a30c9fd884ef4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/output_parsers/yaml.py
@@ -0,0 +1,69 @@
+import json
+import re
+from typing import TypeVar
+
+import yaml
+from langchain_core.exceptions import OutputParserException
+from langchain_core.output_parsers import BaseOutputParser
+from pydantic import BaseModel, ValidationError
+from typing_extensions import override
+
+from langchain_classic.output_parsers.format_instructions import (
+ YAML_FORMAT_INSTRUCTIONS,
+)
+
+T = TypeVar("T", bound=BaseModel)
+
+
+class YamlOutputParser(BaseOutputParser[T]):
+ """Parse YAML output using a Pydantic model."""
+
+ pydantic_object: type[T]
+ """The Pydantic model to parse."""
+ pattern: re.Pattern = re.compile(
+ r"^```(?:ya?ml)?(?P[^`]*)",
+ re.MULTILINE | re.DOTALL,
+ )
+ """Regex pattern to match yaml code blocks
+ within triple backticks with optional yaml or yml prefix."""
+
+ @override
+ def parse(self, text: str) -> T:
+ try:
+ # Greedy search for 1st yaml candidate.
+ match = re.search(self.pattern, text.strip())
+ # If no backticks were present, try to parse the entire output as yaml.
+ yaml_str = match.group("yaml") if match else text
+
+ json_object = yaml.safe_load(yaml_str)
+ return self.pydantic_object.model_validate(json_object)
+
+ except (yaml.YAMLError, ValidationError) as e:
+ name = self.pydantic_object.__name__
+ msg = f"Failed to parse {name} from completion {text}. Got: {e}"
+ raise OutputParserException(msg, llm_output=text) from e
+
+ @override
+ def get_format_instructions(self) -> str:
+ # Copy schema to avoid altering original Pydantic schema.
+ schema = dict(self.pydantic_object.model_json_schema().items())
+
+ # Remove extraneous fields.
+ reduced_schema = schema
+ if "title" in reduced_schema:
+ del reduced_schema["title"]
+ if "type" in reduced_schema:
+ del reduced_schema["type"]
+ # Ensure yaml in context is well-formed with double quotes.
+ schema_str = json.dumps(reduced_schema)
+
+ return YAML_FORMAT_INSTRUCTIONS.format(schema=schema_str)
+
+ @property
+ def _type(self) -> str:
+ return "yaml"
+
+ @property
+ @override
+ def OutputType(self) -> type[T]:
+ return self.pydantic_object
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..62c703d7a0361b17b46b56c0c8373f5ff7c8779f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/__init__.py
@@ -0,0 +1,77 @@
+"""**Prompt** is the input to the model.
+
+Prompt is often constructed
+from multiple components. Prompt classes and functions make constructing and working
+with prompts easy.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.example_selectors import (
+ LengthBasedExampleSelector,
+ MaxMarginalRelevanceExampleSelector,
+ SemanticSimilarityExampleSelector,
+)
+from langchain_core.prompts import (
+ AIMessagePromptTemplate,
+ BaseChatPromptTemplate,
+ BasePromptTemplate,
+ ChatMessagePromptTemplate,
+ ChatPromptTemplate,
+ FewShotChatMessagePromptTemplate,
+ FewShotPromptTemplate,
+ FewShotPromptWithTemplates,
+ HumanMessagePromptTemplate,
+ MessagesPlaceholder,
+ PromptTemplate,
+ StringPromptTemplate,
+ SystemMessagePromptTemplate,
+ load_prompt,
+)
+
+from langchain_classic._api import create_importer
+from langchain_classic.prompts.prompt import Prompt
+
+if TYPE_CHECKING:
+ from langchain_community.example_selectors.ngram_overlap import (
+ NGramOverlapExampleSelector,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+MODULE_LOOKUP = {
+ "NGramOverlapExampleSelector": (
+ "langchain_community.example_selectors.ngram_overlap"
+ ),
+}
+
+_import_attribute = create_importer(__file__, module_lookup=MODULE_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AIMessagePromptTemplate",
+ "BaseChatPromptTemplate",
+ "BasePromptTemplate",
+ "ChatMessagePromptTemplate",
+ "ChatPromptTemplate",
+ "FewShotChatMessagePromptTemplate",
+ "FewShotPromptTemplate",
+ "FewShotPromptWithTemplates",
+ "HumanMessagePromptTemplate",
+ "LengthBasedExampleSelector",
+ "MaxMarginalRelevanceExampleSelector",
+ "MessagesPlaceholder",
+ "NGramOverlapExampleSelector",
+ "Prompt",
+ "PromptTemplate",
+ "SemanticSimilarityExampleSelector",
+ "StringPromptTemplate",
+ "SystemMessagePromptTemplate",
+ "load_prompt",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..085bda5b9396eefeb360dab48a94dac3ef16ad61
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/base.py
@@ -0,0 +1,21 @@
+from langchain_core.prompt_values import StringPromptValue
+from langchain_core.prompts import (
+ BasePromptTemplate,
+ StringPromptTemplate,
+ check_valid_template,
+ get_template_variables,
+ jinja2_formatter,
+ validate_jinja2,
+)
+from langchain_core.prompts.string import _get_jinja2_variables_from_template
+
+__all__ = [
+ "BasePromptTemplate",
+ "StringPromptTemplate",
+ "StringPromptValue",
+ "_get_jinja2_variables_from_template",
+ "check_valid_template",
+ "get_template_variables",
+ "jinja2_formatter",
+ "validate_jinja2",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/chat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/chat.py
new file mode 100644
index 0000000000000000000000000000000000000000..c79534b12cc70d0e939a070afa0dc5800b636722
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/chat.py
@@ -0,0 +1,37 @@
+from langchain_core.prompt_values import ChatPromptValue, ChatPromptValueConcrete
+from langchain_core.prompts.chat import (
+ AIMessagePromptTemplate,
+ BaseChatPromptTemplate,
+ BaseStringMessagePromptTemplate,
+ ChatMessagePromptTemplate,
+ ChatPromptTemplate,
+ HumanMessagePromptTemplate,
+ MessageLike,
+ MessageLikeRepresentation,
+ MessagePromptTemplateT,
+ MessagesPlaceholder,
+ SystemMessagePromptTemplate,
+ _convert_to_message,
+ _create_template_from_message_type,
+)
+
+__all__ = [
+ "AIMessagePromptTemplate",
+ "BaseChatPromptTemplate",
+ "BaseMessagePromptTemplate",
+ "BaseStringMessagePromptTemplate",
+ "ChatMessagePromptTemplate",
+ "ChatPromptTemplate",
+ "ChatPromptValue",
+ "ChatPromptValueConcrete",
+ "HumanMessagePromptTemplate",
+ "MessageLike",
+ "MessageLikeRepresentation",
+ "MessagePromptTemplateT",
+ "MessagesPlaceholder",
+ "SystemMessagePromptTemplate",
+ "_convert_to_message",
+ "_create_template_from_message_type",
+]
+
+from langchain_core.prompts.message import BaseMessagePromptTemplate
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/few_shot.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/few_shot.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3f64d21407753fc11c8b242eeb292271fc9e3f2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/few_shot.py
@@ -0,0 +1,11 @@
+from langchain_core.prompts.few_shot import (
+ FewShotChatMessagePromptTemplate,
+ FewShotPromptTemplate,
+ _FewShotPromptTemplateMixin,
+)
+
+__all__ = [
+ "FewShotChatMessagePromptTemplate",
+ "FewShotPromptTemplate",
+ "_FewShotPromptTemplateMixin",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/few_shot_with_templates.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/few_shot_with_templates.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e530dbe9cbaa06c51772f41757e07e822317396
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/few_shot_with_templates.py
@@ -0,0 +1,3 @@
+from langchain_core.prompts.few_shot_with_templates import FewShotPromptWithTemplates
+
+__all__ = ["FewShotPromptWithTemplates"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/loading.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/loading.py
new file mode 100644
index 0000000000000000000000000000000000000000..8848a8465c7a5666a142ce27f790c82848bf78be
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/loading.py
@@ -0,0 +1,21 @@
+from langchain_core.prompts.loading import (
+ _load_examples,
+ _load_few_shot_prompt,
+ _load_output_parser,
+ _load_prompt,
+ _load_prompt_from_file,
+ _load_template,
+ load_prompt,
+ load_prompt_from_config,
+)
+
+__all__ = [
+ "_load_examples",
+ "_load_few_shot_prompt",
+ "_load_output_parser",
+ "_load_prompt",
+ "_load_prompt_from_file",
+ "_load_template",
+ "load_prompt",
+ "load_prompt_from_config",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..e11c5a49bd3c275127ec035986ec79fbc034f09e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/prompts/prompt.py
@@ -0,0 +1,6 @@
+from langchain_core.prompts.prompt import PromptTemplate
+
+# For backwards compatibility.
+Prompt = PromptTemplate
+
+__all__ = ["Prompt", "PromptTemplate"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..68449d14204aacbea9ca6ac9f38a0fa9e48706f3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/__init__.py
@@ -0,0 +1,169 @@
+"""**Retriever** class returns Documents given a text **query**.
+
+It is more general than a vector store. A retriever does not need to be able to
+store documents, only to return (or retrieve) it. Vector stores can be used as
+the backbone of a retriever, but there are other types of retrievers as well.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api.module_import import create_importer
+from langchain_classic.retrievers.contextual_compression import (
+ ContextualCompressionRetriever,
+)
+from langchain_classic.retrievers.ensemble import EnsembleRetriever
+from langchain_classic.retrievers.merger_retriever import MergerRetriever
+from langchain_classic.retrievers.multi_query import MultiQueryRetriever
+from langchain_classic.retrievers.multi_vector import MultiVectorRetriever
+from langchain_classic.retrievers.parent_document_retriever import (
+ ParentDocumentRetriever,
+)
+from langchain_classic.retrievers.re_phraser import RePhraseQueryRetriever
+from langchain_classic.retrievers.self_query.base import SelfQueryRetriever
+from langchain_classic.retrievers.time_weighted_retriever import (
+ TimeWeightedVectorStoreRetriever,
+)
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import (
+ AmazonKendraRetriever,
+ AmazonKnowledgeBasesRetriever,
+ ArceeRetriever,
+ ArxivRetriever,
+ AzureAISearchRetriever,
+ AzureCognitiveSearchRetriever,
+ BM25Retriever,
+ ChaindeskRetriever,
+ ChatGPTPluginRetriever,
+ CohereRagRetriever,
+ DocArrayRetriever,
+ DriaRetriever,
+ ElasticSearchBM25Retriever,
+ EmbedchainRetriever,
+ GoogleCloudEnterpriseSearchRetriever,
+ GoogleDocumentAIWarehouseRetriever,
+ GoogleVertexAIMultiTurnSearchRetriever,
+ GoogleVertexAISearchRetriever,
+ KayAiRetriever,
+ KNNRetriever,
+ LlamaIndexGraphRetriever,
+ LlamaIndexRetriever,
+ MetalRetriever,
+ MilvusRetriever,
+ NeuralDBRetriever,
+ OutlineRetriever,
+ PineconeHybridSearchRetriever,
+ PubMedRetriever,
+ RemoteLangChainRetriever,
+ SVMRetriever,
+ TavilySearchAPIRetriever,
+ TFIDFRetriever,
+ VespaRetriever,
+ WeaviateHybridSearchRetriever,
+ WebResearchRetriever,
+ WikipediaRetriever,
+ ZepRetriever,
+ ZillizRetriever,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AmazonKendraRetriever": "langchain_community.retrievers",
+ "AmazonKnowledgeBasesRetriever": "langchain_community.retrievers",
+ "ArceeRetriever": "langchain_community.retrievers",
+ "ArxivRetriever": "langchain_community.retrievers",
+ "AzureAISearchRetriever": "langchain_community.retrievers",
+ "AzureCognitiveSearchRetriever": "langchain_community.retrievers",
+ "ChatGPTPluginRetriever": "langchain_community.retrievers",
+ "ChaindeskRetriever": "langchain_community.retrievers",
+ "CohereRagRetriever": "langchain_community.retrievers",
+ "ElasticSearchBM25Retriever": "langchain_community.retrievers",
+ "EmbedchainRetriever": "langchain_community.retrievers",
+ "GoogleDocumentAIWarehouseRetriever": "langchain_community.retrievers",
+ "GoogleCloudEnterpriseSearchRetriever": "langchain_community.retrievers",
+ "GoogleVertexAIMultiTurnSearchRetriever": "langchain_community.retrievers",
+ "GoogleVertexAISearchRetriever": "langchain_community.retrievers",
+ "KayAiRetriever": "langchain_community.retrievers",
+ "KNNRetriever": "langchain_community.retrievers",
+ "LlamaIndexGraphRetriever": "langchain_community.retrievers",
+ "LlamaIndexRetriever": "langchain_community.retrievers",
+ "MetalRetriever": "langchain_community.retrievers",
+ "MilvusRetriever": "langchain_community.retrievers",
+ "OutlineRetriever": "langchain_community.retrievers",
+ "PineconeHybridSearchRetriever": "langchain_community.retrievers",
+ "PubMedRetriever": "langchain_community.retrievers",
+ "RemoteLangChainRetriever": "langchain_community.retrievers",
+ "SVMRetriever": "langchain_community.retrievers",
+ "TavilySearchAPIRetriever": "langchain_community.retrievers",
+ "BM25Retriever": "langchain_community.retrievers",
+ "DriaRetriever": "langchain_community.retrievers",
+ "NeuralDBRetriever": "langchain_community.retrievers",
+ "TFIDFRetriever": "langchain_community.retrievers",
+ "VespaRetriever": "langchain_community.retrievers",
+ "WeaviateHybridSearchRetriever": "langchain_community.retrievers",
+ "WebResearchRetriever": "langchain_community.retrievers",
+ "WikipediaRetriever": "langchain_community.retrievers",
+ "ZepRetriever": "langchain_community.retrievers",
+ "ZillizRetriever": "langchain_community.retrievers",
+ "DocArrayRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AmazonKendraRetriever",
+ "AmazonKnowledgeBasesRetriever",
+ "ArceeRetriever",
+ "ArxivRetriever",
+ "AzureAISearchRetriever",
+ "AzureCognitiveSearchRetriever",
+ "BM25Retriever",
+ "ChaindeskRetriever",
+ "ChatGPTPluginRetriever",
+ "CohereRagRetriever",
+ "ContextualCompressionRetriever",
+ "DocArrayRetriever",
+ "DriaRetriever",
+ "ElasticSearchBM25Retriever",
+ "EmbedchainRetriever",
+ "EnsembleRetriever",
+ "GoogleCloudEnterpriseSearchRetriever",
+ "GoogleDocumentAIWarehouseRetriever",
+ "GoogleVertexAIMultiTurnSearchRetriever",
+ "GoogleVertexAISearchRetriever",
+ "KNNRetriever",
+ "KayAiRetriever",
+ "LlamaIndexGraphRetriever",
+ "LlamaIndexRetriever",
+ "MergerRetriever",
+ "MetalRetriever",
+ "MilvusRetriever",
+ "MultiQueryRetriever",
+ "MultiVectorRetriever",
+ "NeuralDBRetriever",
+ "OutlineRetriever",
+ "ParentDocumentRetriever",
+ "PineconeHybridSearchRetriever",
+ "PubMedRetriever",
+ "RePhraseQueryRetriever",
+ "RemoteLangChainRetriever",
+ "SVMRetriever",
+ "SelfQueryRetriever",
+ "TFIDFRetriever",
+ "TavilySearchAPIRetriever",
+ "TimeWeightedVectorStoreRetriever",
+ "VespaRetriever",
+ "WeaviateHybridSearchRetriever",
+ "WebResearchRetriever",
+ "WikipediaRetriever",
+ "ZepRetriever",
+ "ZillizRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/arcee.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/arcee.py
new file mode 100644
index 0000000000000000000000000000000000000000..e811e1bd9d73fce9af4b4c44872d8b6b0e079ddd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/arcee.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ArceeRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ArceeRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArceeRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/arxiv.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/arxiv.py
new file mode 100644
index 0000000000000000000000000000000000000000..c89fa796592bb15789532e06a759705b2c6005e4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/arxiv.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ArxivRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ArxivRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArxivRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/azure_ai_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/azure_ai_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..827a4bc85375020ed472add02da77a68a4b6e401
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/azure_ai_search.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import (
+ AzureAISearchRetriever,
+ AzureCognitiveSearchRetriever,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AzureAISearchRetriever": "langchain_community.retrievers",
+ "AzureCognitiveSearchRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureAISearchRetriever",
+ "AzureCognitiveSearchRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/bedrock.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/bedrock.py
new file mode 100644
index 0000000000000000000000000000000000000000..4127b0cd501e6b69d4c44379927af5da6e195d56
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/bedrock.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import AmazonKnowledgeBasesRetriever
+ from langchain_community.retrievers.bedrock import (
+ RetrievalConfig,
+ VectorSearchConfig,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "VectorSearchConfig": "langchain_community.retrievers.bedrock",
+ "RetrievalConfig": "langchain_community.retrievers.bedrock",
+ "AmazonKnowledgeBasesRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AmazonKnowledgeBasesRetriever",
+ "RetrievalConfig",
+ "VectorSearchConfig",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/bm25.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/bm25.py
new file mode 100644
index 0000000000000000000000000000000000000000..72547ea17003db0a30d9cd30cd33ae8aca78293b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/bm25.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import BM25Retriever
+ from langchain_community.retrievers.bm25 import default_preprocessing_func
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "default_preprocessing_func": "langchain_community.retrievers.bm25",
+ "BM25Retriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BM25Retriever",
+ "default_preprocessing_func",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/chaindesk.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/chaindesk.py
new file mode 100644
index 0000000000000000000000000000000000000000..55ea633edf284ac8149cc3ab4a24b5c55484ecf8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/chaindesk.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ChaindeskRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChaindeskRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChaindeskRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/chatgpt_plugin_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/chatgpt_plugin_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..8d5cc471b2051cc95c34bd9aa19cc878c1fbfe19
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/chatgpt_plugin_retriever.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ChatGPTPluginRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ChatGPTPluginRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ChatGPTPluginRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/cohere_rag_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/cohere_rag_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..527f1de3d62fd47596ed17f6502f13703f55abb4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/cohere_rag_retriever.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import CohereRagRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"CohereRagRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CohereRagRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/contextual_compression.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/contextual_compression.py
new file mode 100644
index 0000000000000000000000000000000000000000..8f82c6f5b6dd24a9e07258661f0db03a8e8889a2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/contextual_compression.py
@@ -0,0 +1,68 @@
+from typing import Any
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import BaseDocumentCompressor, Document
+from langchain_core.retrievers import BaseRetriever, RetrieverLike
+from pydantic import ConfigDict
+from typing_extensions import override
+
+
+class ContextualCompressionRetriever(BaseRetriever):
+ """Retriever that wraps a base retriever and compresses the results."""
+
+ base_compressor: BaseDocumentCompressor
+ """Compressor for compressing retrieved documents."""
+
+ base_retriever: RetrieverLike
+ """Base Retriever to use for getting relevant documents."""
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ @override
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ **kwargs: Any,
+ ) -> list[Document]:
+ docs = self.base_retriever.invoke(
+ query,
+ config={"callbacks": run_manager.get_child()},
+ **kwargs,
+ )
+ if docs:
+ compressed_docs = self.base_compressor.compress_documents(
+ docs,
+ query,
+ callbacks=run_manager.get_child(),
+ )
+ return list(compressed_docs)
+ return []
+
+ @override
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ **kwargs: Any,
+ ) -> list[Document]:
+ docs = await self.base_retriever.ainvoke(
+ query,
+ config={"callbacks": run_manager.get_child()},
+ **kwargs,
+ )
+ if docs:
+ compressed_docs = await self.base_compressor.acompress_documents(
+ docs,
+ query,
+ callbacks=run_manager.get_child(),
+ )
+ return list(compressed_docs)
+ return []
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/databerry.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/databerry.py
new file mode 100644
index 0000000000000000000000000000000000000000..fd33db2a063bbda72b6bf61859a756d0af1d83d3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/databerry.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers.databerry import DataberryRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DataberryRetriever": "langchain_community.retrievers.databerry"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DataberryRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/docarray.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/docarray.py
new file mode 100644
index 0000000000000000000000000000000000000000..5bc4b49acbac807ae2217808d2bb1bfbd64060f4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/docarray.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import DocArrayRetriever
+ from langchain_community.retrievers.docarray import SearchType
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SearchType": "langchain_community.retrievers.docarray",
+ "DocArrayRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocArrayRetriever",
+ "SearchType",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/elastic_search_bm25.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/elastic_search_bm25.py
new file mode 100644
index 0000000000000000000000000000000000000000..253949b31c6c93134af40df34eb3ce4f993d747f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/elastic_search_bm25.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ElasticSearchBM25Retriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ElasticSearchBM25Retriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ElasticSearchBM25Retriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/embedchain.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/embedchain.py
new file mode 100644
index 0000000000000000000000000000000000000000..c09494f8799bdfa067911452bbeb1e09419717eb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/embedchain.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import EmbedchainRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"EmbedchainRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EmbedchainRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/ensemble.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/ensemble.py
new file mode 100644
index 0000000000000000000000000000000000000000..1306708b481d6d21c3334f9f6ac5b9cbe23c515d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/ensemble.py
@@ -0,0 +1,352 @@
+"""Ensemble Retriever.
+
+Ensemble retriever that ensemble the results of
+multiple retrievers by using weighted Reciprocal Rank Fusion.
+"""
+
+import asyncio
+from collections import defaultdict
+from collections.abc import Callable, Hashable, Iterable, Iterator
+from itertools import chain
+from typing import (
+ Any,
+ TypeVar,
+ cast,
+)
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import Document
+from langchain_core.retrievers import BaseRetriever, RetrieverLike
+from langchain_core.runnables import RunnableConfig
+from langchain_core.runnables.config import ensure_config, patch_config
+from langchain_core.runnables.utils import (
+ ConfigurableFieldSpec,
+ get_unique_config_specs,
+)
+from pydantic import model_validator
+from typing_extensions import override
+
+T = TypeVar("T")
+H = TypeVar("H", bound=Hashable)
+
+
+def unique_by_key(iterable: Iterable[T], key: Callable[[T], H]) -> Iterator[T]:
+ """Yield unique elements of an iterable based on a key function.
+
+ Args:
+ iterable: The iterable to filter.
+ key: A function that returns a hashable key for each element.
+
+ Yields:
+ Unique elements of the iterable based on the key function.
+ """
+ seen = set()
+ for e in iterable:
+ if (k := key(e)) not in seen:
+ seen.add(k)
+ yield e
+
+
+class EnsembleRetriever(BaseRetriever):
+ """Retriever that ensembles the multiple retrievers.
+
+ It uses a rank fusion.
+
+ Args:
+ retrievers: A list of retrievers to ensemble.
+ weights: A list of weights corresponding to the retrievers. Defaults to equal
+ weighting for all retrievers.
+ c: A constant added to the rank, controlling the balance between the importance
+ of high-ranked items and the consideration given to lower-ranked items.
+ id_key: The key in the document's metadata used to determine unique documents.
+ If not specified, page_content is used.
+ """
+
+ retrievers: list[RetrieverLike]
+ weights: list[float]
+ c: int = 60
+ id_key: str | None = None
+
+ @property
+ def config_specs(self) -> list[ConfigurableFieldSpec]:
+ """List configurable fields for this runnable."""
+ return get_unique_config_specs(
+ spec for retriever in self.retrievers for spec in retriever.config_specs
+ )
+
+ @model_validator(mode="before")
+ @classmethod
+ def _set_weights(cls, values: dict[str, Any]) -> Any:
+ weights = values.get("weights")
+
+ if not weights:
+ n_retrievers = len(values["retrievers"])
+ values["weights"] = [1 / n_retrievers] * n_retrievers
+ return values
+
+ retrievers = values["retrievers"]
+ if len(weights) != len(retrievers):
+ msg = (
+ "Length of weights must match number of retrievers "
+ f"(got {len(weights)} weights for {len(retrievers)} retrievers)."
+ )
+ raise ValueError(msg)
+
+ if not any(w > 0 for w in weights):
+ msg = "At least one ensemble weight must be greater than zero."
+ raise ValueError(msg)
+
+ return values
+
+ @override
+ def invoke(
+ self,
+ input: str,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> list[Document]:
+ from langchain_core.callbacks import CallbackManager
+
+ config = ensure_config(config)
+ callback_manager = CallbackManager.configure(
+ config.get("callbacks"),
+ None,
+ verbose=kwargs.get("verbose", False),
+ inheritable_tags=config.get("tags", []),
+ local_tags=self.tags,
+ inheritable_metadata=config.get("metadata", {}),
+ local_metadata=self.metadata,
+ )
+ run_manager = callback_manager.on_retriever_start(
+ None,
+ input,
+ name=config.get("run_name") or self.get_name(),
+ **kwargs,
+ )
+ try:
+ result = self.rank_fusion(input, run_manager=run_manager, config=config)
+ except Exception as e:
+ run_manager.on_retriever_error(e)
+ raise
+ else:
+ run_manager.on_retriever_end(
+ result,
+ **kwargs,
+ )
+ return result
+
+ @override
+ async def ainvoke(
+ self,
+ input: str,
+ config: RunnableConfig | None = None,
+ **kwargs: Any,
+ ) -> list[Document]:
+ from langchain_core.callbacks import AsyncCallbackManager
+
+ config = ensure_config(config)
+ callback_manager = AsyncCallbackManager.configure(
+ config.get("callbacks"),
+ None,
+ verbose=kwargs.get("verbose", False),
+ inheritable_tags=config.get("tags", []),
+ local_tags=self.tags,
+ inheritable_metadata=config.get("metadata", {}),
+ local_metadata=self.metadata,
+ )
+ run_manager = await callback_manager.on_retriever_start(
+ None,
+ input,
+ name=config.get("run_name") or self.get_name(),
+ **kwargs,
+ )
+ try:
+ result = await self.arank_fusion(
+ input,
+ run_manager=run_manager,
+ config=config,
+ )
+ except Exception as e:
+ await run_manager.on_retriever_error(e)
+ raise
+ else:
+ await run_manager.on_retriever_end(
+ result,
+ **kwargs,
+ )
+ return result
+
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Get the relevant documents for a given query.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+
+ Returns:
+ A list of reranked documents.
+ """
+ # Get fused result of the retrievers.
+ return self.rank_fusion(query, run_manager)
+
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Asynchronously get the relevant documents for a given query.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+
+ Returns:
+ A list of reranked documents.
+ """
+ # Get fused result of the retrievers.
+ return await self.arank_fusion(query, run_manager)
+
+ def rank_fusion(
+ self,
+ query: str,
+ run_manager: CallbackManagerForRetrieverRun,
+ *,
+ config: RunnableConfig | None = None,
+ ) -> list[Document]:
+ """Rank fusion.
+
+ Retrieve the results of the retrievers and use rank_fusion_func to get
+ the final result.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+ config: Optional configuration for the retrievers.
+
+ Returns:
+ A list of reranked documents.
+ """
+ # Get the results of all retrievers.
+ retriever_docs = [
+ retriever.invoke(
+ query,
+ patch_config(
+ config,
+ callbacks=run_manager.get_child(tag=f"retriever_{i + 1}"),
+ ),
+ )
+ for i, retriever in enumerate(self.retrievers)
+ ]
+
+ # Enforce that retrieved docs are Documents for each list in retriever_docs
+ for i in range(len(retriever_docs)):
+ retriever_docs[i] = [
+ Document(page_content=cast("str", doc)) if isinstance(doc, str) else doc # type: ignore[unreachable]
+ for doc in retriever_docs[i]
+ ]
+
+ # apply rank fusion
+ return self.weighted_reciprocal_rank(retriever_docs)
+
+ async def arank_fusion(
+ self,
+ query: str,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ *,
+ config: RunnableConfig | None = None,
+ ) -> list[Document]:
+ """Rank fusion.
+
+ Asynchronously retrieve the results of the retrievers
+ and use rank_fusion_func to get the final result.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+ config: Optional configuration for the retrievers.
+
+ Returns:
+ A list of reranked documents.
+ """
+ # Get the results of all retrievers.
+ retriever_docs = await asyncio.gather(
+ *[
+ retriever.ainvoke(
+ query,
+ patch_config(
+ config,
+ callbacks=run_manager.get_child(tag=f"retriever_{i + 1}"),
+ ),
+ )
+ for i, retriever in enumerate(self.retrievers)
+ ],
+ )
+
+ # Enforce that retrieved docs are Documents for each list in retriever_docs
+ for i in range(len(retriever_docs)):
+ retriever_docs[i] = [
+ Document(page_content=doc) if not isinstance(doc, Document) else doc
+ for doc in retriever_docs[i]
+ ]
+
+ # apply rank fusion
+ return self.weighted_reciprocal_rank(retriever_docs)
+
+ def weighted_reciprocal_rank(
+ self,
+ doc_lists: list[list[Document]],
+ ) -> list[Document]:
+ """Perform weighted Reciprocal Rank Fusion on multiple rank lists.
+
+ You can find more details about RRF here:
+ https://plg.uwaterloo.ca/~gvcormac/cormacksigir09-rrf.pdf.
+
+ Args:
+ doc_lists: A list of rank lists, where each rank list contains unique items.
+
+ Returns:
+ The final aggregated list of items sorted by their weighted RRF
+ scores in descending order.
+ """
+ if len(doc_lists) != len(self.weights):
+ msg = "Number of rank lists must be equal to the number of weights."
+ raise ValueError(msg)
+
+ # Associate each doc's content with its RRF score for later sorting by it
+ # Duplicated contents across retrievers are collapsed & scored cumulatively
+ rrf_score: dict[str, float] = defaultdict(float)
+ for doc_list, weight in zip(doc_lists, self.weights, strict=False):
+ for rank, doc in enumerate(doc_list, start=1):
+ rrf_score[
+ (
+ doc.page_content
+ if self.id_key is None
+ else doc.metadata[self.id_key]
+ )
+ ] += weight / (rank + self.c)
+
+ # Docs are deduplicated by their contents then sorted by their scores
+ all_docs = chain.from_iterable(doc_lists)
+ return sorted(
+ unique_by_key(
+ all_docs,
+ lambda doc: (
+ doc.page_content
+ if self.id_key is None
+ else doc.metadata[self.id_key]
+ ),
+ ),
+ reverse=True,
+ key=lambda doc: rrf_score[
+ doc.page_content if self.id_key is None else doc.metadata[self.id_key]
+ ],
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/google_cloud_documentai_warehouse.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/google_cloud_documentai_warehouse.py
new file mode 100644
index 0000000000000000000000000000000000000000..69b11a0e40b42efc6e915a09e7844021fcb8d73f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/google_cloud_documentai_warehouse.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import GoogleDocumentAIWarehouseRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GoogleDocumentAIWarehouseRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleDocumentAIWarehouseRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/google_vertex_ai_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/google_vertex_ai_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba345c097465277f83db8a0216d9da588e61a817
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/google_vertex_ai_search.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import (
+ GoogleCloudEnterpriseSearchRetriever,
+ GoogleVertexAIMultiTurnSearchRetriever,
+ GoogleVertexAISearchRetriever,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "GoogleVertexAISearchRetriever": "langchain_community.retrievers",
+ "GoogleVertexAIMultiTurnSearchRetriever": "langchain_community.retrievers",
+ "GoogleCloudEnterpriseSearchRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleCloudEnterpriseSearchRetriever",
+ "GoogleVertexAIMultiTurnSearchRetriever",
+ "GoogleVertexAISearchRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/kay.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/kay.py
new file mode 100644
index 0000000000000000000000000000000000000000..325c2e0d58ba6bb6bed40630a6779e5c652db2c1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/kay.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import KayAiRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"KayAiRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "KayAiRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/kendra.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/kendra.py
new file mode 100644
index 0000000000000000000000000000000000000000..60a05de7e2dc4c9ba87d5ee517937352dae60725
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/kendra.py
@@ -0,0 +1,66 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import AmazonKendraRetriever
+ from langchain_community.retrievers.kendra import (
+ AdditionalResultAttribute,
+ AdditionalResultAttributeValue,
+ DocumentAttribute,
+ DocumentAttributeValue,
+ Highlight,
+ QueryResult,
+ QueryResultItem,
+ ResultItem,
+ RetrieveResult,
+ RetrieveResultItem,
+ TextWithHighLights,
+ clean_excerpt,
+ combined_text,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "clean_excerpt": "langchain_community.retrievers.kendra",
+ "combined_text": "langchain_community.retrievers.kendra",
+ "Highlight": "langchain_community.retrievers.kendra",
+ "TextWithHighLights": "langchain_community.retrievers.kendra",
+ "AdditionalResultAttributeValue": "langchain_community.retrievers.kendra",
+ "AdditionalResultAttribute": "langchain_community.retrievers.kendra",
+ "DocumentAttributeValue": "langchain_community.retrievers.kendra",
+ "DocumentAttribute": "langchain_community.retrievers.kendra",
+ "ResultItem": "langchain_community.retrievers.kendra",
+ "QueryResultItem": "langchain_community.retrievers.kendra",
+ "RetrieveResultItem": "langchain_community.retrievers.kendra",
+ "QueryResult": "langchain_community.retrievers.kendra",
+ "RetrieveResult": "langchain_community.retrievers.kendra",
+ "AmazonKendraRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AdditionalResultAttribute",
+ "AdditionalResultAttributeValue",
+ "AmazonKendraRetriever",
+ "DocumentAttribute",
+ "DocumentAttributeValue",
+ "Highlight",
+ "QueryResult",
+ "QueryResultItem",
+ "ResultItem",
+ "RetrieveResult",
+ "RetrieveResultItem",
+ "TextWithHighLights",
+ "clean_excerpt",
+ "combined_text",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/knn.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/knn.py
new file mode 100644
index 0000000000000000000000000000000000000000..527b9dd39fd4a87f8e8f14a9064d33fc4a6b92af
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/knn.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import KNNRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"KNNRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "KNNRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/llama_index.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/llama_index.py
new file mode 100644
index 0000000000000000000000000000000000000000..92ecb2d2d22db8673a84bbe98c9061e7c99ab8c0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/llama_index.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import (
+ LlamaIndexGraphRetriever,
+ LlamaIndexRetriever,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LlamaIndexRetriever": "langchain_community.retrievers",
+ "LlamaIndexGraphRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LlamaIndexGraphRetriever",
+ "LlamaIndexRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/merger_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/merger_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..f556b7d1785cf541f40f935303ac0c822a343da5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/merger_retriever.py
@@ -0,0 +1,119 @@
+import asyncio
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import Document
+from langchain_core.retrievers import BaseRetriever
+
+
+class MergerRetriever(BaseRetriever):
+ """Retriever that merges the results of multiple retrievers."""
+
+ retrievers: list[BaseRetriever]
+ """A list of retrievers to merge."""
+
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Get the relevant documents for a given query.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+
+ Returns:
+ A list of relevant documents.
+ """
+ # Merge the results of the retrievers.
+ return self.merge_documents(query, run_manager)
+
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Asynchronously get the relevant documents for a given query.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+
+ Returns:
+ A list of relevant documents.
+ """
+ # Merge the results of the retrievers.
+ return await self.amerge_documents(query, run_manager)
+
+ def merge_documents(
+ self,
+ query: str,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Merge the results of the retrievers.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+
+ Returns:
+ A list of merged documents.
+ """
+ # Get the results of all retrievers.
+ retriever_docs = [
+ retriever.invoke(
+ query,
+ config={"callbacks": run_manager.get_child(f"retriever_{i + 1}")},
+ )
+ for i, retriever in enumerate(self.retrievers)
+ ]
+
+ # Merge the results of the retrievers.
+ merged_documents = []
+ max_docs = max(map(len, retriever_docs), default=0)
+ for i in range(max_docs):
+ for _retriever, doc in zip(self.retrievers, retriever_docs, strict=False):
+ if i < len(doc):
+ merged_documents.append(doc[i])
+
+ return merged_documents
+
+ async def amerge_documents(
+ self,
+ query: str,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Asynchronously merge the results of the retrievers.
+
+ Args:
+ query: The query to search for.
+ run_manager: The callback handler to use.
+
+ Returns:
+ A list of merged documents.
+ """
+ # Get the results of all retrievers.
+ retriever_docs = await asyncio.gather(
+ *(
+ retriever.ainvoke(
+ query,
+ config={"callbacks": run_manager.get_child(f"retriever_{i + 1}")},
+ )
+ for i, retriever in enumerate(self.retrievers)
+ ),
+ )
+
+ # Merge the results of the retrievers.
+ merged_documents = []
+ max_docs = max(map(len, retriever_docs), default=0)
+ for i in range(max_docs):
+ for _retriever, doc in zip(self.retrievers, retriever_docs, strict=False):
+ if i < len(doc):
+ merged_documents.append(doc[i])
+
+ return merged_documents
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/metal.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/metal.py
new file mode 100644
index 0000000000000000000000000000000000000000..e9d73fa31aa9c1bda7ccd7f285e3470710ed6cfa
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/metal.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import MetalRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MetalRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MetalRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/milvus.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/milvus.py
new file mode 100644
index 0000000000000000000000000000000000000000..983e4fd8d3e8833c9a8f3e8201f5d612b1c9e72e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/milvus.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import MilvusRetriever
+ from langchain_community.retrievers.milvus import MilvusRetreiver
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "MilvusRetriever": "langchain_community.retrievers",
+ "MilvusRetreiver": "langchain_community.retrievers.milvus",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MilvusRetreiver",
+ "MilvusRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/multi_query.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/multi_query.py
new file mode 100644
index 0000000000000000000000000000000000000000..76105cbfd73f542ef61fb11ecc94ea5207a2473a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/multi_query.py
@@ -0,0 +1,240 @@
+import asyncio
+import logging
+from collections.abc import Sequence
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import Document
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.output_parsers import BaseOutputParser
+from langchain_core.prompts import BasePromptTemplate
+from langchain_core.prompts.prompt import PromptTemplate
+from langchain_core.retrievers import BaseRetriever
+from langchain_core.runnables import Runnable
+from typing_extensions import override
+
+from langchain_classic.chains.llm import LLMChain
+
+logger = logging.getLogger(__name__)
+
+
+class LineListOutputParser(BaseOutputParser[list[str]]):
+ """Output parser for a list of lines."""
+
+ @override
+ def parse(self, text: str) -> list[str]:
+ lines = text.strip().split("\n")
+ return list(filter(None, lines)) # Remove empty lines
+
+
+# Default prompt
+DEFAULT_QUERY_PROMPT = PromptTemplate(
+ input_variables=["question"],
+ template="""You are an AI language model assistant. Your task is
+ to generate 3 different versions of the given user
+ question to retrieve relevant documents from a vector database.
+ By generating multiple perspectives on the user question,
+ your goal is to help the user overcome some of the limitations
+ of distance-based similarity search. Provide these alternative
+ questions separated by newlines. Original question: {question}""",
+)
+
+
+def _unique_documents(documents: Sequence[Document]) -> list[Document]:
+ return [doc for i, doc in enumerate(documents) if doc not in documents[:i]]
+
+
+class MultiQueryRetriever(BaseRetriever):
+ """Given a query, use an LLM to write a set of queries.
+
+ Retrieve docs for each query. Return the unique union of all retrieved docs.
+ """
+
+ retriever: BaseRetriever
+ llm_chain: Runnable
+ verbose: bool = True
+ parser_key: str = "lines"
+ """DEPRECATED. parser_key is no longer used and should not be specified."""
+ include_original: bool = False
+ """Whether to include the original query in the list of generated queries."""
+
+ @classmethod
+ def from_llm(
+ cls,
+ retriever: BaseRetriever,
+ llm: BaseLanguageModel,
+ prompt: BasePromptTemplate = DEFAULT_QUERY_PROMPT,
+ parser_key: str | None = None, # noqa: ARG003
+ include_original: bool = False, # noqa: FBT001,FBT002
+ ) -> "MultiQueryRetriever":
+ """Initialize from llm using default template.
+
+ Args:
+ retriever: retriever to query documents from
+ llm: llm for query generation using DEFAULT_QUERY_PROMPT
+ prompt: The prompt which aims to generate several different versions
+ of the given user query
+ parser_key: DEPRECATED. `parser_key` is no longer used and should not be
+ specified.
+ include_original: Whether to include the original query in the list of
+ generated queries.
+
+ Returns:
+ MultiQueryRetriever
+ """
+ output_parser = LineListOutputParser()
+ llm_chain = prompt | llm | output_parser
+ return cls(
+ retriever=retriever,
+ llm_chain=llm_chain,
+ include_original=include_original,
+ )
+
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Get relevant documents given a user query.
+
+ Args:
+ query: user query
+ run_manager: the callback handler to use.
+
+ Returns:
+ Unique union of relevant documents from all generated queries
+ """
+ queries = await self.agenerate_queries(query, run_manager)
+ if self.include_original:
+ queries.append(query)
+ documents = await self.aretrieve_documents(queries, run_manager)
+ return self.unique_union(documents)
+
+ async def agenerate_queries(
+ self,
+ question: str,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[str]:
+ """Generate queries based upon user input.
+
+ Args:
+ question: user query
+ run_manager: the callback handler to use.
+
+ Returns:
+ List of LLM generated queries that are similar to the user input
+ """
+ response = await self.llm_chain.ainvoke(
+ {"question": question},
+ config={"callbacks": run_manager.get_child()},
+ )
+ lines = response["text"] if isinstance(self.llm_chain, LLMChain) else response
+ if self.verbose:
+ logger.info("Generated queries: %s", lines)
+ return lines
+
+ async def aretrieve_documents(
+ self,
+ queries: list[str],
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Run all LLM generated queries.
+
+ Args:
+ queries: query list
+ run_manager: the callback handler to use
+
+ Returns:
+ List of retrieved Documents
+ """
+ document_lists = await asyncio.gather(
+ *(
+ self.retriever.ainvoke(
+ query,
+ config={"callbacks": run_manager.get_child()},
+ )
+ for query in queries
+ ),
+ )
+ return [doc for docs in document_lists for doc in docs]
+
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Get relevant documents given a user query.
+
+ Args:
+ query: user query
+ run_manager: the callback handler to use.
+
+ Returns:
+ Unique union of relevant documents from all generated queries
+ """
+ queries = self.generate_queries(query, run_manager)
+ if self.include_original:
+ queries.append(query)
+ documents = self.retrieve_documents(queries, run_manager)
+ return self.unique_union(documents)
+
+ def generate_queries(
+ self,
+ question: str,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[str]:
+ """Generate queries based upon user input.
+
+ Args:
+ question: user query
+ run_manager: run manager for callbacks
+
+ Returns:
+ List of LLM generated queries that are similar to the user input
+ """
+ response = self.llm_chain.invoke(
+ {"question": question},
+ config={"callbacks": run_manager.get_child()},
+ )
+ lines = response["text"] if isinstance(self.llm_chain, LLMChain) else response
+ if self.verbose:
+ logger.info("Generated queries: %s", lines)
+ return lines
+
+ def retrieve_documents(
+ self,
+ queries: list[str],
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Run all LLM generated queries.
+
+ Args:
+ queries: query list
+ run_manager: run manager for callbacks
+
+ Returns:
+ List of retrieved Documents
+ """
+ documents = []
+ for query in queries:
+ docs = self.retriever.invoke(
+ query,
+ config={"callbacks": run_manager.get_child()},
+ )
+ documents.extend(docs)
+ return documents
+
+ def unique_union(self, documents: list[Document]) -> list[Document]:
+ """Get unique Documents.
+
+ Args:
+ documents: List of retrieved Documents
+
+ Returns:
+ List of unique retrieved Documents
+ """
+ return _unique_documents(documents)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/multi_vector.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/multi_vector.py
new file mode 100644
index 0000000000000000000000000000000000000000..ff5f3103902be3bc6f5d3c9cfad4882ca4137fc8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/multi_vector.py
@@ -0,0 +1,155 @@
+from enum import Enum
+from typing import Any
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import Document
+from langchain_core.retrievers import BaseRetriever
+from langchain_core.stores import BaseStore, ByteStore
+from langchain_core.vectorstores import VectorStore
+from pydantic import Field, model_validator
+from typing_extensions import override
+
+from langchain_classic.storage._lc_store import create_kv_docstore
+
+
+class SearchType(str, Enum):
+ """Enumerator of the types of search to perform."""
+
+ similarity = "similarity"
+ """Similarity search."""
+ similarity_score_threshold = "similarity_score_threshold"
+ """Similarity search with a score threshold."""
+ mmr = "mmr"
+ """Maximal Marginal Relevance reranking of similarity search."""
+
+
+class MultiVectorRetriever(BaseRetriever):
+ """Retriever that supports multiple embeddings per parent document.
+
+ This retriever is designed for scenarios where documents are split into
+ smaller chunks for embedding and vector search, but retrieval returns
+ the original parent documents rather than individual chunks.
+
+ It works by:
+ - Performing similarity (or MMR) search over embedded child chunks
+ - Collecting unique parent document IDs from chunk metadata
+ - Fetching and returning the corresponding parent documents from the docstore
+
+ This pattern is commonly used in RAG pipelines to improve answer grounding
+ while preserving full document context.
+ """
+
+ vectorstore: VectorStore
+ """The underlying `VectorStore` to use to store small chunks
+ and their embedding vectors"""
+
+ byte_store: ByteStore | None = None
+ """The lower-level backing storage layer for the parent documents"""
+
+ docstore: BaseStore[str, Document]
+ """The storage interface for the parent documents"""
+
+ id_key: str = "doc_id"
+
+ search_kwargs: dict = Field(default_factory=dict)
+ """Keyword arguments to pass to the search function."""
+
+ search_type: SearchType = SearchType.similarity
+ """Type of search to perform (similarity / mmr)"""
+
+ @model_validator(mode="before")
+ @classmethod
+ def _shim_docstore(cls, values: dict) -> Any:
+ byte_store = values.get("byte_store")
+ docstore = values.get("docstore")
+ if byte_store is not None:
+ docstore = create_kv_docstore(byte_store)
+ elif docstore is None:
+ msg = "You must pass a `byte_store` parameter."
+ raise ValueError(msg)
+ values["docstore"] = docstore
+ return values
+
+ @override
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Get documents relevant to a query.
+
+ Args:
+ query: String to find relevant documents for
+ run_manager: The callbacks handler to use
+ Returns:
+ List of relevant documents.
+ """
+ if self.search_type == SearchType.mmr:
+ sub_docs = self.vectorstore.max_marginal_relevance_search(
+ query,
+ **self.search_kwargs,
+ )
+ elif self.search_type == SearchType.similarity_score_threshold:
+ sub_docs_and_similarities = (
+ self.vectorstore.similarity_search_with_relevance_scores(
+ query,
+ **self.search_kwargs,
+ )
+ )
+ sub_docs = [sub_doc for sub_doc, _ in sub_docs_and_similarities]
+ else:
+ sub_docs = self.vectorstore.similarity_search(query, **self.search_kwargs)
+
+ # We do this to maintain the order of the IDs that are returned
+ ids = []
+ for d in sub_docs:
+ if self.id_key in d.metadata and d.metadata[self.id_key] not in ids:
+ ids.append(d.metadata[self.id_key])
+ docs = self.docstore.mget(ids)
+ return [d for d in docs if d is not None]
+
+ @override
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Asynchronously get documents relevant to a query.
+
+ Args:
+ query: String to find relevant documents for
+ run_manager: The callbacks handler to use
+ Returns:
+ List of relevant documents.
+ """
+ if self.search_type == SearchType.mmr:
+ sub_docs = await self.vectorstore.amax_marginal_relevance_search(
+ query,
+ **self.search_kwargs,
+ )
+ elif self.search_type == SearchType.similarity_score_threshold:
+ sub_docs_and_similarities = (
+ await self.vectorstore.asimilarity_search_with_relevance_scores(
+ query,
+ **self.search_kwargs,
+ )
+ )
+ sub_docs = [sub_doc for sub_doc, _ in sub_docs_and_similarities]
+ else:
+ sub_docs = await self.vectorstore.asimilarity_search(
+ query,
+ **self.search_kwargs,
+ )
+
+ # We do this to maintain the order of the IDs that are returned
+ ids = []
+ for d in sub_docs:
+ if self.id_key in d.metadata and d.metadata[self.id_key] not in ids:
+ ids.append(d.metadata[self.id_key])
+ docs = await self.docstore.amget(ids)
+ return [d for d in docs if d is not None]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/outline.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/outline.py
new file mode 100644
index 0000000000000000000000000000000000000000..871b332b9acae55f4d191e6f0728834be18cee75
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/outline.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import OutlineRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OutlineRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OutlineRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/parent_document_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/parent_document_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..635f320f21f7ca5638fce3f769056aec1f15b61d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/parent_document_retriever.py
@@ -0,0 +1,176 @@
+import uuid
+from collections.abc import Sequence
+from typing import Any
+
+from langchain_core.documents import Document
+from langchain_text_splitters import TextSplitter
+
+from langchain_classic.retrievers import MultiVectorRetriever
+
+
+class ParentDocumentRetriever(MultiVectorRetriever):
+ """Retrieve small chunks then retrieve their parent documents.
+
+ When splitting documents for retrieval, there are often conflicting desires:
+
+ 1. You may want to have small documents, so that their embeddings can most
+ accurately reflect their meaning. If too long, then the embeddings can
+ lose meaning.
+ 2. You want to have long enough documents that the context of each chunk is
+ retained.
+
+ The ParentDocumentRetriever strikes that balance by splitting and storing
+ small chunks of data. During retrieval, it first fetches the small chunks
+ but then looks up the parent IDs for those chunks and returns those larger
+ documents.
+
+ Note that "parent document" refers to the document that a small chunk
+ originated from. This can either be the whole raw document OR a larger
+ chunk.
+
+ Examples:
+ ```python
+ from langchain_chroma import Chroma
+ from langchain_community.embeddings import OpenAIEmbeddings
+ from langchain_text_splitters import RecursiveCharacterTextSplitter
+ from langchain_classic.storage import InMemoryStore
+
+ # This text splitter is used to create the parent documents
+ parent_splitter = RecursiveCharacterTextSplitter(
+ chunk_size=2000, add_start_index=True
+ )
+ # This text splitter is used to create the child documents
+ # It should create documents smaller than the parent
+ child_splitter = RecursiveCharacterTextSplitter(
+ chunk_size=400, add_start_index=True
+ )
+ # The VectorStore to use to index the child chunks
+ vectorstore = Chroma(embedding_function=OpenAIEmbeddings())
+ # The storage layer for the parent documents
+ store = InMemoryStore()
+
+ # Initialize the retriever
+ retriever = ParentDocumentRetriever(
+ vectorstore=vectorstore,
+ docstore=store,
+ child_splitter=child_splitter,
+ parent_splitter=parent_splitter,
+ )
+ ```
+ """
+
+ child_splitter: TextSplitter
+ """The text splitter to use to create child documents."""
+
+ """The key to use to track the parent id. This will be stored in the
+ metadata of child documents."""
+ parent_splitter: TextSplitter | None = None
+ """The text splitter to use to create parent documents.
+ If none, then the parent documents will be the raw documents passed in."""
+
+ child_metadata_fields: Sequence[str] | None = None
+ """Metadata fields to leave in child documents. If `None`, leave all parent document
+ metadata.
+ """
+
+ def _split_docs_for_adding(
+ self,
+ documents: list[Document],
+ ids: list[str] | None = None,
+ *,
+ add_to_docstore: bool = True,
+ ) -> tuple[list[Document], list[tuple[str, Document]]]:
+ if self.parent_splitter is not None:
+ documents = self.parent_splitter.split_documents(documents)
+ if ids is None:
+ doc_ids = [str(uuid.uuid4()) for _ in documents]
+ if not add_to_docstore:
+ msg = "If IDs are not passed in, `add_to_docstore` MUST be True"
+ raise ValueError(msg)
+ else:
+ if len(documents) != len(ids):
+ msg = (
+ "Got uneven list of documents and ids. "
+ "If `ids` is provided, should be same length as `documents`."
+ )
+ raise ValueError(msg)
+ doc_ids = ids
+
+ docs = []
+ full_docs = []
+ for i, doc in enumerate(documents):
+ _id = doc_ids[i]
+ sub_docs = self.child_splitter.split_documents([doc])
+ if self.child_metadata_fields is not None:
+ for _doc in sub_docs:
+ _doc.metadata = {
+ k: _doc.metadata[k] for k in self.child_metadata_fields
+ }
+ for _doc in sub_docs:
+ _doc.metadata[self.id_key] = _id
+ docs.extend(sub_docs)
+ full_docs.append((_id, doc))
+
+ return docs, full_docs
+
+ def add_documents(
+ self,
+ documents: list[Document],
+ ids: list[str] | None = None,
+ add_to_docstore: bool = True, # noqa: FBT001,FBT002
+ **kwargs: Any,
+ ) -> None:
+ """Adds documents to the docstore and vectorstores.
+
+ Args:
+ documents: List of documents to add
+ ids: Optional list of IDs for documents. If provided should be the same
+ length as the list of documents. Can be provided if parent documents
+ are already in the document store and you don't want to re-add
+ to the docstore. If not provided, random UUIDs will be used as
+ IDs.
+ add_to_docstore: Boolean of whether to add documents to docstore.
+ This can be false if and only if `ids` are provided. You may want
+ to set this to False if the documents are already in the docstore
+ and you don't want to re-add them.
+ **kwargs: additional keyword arguments passed to the `VectorStore`.
+ """
+ docs, full_docs = self._split_docs_for_adding(
+ documents,
+ ids,
+ add_to_docstore=add_to_docstore,
+ )
+ self.vectorstore.add_documents(docs, **kwargs)
+ if add_to_docstore:
+ self.docstore.mset(full_docs)
+
+ async def aadd_documents(
+ self,
+ documents: list[Document],
+ ids: list[str] | None = None,
+ add_to_docstore: bool = True, # noqa: FBT001,FBT002
+ **kwargs: Any,
+ ) -> None:
+ """Adds documents to the docstore and vectorstores.
+
+ Args:
+ documents: List of documents to add
+ ids: Optional list of IDs for documents. If provided should be the same
+ length as the list of documents. Can be provided if parent documents
+ are already in the document store and you don't want to re-add
+ to the docstore. If not provided, random UUIDs will be used as
+ idIDss.
+ add_to_docstore: Boolean of whether to add documents to docstore.
+ This can be false if and only if `ids` are provided. You may want
+ to set this to False if the documents are already in the docstore
+ and you don't want to re-add them.
+ **kwargs: additional keyword arguments passed to the `VectorStore`.
+ """
+ docs, full_docs = self._split_docs_for_adding(
+ documents,
+ ids,
+ add_to_docstore=add_to_docstore,
+ )
+ await self.vectorstore.aadd_documents(docs, **kwargs)
+ if add_to_docstore:
+ await self.docstore.amset(full_docs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pinecone_hybrid_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pinecone_hybrid_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..e2bb10f5fa1814f79ecbfcac74100a226d9a4201
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pinecone_hybrid_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import PineconeHybridSearchRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PineconeHybridSearchRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PineconeHybridSearchRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pubmed.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pubmed.py
new file mode 100644
index 0000000000000000000000000000000000000000..775dd73dcd72327175e89aab10ee7d865dffdf5d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pubmed.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import PubMedRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PubMedRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PubMedRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pupmed.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pupmed.py
new file mode 100644
index 0000000000000000000000000000000000000000..775dd73dcd72327175e89aab10ee7d865dffdf5d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/pupmed.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import PubMedRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PubMedRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PubMedRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/re_phraser.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/re_phraser.py
new file mode 100644
index 0000000000000000000000000000000000000000..8d83a55c91b4eabe6791c6352ad66a7665fd5ccf
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/re_phraser.py
@@ -0,0 +1,92 @@
+import logging
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import Document
+from langchain_core.language_models import BaseLLM
+from langchain_core.output_parsers import StrOutputParser
+from langchain_core.prompts import BasePromptTemplate
+from langchain_core.prompts.prompt import PromptTemplate
+from langchain_core.retrievers import BaseRetriever
+from langchain_core.runnables import Runnable
+
+logger = logging.getLogger(__name__)
+
+# Default template
+DEFAULT_TEMPLATE = """You are an assistant tasked with taking a natural language \
+query from a user and converting it into a query for a vectorstore. \
+In this process, you strip out information that is not relevant for \
+the retrieval task. Here is the user query: {question}"""
+
+# Default prompt
+DEFAULT_QUERY_PROMPT = PromptTemplate.from_template(DEFAULT_TEMPLATE)
+
+
+class RePhraseQueryRetriever(BaseRetriever):
+ """Given a query, use an LLM to re-phrase it.
+
+ Then, retrieve docs for the re-phrased query.
+ """
+
+ retriever: BaseRetriever
+ llm_chain: Runnable
+
+ @classmethod
+ def from_llm(
+ cls,
+ retriever: BaseRetriever,
+ llm: BaseLLM,
+ prompt: BasePromptTemplate = DEFAULT_QUERY_PROMPT,
+ ) -> "RePhraseQueryRetriever":
+ """Initialize from llm using default template.
+
+ The prompt used here expects a single input: `question`
+
+ Args:
+ retriever: retriever to query documents from
+ llm: llm for query generation using DEFAULT_QUERY_PROMPT
+ prompt: prompt template for query generation
+
+ Returns:
+ RePhraseQueryRetriever
+ """
+ llm_chain = prompt | llm | StrOutputParser()
+ return cls(
+ retriever=retriever,
+ llm_chain=llm_chain,
+ )
+
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ """Get relevant documents given a user question.
+
+ Args:
+ query: user question
+ run_manager: callback handler to use
+
+ Returns:
+ Relevant documents for re-phrased question
+ """
+ re_phrased_question = self.llm_chain.invoke(
+ query,
+ {"callbacks": run_manager.get_child()},
+ )
+ logger.info("Re-phrased question: %s", re_phrased_question)
+ return self.retriever.invoke(
+ re_phrased_question,
+ config={"callbacks": run_manager.get_child()},
+ )
+
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ raise NotImplementedError
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/remote_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/remote_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..620c6d731a7a5316dd5dd0b02ff220e23f780e35
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/remote_retriever.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import RemoteLangChainRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RemoteLangChainRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RemoteLangChainRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/svm.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/svm.py
new file mode 100644
index 0000000000000000000000000000000000000000..dc8aec49f5730ea8b6d91dfad672949cd6e3301b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/svm.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import SVMRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SVMRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SVMRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/tavily_search_api.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/tavily_search_api.py
new file mode 100644
index 0000000000000000000000000000000000000000..6af7562f41c3aee268fa5a979e95b17ed6ab084e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/tavily_search_api.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import TavilySearchAPIRetriever
+ from langchain_community.retrievers.tavily_search_api import SearchDepth
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SearchDepth": "langchain_community.retrievers.tavily_search_api",
+ "TavilySearchAPIRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SearchDepth",
+ "TavilySearchAPIRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/tfidf.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/tfidf.py
new file mode 100644
index 0000000000000000000000000000000000000000..c3a824ee37d3245aa8d793a58b9749d1adae8ff8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/tfidf.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import TFIDFRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TFIDFRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TFIDFRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/time_weighted_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/time_weighted_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..7cba23e4bd35d380f34395241bcd0c55cf248c3c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/time_weighted_retriever.py
@@ -0,0 +1,198 @@
+import datetime
+from copy import deepcopy
+from typing import Any
+
+from langchain_core.callbacks import (
+ AsyncCallbackManagerForRetrieverRun,
+ CallbackManagerForRetrieverRun,
+)
+from langchain_core.documents import Document
+from langchain_core.retrievers import BaseRetriever
+from langchain_core.vectorstores import VectorStore
+from pydantic import ConfigDict, Field
+from typing_extensions import override
+
+
+def _get_hours_passed(time: datetime.datetime, ref_time: datetime.datetime) -> float:
+ """Get the hours passed between two datetimes."""
+ return (time - ref_time).total_seconds() / 3600
+
+
+class TimeWeightedVectorStoreRetriever(BaseRetriever):
+ """Time Weighted Vector Store Retriever.
+
+ Retriever that combines embedding similarity with recency in retrieving values.
+ """
+
+ vectorstore: VectorStore
+ """The `VectorStore` to store documents and determine salience."""
+
+ search_kwargs: dict = Field(default_factory=lambda: {"k": 100})
+ """Keyword arguments to pass to the `VectorStore` similarity search."""
+
+ # TODO: abstract as a queue
+ memory_stream: list[Document] = Field(default_factory=list)
+ """The memory_stream of documents to search through."""
+
+ decay_rate: float = Field(default=0.01)
+ """The exponential decay factor used as `(1.0-decay_rate)**(hrs_passed)`."""
+
+ k: int = 4
+ """The maximum number of documents to retrieve in a given call."""
+
+ other_score_keys: list[str] = []
+ """Other keys in the metadata to factor into the score, e.g. 'importance'."""
+
+ default_salience: float | None = None
+ """The salience to assign memories not retrieved from the vector store.
+
+ None assigns no salience to documents not fetched from the vector store.
+ """
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def _document_get_date(self, field: str, document: Document) -> datetime.datetime:
+ """Return the value of the date field of a document."""
+ if field in document.metadata:
+ if isinstance(document.metadata[field], float):
+ return datetime.datetime.fromtimestamp(document.metadata[field])
+ return document.metadata[field]
+ return datetime.datetime.now()
+
+ def _get_combined_score(
+ self,
+ document: Document,
+ vector_relevance: float | None,
+ current_time: datetime.datetime,
+ ) -> float:
+ """Return the combined score for a document."""
+ hours_passed = _get_hours_passed(
+ current_time,
+ self._document_get_date("last_accessed_at", document),
+ )
+ score = (1.0 - self.decay_rate) ** hours_passed
+ for key in self.other_score_keys:
+ if key in document.metadata:
+ score += document.metadata[key]
+ if vector_relevance is not None:
+ score += vector_relevance
+ return score
+
+ def get_salient_docs(self, query: str) -> dict[int, tuple[Document, float]]:
+ """Return documents that are salient to the query."""
+ docs_and_scores: list[tuple[Document, float]]
+ docs_and_scores = self.vectorstore.similarity_search_with_relevance_scores(
+ query,
+ **self.search_kwargs,
+ )
+ results = {}
+ for fetched_doc, relevance in docs_and_scores:
+ if "buffer_idx" in fetched_doc.metadata:
+ buffer_idx = fetched_doc.metadata["buffer_idx"]
+ doc = self.memory_stream[buffer_idx]
+ results[buffer_idx] = (doc, relevance)
+ return results
+
+ async def aget_salient_docs(self, query: str) -> dict[int, tuple[Document, float]]:
+ """Return documents that are salient to the query."""
+ docs_and_scores: list[tuple[Document, float]]
+ docs_and_scores = (
+ await self.vectorstore.asimilarity_search_with_relevance_scores(
+ query,
+ **self.search_kwargs,
+ )
+ )
+ results = {}
+ for fetched_doc, relevance in docs_and_scores:
+ if "buffer_idx" in fetched_doc.metadata:
+ buffer_idx = fetched_doc.metadata["buffer_idx"]
+ doc = self.memory_stream[buffer_idx]
+ results[buffer_idx] = (doc, relevance)
+ return results
+
+ def _get_rescored_docs(
+ self,
+ docs_and_scores: dict[Any, tuple[Document, float | None]],
+ ) -> list[Document]:
+ current_time = datetime.datetime.now()
+ rescored_docs = [
+ (doc, self._get_combined_score(doc, relevance, current_time))
+ for doc, relevance in docs_and_scores.values()
+ ]
+ rescored_docs.sort(key=lambda x: x[1], reverse=True)
+ result = []
+ # Ensure frequently accessed memories aren't forgotten
+ for doc, _ in rescored_docs[: self.k]:
+ # TODO: Update vector store doc once `update` method is exposed.
+ buffered_doc = self.memory_stream[doc.metadata["buffer_idx"]]
+ buffered_doc.metadata["last_accessed_at"] = current_time
+ result.append(buffered_doc)
+ return result
+
+ @override
+ def _get_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: CallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ docs_and_scores = {
+ doc.metadata["buffer_idx"]: (doc, self.default_salience)
+ for doc in self.memory_stream[-self.k :]
+ }
+ # If a doc is considered salient, update the salience score
+ docs_and_scores.update(self.get_salient_docs(query))
+ return self._get_rescored_docs(docs_and_scores)
+
+ @override
+ async def _aget_relevant_documents(
+ self,
+ query: str,
+ *,
+ run_manager: AsyncCallbackManagerForRetrieverRun,
+ ) -> list[Document]:
+ docs_and_scores = {
+ doc.metadata["buffer_idx"]: (doc, self.default_salience)
+ for doc in self.memory_stream[-self.k :]
+ }
+ # If a doc is considered salient, update the salience score
+ docs_and_scores.update(await self.aget_salient_docs(query))
+ return self._get_rescored_docs(docs_and_scores)
+
+ def add_documents(self, documents: list[Document], **kwargs: Any) -> list[str]:
+ """Add documents to vectorstore."""
+ current_time = kwargs.get("current_time")
+ if current_time is None:
+ current_time = datetime.datetime.now()
+ # Avoid mutating input documents
+ dup_docs = [deepcopy(d) for d in documents]
+ for i, doc in enumerate(dup_docs):
+ if "last_accessed_at" not in doc.metadata:
+ doc.metadata["last_accessed_at"] = current_time
+ if "created_at" not in doc.metadata:
+ doc.metadata["created_at"] = current_time
+ doc.metadata["buffer_idx"] = len(self.memory_stream) + i
+ self.memory_stream.extend(dup_docs)
+ return self.vectorstore.add_documents(dup_docs, **kwargs)
+
+ async def aadd_documents(
+ self,
+ documents: list[Document],
+ **kwargs: Any,
+ ) -> list[str]:
+ """Add documents to vectorstore."""
+ current_time = kwargs.get("current_time")
+ if current_time is None:
+ current_time = datetime.datetime.now()
+ # Avoid mutating input documents
+ dup_docs = [deepcopy(d) for d in documents]
+ for i, doc in enumerate(dup_docs):
+ if "last_accessed_at" not in doc.metadata:
+ doc.metadata["last_accessed_at"] = current_time
+ if "created_at" not in doc.metadata:
+ doc.metadata["created_at"] = current_time
+ doc.metadata["buffer_idx"] = len(self.memory_stream) + i
+ self.memory_stream.extend(dup_docs)
+ return await self.vectorstore.aadd_documents(dup_docs, **kwargs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/vespa_retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/vespa_retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..6a777fc78664a96780d90927c6d0d1bdefe29abb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/vespa_retriever.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import VespaRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"VespaRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VespaRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/weaviate_hybrid_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/weaviate_hybrid_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..f6a0a7c4e54c465d693bd5c113b5c182f49576aa
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/weaviate_hybrid_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import WeaviateHybridSearchRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WeaviateHybridSearchRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WeaviateHybridSearchRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/web_research.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/web_research.py
new file mode 100644
index 0000000000000000000000000000000000000000..c77b37d3bffc10dead6257e39f1802c7e71ecd9f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/web_research.py
@@ -0,0 +1,29 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers.web_research import (
+ QuestionListOutputParser,
+ SearchQueries,
+ WebResearchRetriever,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "QuestionListOutputParser": "langchain_community.retrievers.web_research",
+ "SearchQueries": "langchain_community.retrievers.web_research",
+ "WebResearchRetriever": "langchain_community.retrievers.web_research",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = ["QuestionListOutputParser", "SearchQueries", "WebResearchRetriever"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/wikipedia.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/wikipedia.py
new file mode 100644
index 0000000000000000000000000000000000000000..c1a7beeb0b740bd79b854c815d99edb2a5ab40f6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/wikipedia.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import WikipediaRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WikipediaRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WikipediaRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/you.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/you.py
new file mode 100644
index 0000000000000000000000000000000000000000..374dbff40d48106802f8593adb5da68991a0e994
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/you.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import YouRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"YouRetriever": "langchain_community.retrievers"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "YouRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/zep.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/zep.py
new file mode 100644
index 0000000000000000000000000000000000000000..f99db978b6d71793bb82638578a1f0d55ea13765
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/zep.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ZepRetriever
+ from langchain_community.retrievers.zep import SearchScope, SearchType
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SearchScope": "langchain_community.retrievers.zep",
+ "SearchType": "langchain_community.retrievers.zep",
+ "ZepRetriever": "langchain_community.retrievers",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SearchScope",
+ "SearchType",
+ "ZepRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/zilliz.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/zilliz.py
new file mode 100644
index 0000000000000000000000000000000000000000..be831e423083b59d709cf0a9fb7e079e956adc9e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/retrievers/zilliz.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.retrievers import ZillizRetriever
+ from langchain_community.retrievers.zilliz import ZillizRetreiver
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ZillizRetriever": "langchain_community.retrievers",
+ "ZillizRetreiver": "langchain_community.retrievers.zilliz",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ZillizRetreiver",
+ "ZillizRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..0a8b3c39f6cd765bfad4fbaa69d074c4c273f96f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/__init__.py
@@ -0,0 +1,18 @@
+"""LangChain **Runnable** and the **LangChain Expression Language (LCEL)**.
+
+The LangChain Expression Language (LCEL) offers a declarative method to build
+production-grade programs that harness the power of LLMs.
+
+Programs created using LCEL and LangChain Runnables inherently support
+synchronous, asynchronous, batch, and streaming operations.
+
+Support for **async** allows servers hosting the LCEL based programs
+to scale better for higher concurrent loads.
+
+**Batch** operations allow for processing multiple inputs in parallel.
+
+**Streaming** of intermediate outputs, as they're being generated, allows for
+creating more responsive UX.
+
+This module contains non-core Runnable classes.
+"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/hub.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/hub.py
new file mode 100644
index 0000000000000000000000000000000000000000..40293c8a6175cc2b8ce5fafff6424e4b77c3ee02
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/hub.py
@@ -0,0 +1,50 @@
+from typing import Any
+
+from langchain_core._api.deprecation import deprecated
+from langchain_core.runnables.base import RunnableBindingBase
+from langchain_core.runnables.utils import Input, Output
+
+
+@deprecated(
+ since="1.0.7",
+ removal="2.0.0",
+ message=(
+ "langchain_classic.hub.pull is deprecated. Use the LangSmith SDK instead."
+ ),
+)
+class HubRunnable(RunnableBindingBase[Input, Output]): # type: ignore[no-redef]
+ """An instance of a runnable stored in the LangChain Hub."""
+
+ owner_repo_commit: str
+
+ def __init__(
+ self,
+ owner_repo_commit: str,
+ *,
+ api_url: str | None = None,
+ api_key: str | None = None,
+ **kwargs: Any,
+ ) -> None:
+ """Initialize the `HubRunnable`.
+
+ Args:
+ owner_repo_commit: The full name of the prompt to pull from in the format of
+ `owner/prompt_name:commit_hash` or `owner/prompt_name`
+ or just `prompt_name` if it's your own prompt.
+ api_url: The URL of the LangChain Hub API.
+ Defaults to the hosted API service if you have an api key set,
+ or a localhost instance if not.
+ api_key: The API key to use to authenticate with the LangChain Hub API.
+ **kwargs: Additional keyword arguments to pass to the parent class.
+ """
+ from langchain_classic.hub import pull
+
+ pulled = pull(owner_repo_commit, api_url=api_url, api_key=api_key)
+ super_kwargs = {
+ "kwargs": {},
+ "config": {},
+ **kwargs,
+ "bound": pulled,
+ "owner_repo_commit": owner_repo_commit,
+ }
+ super().__init__(**super_kwargs)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/openai_functions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/openai_functions.py
new file mode 100644
index 0000000000000000000000000000000000000000..29f2194c855f491b9ce84488faf7d71c1c04a90b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/runnables/openai_functions.py
@@ -0,0 +1,54 @@
+from collections.abc import Callable, Mapping
+from operator import itemgetter
+from typing import Any
+
+from langchain_core.messages import BaseMessage
+from langchain_core.output_parsers.openai_functions import JsonOutputFunctionsParser
+from langchain_core.runnables import RouterRunnable, Runnable
+from langchain_core.runnables.base import RunnableBindingBase
+from typing_extensions import TypedDict
+
+
+class OpenAIFunction(TypedDict):
+ """A function description for `ChatOpenAI`."""
+
+ name: str
+ """The name of the function."""
+ description: str
+ """The description of the function."""
+ parameters: dict
+ """The parameters to the function."""
+
+
+class OpenAIFunctionsRouter(RunnableBindingBase[BaseMessage, Any]): # type: ignore[no-redef]
+ """A runnable that routes to the selected function."""
+
+ functions: list[OpenAIFunction] | None
+
+ def __init__(
+ self,
+ runnables: Mapping[
+ str,
+ Runnable[dict, Any] | Callable[[dict], Any],
+ ],
+ functions: list[OpenAIFunction] | None = None,
+ ):
+ """Initialize the `OpenAIFunctionsRouter`.
+
+ Args:
+ runnables: A mapping of function names to runnables.
+ functions: Optional list of functions to check against the runnables.
+ """
+ if functions is not None:
+ if len(functions) != len(runnables):
+ msg = "The number of functions does not match the number of runnables."
+ raise ValueError(msg)
+ if not all(func["name"] in runnables for func in functions):
+ msg = "One or more function names are not found in runnables."
+ raise ValueError(msg)
+ router = (
+ JsonOutputFunctionsParser(args_only=False)
+ | {"key": itemgetter("name"), "input": itemgetter("arguments")}
+ | RouterRunnable(runnables)
+ )
+ super().__init__(bound=router, kwargs={}, functions=functions)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..c957fe8b9a528c7d822eea6b22ab018dabd77666
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/__init__.py
@@ -0,0 +1,83 @@
+"""**Schemas** are the LangChain Base Classes and Interfaces."""
+
+from langchain_core.agents import AgentAction, AgentFinish
+from langchain_core.caches import BaseCache
+from langchain_core.chat_history import BaseChatMessageHistory
+from langchain_core.documents import BaseDocumentTransformer, Document
+from langchain_core.exceptions import LangChainException, OutputParserException
+from langchain_core.messages import (
+ AIMessage,
+ BaseMessage,
+ ChatMessage,
+ FunctionMessage,
+ HumanMessage,
+ SystemMessage,
+ _message_from_dict,
+ get_buffer_string,
+ messages_from_dict,
+ messages_to_dict,
+)
+from langchain_core.messages.base import message_to_dict
+from langchain_core.output_parsers import (
+ BaseLLMOutputParser,
+ BaseOutputParser,
+ StrOutputParser,
+)
+from langchain_core.outputs import (
+ ChatGeneration,
+ ChatResult,
+ Generation,
+ LLMResult,
+ RunInfo,
+)
+from langchain_core.prompt_values import PromptValue
+from langchain_core.prompts import BasePromptTemplate, format_document
+from langchain_core.retrievers import BaseRetriever
+from langchain_core.stores import BaseStore
+
+from langchain_classic.base_memory import BaseMemory
+
+RUN_KEY = "__run"
+
+# Backwards compatibility.
+Memory = BaseMemory
+_message_to_dict = message_to_dict
+
+__all__ = [
+ "RUN_KEY",
+ "AIMessage",
+ "AgentAction",
+ "AgentFinish",
+ "BaseCache",
+ "BaseChatMessageHistory",
+ "BaseDocumentTransformer",
+ "BaseLLMOutputParser",
+ "BaseMemory",
+ "BaseMessage",
+ "BaseOutputParser",
+ "BasePromptTemplate",
+ "BaseRetriever",
+ "BaseStore",
+ "ChatGeneration",
+ "ChatMessage",
+ "ChatResult",
+ "Document",
+ "FunctionMessage",
+ "Generation",
+ "HumanMessage",
+ "LLMResult",
+ "LangChainException",
+ "Memory",
+ "OutputParserException",
+ "PromptValue",
+ "RunInfo",
+ "StrOutputParser",
+ "SystemMessage",
+ "_message_from_dict",
+ "_message_to_dict",
+ "format_document",
+ "get_buffer_string",
+ "message_to_dict",
+ "messages_from_dict",
+ "messages_to_dict",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/agent.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/agent.py
new file mode 100644
index 0000000000000000000000000000000000000000..498a4aea7c542e3e73b4725be20f7b57da12a2d9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/agent.py
@@ -0,0 +1,3 @@
+from langchain_core.agents import AgentAction, AgentActionMessageLog, AgentFinish
+
+__all__ = ["AgentAction", "AgentActionMessageLog", "AgentFinish"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/cache.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/cache.py
new file mode 100644
index 0000000000000000000000000000000000000000..d74e1c4cae668386905e0d93a6d82cf81c310ce3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/cache.py
@@ -0,0 +1,3 @@
+from langchain_core.caches import RETURN_VAL_TYPE, BaseCache
+
+__all__ = ["RETURN_VAL_TYPE", "BaseCache"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/chat.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/chat.py
new file mode 100644
index 0000000000000000000000000000000000000000..1f9080f8f372ad16c3a1fe3d7bc61896802d2eda
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/chat.py
@@ -0,0 +1,3 @@
+from langchain_core.chat_sessions import ChatSession
+
+__all__ = ["ChatSession"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/chat_history.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/chat_history.py
new file mode 100644
index 0000000000000000000000000000000000000000..08dcffe47ec6086a32f4706e9ee70df70ef8f06d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/chat_history.py
@@ -0,0 +1,3 @@
+from langchain_core.chat_history import BaseChatMessageHistory
+
+__all__ = ["BaseChatMessageHistory"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/document.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/document.py
new file mode 100644
index 0000000000000000000000000000000000000000..266f6afbae9284a5e0d36494961fbc6c70a2bd92
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/document.py
@@ -0,0 +1,3 @@
+from langchain_core.documents import BaseDocumentTransformer, Document
+
+__all__ = ["BaseDocumentTransformer", "Document"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/embeddings.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/embeddings.py
new file mode 100644
index 0000000000000000000000000000000000000000..dd38b6276e1b8411176a950b40ff7668ade9e097
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/embeddings.py
@@ -0,0 +1,3 @@
+from langchain_core.embeddings import Embeddings
+
+__all__ = ["Embeddings"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/exceptions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/exceptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..a26216c688b51c81dbf568eec41532a50906becb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/exceptions.py
@@ -0,0 +1,3 @@
+from langchain_core.exceptions import LangChainException
+
+__all__ = ["LangChainException"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/language_model.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/language_model.py
new file mode 100644
index 0000000000000000000000000000000000000000..99e5921dd83a96a95d91f0abca5d5081f3719133
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/language_model.py
@@ -0,0 +1,15 @@
+from langchain_core.language_models import (
+ BaseLanguageModel,
+ LanguageModelInput,
+ LanguageModelOutput,
+ get_tokenizer,
+)
+from langchain_core.language_models.base import _get_token_ids_default_method
+
+__all__ = [
+ "BaseLanguageModel",
+ "LanguageModelInput",
+ "LanguageModelOutput",
+ "_get_token_ids_default_method",
+ "get_tokenizer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..238d3283936a79a3f17cd223b00b789808fa0b18
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/memory.py
@@ -0,0 +1,3 @@
+from langchain_classic.base_memory import BaseMemory
+
+__all__ = ["BaseMemory"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/messages.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/messages.py
new file mode 100644
index 0000000000000000000000000000000000000000..0cae2fa4a858fdc3f06443aef60d26753d744548
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/messages.py
@@ -0,0 +1,51 @@
+from langchain_core.messages import (
+ AIMessage,
+ AIMessageChunk,
+ AnyMessage,
+ BaseMessage,
+ BaseMessageChunk,
+ ChatMessage,
+ ChatMessageChunk,
+ FunctionMessage,
+ FunctionMessageChunk,
+ HumanMessage,
+ HumanMessageChunk,
+ SystemMessage,
+ SystemMessageChunk,
+ ToolMessage,
+ ToolMessageChunk,
+ _message_from_dict,
+ get_buffer_string,
+ merge_content,
+ message_to_dict,
+ messages_from_dict,
+ messages_to_dict,
+)
+
+# Backwards compatibility.
+_message_to_dict = message_to_dict
+
+__all__ = [
+ "AIMessage",
+ "AIMessageChunk",
+ "AnyMessage",
+ "BaseMessage",
+ "BaseMessageChunk",
+ "ChatMessage",
+ "ChatMessageChunk",
+ "FunctionMessage",
+ "FunctionMessageChunk",
+ "HumanMessage",
+ "HumanMessageChunk",
+ "SystemMessage",
+ "SystemMessageChunk",
+ "ToolMessage",
+ "ToolMessageChunk",
+ "_message_from_dict",
+ "_message_to_dict",
+ "get_buffer_string",
+ "merge_content",
+ "message_to_dict",
+ "messages_from_dict",
+ "messages_to_dict",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/output.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/output.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb08d5751e8fc62ecd05ea12e15dc64e401d300b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/output.py
@@ -0,0 +1,19 @@
+from langchain_core.outputs import (
+ ChatGeneration,
+ ChatGenerationChunk,
+ ChatResult,
+ Generation,
+ GenerationChunk,
+ LLMResult,
+ RunInfo,
+)
+
+__all__ = [
+ "ChatGeneration",
+ "ChatGenerationChunk",
+ "ChatResult",
+ "Generation",
+ "GenerationChunk",
+ "LLMResult",
+ "RunInfo",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/output_parser.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/output_parser.py
new file mode 100644
index 0000000000000000000000000000000000000000..0b2652cafdd38dbe658831a18109860fde4549d6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/output_parser.py
@@ -0,0 +1,25 @@
+from langchain_core.exceptions import OutputParserException
+from langchain_core.output_parsers import (
+ BaseCumulativeTransformOutputParser,
+ BaseGenerationOutputParser,
+ BaseLLMOutputParser,
+ BaseOutputParser,
+ BaseTransformOutputParser,
+ StrOutputParser,
+)
+from langchain_core.output_parsers.base import T
+
+# Backwards compatibility.
+NoOpOutputParser = StrOutputParser
+
+__all__ = [
+ "BaseCumulativeTransformOutputParser",
+ "BaseGenerationOutputParser",
+ "BaseLLMOutputParser",
+ "BaseOutputParser",
+ "BaseTransformOutputParser",
+ "NoOpOutputParser",
+ "OutputParserException",
+ "StrOutputParser",
+ "T",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..8b3e3c444514f74e71f5c52287fc0c17f95c3223
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/prompt.py
@@ -0,0 +1,3 @@
+from langchain_core.prompt_values import PromptValue
+
+__all__ = ["PromptValue"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/prompt_template.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/prompt_template.py
new file mode 100644
index 0000000000000000000000000000000000000000..49a3595b036dcee4f18f52aa6274effd39117e10
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/prompt_template.py
@@ -0,0 +1,3 @@
+from langchain_core.prompts import BasePromptTemplate, format_document
+
+__all__ = ["BasePromptTemplate", "format_document"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..ca795d341dd41c9f870cb94af76b400cf169ba5e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/retriever.py
@@ -0,0 +1,3 @@
+from langchain_core.retrievers import BaseRetriever
+
+__all__ = ["BaseRetriever"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/storage.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/storage.py
new file mode 100644
index 0000000000000000000000000000000000000000..70d6925a4fd28717ae3da52e8cde8a0e8bb9f590
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/storage.py
@@ -0,0 +1,3 @@
+from langchain_core.stores import BaseStore, K, V
+
+__all__ = ["BaseStore", "K", "V"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/vectorstore.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/vectorstore.py
new file mode 100644
index 0000000000000000000000000000000000000000..4accfef0b84d81a69152bc9ecb5ee39847a77510
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/schema/vectorstore.py
@@ -0,0 +1,3 @@
+from langchain_core.vectorstores import VST, VectorStore, VectorStoreRetriever
+
+__all__ = ["VST", "VectorStore", "VectorStoreRetriever"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/smith/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/smith/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..a744151182c94f0196c0a92ec732097e264dc7a9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/smith/__init__.py
@@ -0,0 +1,116 @@
+"""**LangSmith** utilities.
+
+This module provides utilities for connecting to
+[LangSmith](https://docs.langchain.com/langsmith/home).
+
+**Evaluation**
+
+LangSmith helps you evaluate Chains and other language model application components
+using a number of LangChain evaluators.
+An example of this is shown below, assuming you've created a LangSmith dataset
+called ``:
+
+```python
+from langsmith import Client
+from langchain_openai import ChatOpenAI
+from langchain_classic.chains import LLMChain
+from langchain_classic.smith import RunEvalConfig, run_on_dataset
+
+
+# Chains may have memory. Passing in a constructor function lets the
+# evaluation framework avoid cross-contamination between runs.
+def construct_chain():
+ model = ChatOpenAI(temperature=0)
+ chain = LLMChain.from_string(model, "What's the answer to {your_input_key}")
+ return chain
+
+
+# Load off-the-shelf evaluators via config or the EvaluatorType (string or enum)
+evaluation_config = RunEvalConfig(
+ evaluators=[
+ "qa", # "Correctness" against a reference answer
+ "embedding_distance",
+ RunEvalConfig.Criteria("helpfulness"),
+ RunEvalConfig.Criteria(
+ {
+ "fifth-grader-score": "Do you have to be smarter than a fifth "
+ "grader to answer this question?"
+ }
+ ),
+ ]
+)
+
+client = Client()
+run_on_dataset(
+ client,
+ "",
+ construct_chain,
+ evaluation=evaluation_config,
+)
+```
+
+You can also create custom evaluators by subclassing the
+`StringEvaluator `
+or LangSmith's `RunEvaluator` classes.
+
+```python
+from typing import Optional
+from langchain_classic.evaluation import StringEvaluator
+
+
+class MyStringEvaluator(StringEvaluator):
+ @property
+ def requires_input(self) -> bool:
+ return False
+
+ @property
+ def requires_reference(self) -> bool:
+ return True
+
+ @property
+ def evaluation_name(self) -> str:
+ return "exact_match"
+
+ def _evaluate_strings(
+ self, prediction, reference=None, input=None, **kwargs
+ ) -> dict:
+ return {"score": prediction == reference}
+
+
+evaluation_config = RunEvalConfig(
+ custom_evaluators=[MyStringEvaluator()],
+)
+
+run_on_dataset(
+ client,
+ "",
+ construct_chain,
+ evaluation=evaluation_config,
+)
+```
+
+**Primary Functions**
+
+- `arun_on_dataset `:
+ Asynchronous function to evaluate a chain, agent, or other LangChain component over
+ a dataset.
+- `run_on_dataset `:
+ Function to evaluate a chain, agent, or other LangChain component over a dataset.
+- `RunEvalConfig `:
+ Class representing the configuration for running evaluation.
+ You can select evaluators by
+ `EvaluatorType ` or config,
+ or you can pass in `custom_evaluators`.
+"""
+
+from langchain_classic.smith.evaluation import (
+ RunEvalConfig,
+ arun_on_dataset,
+ run_on_dataset,
+)
+
+__all__ = [
+ "RunEvalConfig",
+ "arun_on_dataset",
+ "run_on_dataset",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..8c894ccf522bf146e79bc1f4480156812083ecff
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/__init__.py
@@ -0,0 +1,57 @@
+"""Implementations of key-value stores and storage helpers.
+
+Module provides implementations of various key-value stores that conform
+to a simple key-value interface.
+
+The primary goal of these storages is to support implementation of caching.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.stores import (
+ InMemoryByteStore,
+ InMemoryStore,
+ InvalidKeyException,
+)
+
+from langchain_classic._api import create_importer
+from langchain_classic.storage._lc_store import create_kv_docstore, create_lc_store
+from langchain_classic.storage.encoder_backed import EncoderBackedStore
+from langchain_classic.storage.file_system import LocalFileStore
+
+if TYPE_CHECKING:
+ from langchain_community.storage import (
+ RedisStore,
+ UpstashRedisByteStore,
+ UpstashRedisStore,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "RedisStore": "langchain_community.storage",
+ "UpstashRedisByteStore": "langchain_community.storage",
+ "UpstashRedisStore": "langchain_community.storage",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "EncoderBackedStore",
+ "InMemoryByteStore",
+ "InMemoryStore",
+ "InvalidKeyException",
+ "LocalFileStore",
+ "RedisStore",
+ "UpstashRedisByteStore",
+ "UpstashRedisStore",
+ "create_kv_docstore",
+ "create_lc_store",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/_lc_store.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/_lc_store.py
new file mode 100644
index 0000000000000000000000000000000000000000..1a7ca26f0f7396c4971936cac3d481fc548db186
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/_lc_store.py
@@ -0,0 +1,120 @@
+"""Create a key-value store for any langchain serializable object."""
+
+from collections.abc import Callable
+from typing import Any
+
+from langchain_core.documents import Document
+from langchain_core.load import Serializable, dumps, loads
+from langchain_core.stores import BaseStore, ByteStore
+
+from langchain_classic.storage.encoder_backed import EncoderBackedStore
+
+
+def _dump_as_bytes(obj: Serializable) -> bytes:
+ """Return a bytes representation of a `Document`."""
+ return dumps(obj).encode("utf-8")
+
+
+def _dump_document_as_bytes(obj: Any) -> bytes:
+ """Return a bytes representation of a `Document`."""
+ if not isinstance(obj, Document):
+ msg = "Expected a Document instance"
+ raise TypeError(msg)
+ return dumps(obj).encode("utf-8")
+
+
+def _load_document_from_bytes(serialized: bytes) -> Document:
+ """Return a document from a bytes representation."""
+ obj = loads(serialized.decode("utf-8"), allowed_objects=[Document])
+ if not isinstance(obj, Document):
+ msg = f"Expected a Document instance. Got {type(obj)}"
+ raise TypeError(msg)
+ return obj
+
+
+def _load_from_bytes(serialized: bytes) -> Serializable:
+ """Return a `Serializable` from a bytes representation."""
+ # The default allowlist (`'core'`) is unsafe with untrusted input - a
+ # tampered byte payload can reconstruct any core class with
+ # attacker-controlled kwargs (custom `base_url`, headers, model name,
+ # etc.). The byte store backing this loader must be treated as a trust
+ # boundary - see the danger note on `create_lc_store`. If the store can
+ # be written to by anyone you do not already trust, use
+ # `create_kv_docstore` instead.
+ return loads(serialized.decode("utf-8"))
+
+
+def _identity(x: str) -> str:
+ """Return the same object."""
+ return x
+
+
+# PUBLIC API
+
+
+def create_lc_store(
+ store: ByteStore,
+ *,
+ key_encoder: Callable[[str], str] | None = None,
+) -> BaseStore[str, Serializable]:
+ """Create a store for LangChain serializable objects from a bytes store.
+
+ !!! danger "Treat the underlying byte store as a trust boundary"
+
+ Reads from this store are deserialized with
+ `langchain_core.load.loads`, which instantiates Python objects from
+ the stored payload. The same threat model applies: a payload can
+ carry constructor kwargs (custom `base_url`, headers, model name,
+ etc.) that get applied during `__init__`, so the bytes are
+ effectively executable configuration rather than plain data.
+
+ **Never back this store with anything an attacker can write to** —
+ for example a shared cache that other tenants can populate, an
+ S3 bucket without strict write controls, or a Redis instance reused
+ across trust boundaries. A single tampered value will instantiate
+ attacker-controlled classes the next time the store is read.
+
+ If you cannot guarantee the store is write-restricted to your own
+ process, use `create_kv_docstore` instead — it pins
+ `allowed_objects=[Document]` so a tampered value can at worst
+ produce a `Document`, never a chat model or LLM with a redirected
+ endpoint.
+
+ Args:
+ store: A bytes store to use as the underlying store.
+ key_encoder: A function to encode keys; if `None` uses identity function.
+
+ Returns:
+ A key-value store for `Document` objects.
+ """
+ return EncoderBackedStore(
+ store,
+ key_encoder or _identity,
+ _dump_as_bytes,
+ _load_from_bytes,
+ )
+
+
+def create_kv_docstore(
+ store: ByteStore,
+ *,
+ key_encoder: Callable[[str], str] | None = None,
+) -> BaseStore[str, Document]:
+ """Create a store for langchain `Document` objects from a bytes store.
+
+ This store does run time type checking to ensure that the values are
+ `Document` objects.
+
+ Args:
+ store: A bytes store to use as the underlying store.
+ key_encoder: A function to encode keys; if `None`, uses identity function.
+
+ Returns:
+ A key-value store for `Document` objects.
+ """
+ return EncoderBackedStore(
+ store,
+ key_encoder or _identity,
+ _dump_document_as_bytes,
+ _load_document_from_bytes,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/encoder_backed.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/encoder_backed.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e5cefb7a826caab253d782fe94c84b797bf5b6d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/encoder_backed.py
@@ -0,0 +1,181 @@
+from collections.abc import AsyncIterator, Callable, Iterator, Sequence
+from typing import (
+ Any,
+ TypeVar,
+)
+
+from langchain_core.stores import BaseStore
+
+K = TypeVar("K")
+V = TypeVar("V")
+
+
+class EncoderBackedStore(BaseStore[K, V]):
+ """Wraps a store with key and value encoders/decoders.
+
+ Examples that uses JSON for encoding/decoding:
+
+ ```python
+ import json
+
+
+ def key_encoder(key: int) -> str:
+ return json.dumps(key)
+
+
+ def value_serializer(value: float) -> str:
+ return json.dumps(value)
+
+
+ def value_deserializer(serialized_value: str) -> float:
+ return json.loads(serialized_value)
+
+
+ # Create an instance of the abstract store
+ abstract_store = MyCustomStore()
+
+ # Create an instance of the encoder-backed store
+ store = EncoderBackedStore(
+ store=abstract_store,
+ key_encoder=key_encoder,
+ value_serializer=value_serializer,
+ value_deserializer=value_deserializer,
+ )
+
+ # Use the encoder-backed store methods
+ store.mset([(1, 3.14), (2, 2.718)])
+ values = store.mget([1, 2]) # Retrieves [3.14, 2.718]
+ store.mdelete([1, 2]) # Deletes the keys 1 and 2
+ ```
+ """
+
+ def __init__(
+ self,
+ store: BaseStore[str, Any],
+ key_encoder: Callable[[K], str],
+ value_serializer: Callable[[V], bytes],
+ value_deserializer: Callable[[Any], V],
+ ) -> None:
+ """Initialize an `EncodedStore`.
+
+ Args:
+ store: The underlying byte store to wrap.
+ key_encoder: Function to encode keys from type `K` to strings.
+ value_serializer: Function to serialize values from type `V` to bytes.
+ value_deserializer: Function to deserialize bytes back to type V.
+ """
+ self.store = store
+ self.key_encoder = key_encoder
+ self.value_serializer = value_serializer
+ self.value_deserializer = value_deserializer
+
+ def mget(self, keys: Sequence[K]) -> list[V | None]:
+ """Get the values associated with the given keys.
+
+ Args:
+ keys: A sequence of keys.
+
+ Returns:
+ A sequence of optional values associated with the keys.
+ If a key is not found, the corresponding value will be `None`.
+ """
+ encoded_keys: list[str] = [self.key_encoder(key) for key in keys]
+ values = self.store.mget(encoded_keys)
+ return [
+ self.value_deserializer(value) if value is not None else value
+ for value in values
+ ]
+
+ async def amget(self, keys: Sequence[K]) -> list[V | None]:
+ """Async get the values associated with the given keys.
+
+ Args:
+ keys: A sequence of keys.
+
+ Returns:
+ A sequence of optional values associated with the keys.
+ If a key is not found, the corresponding value will be `None`.
+ """
+ encoded_keys: list[str] = [self.key_encoder(key) for key in keys]
+ values = await self.store.amget(encoded_keys)
+ return [
+ self.value_deserializer(value) if value is not None else value
+ for value in values
+ ]
+
+ def mset(self, key_value_pairs: Sequence[tuple[K, V]]) -> None:
+ """Set the values for the given keys.
+
+ Args:
+ key_value_pairs: A sequence of key-value pairs.
+ """
+ encoded_pairs = [
+ (self.key_encoder(key), self.value_serializer(value))
+ for key, value in key_value_pairs
+ ]
+ self.store.mset(encoded_pairs)
+
+ async def amset(self, key_value_pairs: Sequence[tuple[K, V]]) -> None:
+ """Async set the values for the given keys.
+
+ Args:
+ key_value_pairs: A sequence of key-value pairs.
+ """
+ encoded_pairs = [
+ (self.key_encoder(key), self.value_serializer(value))
+ for key, value in key_value_pairs
+ ]
+ await self.store.amset(encoded_pairs)
+
+ def mdelete(self, keys: Sequence[K]) -> None:
+ """Delete the given keys and their associated values.
+
+ Args:
+ keys: A sequence of keys to delete.
+ """
+ encoded_keys = [self.key_encoder(key) for key in keys]
+ self.store.mdelete(encoded_keys)
+
+ async def amdelete(self, keys: Sequence[K]) -> None:
+ """Async delete the given keys and their associated values.
+
+ Args:
+ keys: A sequence of keys to delete.
+ """
+ encoded_keys = [self.key_encoder(key) for key in keys]
+ await self.store.amdelete(encoded_keys)
+
+ def yield_keys(
+ self,
+ *,
+ prefix: str | None = None,
+ ) -> Iterator[K] | Iterator[str]:
+ """Get an iterator over keys that match the given prefix.
+
+ Args:
+ prefix: The prefix to match.
+
+ Yields:
+ Keys that match the given prefix.
+ """
+ # For the time being this does not return K, but str
+ # it's for debugging purposes. Should fix this.
+ yield from self.store.yield_keys(prefix=prefix)
+
+ async def ayield_keys(
+ self,
+ *,
+ prefix: str | None = None,
+ ) -> AsyncIterator[K] | AsyncIterator[str]:
+ """Async get an iterator over keys that match the given prefix.
+
+ Args:
+ prefix: The prefix to match.
+
+ Yields:
+ Keys that match the given prefix.
+ """
+ # For the time being this does not return K, but str
+ # it's for debugging purposes. Should fix this.
+ async for key in self.store.ayield_keys(prefix=prefix):
+ yield key
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/exceptions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/exceptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..82d7c8a2fa2cd5b128de8102658e12b95dc9c50b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/exceptions.py
@@ -0,0 +1,3 @@
+from langchain_core.stores import InvalidKeyException
+
+__all__ = ["InvalidKeyException"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/file_system.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/file_system.py
new file mode 100644
index 0000000000000000000000000000000000000000..047162e7be97cae2efa563ada0ff9e9325ea6a95
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/file_system.py
@@ -0,0 +1,164 @@
+import os
+import re
+import time
+from collections.abc import Iterator, Sequence
+from pathlib import Path
+
+from langchain_core.stores import ByteStore
+
+from langchain_classic.storage.exceptions import InvalidKeyException
+
+
+class LocalFileStore(ByteStore):
+ """`BaseStore` interface that works on the local file system.
+
+ Examples:
+ Create a `LocalFileStore` instance and perform operations on it:
+
+ ```python
+ from langchain_classic.storage import LocalFileStore
+
+ # Instantiate the LocalFileStore with the root path
+ file_store = LocalFileStore("/path/to/root")
+
+ # Set values for keys
+ file_store.mset([("key1", b"value1"), ("key2", b"value2")])
+
+ # Get values for keys
+ values = file_store.mget(["key1", "key2"]) # Returns [b"value1", b"value2"]
+
+ # Delete keys
+ file_store.mdelete(["key1"])
+
+ # Iterate over keys
+ for key in file_store.yield_keys():
+ print(key) # noqa: T201
+ ```
+ """
+
+ def __init__(
+ self,
+ root_path: str | Path,
+ *,
+ chmod_file: int | None = None,
+ chmod_dir: int | None = None,
+ update_atime: bool = False,
+ ) -> None:
+ """Implement the `BaseStore` interface for the local file system.
+
+ Args:
+ root_path: The root path of the file store. All keys are interpreted as
+ paths relative to this root.
+ chmod_file: Sets permissions for newly created files, overriding the
+ current `umask` if needed.
+ chmod_dir: Sets permissions for newly created dirs, overriding the
+ current `umask` if needed.
+ update_atime: Updates the filesystem access time (but not the modified
+ time) when a file is read. This allows MRU/LRU cache policies to be
+ implemented for filesystems where access time updates are disabled.
+ """
+ self.root_path = Path(root_path).absolute()
+ self.chmod_file = chmod_file
+ self.chmod_dir = chmod_dir
+ self.update_atime = update_atime
+
+ def _get_full_path(self, key: str) -> Path:
+ """Get the full path for a given key relative to the root path.
+
+ Args:
+ key: The key relative to the root path.
+
+ Returns:
+ The full path for the given key.
+ """
+ if not re.match(r"^[a-zA-Z0-9_.\-/]+$", key):
+ msg = f"Invalid characters in key: {key}"
+ raise InvalidKeyException(msg)
+ full_path = (self.root_path / key).resolve()
+ root_path = self.root_path.resolve()
+ common_path = os.path.commonpath([root_path, full_path])
+ if common_path != str(root_path):
+ msg = (
+ f"Invalid key: {key}. Key should be relative to the full path. "
+ f"{root_path} vs. {common_path} and full path of {full_path}"
+ )
+ raise InvalidKeyException(msg)
+
+ return full_path
+
+ def _mkdir_for_store(self, dir_path: Path) -> None:
+ """Makes a store directory path (including parents) with specified permissions.
+
+ This is needed because `Path.mkdir()` is restricted by the current `umask`,
+ whereas the explicit `os.chmod()` used here is not.
+
+ Args:
+ dir_path: The store directory to make.
+ """
+ if not dir_path.exists():
+ self._mkdir_for_store(dir_path.parent)
+ dir_path.mkdir(exist_ok=True)
+ if self.chmod_dir is not None:
+ dir_path.chmod(self.chmod_dir)
+
+ def mget(self, keys: Sequence[str]) -> list[bytes | None]:
+ """Get the values associated with the given keys.
+
+ Args:
+ keys: A sequence of keys.
+
+ Returns:
+ A sequence of optional values associated with the keys.
+ If a key is not found, the corresponding value will be `None`.
+ """
+ values: list[bytes | None] = []
+ for key in keys:
+ full_path = self._get_full_path(key)
+ if full_path.exists():
+ value = full_path.read_bytes()
+ values.append(value)
+ if self.update_atime:
+ # update access time only; preserve modified time
+ os.utime(full_path, (time.time(), full_path.stat().st_mtime))
+ else:
+ values.append(None)
+ return values
+
+ def mset(self, key_value_pairs: Sequence[tuple[str, bytes]]) -> None:
+ """Set the values for the given keys.
+
+ Args:
+ key_value_pairs: A sequence of key-value pairs.
+ """
+ for key, value in key_value_pairs:
+ full_path = self._get_full_path(key)
+ self._mkdir_for_store(full_path.parent)
+ full_path.write_bytes(value)
+ if self.chmod_file is not None:
+ full_path.chmod(self.chmod_file)
+
+ def mdelete(self, keys: Sequence[str]) -> None:
+ """Delete the given keys and their associated values.
+
+ Args:
+ keys: A sequence of keys to delete.
+ """
+ for key in keys:
+ full_path = self._get_full_path(key)
+ if full_path.exists():
+ full_path.unlink()
+
+ def yield_keys(self, *, prefix: str | None = None) -> Iterator[str]:
+ """Get an iterator over keys that match the given prefix.
+
+ Args:
+ prefix: The prefix to match.
+
+ Yields:
+ Keys that match the given prefix.
+ """
+ prefix_path = self._get_full_path(prefix) if prefix else self.root_path
+ for file in prefix_path.rglob("*"):
+ if file.is_file():
+ relative_path = file.relative_to(self.root_path)
+ yield str(relative_path)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/in_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/in_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..296bc19a02d16383b76ea65806b4e9dcaa42a7b1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/in_memory.py
@@ -0,0 +1,13 @@
+"""In memory store that is not thread safe and has no eviction policy.
+
+This is a simple implementation of the BaseStore using a dictionary that is useful
+primarily for unit testing purposes.
+"""
+
+from langchain_core.stores import InMemoryBaseStore, InMemoryByteStore, InMemoryStore
+
+__all__ = [
+ "InMemoryBaseStore",
+ "InMemoryByteStore",
+ "InMemoryStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/redis.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/redis.py
new file mode 100644
index 0000000000000000000000000000000000000000..9d51d5305c3de81622ff2020f4a1045ea32511a9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/redis.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.storage import RedisStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"RedisStore": "langchain_community.storage"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RedisStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/upstash_redis.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/upstash_redis.py
new file mode 100644
index 0000000000000000000000000000000000000000..de97021dc6d0ed0b26f6570f2a85ff94fdc2c960
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/storage/upstash_redis.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.storage import UpstashRedisByteStore, UpstashRedisStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "UpstashRedisStore": "langchain_community.storage",
+ "UpstashRedisByteStore": "langchain_community.storage",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "UpstashRedisByteStore",
+ "UpstashRedisStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..0ab3c233f13a5026df2441a3b25def092fcd12d3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/__init__.py
@@ -0,0 +1,195 @@
+"""**Tools** are classes that an Agent uses to interact with the world.
+
+Each tool has a **description**. Agent uses the description to choose the right
+tool for the job.
+"""
+
+import warnings
+from typing import Any
+
+from langchain_core._api import LangChainDeprecationWarning
+from langchain_core.tools import (
+ BaseTool as BaseTool,
+)
+from langchain_core.tools import (
+ StructuredTool as StructuredTool,
+)
+from langchain_core.tools import (
+ Tool as Tool,
+)
+from langchain_core.tools.convert import tool as tool
+
+from langchain_classic._api.interactive_env import is_interactive_env
+
+# Used for internal purposes
+_DEPRECATED_TOOLS = {"PythonAstREPLTool", "PythonREPLTool"}
+
+
+def _import_python_tool_python_ast_repl_tool() -> Any:
+ msg = (
+ "This tool has been moved to langchain_experimental. "
+ "This tool has access to a python REPL. "
+ "For best practices make sure to sandbox this tool. "
+ "Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md "
+ "To keep using this code as is, install langchain_experimental and "
+ "update relevant imports replacing 'langchain' with 'langchain_experimental'"
+ )
+ raise ImportError(msg)
+
+
+def _import_python_tool_python_repl_tool() -> Any:
+ msg = (
+ "This tool has been moved to langchain_experimental. "
+ "This tool has access to a python REPL. "
+ "For best practices make sure to sandbox this tool. "
+ "Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md "
+ "To keep using this code as is, install langchain_experimental and "
+ "update relevant imports replacing 'langchain' with 'langchain_experimental'"
+ )
+ raise ImportError(msg)
+
+
+def __getattr__(name: str) -> Any:
+ if name == "PythonAstREPLTool":
+ return _import_python_tool_python_ast_repl_tool()
+ if name == "PythonREPLTool":
+ return _import_python_tool_python_repl_tool()
+ from langchain_community import tools
+
+ # If not in interactive env, raise warning.
+ if not is_interactive_env():
+ warnings.warn(
+ "Importing tools from langchain is deprecated. Importing from "
+ "langchain will no longer be supported as of langchain==0.2.0. "
+ "Please import from langchain-community instead:\n\n"
+ f"`from langchain_community.tools import {name}`.\n\n"
+ "To install langchain-community run "
+ "`pip install -U langchain-community`.",
+ stacklevel=2,
+ category=LangChainDeprecationWarning,
+ )
+
+ return getattr(tools, name)
+
+
+__all__ = [
+ "AINAppOps",
+ "AINOwnerOps",
+ "AINRuleOps",
+ "AINTransfer",
+ "AINValueOps",
+ "AIPluginTool",
+ "APIOperation",
+ "ArxivQueryRun",
+ "AzureCogsFormRecognizerTool",
+ "AzureCogsImageAnalysisTool",
+ "AzureCogsSpeech2TextTool",
+ "AzureCogsText2SpeechTool",
+ "AzureCogsTextAnalyticsHealthTool",
+ "BaseGraphQLTool",
+ "BaseRequestsTool",
+ "BaseSQLDatabaseTool",
+ "BaseSparkSQLTool",
+ "BaseTool",
+ "BearlyInterpreterTool",
+ "BingSearchResults",
+ "BingSearchRun",
+ "BraveSearch",
+ "ClickTool",
+ "CopyFileTool",
+ "CurrentWebPageTool",
+ "DeleteFileTool",
+ "DuckDuckGoSearchResults",
+ "DuckDuckGoSearchRun",
+ "E2BDataAnalysisTool",
+ "EdenAiExplicitImageTool",
+ "EdenAiObjectDetectionTool",
+ "EdenAiParsingIDTool",
+ "EdenAiParsingInvoiceTool",
+ "EdenAiSpeechToTextTool",
+ "EdenAiTextModerationTool",
+ "EdenAiTextToSpeechTool",
+ "EdenaiTool",
+ "ElevenLabsText2SpeechTool",
+ "ExtractHyperlinksTool",
+ "ExtractTextTool",
+ "FileSearchTool",
+ "GetElementsTool",
+ "GmailCreateDraft",
+ "GmailGetMessage",
+ "GmailGetThread",
+ "GmailSearch",
+ "GmailSendMessage",
+ "GoogleCloudTextToSpeechTool",
+ "GooglePlacesTool",
+ "GoogleSearchResults",
+ "GoogleSearchRun",
+ "GoogleSerperResults",
+ "GoogleSerperRun",
+ "HumanInputRun",
+ "IFTTTWebhook",
+ "InfoPowerBITool",
+ "InfoSQLDatabaseTool",
+ "InfoSparkSQLTool",
+ "JiraAction",
+ "JsonGetValueTool",
+ "JsonListKeysTool",
+ "ListDirectoryTool",
+ "ListPowerBITool",
+ "ListSQLDatabaseTool",
+ "ListSparkSQLTool",
+ "MerriamWebsterQueryRun",
+ "MetaphorSearchResults",
+ "MoveFileTool",
+ "NasaAction",
+ "NavigateBackTool",
+ "NavigateTool",
+ "O365CreateDraftMessage",
+ "O365SearchEmails",
+ "O365SearchEvents",
+ "O365SendEvent",
+ "O365SendMessage",
+ "OpenAPISpec",
+ "OpenWeatherMapQueryRun",
+ "PubmedQueryRun",
+ "QueryCheckerTool",
+ "QueryPowerBITool",
+ "QuerySQLCheckerTool",
+ "QuerySQLDataBaseTool",
+ "QuerySparkSQLTool",
+ "ReadFileTool",
+ "RedditSearchRun",
+ "RequestsDeleteTool",
+ "RequestsGetTool",
+ "RequestsPatchTool",
+ "RequestsPostTool",
+ "RequestsPutTool",
+ "SceneXplainTool",
+ "SearchAPIResults",
+ "SearchAPIRun",
+ "SearxSearchResults",
+ "SearxSearchRun",
+ "ShellTool",
+ "SlackGetChannel",
+ "SlackGetMessage",
+ "SlackScheduleMessage",
+ "SlackSendMessage",
+ "SleepTool",
+ "StackExchangeTool",
+ "StdInInquireTool",
+ "SteamWebAPIQueryRun",
+ "SteamshipImageGenerationTool",
+ "StructuredTool",
+ "Tool",
+ "VectorStoreQATool",
+ "VectorStoreQAWithSourcesTool",
+ "WikipediaQueryRun",
+ "WolframAlphaQueryRun",
+ "WriteFileTool",
+ "YahooFinanceNewsTool",
+ "YouTubeSearchTool",
+ "ZapierNLAListActions",
+ "ZapierNLARunAction",
+ "format_tool_to_openai_function",
+ "tool",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..ecacb95349e0ba30508b61b2080b7578816b3338
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/base.py
@@ -0,0 +1,19 @@
+from langchain_core.tools import (
+ BaseTool,
+ SchemaAnnotationError,
+ StructuredTool,
+ Tool,
+ ToolException,
+ create_schema_from_function,
+ tool,
+)
+
+__all__ = [
+ "BaseTool",
+ "SchemaAnnotationError",
+ "StructuredTool",
+ "Tool",
+ "ToolException",
+ "create_schema_from_function",
+ "tool",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/convert_to_openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/convert_to_openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..1e185e3d248dcb097eb51021dc3d779dc9850d99
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/convert_to_openai.py
@@ -0,0 +1,6 @@
+from langchain_core.utils.function_calling import (
+ convert_to_openai_function as format_tool_to_openai_function,
+)
+
+# For backwards compatibility
+__all__ = ["format_tool_to_openai_function"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/ifttt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/ifttt.py
new file mode 100644
index 0000000000000000000000000000000000000000..2043c508e61e47fb57df57eafe7125dd9b3213d4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/ifttt.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.tools import IFTTTWebhook
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"IFTTTWebhook": "langchain_community.tools"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "IFTTTWebhook",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/plugin.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/plugin.py
new file mode 100644
index 0000000000000000000000000000000000000000..b7292a8d52dc8e15a118b35a6c4d869219f728d1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/plugin.py
@@ -0,0 +1,32 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.tools import AIPluginTool
+ from langchain_community.tools.plugin import AIPlugin, AIPluginToolSchema, ApiConfig
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ApiConfig": "langchain_community.tools.plugin",
+ "AIPlugin": "langchain_community.tools.plugin",
+ "AIPluginToolSchema": "langchain_community.tools.plugin",
+ "AIPluginTool": "langchain_community.tools",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AIPlugin",
+ "AIPluginTool",
+ "AIPluginToolSchema",
+ "ApiConfig",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/render.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/render.py
new file mode 100644
index 0000000000000000000000000000000000000000..50604080499a16c4f842bf6943520f38c4a640de
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/render.py
@@ -0,0 +1,25 @@
+"""Different methods for rendering Tools to be passed to LLMs.
+
+Depending on the LLM you are using and the prompting strategy you are using,
+you may want Tools to be rendered in a different way.
+This module contains various ways to render tools.
+"""
+
+# For backwards compatibility
+from langchain_core.tools import (
+ render_text_description,
+ render_text_description_and_args,
+)
+from langchain_core.utils.function_calling import (
+ convert_to_openai_function as format_tool_to_openai_function,
+)
+from langchain_core.utils.function_calling import (
+ convert_to_openai_tool as format_tool_to_openai_tool,
+)
+
+__all__ = [
+ "format_tool_to_openai_function",
+ "format_tool_to_openai_tool",
+ "render_text_description",
+ "render_text_description_and_args",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/retriever.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/retriever.py
new file mode 100644
index 0000000000000000000000000000000000000000..39d2a52ecb0868b3d76cb13d5671a558f54e498b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/retriever.py
@@ -0,0 +1,11 @@
+from langchain_core.tools import (
+ create_retriever_tool,
+ render_text_description,
+ render_text_description_and_args,
+)
+
+__all__ = [
+ "create_retriever_tool",
+ "render_text_description",
+ "render_text_description_and_args",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/yahoo_finance_news.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/yahoo_finance_news.py
new file mode 100644
index 0000000000000000000000000000000000000000..365ffd4acc1e05caa70b3dcd8ee485297c001510
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/tools/yahoo_finance_news.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.tools import YahooFinanceNewsTool
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"YahooFinanceNewsTool": "langchain_community.tools"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "YahooFinanceNewsTool",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..190fc57e8c56296e1225876334050c4829d4ef8c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/__init__.py
@@ -0,0 +1,168 @@
+"""**Utilities** are the integrations with third-part systems and packages.
+
+Other LangChain classes use **Utilities** to interact with third-part systems
+and packages.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import (
+ AlphaVantageAPIWrapper,
+ ApifyWrapper,
+ ArceeWrapper,
+ ArxivAPIWrapper,
+ BibtexparserWrapper,
+ BingSearchAPIWrapper,
+ BraveSearchWrapper,
+ DuckDuckGoSearchAPIWrapper,
+ GoldenQueryAPIWrapper,
+ GoogleFinanceAPIWrapper,
+ GoogleJobsAPIWrapper,
+ GoogleLensAPIWrapper,
+ GooglePlacesAPIWrapper,
+ GoogleScholarAPIWrapper,
+ GoogleSearchAPIWrapper,
+ GoogleSerperAPIWrapper,
+ GoogleTrendsAPIWrapper,
+ GraphQLAPIWrapper,
+ JiraAPIWrapper,
+ LambdaWrapper,
+ MaxComputeAPIWrapper,
+ MerriamWebsterAPIWrapper,
+ MetaphorSearchAPIWrapper,
+ NasaAPIWrapper,
+ OpenWeatherMapAPIWrapper,
+ OutlineAPIWrapper,
+ Portkey,
+ PowerBIDataset,
+ PubMedAPIWrapper,
+ Requests,
+ RequestsWrapper,
+ SceneXplainAPIWrapper,
+ SearchApiAPIWrapper,
+ SearxSearchWrapper,
+ SerpAPIWrapper,
+ SparkSQL,
+ SQLDatabase,
+ StackExchangeAPIWrapper,
+ SteamWebAPIWrapper,
+ TensorflowDatasets,
+ TextRequestsWrapper,
+ TwilioAPIWrapper,
+ WikipediaAPIWrapper,
+ WolframAlphaAPIWrapper,
+ ZapierNLAWrapper,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AlphaVantageAPIWrapper": "langchain_community.utilities",
+ "ApifyWrapper": "langchain_community.utilities",
+ "ArceeWrapper": "langchain_community.utilities",
+ "ArxivAPIWrapper": "langchain_community.utilities",
+ "BibtexparserWrapper": "langchain_community.utilities",
+ "BingSearchAPIWrapper": "langchain_community.utilities",
+ "BraveSearchWrapper": "langchain_community.utilities",
+ "DuckDuckGoSearchAPIWrapper": "langchain_community.utilities",
+ "GoldenQueryAPIWrapper": "langchain_community.utilities",
+ "GoogleFinanceAPIWrapper": "langchain_community.utilities",
+ "GoogleLensAPIWrapper": "langchain_community.utilities",
+ "GoogleJobsAPIWrapper": "langchain_community.utilities",
+ "GooglePlacesAPIWrapper": "langchain_community.utilities",
+ "GoogleScholarAPIWrapper": "langchain_community.utilities",
+ "GoogleTrendsAPIWrapper": "langchain_community.utilities",
+ "GoogleSearchAPIWrapper": "langchain_community.utilities",
+ "GoogleSerperAPIWrapper": "langchain_community.utilities",
+ "GraphQLAPIWrapper": "langchain_community.utilities",
+ "JiraAPIWrapper": "langchain_community.utilities",
+ "LambdaWrapper": "langchain_community.utilities",
+ "MaxComputeAPIWrapper": "langchain_community.utilities",
+ "MerriamWebsterAPIWrapper": "langchain_community.utilities",
+ "MetaphorSearchAPIWrapper": "langchain_community.utilities",
+ "NasaAPIWrapper": "langchain_community.utilities",
+ "OpenWeatherMapAPIWrapper": "langchain_community.utilities",
+ "OutlineAPIWrapper": "langchain_community.utilities",
+ "Portkey": "langchain_community.utilities",
+ "PowerBIDataset": "langchain_community.utilities",
+ "PubMedAPIWrapper": "langchain_community.utilities",
+ # We will not list PythonREPL in __all__ since it has been removed from community
+ # it'll proxy to community package, which will raise an appropriate exception.
+ "PythonREPL": "langchain_community.utilities",
+ "Requests": "langchain_community.utilities",
+ "SteamWebAPIWrapper": "langchain_community.utilities",
+ "SQLDatabase": "langchain_community.utilities",
+ "SceneXplainAPIWrapper": "langchain_community.utilities",
+ "SearchApiAPIWrapper": "langchain_community.utilities",
+ "SearxSearchWrapper": "langchain_community.utilities",
+ "SerpAPIWrapper": "langchain_community.utilities",
+ "SparkSQL": "langchain_community.utilities",
+ "StackExchangeAPIWrapper": "langchain_community.utilities",
+ "TensorflowDatasets": "langchain_community.utilities",
+ "RequestsWrapper": "langchain_community.utilities",
+ "TextRequestsWrapper": "langchain_community.utilities",
+ "TwilioAPIWrapper": "langchain_community.utilities",
+ "WikipediaAPIWrapper": "langchain_community.utilities",
+ "WolframAlphaAPIWrapper": "langchain_community.utilities",
+ "ZapierNLAWrapper": "langchain_community.utilities",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AlphaVantageAPIWrapper",
+ "ApifyWrapper",
+ "ArceeWrapper",
+ "ArxivAPIWrapper",
+ "BibtexparserWrapper",
+ "BingSearchAPIWrapper",
+ "BraveSearchWrapper",
+ "DuckDuckGoSearchAPIWrapper",
+ "GoldenQueryAPIWrapper",
+ "GoogleFinanceAPIWrapper",
+ "GoogleJobsAPIWrapper",
+ "GoogleLensAPIWrapper",
+ "GooglePlacesAPIWrapper",
+ "GoogleScholarAPIWrapper",
+ "GoogleSearchAPIWrapper",
+ "GoogleSerperAPIWrapper",
+ "GoogleTrendsAPIWrapper",
+ "GraphQLAPIWrapper",
+ "JiraAPIWrapper",
+ "LambdaWrapper",
+ "MaxComputeAPIWrapper",
+ "MerriamWebsterAPIWrapper",
+ "MetaphorSearchAPIWrapper",
+ "NasaAPIWrapper",
+ "OpenWeatherMapAPIWrapper",
+ "OutlineAPIWrapper",
+ "Portkey",
+ "PowerBIDataset",
+ "PubMedAPIWrapper",
+ "Requests",
+ "RequestsWrapper",
+ "SQLDatabase",
+ "SceneXplainAPIWrapper",
+ "SearchApiAPIWrapper",
+ "SearxSearchWrapper",
+ "SerpAPIWrapper",
+ "SparkSQL",
+ "StackExchangeAPIWrapper",
+ "SteamWebAPIWrapper",
+ "TensorflowDatasets",
+ "TextRequestsWrapper",
+ "TwilioAPIWrapper",
+ "WikipediaAPIWrapper",
+ "WolframAlphaAPIWrapper",
+ "ZapierNLAWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/alpha_vantage.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/alpha_vantage.py
new file mode 100644
index 0000000000000000000000000000000000000000..3ccbd74d59027d198f9ddaa79f516f358aad3c5e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/alpha_vantage.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import AlphaVantageAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AlphaVantageAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AlphaVantageAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/anthropic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/anthropic.py
new file mode 100644
index 0000000000000000000000000000000000000000..6b7257bead546a446d82cf740149d8dbd38cae59
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/anthropic.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.anthropic import (
+ get_num_tokens_anthropic,
+ get_token_ids_anthropic,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "get_num_tokens_anthropic": "langchain_community.utilities.anthropic",
+ "get_token_ids_anthropic": "langchain_community.utilities.anthropic",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "get_num_tokens_anthropic",
+ "get_token_ids_anthropic",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/apify.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/apify.py
new file mode 100644
index 0000000000000000000000000000000000000000..d1b3e794ebbf6a66d077c6ecb0cef84917181bde
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/apify.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import ApifyWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ApifyWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ApifyWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/arcee.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/arcee.py
new file mode 100644
index 0000000000000000000000000000000000000000..52521e6afe65174eb29d648398ed9cb9d29dda06
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/arcee.py
@@ -0,0 +1,45 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import ArceeWrapper
+ from langchain_community.utilities.arcee import (
+ ArceeDocument,
+ ArceeDocumentAdapter,
+ ArceeDocumentSource,
+ ArceeRoute,
+ DALMFilter,
+ DALMFilterType,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ArceeRoute": "langchain_community.utilities.arcee",
+ "DALMFilterType": "langchain_community.utilities.arcee",
+ "DALMFilter": "langchain_community.utilities.arcee",
+ "ArceeDocumentSource": "langchain_community.utilities.arcee",
+ "ArceeDocument": "langchain_community.utilities.arcee",
+ "ArceeDocumentAdapter": "langchain_community.utilities.arcee",
+ "ArceeWrapper": "langchain_community.utilities",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArceeDocument",
+ "ArceeDocumentAdapter",
+ "ArceeDocumentSource",
+ "ArceeRoute",
+ "ArceeWrapper",
+ "DALMFilter",
+ "DALMFilterType",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/arxiv.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/arxiv.py
new file mode 100644
index 0000000000000000000000000000000000000000..b4d0efc4bdc5bf63809f9ee34ba6fc6587543a66
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/arxiv.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import ArxivAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ArxivAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ArxivAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/asyncio.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/asyncio.py
new file mode 100644
index 0000000000000000000000000000000000000000..f00e87f45233668acf22d739b1c716ca4851f345
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/asyncio.py
@@ -0,0 +1,11 @@
+"""Shims for asyncio features that may be missing from older python versions."""
+
+import sys
+
+if sys.version_info[:2] < (3, 11):
+ from async_timeout import timeout as asyncio_timeout
+else:
+ from asyncio import timeout as asyncio_timeout
+
+
+__all__ = ["asyncio_timeout"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/awslambda.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/awslambda.py
new file mode 100644
index 0000000000000000000000000000000000000000..9543927d3c3fd6545d934c2bca49286f0b71dc0b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/awslambda.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import LambdaWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LambdaWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LambdaWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/bibtex.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/bibtex.py
new file mode 100644
index 0000000000000000000000000000000000000000..c7cd9b6ebc26ed317d0520ea586496e92001244c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/bibtex.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import BibtexparserWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BibtexparserWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BibtexparserWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/bing_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/bing_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..b0261b5b46ea4063fce0625ccfb85154cdb407cd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/bing_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import BingSearchAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BingSearchAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BingSearchAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/brave_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/brave_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..62473f8f8d4c86c0f407c31d55ba59aba2b95d3d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/brave_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import BraveSearchWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BraveSearchWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BraveSearchWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/clickup.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/clickup.py
new file mode 100644
index 0000000000000000000000000000000000000000..0eb1fa3f85c121426316757ed1cf366f69fef61e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/clickup.py
@@ -0,0 +1,45 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.clickup import (
+ ClickupAPIWrapper,
+ Component,
+ CUList,
+ Member,
+ Space,
+ Task,
+ Team,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Component": "langchain_community.utilities.clickup",
+ "Task": "langchain_community.utilities.clickup",
+ "CUList": "langchain_community.utilities.clickup",
+ "Member": "langchain_community.utilities.clickup",
+ "Team": "langchain_community.utilities.clickup",
+ "Space": "langchain_community.utilities.clickup",
+ "ClickupAPIWrapper": "langchain_community.utilities.clickup",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CUList",
+ "ClickupAPIWrapper",
+ "Component",
+ "Member",
+ "Space",
+ "Task",
+ "Team",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/dalle_image_generator.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/dalle_image_generator.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba44e24ad7d6e5c8750b23d14fb5711a21fa1b77
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/dalle_image_generator.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.dalle_image_generator import DallEAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DallEAPIWrapper": "langchain_community.utilities.dalle_image_generator",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DallEAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/dataforseo_api_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/dataforseo_api_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..b56c858c08447aaff768cf7a968d86291114cb79
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/dataforseo_api_search.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.dataforseo_api_search import DataForSeoAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DataForSeoAPIWrapper": "langchain_community.utilities.dataforseo_api_search",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DataForSeoAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/duckduckgo_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/duckduckgo_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..549a1ccc840ee062b4a383e1841eff9a4da1a60a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/duckduckgo_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import DuckDuckGoSearchAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DuckDuckGoSearchAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DuckDuckGoSearchAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/github.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/github.py
new file mode 100644
index 0000000000000000000000000000000000000000..6f1a41adf18c55bb81485d05e50bd3c5c373b3a7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/github.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.github import GitHubAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GitHubAPIWrapper": "langchain_community.utilities.github"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GitHubAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/gitlab.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/gitlab.py
new file mode 100644
index 0000000000000000000000000000000000000000..a47d6504beb483ebb9c3ecf369427e210a1d16b4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/gitlab.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.gitlab import GitLabAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GitLabAPIWrapper": "langchain_community.utilities.gitlab"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GitLabAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/golden_query.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/golden_query.py
new file mode 100644
index 0000000000000000000000000000000000000000..824a1b448a9ed29578927b2221043d38339fa241
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/golden_query.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoldenQueryAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoldenQueryAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoldenQueryAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_finance.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_finance.py
new file mode 100644
index 0000000000000000000000000000000000000000..66fc4ce70f319c14febd7dc1ab322ea88815bc46
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_finance.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleFinanceAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleFinanceAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleFinanceAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_jobs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_jobs.py
new file mode 100644
index 0000000000000000000000000000000000000000..26632f7d7c1a5ae43d8446a307810e432b2c9847
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_jobs.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleJobsAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleJobsAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleJobsAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_lens.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_lens.py
new file mode 100644
index 0000000000000000000000000000000000000000..aa43d63154897ddcc22065c816ce40aefc681594
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_lens.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleLensAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleLensAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleLensAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_places_api.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_places_api.py
new file mode 100644
index 0000000000000000000000000000000000000000..b12c1a0559695f682ddff8cdd3f01dd9c8ee1aed
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_places_api.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GooglePlacesAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GooglePlacesAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GooglePlacesAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_scholar.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_scholar.py
new file mode 100644
index 0000000000000000000000000000000000000000..3fb3b83031e646e022c5f4afb6296571158f75cc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_scholar.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleScholarAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleScholarAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleScholarAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..734d8e1145b49f2cbf1eff62c473cd6bb8d8b19a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleSearchAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleSearchAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleSearchAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_serper.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_serper.py
new file mode 100644
index 0000000000000000000000000000000000000000..edde4d59d443b646d4e675bd27e8501bb7d1bf0a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_serper.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleSerperAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleSerperAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleSerperAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_trends.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_trends.py
new file mode 100644
index 0000000000000000000000000000000000000000..6334529c7db477e8490f7b48c3412b0a36ea0ce1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/google_trends.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GoogleTrendsAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GoogleTrendsAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GoogleTrendsAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/graphql.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/graphql.py
new file mode 100644
index 0000000000000000000000000000000000000000..0fd1d74ca0c025dc621b7752c7ba005c77711fc4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/graphql.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import GraphQLAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"GraphQLAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "GraphQLAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/jira.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/jira.py
new file mode 100644
index 0000000000000000000000000000000000000000..97ae7c33d973616ca213a3d2ef820bd86e5159fe
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/jira.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import JiraAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"JiraAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "JiraAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/max_compute.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/max_compute.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8629da978b143443348fc343e4ac17b3f3dfd47
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/max_compute.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import MaxComputeAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MaxComputeAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MaxComputeAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/merriam_webster.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/merriam_webster.py
new file mode 100644
index 0000000000000000000000000000000000000000..67c776e03875b524b4d80ccdce0d9b868317291d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/merriam_webster.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import MerriamWebsterAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MerriamWebsterAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MerriamWebsterAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/metaphor_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/metaphor_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..6e622e1e735b50c659b206b83765fe3bdf66f88d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/metaphor_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import MetaphorSearchAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MetaphorSearchAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MetaphorSearchAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/nasa.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/nasa.py
new file mode 100644
index 0000000000000000000000000000000000000000..6b25bdf623c541f71886f01a7083e7eef95f0991
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/nasa.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import NasaAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NasaAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NasaAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/opaqueprompts.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/opaqueprompts.py
new file mode 100644
index 0000000000000000000000000000000000000000..3b70400afc5596a365ee8cf7c89b6f8d92fa7788
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/opaqueprompts.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.opaqueprompts import desanitize, sanitize
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "sanitize": "langchain_community.utilities.opaqueprompts",
+ "desanitize": "langchain_community.utilities.opaqueprompts",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "desanitize",
+ "sanitize",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/openapi.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/openapi.py
new file mode 100644
index 0000000000000000000000000000000000000000..dd4fa4bd1294eed7b327fbf84dcbb127279d147c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/openapi.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.tools import OpenAPISpec
+ from langchain_community.utilities.openapi import HTTPVerb
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "HTTPVerb": "langchain_community.utilities.openapi",
+ "OpenAPISpec": "langchain_community.tools",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HTTPVerb",
+ "OpenAPISpec",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/openweathermap.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/openweathermap.py
new file mode 100644
index 0000000000000000000000000000000000000000..7d5b79e202aa5e85269f554a7f2e9295ac773497
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/openweathermap.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import OpenWeatherMapAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpenWeatherMapAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenWeatherMapAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/outline.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/outline.py
new file mode 100644
index 0000000000000000000000000000000000000000..7b6b254c3d3f33f4b4f8fe8d5ccf33755f390d49
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/outline.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import OutlineAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OutlineAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OutlineAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/portkey.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/portkey.py
new file mode 100644
index 0000000000000000000000000000000000000000..9df9cc54830fec62583460e07d616364d01a56ff
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/portkey.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import Portkey
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Portkey": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Portkey",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/powerbi.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/powerbi.py
new file mode 100644
index 0000000000000000000000000000000000000000..f49fcf85865f4625faacec626b0148c4bca42722
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/powerbi.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import PowerBIDataset
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PowerBIDataset": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PowerBIDataset",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/pubmed.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/pubmed.py
new file mode 100644
index 0000000000000000000000000000000000000000..366aee4a4362764b50bd2229daf848840efd1a2e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/pubmed.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import PubMedAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PubMedAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PubMedAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/python.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/python.py
new file mode 100644
index 0000000000000000000000000000000000000000..d28816597abd77ddef7afc874026e3a07ff12207
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/python.py
@@ -0,0 +1,19 @@
+"""For backwards compatibility."""
+
+from typing import Any
+
+from langchain_classic._api import create_importer
+
+# Code has been removed from the community package as well.
+# We'll proxy to community package, which will raise an appropriate exception,
+# but we'll not include this in __all__, so it won't be listed as importable.
+
+_importer = create_importer(
+ __package__,
+ deprecated_lookups={"PythonREPL": "langchain_community.utilities.python"},
+)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _importer(name)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/reddit_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/reddit_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..324514fd12a69f5f5b93cdce012e075783689171
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/reddit_search.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.reddit_search import RedditSearchAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "RedditSearchAPIWrapper": "langchain_community.utilities.reddit_search",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RedditSearchAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/redis.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/redis.py
new file mode 100644
index 0000000000000000000000000000000000000000..cbe1b685183874a1c3e6693c0bb6dc97ec8266b7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/redis.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.redis import (
+ TokenEscaper,
+ check_redis_module_exist,
+ get_client,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "TokenEscaper": "langchain_community.utilities.redis",
+ "check_redis_module_exist": "langchain_community.utilities.redis",
+ "get_client": "langchain_community.utilities.redis",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TokenEscaper",
+ "check_redis_module_exist",
+ "get_client",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/requests.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/requests.py
new file mode 100644
index 0000000000000000000000000000000000000000..2d2ae2de23da0e17e31de7d63450763388bb4cb3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/requests.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import Requests, RequestsWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Requests": "langchain_community.utilities",
+ "RequestsWrapper": "langchain_community.utilities",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Requests",
+ "RequestsWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/scenexplain.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/scenexplain.py
new file mode 100644
index 0000000000000000000000000000000000000000..96538191df03197ad334f78d9cc8e9d2459031c5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/scenexplain.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SceneXplainAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SceneXplainAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SceneXplainAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/searchapi.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/searchapi.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbfbf400e46bd81dc9a092c5a1c5f986980dbea0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/searchapi.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SearchApiAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SearchApiAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SearchApiAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/searx_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/searx_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..66b4205c84f146f8bb093af5fb977b2e23218ace
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/searx_search.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SearxSearchWrapper
+ from langchain_community.utilities.searx_search import SearxResults
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SearxResults": "langchain_community.utilities.searx_search",
+ "SearxSearchWrapper": "langchain_community.utilities",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SearxResults",
+ "SearxSearchWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/serpapi.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/serpapi.py
new file mode 100644
index 0000000000000000000000000000000000000000..5cc64d2add73e35aba5893aa38d1832171107f58
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/serpapi.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SerpAPIWrapper
+ from langchain_community.utilities.serpapi import HiddenPrints
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "HiddenPrints": "langchain_community.utilities.serpapi",
+ "SerpAPIWrapper": "langchain_community.utilities",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "HiddenPrints",
+ "SerpAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/spark_sql.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/spark_sql.py
new file mode 100644
index 0000000000000000000000000000000000000000..bc56ab850b819c735346069e32058b076ca45bf7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/spark_sql.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SparkSQL
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SparkSQL": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SparkSQL",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/sql_database.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/sql_database.py
new file mode 100644
index 0000000000000000000000000000000000000000..57409e0cf07c689c0b7d461504cbf0e8b90bc3ab
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/sql_database.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SQLDatabase
+ from langchain_community.utilities.sql_database import truncate_word
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "truncate_word": "langchain_community.utilities.sql_database",
+ "SQLDatabase": "langchain_community.utilities",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SQLDatabase",
+ "truncate_word",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/stackexchange.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/stackexchange.py
new file mode 100644
index 0000000000000000000000000000000000000000..72092aef8bc3b8a88ff57b24c1121449580e27f6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/stackexchange.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import StackExchangeAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"StackExchangeAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "StackExchangeAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/steam.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/steam.py
new file mode 100644
index 0000000000000000000000000000000000000000..4f1007d7d1e035f7818ad5bd4bd988485a8785b7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/steam.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import SteamWebAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SteamWebAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SteamWebAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/tavily_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/tavily_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..97ac05d92197e57ebf25170956d84afa2a08b539
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/tavily_search.py
@@ -0,0 +1,25 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "TavilySearchAPIWrapper": "langchain_community.utilities.tavily_search",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TavilySearchAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/tensorflow_datasets.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/tensorflow_datasets.py
new file mode 100644
index 0000000000000000000000000000000000000000..a917a52bba744a7e4382ea7635bbda72cc38400e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/tensorflow_datasets.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import TensorflowDatasets
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TensorflowDatasets": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TensorflowDatasets",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/twilio.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/twilio.py
new file mode 100644
index 0000000000000000000000000000000000000000..7078fc0ed851b3e8fecf433c9bb9c394b105dff6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/twilio.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import TwilioAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TwilioAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TwilioAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/vertexai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/vertexai.py
new file mode 100644
index 0000000000000000000000000000000000000000..a7f92943e08eb3d97844fb057a320375f69e78b5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/vertexai.py
@@ -0,0 +1,36 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities.vertexai import (
+ create_retry_decorator,
+ get_client_info,
+ init_vertexai,
+ raise_vertex_import_error,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "create_retry_decorator": "langchain_community.utilities.vertexai",
+ "raise_vertex_import_error": "langchain_community.utilities.vertexai",
+ "init_vertexai": "langchain_community.utilities.vertexai",
+ "get_client_info": "langchain_community.utilities.vertexai",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "create_retry_decorator",
+ "get_client_info",
+ "init_vertexai",
+ "raise_vertex_import_error",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/wikipedia.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/wikipedia.py
new file mode 100644
index 0000000000000000000000000000000000000000..751fc9ce7fea18ecc0b02fda07360b2485d9b7c2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/wikipedia.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import WikipediaAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WikipediaAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WikipediaAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/wolfram_alpha.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/wolfram_alpha.py
new file mode 100644
index 0000000000000000000000000000000000000000..d272c4efcdb3d7b84d3b6555897b7cce7675cc39
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/wolfram_alpha.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import WolframAlphaAPIWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"WolframAlphaAPIWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "WolframAlphaAPIWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/zapier.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/zapier.py
new file mode 100644
index 0000000000000000000000000000000000000000..e4f65b2812438aad23d6414844a6848f8cedd212
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utilities/zapier.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utilities import ZapierNLAWrapper
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ZapierNLAWrapper": "langchain_community.utilities"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ZapierNLAWrapper",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..0777d743a35082096975a345a38ad35581368605
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/__init__.py
@@ -0,0 +1,76 @@
+"""Utility functions for LangChain.
+
+These functions do not depend on any other LangChain module.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.utils import (
+ comma_list,
+ get_from_dict_or_env,
+ get_from_env,
+ stringify_dict,
+ stringify_value,
+)
+from langchain_core.utils.formatting import StrictFormatter, formatter
+from langchain_core.utils.input import (
+ get_bolded_text,
+ get_color_mapping,
+ get_colored_text,
+ print_text,
+)
+from langchain_core.utils.utils import (
+ check_package_version,
+ convert_to_secret_str,
+ get_pydantic_field_names,
+ guard_import,
+ mock_now,
+ raise_for_status_with_text,
+ xor_args,
+)
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utils.math import (
+ cosine_similarity,
+ cosine_similarity_top_k,
+ )
+
+# Not deprecated right now because we will likely need to move these functions
+# back into langchain (as long as we're OK with the dependency on numpy).
+_MODULE_LOOKUP = {
+ "cosine_similarity": "langchain_community.utils.math",
+ "cosine_similarity_top_k": "langchain_community.utils.math",
+}
+
+_import_attribute = create_importer(__package__, module_lookup=_MODULE_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "StrictFormatter",
+ "check_package_version",
+ "comma_list",
+ "convert_to_secret_str",
+ "cosine_similarity",
+ "cosine_similarity_top_k",
+ "formatter",
+ "get_bolded_text",
+ "get_color_mapping",
+ "get_colored_text",
+ "get_from_dict_or_env",
+ "get_from_env",
+ "get_pydantic_field_names",
+ "guard_import",
+ "mock_now",
+ "print_text",
+ "raise_for_status_with_text",
+ "stringify_dict",
+ "stringify_value",
+ "xor_args",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/aiter.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/aiter.py
new file mode 100644
index 0000000000000000000000000000000000000000..1ba006d6afc680f5598ced65e1e6c38a87a45dd9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/aiter.py
@@ -0,0 +1,3 @@
+from langchain_core.utils.aiter import NoLock, Tee, py_anext
+
+__all__ = ["NoLock", "Tee", "py_anext"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/env.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/env.py
new file mode 100644
index 0000000000000000000000000000000000000000..b1e212d22e0c412f36ed0d39715a81db6d411679
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/env.py
@@ -0,0 +1,3 @@
+from langchain_core.utils.env import get_from_dict_or_env, get_from_env
+
+__all__ = ["get_from_dict_or_env", "get_from_env"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/ernie_functions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/ernie_functions.py
new file mode 100644
index 0000000000000000000000000000000000000000..5f714b428b51377fe958605bc9d849eb8608670e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/ernie_functions.py
@@ -0,0 +1,36 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utils.ernie_functions import (
+ FunctionDescription,
+ ToolDescription,
+ convert_pydantic_to_ernie_function,
+ convert_pydantic_to_ernie_tool,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "FunctionDescription": "langchain_community.utils.ernie_functions",
+ "ToolDescription": "langchain_community.utils.ernie_functions",
+ "convert_pydantic_to_ernie_function": "langchain_community.utils.ernie_functions",
+ "convert_pydantic_to_ernie_tool": "langchain_community.utils.ernie_functions",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FunctionDescription",
+ "ToolDescription",
+ "convert_pydantic_to_ernie_function",
+ "convert_pydantic_to_ernie_tool",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/formatting.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/formatting.py
new file mode 100644
index 0000000000000000000000000000000000000000..212bff83613ba90cde0fc4da150a9e0b394dea42
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/formatting.py
@@ -0,0 +1,3 @@
+from langchain_core.utils.formatting import StrictFormatter
+
+__all__ = ["StrictFormatter"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/html.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/html.py
new file mode 100644
index 0000000000000000000000000000000000000000..efe6d725c99e1da6cd7699ec2947363dadea2964
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/html.py
@@ -0,0 +1,19 @@
+from langchain_core.utils.html import (
+ DEFAULT_LINK_REGEX,
+ PREFIXES_TO_IGNORE,
+ PREFIXES_TO_IGNORE_REGEX,
+ SUFFIXES_TO_IGNORE,
+ SUFFIXES_TO_IGNORE_REGEX,
+ extract_sub_links,
+ find_all_links,
+)
+
+__all__ = [
+ "DEFAULT_LINK_REGEX",
+ "PREFIXES_TO_IGNORE",
+ "PREFIXES_TO_IGNORE_REGEX",
+ "SUFFIXES_TO_IGNORE",
+ "SUFFIXES_TO_IGNORE_REGEX",
+ "extract_sub_links",
+ "find_all_links",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/input.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/input.py
new file mode 100644
index 0000000000000000000000000000000000000000..bff9f875d85bd1af6c289d50ea185ce313b2138c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/input.py
@@ -0,0 +1,8 @@
+from langchain_core.utils.input import (
+ get_bolded_text,
+ get_color_mapping,
+ get_colored_text,
+ print_text,
+)
+
+__all__ = ["get_bolded_text", "get_color_mapping", "get_colored_text", "print_text"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/iter.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/iter.py
new file mode 100644
index 0000000000000000000000000000000000000000..a905911b1dca5bcfe73b33febf3eaa761f82806c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/iter.py
@@ -0,0 +1,3 @@
+from langchain_core.utils.iter import NoLock, Tee, batch_iterate, tee_peer
+
+__all__ = ["NoLock", "Tee", "batch_iterate", "tee_peer"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/json_schema.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/json_schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..bfcf112c7885769e3dc63e35daccf75da33b009e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/json_schema.py
@@ -0,0 +1,11 @@
+from langchain_core.utils.json_schema import (
+ _dereference_refs_helper,
+ _retrieve_ref,
+ dereference_refs,
+)
+
+__all__ = [
+ "_dereference_refs_helper",
+ "_retrieve_ref",
+ "dereference_refs",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/math.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/math.py
new file mode 100644
index 0000000000000000000000000000000000000000..c51d10e53af6fe501e977c18cd8eaa8952883d6f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/math.py
@@ -0,0 +1,32 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utils.math import (
+ cosine_similarity,
+ cosine_similarity_top_k,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+# Not marked as deprecated since we may want to move the functionality
+# into langchain as long as we're OK with numpy as the dependency.
+_MODULE_LOOKUP = {
+ "cosine_similarity": "langchain_community.utils.math",
+ "cosine_similarity_top_k": "langchain_community.utils.math",
+}
+
+_import_attribute = create_importer(__package__, module_lookup=_MODULE_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "cosine_similarity",
+ "cosine_similarity_top_k",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/openai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/openai.py
new file mode 100644
index 0000000000000000000000000000000000000000..d7b3db9a400b0cb557f681869c09eed28f3c8d85
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/openai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.utils.openai import is_openai_v1
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"is_openai_v1": "langchain_community.utils.openai"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "is_openai_v1",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/openai_functions.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/openai_functions.py
new file mode 100644
index 0000000000000000000000000000000000000000..0e21c36857f94ba1f09f9565951749b22a81eecb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/openai_functions.py
@@ -0,0 +1,14 @@
+from langchain_core.utils.function_calling import FunctionDescription, ToolDescription
+from langchain_core.utils.function_calling import (
+ convert_to_openai_function as convert_pydantic_to_openai_function,
+)
+from langchain_core.utils.function_calling import (
+ convert_to_openai_tool as convert_pydantic_to_openai_tool,
+)
+
+__all__ = [
+ "FunctionDescription",
+ "ToolDescription",
+ "convert_pydantic_to_openai_function",
+ "convert_pydantic_to_openai_tool",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/pydantic.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/pydantic.py
new file mode 100644
index 0000000000000000000000000000000000000000..58914f760d08519c4f8c63832a761203ef3212be
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/pydantic.py
@@ -0,0 +1,13 @@
+from langchain_core.utils.pydantic import PYDANTIC_VERSION
+
+
+def get_pydantic_major_version() -> int:
+ """Get the major version of Pydantic.
+
+ Returns:
+ The major version of Pydantic.
+ """
+ return PYDANTIC_VERSION.major
+
+
+__all__ = ["get_pydantic_major_version"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/strings.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/strings.py
new file mode 100644
index 0000000000000000000000000000000000000000..3c394c4694bb0909b1f33974547cf7a0fc2868e7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/strings.py
@@ -0,0 +1,3 @@
+from langchain_core.utils.strings import comma_list, stringify_dict, stringify_value
+
+__all__ = ["comma_list", "stringify_dict", "stringify_value"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..9856fa02b0f1874090375bfcadfac6a638d91c3b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/utils/utils.py
@@ -0,0 +1,21 @@
+from langchain_core.utils.utils import (
+ build_extra_kwargs,
+ check_package_version,
+ convert_to_secret_str,
+ get_pydantic_field_names,
+ guard_import,
+ mock_now,
+ raise_for_status_with_text,
+ xor_args,
+)
+
+__all__ = [
+ "build_extra_kwargs",
+ "check_package_version",
+ "convert_to_secret_str",
+ "get_pydantic_field_names",
+ "guard_import",
+ "mock_now",
+ "raise_for_status_with_text",
+ "xor_args",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..74882a4987b92529d5dea8c72de1f89b3826ef91
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__init__.py
@@ -0,0 +1,245 @@
+"""**Vector store** stores embedded data and performs vector search.
+
+One of the most common ways to store and search over unstructured data is to
+embed it and store the resulting embedding vectors, and then query the store
+and retrieve the data that are 'most similar' to the embedded query.
+"""
+
+from typing import TYPE_CHECKING, Any
+
+from langchain_core.vectorstores import VectorStore
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import (
+ FAISS,
+ AlibabaCloudOpenSearch,
+ AlibabaCloudOpenSearchSettings,
+ AnalyticDB,
+ Annoy,
+ AstraDB,
+ AtlasDB,
+ AwaDB,
+ AzureCosmosDBVectorSearch,
+ AzureSearch,
+ Bagel,
+ Cassandra,
+ Chroma,
+ Clarifai,
+ Clickhouse,
+ ClickhouseSettings,
+ DashVector,
+ DatabricksVectorSearch,
+ DeepLake,
+ Dingo,
+ DocArrayHnswSearch,
+ DocArrayInMemorySearch,
+ DuckDB,
+ EcloudESVectorStore,
+ ElasticKnnSearch,
+ ElasticsearchStore,
+ ElasticVectorSearch,
+ Epsilla,
+ Hologres,
+ LanceDB,
+ LLMRails,
+ Marqo,
+ MatchingEngine,
+ Meilisearch,
+ Milvus,
+ MomentoVectorIndex,
+ MongoDBAtlasVectorSearch,
+ MyScale,
+ MyScaleSettings,
+ Neo4jVector,
+ NeuralDBClientVectorStore,
+ NeuralDBVectorStore,
+ OpenSearchVectorSearch,
+ PGEmbedding,
+ PGVector,
+ Pinecone,
+ Qdrant,
+ Redis,
+ Rockset,
+ ScaNN,
+ SemaDB,
+ SingleStoreDB,
+ SKLearnVectorStore,
+ SQLiteVSS,
+ StarRocks,
+ SupabaseVectorStore,
+ Tair,
+ TencentVectorDB,
+ TileDB,
+ TimescaleVector,
+ Typesense,
+ USearch,
+ Vald,
+ Vearch,
+ Vectara,
+ VespaStore,
+ Weaviate,
+ Yellowbrick,
+ ZepVectorStore,
+ Zilliz,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AlibabaCloudOpenSearch": "langchain_community.vectorstores",
+ "AlibabaCloudOpenSearchSettings": "langchain_community.vectorstores",
+ "AnalyticDB": "langchain_community.vectorstores",
+ "Annoy": "langchain_community.vectorstores",
+ "AstraDB": "langchain_community.vectorstores",
+ "AtlasDB": "langchain_community.vectorstores",
+ "AwaDB": "langchain_community.vectorstores",
+ "AzureCosmosDBVectorSearch": "langchain_community.vectorstores",
+ "AzureSearch": "langchain_community.vectorstores",
+ "Bagel": "langchain_community.vectorstores",
+ "Cassandra": "langchain_community.vectorstores",
+ "Chroma": "langchain_community.vectorstores",
+ "Clarifai": "langchain_community.vectorstores",
+ "Clickhouse": "langchain_community.vectorstores",
+ "ClickhouseSettings": "langchain_community.vectorstores",
+ "DashVector": "langchain_community.vectorstores",
+ "DatabricksVectorSearch": "langchain_community.vectorstores",
+ "DeepLake": "langchain_community.vectorstores",
+ "Dingo": "langchain_community.vectorstores",
+ "DocArrayHnswSearch": "langchain_community.vectorstores",
+ "DocArrayInMemorySearch": "langchain_community.vectorstores",
+ "DuckDB": "langchain_community.vectorstores",
+ "EcloudESVectorStore": "langchain_community.vectorstores",
+ "ElasticKnnSearch": "langchain_community.vectorstores",
+ "ElasticsearchStore": "langchain_community.vectorstores",
+ "ElasticVectorSearch": "langchain_community.vectorstores",
+ "Epsilla": "langchain_community.vectorstores",
+ "FAISS": "langchain_community.vectorstores",
+ "Hologres": "langchain_community.vectorstores",
+ "LanceDB": "langchain_community.vectorstores",
+ "LLMRails": "langchain_community.vectorstores",
+ "Marqo": "langchain_community.vectorstores",
+ "MatchingEngine": "langchain_community.vectorstores",
+ "Meilisearch": "langchain_community.vectorstores",
+ "Milvus": "langchain_community.vectorstores",
+ "MomentoVectorIndex": "langchain_community.vectorstores",
+ "MongoDBAtlasVectorSearch": "langchain_community.vectorstores",
+ "MyScale": "langchain_community.vectorstores",
+ "MyScaleSettings": "langchain_community.vectorstores",
+ "Neo4jVector": "langchain_community.vectorstores",
+ "NeuralDBClientVectorStore": "langchain_community.vectorstores",
+ "NeuralDBVectorStore": "langchain_community.vectorstores",
+ "NEuralDBVectorStore": "langchain_community.vectorstores",
+ "OpenSearchVectorSearch": "langchain_community.vectorstores",
+ "PGEmbedding": "langchain_community.vectorstores",
+ "PGVector": "langchain_community.vectorstores",
+ "Pinecone": "langchain_community.vectorstores",
+ "Qdrant": "langchain_community.vectorstores",
+ "Redis": "langchain_community.vectorstores",
+ "Rockset": "langchain_community.vectorstores",
+ "ScaNN": "langchain_community.vectorstores",
+ "SemaDB": "langchain_community.vectorstores",
+ "SingleStoreDB": "langchain_community.vectorstores",
+ "SKLearnVectorStore": "langchain_community.vectorstores",
+ "SQLiteVSS": "langchain_community.vectorstores",
+ "StarRocks": "langchain_community.vectorstores",
+ "SupabaseVectorStore": "langchain_community.vectorstores",
+ "Tair": "langchain_community.vectorstores",
+ "TencentVectorDB": "langchain_community.vectorstores",
+ "TileDB": "langchain_community.vectorstores",
+ "TimescaleVector": "langchain_community.vectorstores",
+ "Typesense": "langchain_community.vectorstores",
+ "USearch": "langchain_community.vectorstores",
+ "Vald": "langchain_community.vectorstores",
+ "Vearch": "langchain_community.vectorstores",
+ "Vectara": "langchain_community.vectorstores",
+ "VespaStore": "langchain_community.vectorstores",
+ "Weaviate": "langchain_community.vectorstores",
+ "Yellowbrick": "langchain_community.vectorstores",
+ "ZepVectorStore": "langchain_community.vectorstores",
+ "Zilliz": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FAISS",
+ "AlibabaCloudOpenSearch",
+ "AlibabaCloudOpenSearchSettings",
+ "AnalyticDB",
+ "Annoy",
+ "AstraDB",
+ "AtlasDB",
+ "AwaDB",
+ "AzureCosmosDBVectorSearch",
+ "AzureSearch",
+ "Bagel",
+ "Cassandra",
+ "Chroma",
+ "Clarifai",
+ "Clickhouse",
+ "ClickhouseSettings",
+ "DashVector",
+ "DatabricksVectorSearch",
+ "DeepLake",
+ "Dingo",
+ "DocArrayHnswSearch",
+ "DocArrayInMemorySearch",
+ "DuckDB",
+ "EcloudESVectorStore",
+ "ElasticKnnSearch",
+ "ElasticVectorSearch",
+ "ElasticsearchStore",
+ "Epsilla",
+ "Hologres",
+ "LLMRails",
+ "LanceDB",
+ "Marqo",
+ "MatchingEngine",
+ "Meilisearch",
+ "Milvus",
+ "MomentoVectorIndex",
+ "MongoDBAtlasVectorSearch",
+ "MyScale",
+ "MyScaleSettings",
+ "Neo4jVector",
+ "NeuralDBClientVectorStore",
+ "NeuralDBVectorStore",
+ "OpenSearchVectorSearch",
+ "PGEmbedding",
+ "PGVector",
+ "Pinecone",
+ "Qdrant",
+ "Redis",
+ "Rockset",
+ "SKLearnVectorStore",
+ "SQLiteVSS",
+ "ScaNN",
+ "SemaDB",
+ "SingleStoreDB",
+ "StarRocks",
+ "SupabaseVectorStore",
+ "Tair",
+ "TencentVectorDB",
+ "TileDB",
+ "TimescaleVector",
+ "Typesense",
+ "USearch",
+ "Vald",
+ "Vearch",
+ "Vectara",
+ "VectorStore",
+ "VespaStore",
+ "Weaviate",
+ "Yellowbrick",
+ "ZepVectorStore",
+ "Zilliz",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/alibabacloud_opensearch.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/alibabacloud_opensearch.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d0e64325d776989ed9b7fd06333327bf84a31fc9
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/alibabacloud_opensearch.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/analyticdb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/analyticdb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8ab540d1ed8c8ba3e58024c2f596ce2b96836610
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/analyticdb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/annoy.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/annoy.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..49f922f0590e80d1a9817e4c4ff98575dbd39ace
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/annoy.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/astradb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/astradb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ffac2e63f160ab126816c70a3594cd2868d4f377
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/astradb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/atlas.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/atlas.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c37fab2dde3a70758c4d08bfae0db6de9b735a37
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/atlas.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/awadb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/awadb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d075c3f45001554228892872793c7235081a5c12
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/awadb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/azure_cosmos_db.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/azure_cosmos_db.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3a99811b37a80c721b32dcc370c01c5bec9ad607
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/azure_cosmos_db.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/azuresearch.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/azuresearch.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6ba32490611860bfa8894fa8615129acea75c6a9
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/azuresearch.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/bageldb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/bageldb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ead242ae905324f2d4414d1c9cc5b865aca6dcb2
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/bageldb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/baiducloud_vector_search.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/baiducloud_vector_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ae023f2fa4b72f3a1ce63de57bb8749b034c70e9
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/baiducloud_vector_search.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..11309d8bcd8a52b25970dc07611bd0b4c19a4c0b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/cassandra.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/cassandra.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8599efff35a1563aa9165be47c8a794049c85740
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/cassandra.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/chroma.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/chroma.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ecc02a1d6faf2096249acd323db7a9c0ab272964
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/chroma.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/clarifai.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/clarifai.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f3e778cc1bff17b99e91104d8e5f61ccb06decae
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/clarifai.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/clickhouse.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/clickhouse.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2eaca2f161e0eead88be89603b17c1c3de44437e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/clickhouse.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/dashvector.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/dashvector.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9d9cb465ede3fb465a0cf6b039ca452c66c561dc
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/dashvector.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/databricks_vector_search.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/databricks_vector_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2df2b67ae387f5a96c2bb98f2b50fd31493686c4
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/databricks_vector_search.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/deeplake.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/deeplake.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..dbaf7590e28b36e62cc5d336cd3d888293ebbb14
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/deeplake.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/dingo.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/dingo.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4f8259ac9c05fd01ebd15a621f6645e38d0a58ca
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/dingo.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/elastic_vector_search.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/elastic_vector_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bc2e8e563b6c6d3ffc420407f6b48d47623b5598
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/elastic_vector_search.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/elasticsearch.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/elasticsearch.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f15ebf7db424a0e73c01e059b397b1a1b753850b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/elasticsearch.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/epsilla.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/epsilla.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8fef4253e46c83506e1f42a6173c8da3c57cdef1
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/epsilla.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/faiss.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/faiss.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fdd28e0ba52c9d4ceedecaebe6715795709fddec
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/faiss.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/hippo.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/hippo.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..59e44ce71da3473718bedec2c23d59b93d91c6fc
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/hippo.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/hologres.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/hologres.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4b30d12ac1452d03c6e3d49bf263122e59aa54fd
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/hologres.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/lancedb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/lancedb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..46f58b09882fd7cde5bf788efef9e648265c7733
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/lancedb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/llm_rails.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/llm_rails.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8a90020f9bb771a1bec1aab8eaffdf674a49f6b6
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/llm_rails.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/marqo.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/marqo.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..171e9041a0b438a1927d909a40fa148e72ea547e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/marqo.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/matching_engine.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/matching_engine.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..959dbff39c91e042963cd74d9b57911f23972bd7
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/matching_engine.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/meilisearch.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/meilisearch.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d5e47b0762ff0c668446384b94f2df9fbf158715
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/meilisearch.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/milvus.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/milvus.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5f652a3e3f72a5f6ce51eeba02bffe7a2c7a6ebf
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/milvus.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/momento_vector_index.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/momento_vector_index.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a6f0a65da28d030ffb4f3e97912c4f15e132278b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/momento_vector_index.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/mongodb_atlas.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/mongodb_atlas.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fc8b69fa7209f50dd1309280a45acc2d1f92ed76
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/mongodb_atlas.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/myscale.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/myscale.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..82982f1f61792e3b5b6cf5611e18ab583b84eea3
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/myscale.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/neo4j_vector.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/neo4j_vector.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..14ce5548a5838381c0e5aebb9e007857e6f80cd4
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/neo4j_vector.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/nucliadb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/nucliadb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..730939bd5740ac6db70776179bf04cdb8ad08ea8
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/nucliadb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/opensearch_vector_search.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/opensearch_vector_search.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..12105653e3a7ba6a78331332791edff849cad53a
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/opensearch_vector_search.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgembedding.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgembedding.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7d2adfd5b7062359a006deacad9a61330d7741df
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgembedding.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgvecto_rs.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgvecto_rs.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..713280c7cf0b5376370f0eea91c37b51fab5992e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgvecto_rs.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgvector.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgvector.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..dcc701ec92e5bf8a6caa28539606e3b5ccc40542
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pgvector.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pinecone.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pinecone.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..881e1a1cc5bd0a967c4c56df3054fe3d37e325ff
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/pinecone.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/qdrant.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/qdrant.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..14aedadb78098f93ab11e848f33229f3e9690200
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/qdrant.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/rocksetdb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/rocksetdb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..36d182a2a100cac9ed277ff1ac7c4457e5782101
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/rocksetdb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/scann.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/scann.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..19722feb3348a3a3bd3192f9ae5e58471bc6c3da
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/scann.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/semadb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/semadb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..476dc3194b99a2ce84aa2507566e3a393276ae9b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/semadb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/singlestoredb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/singlestoredb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..59ce174a66ddef37269fa7e9841b59821a006d73
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/singlestoredb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/sklearn.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/sklearn.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..aa932b70ccca777486bb47048195d09816fc028b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/sklearn.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/sqlitevss.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/sqlitevss.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..42bbff69b185d1850ac1731ca28a7f864dc5b996
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/sqlitevss.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/starrocks.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/starrocks.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0e95853bd898c4b7f4ca1e32f1113d85d5d9ed37
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/starrocks.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/supabase.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/supabase.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..123712780fbc12a376aa4bac725879dd7e55cdbe
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/supabase.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tair.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tair.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2f9eb1996dd0a39312e0d0047dd79a99142add40
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tair.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tencentvectordb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tencentvectordb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a646a6125dc6276508feb92c0ff1bebca3f34713
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tencentvectordb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tiledb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tiledb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b5366f47e02a6f757ee4d7d02469f11f3b5ece65
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/tiledb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/timescalevector.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/timescalevector.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1ddb95d9261918f5548de972ec9fb673feb1838b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/timescalevector.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/typesense.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/typesense.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..33d735ecfbeb93351d8fb77fa386335b68506934
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/typesense.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/usearch.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/usearch.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..501805f62e00566078e423a956a267c088d93ec0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/__pycache__/usearch.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/alibabacloud_opensearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/alibabacloud_opensearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..6e76c2e27a70d5d1acc65a4d06c88b2350f423a8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/alibabacloud_opensearch.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import (
+ AlibabaCloudOpenSearch,
+ AlibabaCloudOpenSearchSettings,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AlibabaCloudOpenSearchSettings": "langchain_community.vectorstores",
+ "AlibabaCloudOpenSearch": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AlibabaCloudOpenSearch",
+ "AlibabaCloudOpenSearchSettings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/analyticdb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/analyticdb.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e243cac25de28e154028ff575f2e0595fc1989c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/analyticdb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import AnalyticDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AnalyticDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AnalyticDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/annoy.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/annoy.py
new file mode 100644
index 0000000000000000000000000000000000000000..4d85b404df7665ed84f13bd517055f8e977f0efe
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/annoy.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Annoy
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Annoy": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Annoy",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/astradb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/astradb.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbe447c0e57eb3c35759af08ae7e9c397038ac5a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/astradb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import AstraDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AstraDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AstraDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/atlas.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/atlas.py
new file mode 100644
index 0000000000000000000000000000000000000000..7bfbfa2ca4e99ae47d8cadbae231a18f484cea24
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/atlas.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import AtlasDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AtlasDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AtlasDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/awadb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/awadb.py
new file mode 100644
index 0000000000000000000000000000000000000000..c56cd53b517e1c1fa0f9561cc72d53dce8806638
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/awadb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import AwaDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"AwaDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AwaDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/azure_cosmos_db.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/azure_cosmos_db.py
new file mode 100644
index 0000000000000000000000000000000000000000..fd0c8f77bd1abb063ec762009c9635c97b0e7210
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/azure_cosmos_db.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import AzureCosmosDBVectorSearch
+ from langchain_community.vectorstores.azure_cosmos_db import CosmosDBSimilarityType
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CosmosDBSimilarityType": "langchain_community.vectorstores.azure_cosmos_db",
+ "AzureCosmosDBVectorSearch": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureCosmosDBVectorSearch",
+ "CosmosDBSimilarityType",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/azuresearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/azuresearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..92556c80b2bc54f705da890faa51f3a5c9382d28
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/azuresearch.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import AzureSearch
+ from langchain_community.vectorstores.azuresearch import (
+ AzureSearchVectorStoreRetriever,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "AzureSearch": "langchain_community.vectorstores",
+ "AzureSearchVectorStoreRetriever": "langchain_community.vectorstores.azuresearch",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "AzureSearch",
+ "AzureSearchVectorStoreRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/bageldb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/bageldb.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac3c8a5f9d71fdc59c42a2b26a73994baa3fb6f2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/bageldb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Bagel
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Bagel": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Bagel",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/baiducloud_vector_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/baiducloud_vector_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac9ecd43f8eeadec27ceb40d926cd7c418016adc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/baiducloud_vector_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import BESVectorStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"BESVectorStore": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BESVectorStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..59a719b541eea9f7c0a5ee112fb5db400fe120d0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/base.py
@@ -0,0 +1,3 @@
+from langchain_core.vectorstores import VectorStore, VectorStoreRetriever
+
+__all__ = ["VectorStore", "VectorStoreRetriever"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/cassandra.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/cassandra.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f8a8035b22ef02d876f48dcf58881c96e42b6e8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/cassandra.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Cassandra
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Cassandra": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Cassandra",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/chroma.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/chroma.py
new file mode 100644
index 0000000000000000000000000000000000000000..03d6300362391bd8d5a0c9a21ec898a6f1e8be99
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/chroma.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Chroma
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Chroma": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Chroma",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/clarifai.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/clarifai.py
new file mode 100644
index 0000000000000000000000000000000000000000..08d727bd9faf713a39bab9d38d064b551677bf74
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/clarifai.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Clarifai
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Clarifai": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Clarifai",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/clickhouse.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/clickhouse.py
new file mode 100644
index 0000000000000000000000000000000000000000..e5ff264a31bf66e5c23bd489b4a60357ada9631b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/clickhouse.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Clickhouse, ClickhouseSettings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ClickhouseSettings": "langchain_community.vectorstores",
+ "Clickhouse": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Clickhouse",
+ "ClickhouseSettings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/dashvector.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/dashvector.py
new file mode 100644
index 0000000000000000000000000000000000000000..d52addf210db94b12dcf854bc13ef96f08d7c8bf
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/dashvector.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import DashVector
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DashVector": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DashVector",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/databricks_vector_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/databricks_vector_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..1b744a182c166765990354edaef7b6c8ca1cd429
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/databricks_vector_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import DatabricksVectorSearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DatabricksVectorSearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DatabricksVectorSearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/deeplake.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/deeplake.py
new file mode 100644
index 0000000000000000000000000000000000000000..d9af2293a10688894230415458311c8697d8e873
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/deeplake.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import DeepLake
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DeepLake": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DeepLake",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/dingo.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/dingo.py
new file mode 100644
index 0000000000000000000000000000000000000000..b6e10ffc20e44e6f194edaf0a50874f3b3142b08
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/dingo.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Dingo
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Dingo": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Dingo",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..5cb1e41613be756eafa42f3c281661b60320d0ae
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/__init__.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import (
+ DocArrayHnswSearch,
+ DocArrayInMemorySearch,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DocArrayHnswSearch": "langchain_community.vectorstores",
+ "DocArrayInMemorySearch": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocArrayHnswSearch",
+ "DocArrayInMemorySearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..9563979b8811e9307c5416c768d486ed022b85e0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/base.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.docarray.base import DocArrayIndex
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DocArrayIndex": "langchain_community.vectorstores.docarray.base"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocArrayIndex",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/hnsw.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/hnsw.py
new file mode 100644
index 0000000000000000000000000000000000000000..ccd1b0279cb16f2ec9885850657984ae157e89cb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/hnsw.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import DocArrayHnswSearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DocArrayHnswSearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocArrayHnswSearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/in_memory.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/in_memory.py
new file mode 100644
index 0000000000000000000000000000000000000000..62630a3688863819837674ee9179063e9ec8b44b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/docarray/in_memory.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import DocArrayInMemorySearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"DocArrayInMemorySearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DocArrayInMemorySearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/elastic_vector_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/elastic_vector_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..29c707f60ff551e4a81a5e769c2da3aec0f38c2a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/elastic_vector_search.py
@@ -0,0 +1,27 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import ElasticKnnSearch, ElasticVectorSearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ElasticVectorSearch": "langchain_community.vectorstores",
+ "ElasticKnnSearch": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ElasticKnnSearch",
+ "ElasticVectorSearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/elasticsearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/elasticsearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..e11f43f340215940254700590cef64b1c7b6560a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/elasticsearch.py
@@ -0,0 +1,39 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import ElasticsearchStore
+ from langchain_community.vectorstores.elasticsearch import (
+ ApproxRetrievalStrategy,
+ BaseRetrievalStrategy,
+ ExactRetrievalStrategy,
+ SparseRetrievalStrategy,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaseRetrievalStrategy": "langchain_community.vectorstores.elasticsearch",
+ "ApproxRetrievalStrategy": "langchain_community.vectorstores.elasticsearch",
+ "ExactRetrievalStrategy": "langchain_community.vectorstores.elasticsearch",
+ "SparseRetrievalStrategy": "langchain_community.vectorstores.elasticsearch",
+ "ElasticsearchStore": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ApproxRetrievalStrategy",
+ "BaseRetrievalStrategy",
+ "ElasticsearchStore",
+ "ExactRetrievalStrategy",
+ "SparseRetrievalStrategy",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/epsilla.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/epsilla.py
new file mode 100644
index 0000000000000000000000000000000000000000..f7afedba9ea12bd1073d7b47af8d7fe88adfce1a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/epsilla.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Epsilla
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Epsilla": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Epsilla",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/faiss.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/faiss.py
new file mode 100644
index 0000000000000000000000000000000000000000..10383c17fd15adc8a207f955f753346092d487e1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/faiss.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import FAISS
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"FAISS": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FAISS",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/hippo.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/hippo.py
new file mode 100644
index 0000000000000000000000000000000000000000..b8fa171ee0fe0649d8339cb5f997ded79590591b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/hippo.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.hippo import Hippo
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Hippo": "langchain_community.vectorstores.hippo"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Hippo",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/hologres.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/hologres.py
new file mode 100644
index 0000000000000000000000000000000000000000..a20558e533aaf14df16431a540c0d4a8145891a6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/hologres.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Hologres
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Hologres": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Hologres",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/lancedb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/lancedb.py
new file mode 100644
index 0000000000000000000000000000000000000000..a81a7fbc9f6ad17daf35ca777157fcecd9e51667
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/lancedb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import LanceDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"LanceDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LanceDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/llm_rails.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/llm_rails.py
new file mode 100644
index 0000000000000000000000000000000000000000..392b7c3f4f68a7eb3f1e2c0b37e2199ad869e68c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/llm_rails.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import LLMRails
+ from langchain_community.vectorstores.llm_rails import LLMRailsRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "LLMRails": "langchain_community.vectorstores",
+ "LLMRailsRetriever": "langchain_community.vectorstores.llm_rails",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "LLMRails",
+ "LLMRailsRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/marqo.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/marqo.py
new file mode 100644
index 0000000000000000000000000000000000000000..31ed942638b8342fd535e49ae44b187413c03470
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/marqo.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Marqo
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Marqo": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Marqo",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/matching_engine.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/matching_engine.py
new file mode 100644
index 0000000000000000000000000000000000000000..f59a1b12a27de5313cc8dfaf7052cbb3a294647f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/matching_engine.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import MatchingEngine
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MatchingEngine": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MatchingEngine",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/meilisearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/meilisearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..71318f546a548656dc4a4265557a2bb59585eca0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/meilisearch.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Meilisearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Meilisearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Meilisearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/milvus.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/milvus.py
new file mode 100644
index 0000000000000000000000000000000000000000..314f221dd0b091a18f960f2ea6880f8c96b6a55b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/milvus.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Milvus
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Milvus": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Milvus",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/momento_vector_index.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/momento_vector_index.py
new file mode 100644
index 0000000000000000000000000000000000000000..b675350b84d5c9161fe9b1b152200d4ab5ac7c35
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/momento_vector_index.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import MomentoVectorIndex
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MomentoVectorIndex": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MomentoVectorIndex",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/mongodb_atlas.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/mongodb_atlas.py
new file mode 100644
index 0000000000000000000000000000000000000000..0ce46936f61bda848cf1cb6663e37bc01dcfc5aa
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/mongodb_atlas.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import MongoDBAtlasVectorSearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"MongoDBAtlasVectorSearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MongoDBAtlasVectorSearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/myscale.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/myscale.py
new file mode 100644
index 0000000000000000000000000000000000000000..85936be5f28fa6dd8e7f1894fcb8c955d05da3c2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/myscale.py
@@ -0,0 +1,30 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import MyScale, MyScaleSettings
+ from langchain_community.vectorstores.myscale import MyScaleWithoutJSON
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "MyScaleSettings": "langchain_community.vectorstores",
+ "MyScale": "langchain_community.vectorstores",
+ "MyScaleWithoutJSON": "langchain_community.vectorstores.myscale",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "MyScale",
+ "MyScaleSettings",
+ "MyScaleWithoutJSON",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/neo4j_vector.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/neo4j_vector.py
new file mode 100644
index 0000000000000000000000000000000000000000..a37fa92f26018e10ae843c3baabaeb5836aaacc6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/neo4j_vector.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Neo4jVector
+ from langchain_community.vectorstores.neo4j_vector import SearchType
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "SearchType": "langchain_community.vectorstores.neo4j_vector",
+ "Neo4jVector": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Neo4jVector",
+ "SearchType",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/nucliadb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/nucliadb.py
new file mode 100644
index 0000000000000000000000000000000000000000..9fc7c37de61ccf389266735c861c2187e95efcef
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/nucliadb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.nucliadb import NucliaDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"NucliaDB": "langchain_community.vectorstores.nucliadb"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "NucliaDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/opensearch_vector_search.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/opensearch_vector_search.py
new file mode 100644
index 0000000000000000000000000000000000000000..b3686b7aa558505756260c51bbf150f047b2ee4e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/opensearch_vector_search.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import OpenSearchVectorSearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"OpenSearchVectorSearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "OpenSearchVectorSearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgembedding.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgembedding.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac0401a48e42990bb14c83bc1e93eb51f81be194
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgembedding.py
@@ -0,0 +1,36 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import PGEmbedding
+ from langchain_community.vectorstores.pgembedding import (
+ CollectionStore,
+ EmbeddingStore,
+ QueryResult,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CollectionStore": "langchain_community.vectorstores.pgembedding",
+ "EmbeddingStore": "langchain_community.vectorstores.pgembedding",
+ "QueryResult": "langchain_community.vectorstores.pgembedding",
+ "PGEmbedding": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CollectionStore",
+ "EmbeddingStore",
+ "PGEmbedding",
+ "QueryResult",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgvecto_rs.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgvecto_rs.py
new file mode 100644
index 0000000000000000000000000000000000000000..9886ea6492be287f67766169c57a7de4456636d5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgvecto_rs.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.pgvecto_rs import PGVecto_rs
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"PGVecto_rs": "langchain_community.vectorstores.pgvecto_rs"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "PGVecto_rs",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgvector.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgvector.py
new file mode 100644
index 0000000000000000000000000000000000000000..86a100aae8bad31e16dab5e124db01715a386732
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pgvector.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import PGVector
+ from langchain_community.vectorstores.pgvector import DistanceStrategy
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DistanceStrategy": "langchain_community.vectorstores.pgvector",
+ "PGVector": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DistanceStrategy",
+ "PGVector",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pinecone.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pinecone.py
new file mode 100644
index 0000000000000000000000000000000000000000..8bab4faaee83affdef83cda0fea99aeee4e19be5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/pinecone.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Pinecone
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Pinecone": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Pinecone",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/qdrant.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/qdrant.py
new file mode 100644
index 0000000000000000000000000000000000000000..f29d1a2e6bcff6df06f1f6634de6bafca155e089
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/qdrant.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Qdrant
+ from langchain_community.vectorstores.qdrant import QdrantException
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "QdrantException": "langchain_community.vectorstores.qdrant",
+ "Qdrant": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Qdrant",
+ "QdrantException",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..d116a4f947e594f8119a47f6cea9d3623fae3221
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/__init__.py
@@ -0,0 +1,42 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Redis
+ from langchain_community.vectorstores.redis.base import RedisVectorStoreRetriever
+ from langchain_community.vectorstores.redis.filters import (
+ RedisFilter,
+ RedisNum,
+ RedisTag,
+ RedisText,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Redis": "langchain_community.vectorstores",
+ "RedisFilter": "langchain_community.vectorstores.redis.filters",
+ "RedisTag": "langchain_community.vectorstores.redis.filters",
+ "RedisText": "langchain_community.vectorstores.redis.filters",
+ "RedisNum": "langchain_community.vectorstores.redis.filters",
+ "RedisVectorStoreRetriever": "langchain_community.vectorstores.redis.base",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Redis",
+ "RedisFilter",
+ "RedisNum",
+ "RedisTag",
+ "RedisText",
+ "RedisVectorStoreRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..c44407ee8a1e8ffa9cf77d4bad6f865c72ec1599
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/base.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Redis
+ from langchain_community.vectorstores.redis.base import (
+ RedisVectorStoreRetriever,
+ check_index_exists,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "check_index_exists": "langchain_community.vectorstores.redis.base",
+ "Redis": "langchain_community.vectorstores",
+ "RedisVectorStoreRetriever": "langchain_community.vectorstores.redis.base",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Redis",
+ "RedisVectorStoreRetriever",
+ "check_index_exists",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/filters.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/filters.py
new file mode 100644
index 0000000000000000000000000000000000000000..d6689d97e34d752646ffc12b71e468f4a5a64148
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/filters.py
@@ -0,0 +1,48 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.redis.filters import (
+ RedisFilter,
+ RedisFilterExpression,
+ RedisFilterField,
+ RedisFilterOperator,
+ RedisNum,
+ RedisTag,
+ RedisText,
+ check_operator_misuse,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "RedisFilterOperator": "langchain_community.vectorstores.redis.filters",
+ "RedisFilter": "langchain_community.vectorstores.redis.filters",
+ "RedisFilterField": "langchain_community.vectorstores.redis.filters",
+ "check_operator_misuse": "langchain_community.vectorstores.redis.filters",
+ "RedisTag": "langchain_community.vectorstores.redis.filters",
+ "RedisNum": "langchain_community.vectorstores.redis.filters",
+ "RedisText": "langchain_community.vectorstores.redis.filters",
+ "RedisFilterExpression": "langchain_community.vectorstores.redis.filters",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "RedisFilter",
+ "RedisFilterExpression",
+ "RedisFilterField",
+ "RedisFilterOperator",
+ "RedisNum",
+ "RedisTag",
+ "RedisText",
+ "check_operator_misuse",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/schema.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/schema.py
new file mode 100644
index 0000000000000000000000000000000000000000..f1f2f88cf451e3131b01e2d765f88d2bea48a71e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/redis/schema.py
@@ -0,0 +1,54 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.redis.schema import (
+ FlatVectorField,
+ HNSWVectorField,
+ NumericFieldSchema,
+ RedisDistanceMetric,
+ RedisField,
+ RedisModel,
+ RedisVectorField,
+ TagFieldSchema,
+ TextFieldSchema,
+ read_schema,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "RedisDistanceMetric": "langchain_community.vectorstores.redis.schema",
+ "RedisField": "langchain_community.vectorstores.redis.schema",
+ "TextFieldSchema": "langchain_community.vectorstores.redis.schema",
+ "TagFieldSchema": "langchain_community.vectorstores.redis.schema",
+ "NumericFieldSchema": "langchain_community.vectorstores.redis.schema",
+ "RedisVectorField": "langchain_community.vectorstores.redis.schema",
+ "FlatVectorField": "langchain_community.vectorstores.redis.schema",
+ "HNSWVectorField": "langchain_community.vectorstores.redis.schema",
+ "RedisModel": "langchain_community.vectorstores.redis.schema",
+ "read_schema": "langchain_community.vectorstores.redis.schema",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "FlatVectorField",
+ "HNSWVectorField",
+ "NumericFieldSchema",
+ "RedisDistanceMetric",
+ "RedisField",
+ "RedisModel",
+ "RedisVectorField",
+ "TagFieldSchema",
+ "TextFieldSchema",
+ "read_schema",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/rocksetdb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/rocksetdb.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e748a408a986df411d22f74b72ac03b6afcd79b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/rocksetdb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Rockset
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Rockset": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Rockset",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/scann.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/scann.py
new file mode 100644
index 0000000000000000000000000000000000000000..260bdec37e46e56679a4aedc1c9c05931797e9c4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/scann.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import ScaNN
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"ScaNN": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ScaNN",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/semadb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/semadb.py
new file mode 100644
index 0000000000000000000000000000000000000000..b63e3ab12c61e24fdfa48ae2cb446ae44a072f9c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/semadb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import SemaDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SemaDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SemaDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/singlestoredb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/singlestoredb.py
new file mode 100644
index 0000000000000000000000000000000000000000..c46e65a980d23a1021a042c3faeaa19d4775b463
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/singlestoredb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import SingleStoreDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SingleStoreDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SingleStoreDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/sklearn.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/sklearn.py
new file mode 100644
index 0000000000000000000000000000000000000000..fde722c99b2f58f9c3007413c2a3a406ee586f14
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/sklearn.py
@@ -0,0 +1,42 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import SKLearnVectorStore
+ from langchain_community.vectorstores.sklearn import (
+ BaseSerializer,
+ BsonSerializer,
+ JsonSerializer,
+ ParquetSerializer,
+ SKLearnVectorStoreException,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "BaseSerializer": "langchain_community.vectorstores.sklearn",
+ "JsonSerializer": "langchain_community.vectorstores.sklearn",
+ "BsonSerializer": "langchain_community.vectorstores.sklearn",
+ "ParquetSerializer": "langchain_community.vectorstores.sklearn",
+ "SKLearnVectorStoreException": "langchain_community.vectorstores.sklearn",
+ "SKLearnVectorStore": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "BaseSerializer",
+ "BsonSerializer",
+ "JsonSerializer",
+ "ParquetSerializer",
+ "SKLearnVectorStore",
+ "SKLearnVectorStoreException",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/sqlitevss.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/sqlitevss.py
new file mode 100644
index 0000000000000000000000000000000000000000..2827298cee9d8fdda54a798a74e70618e34066cb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/sqlitevss.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import SQLiteVSS
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SQLiteVSS": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SQLiteVSS",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/starrocks.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/starrocks.py
new file mode 100644
index 0000000000000000000000000000000000000000..9604672c32be078f1029d1274b6634c9c869efd4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/starrocks.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import StarRocks
+ from langchain_community.vectorstores.starrocks import StarRocksSettings
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "StarRocksSettings": "langchain_community.vectorstores.starrocks",
+ "StarRocks": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "StarRocks",
+ "StarRocksSettings",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/supabase.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/supabase.py
new file mode 100644
index 0000000000000000000000000000000000000000..f55499edaac003e5216e2d004327b198a995389f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/supabase.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import SupabaseVectorStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"SupabaseVectorStore": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "SupabaseVectorStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tair.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tair.py
new file mode 100644
index 0000000000000000000000000000000000000000..76e85bc2d25995c15933118dadc8bd80af6d24a9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tair.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Tair
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Tair": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Tair",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tencentvectordb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tencentvectordb.py
new file mode 100644
index 0000000000000000000000000000000000000000..d4806cd9c347982a771351c2332a21332b17f97e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tencentvectordb.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import TencentVectorDB
+ from langchain_community.vectorstores.tencentvectordb import (
+ ConnectionParams,
+ IndexParams,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "ConnectionParams": "langchain_community.vectorstores.tencentvectordb",
+ "IndexParams": "langchain_community.vectorstores.tencentvectordb",
+ "TencentVectorDB": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "ConnectionParams",
+ "IndexParams",
+ "TencentVectorDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tiledb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tiledb.py
new file mode 100644
index 0000000000000000000000000000000000000000..930272a25be1e3accb426983cf9b676872eb54eb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/tiledb.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import TileDB
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TileDB": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TileDB",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/timescalevector.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/timescalevector.py
new file mode 100644
index 0000000000000000000000000000000000000000..55f730e4e620504b1da7e97935a11afd4b474913
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/timescalevector.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import TimescaleVector
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"TimescaleVector": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "TimescaleVector",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/typesense.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/typesense.py
new file mode 100644
index 0000000000000000000000000000000000000000..40256a8bcd33dea33755dd54fe8966078233c019
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/typesense.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Typesense
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Typesense": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Typesense",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/usearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/usearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..8012a86b4251759c0ef82f3a256c1c4b2f26602c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/usearch.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import USearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"USearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "USearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/utils.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8129c70e6fe62453b3f90d9b1d09b71013ac58b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/utils.py
@@ -0,0 +1,33 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.utils import (
+ DistanceStrategy,
+ filter_complex_metadata,
+ maximal_marginal_relevance,
+ )
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "DistanceStrategy": "langchain_community.vectorstores.utils",
+ "maximal_marginal_relevance": "langchain_community.vectorstores.utils",
+ "filter_complex_metadata": "langchain_community.vectorstores.utils",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "DistanceStrategy",
+ "filter_complex_metadata",
+ "maximal_marginal_relevance",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vald.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vald.py
new file mode 100644
index 0000000000000000000000000000000000000000..f08a1e954adf6c60472c56735a816c9ca98b355e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vald.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Vald
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Vald": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Vald",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vearch.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vearch.py
new file mode 100644
index 0000000000000000000000000000000000000000..adc91079f586b4c7afedb7e2d7b57cc63fe97b57
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vearch.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Vearch
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Vearch": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Vearch",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vectara.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vectara.py
new file mode 100644
index 0000000000000000000000000000000000000000..9acefc3cb2ee60245b0d020b6f308a962588053b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vectara.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Vectara
+ from langchain_community.vectorstores.vectara import VectaraRetriever
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "Vectara": "langchain_community.vectorstores",
+ "VectaraRetriever": "langchain_community.vectorstores.vectara",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Vectara",
+ "VectaraRetriever",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vespa.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vespa.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cd6414d33aa52ac8a793c7de62f87238f0f8456
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/vespa.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import VespaStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"VespaStore": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "VespaStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/weaviate.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/weaviate.py
new file mode 100644
index 0000000000000000000000000000000000000000..ea3607702f90c9331a30ae8516288b1614d2ddd4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/weaviate.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Weaviate
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Weaviate": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Weaviate",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/xata.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/xata.py
new file mode 100644
index 0000000000000000000000000000000000000000..835ff8571bd78b7f65a85e9b64df3e2d4de4640a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/xata.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores.xata import XataVectorStore
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"XataVectorStore": "langchain_community.vectorstores.xata"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "XataVectorStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/yellowbrick.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/yellowbrick.py
new file mode 100644
index 0000000000000000000000000000000000000000..0db830d81ccb7523fb6ef739ac05514af11b90af
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/yellowbrick.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Yellowbrick
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Yellowbrick": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Yellowbrick",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/zep.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/zep.py
new file mode 100644
index 0000000000000000000000000000000000000000..1ca2b025025883802acf47454a7542ffecaaeaba
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/zep.py
@@ -0,0 +1,28 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import ZepVectorStore
+ from langchain_community.vectorstores.zep import CollectionConfig
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {
+ "CollectionConfig": "langchain_community.vectorstores.zep",
+ "ZepVectorStore": "langchain_community.vectorstores",
+}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "CollectionConfig",
+ "ZepVectorStore",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/zilliz.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/zilliz.py
new file mode 100644
index 0000000000000000000000000000000000000000..e7b52226374ac7e26db07254d8ae0dfca8ca8cf7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_classic/vectorstores/zilliz.py
@@ -0,0 +1,23 @@
+from typing import TYPE_CHECKING, Any
+
+from langchain_classic._api import create_importer
+
+if TYPE_CHECKING:
+ from langchain_community.vectorstores import Zilliz
+
+# Create a way to dynamically look up deprecated imports.
+# Used to consolidate logic for raising deprecation warnings and
+# handling optional imports.
+DEPRECATED_LOOKUP = {"Zilliz": "langchain_community.vectorstores"}
+
+_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
+
+
+def __getattr__(name: str) -> Any:
+ """Look up attributes dynamically."""
+ return _import_attribute(name)
+
+
+__all__ = [
+ "Zilliz",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/adapters/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/adapters/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..841cf787140080b530576a275970d8a22072b14b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/adapters/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/adapters/__pycache__/openai.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/adapters/__pycache__/openai.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fea0d8c4ee3670794e3204acfeb5e8d11cd87c03
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/adapters/__pycache__/openai.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..264bdcec6a507b13c2bba4c168d1c9a395b09781
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/azure_ai_services.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/azure_ai_services.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f74595104274b59bd7ec39b768e77140584b6bf8
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/azure_ai_services.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/azure_cognitive_services.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/azure_cognitive_services.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bdbde3b50758998054015194b2c4dba976bb1015
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/azure_cognitive_services.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f3198e7f26dce765fc7289c3cf7f94e9c6d1755f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/load_tools.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/load_tools.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3975d9013de75b3293beb115f55c8de91374fca8
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/__pycache__/load_tools.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..c4295f2ef4886a3a6e862ed49c0050d3d9b8fc46
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__init__.py
@@ -0,0 +1 @@
+"""AINetwork toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3867cc84585d02c63e8cc66231962a137af71ebd
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ccd2c3798b5a65a281031e14533ab14bafe37063
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..abce2b6ed44fbd749f274d1a8dc3c4ab90fa8bbb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/ainetwork/toolkit.py
@@ -0,0 +1,70 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, List, Literal, Optional
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, model_validator
+
+from langchain_community.tools.ainetwork.app import AINAppOps
+from langchain_community.tools.ainetwork.owner import AINOwnerOps
+from langchain_community.tools.ainetwork.rule import AINRuleOps
+from langchain_community.tools.ainetwork.transfer import AINTransfer
+from langchain_community.tools.ainetwork.utils import authenticate
+from langchain_community.tools.ainetwork.value import AINValueOps
+
+if TYPE_CHECKING:
+ from ain.ain import Ain
+
+
+class AINetworkToolkit(BaseToolkit):
+ """Toolkit for interacting with AINetwork Blockchain.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by reading, creating, updating, deleting
+ data associated with this service.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ network: Optional. The network to connect to. Default is "testnet".
+ Options are "mainnet" or "testnet".
+ interface: Optional. The interface to use. If not provided, will
+ attempt to authenticate with the network. Default is None.
+ """
+
+ network: Optional[Literal["mainnet", "testnet"]] = "testnet"
+ interface: Optional[Ain] = None
+
+ @model_validator(mode="before")
+ @classmethod
+ def set_interface(cls, values: dict) -> Any:
+ """Set the interface if not provided.
+
+ If the interface is not provided, attempt to authenticate with the
+ network using the network value provided.
+
+ Args:
+ values: The values to validate.
+
+ Returns:
+ The validated values.
+ """
+ if not values.get("interface"):
+ values["interface"] = authenticate(network=values.get("network", "testnet"))
+ return values
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ validate_default=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ AINAppOps(),
+ AINOwnerOps(),
+ AINRuleOps(),
+ AINTransfer(),
+ AINValueOps(),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..37a6fca8d86dda9423be677ead774c9f98435d69
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..73c30a430defe3155758d370c202bde29053ab44
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..87f81653229747d345129b3cdf6f892c876625da
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/amadeus/toolkit.py
@@ -0,0 +1,38 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List, Optional
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.amadeus.closest_airport import AmadeusClosestAirport
+from langchain_community.tools.amadeus.flight_search import AmadeusFlightSearch
+from langchain_community.tools.amadeus.utils import authenticate
+
+if TYPE_CHECKING:
+ from amadeus import Client
+
+
+class AmadeusToolkit(BaseToolkit):
+ """Toolkit for interacting with Amadeus which offers APIs for travel.
+
+ Parameters:
+ client: Optional. The Amadeus client. Default is None.
+ llm: Optional. The language model to use. Default is None.
+ """
+
+ client: Client = Field(default_factory=authenticate)
+ llm: Optional[BaseLanguageModel] = Field(default=None)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ AmadeusClosestAirport(llm=self.llm),
+ AmadeusFlightSearch(),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..ada4255d14216a3fab4d578960c8028406082d2e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__init__.py
@@ -0,0 +1 @@
+"""Apache Cassandra Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c16327c12bfb3f6d04c8976d4988d584cf117677
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2af4503739c5a847a5a98b321f5244f3fa0fa8c0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..2e017e994798e678bfc2f7c28b30efc10f75389b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cassandra_database/toolkit.py
@@ -0,0 +1,37 @@
+"""Apache Cassandra Toolkit."""
+
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.cassandra_database.tool import (
+ GetSchemaCassandraDatabaseTool,
+ GetTableDataCassandraDatabaseTool,
+ QueryCassandraDatabaseTool,
+)
+from langchain_community.utilities.cassandra_database import CassandraDatabase
+
+
+class CassandraDatabaseToolkit(BaseToolkit):
+ """Toolkit for interacting with an Apache Cassandra database.
+
+ Parameters:
+ db: CassandraDatabase. The Cassandra database to interact
+ with.
+ """
+
+ db: CassandraDatabase = Field(exclude=True)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ GetSchemaCassandraDatabaseTool(db=self.db),
+ QueryCassandraDatabaseTool(db=self.db),
+ GetTableDataCassandraDatabaseTool(db=self.db),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..92bc96193b44fd6b146aff23a22707d87da18a5a
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..752cb11a4a066d0bd1072ff4f22fbdab86232bf8
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..6411c67dae59ec1245eeb97d05ab686310ba2620
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/clickup/toolkit.py
@@ -0,0 +1,120 @@
+from typing import Dict, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.clickup.prompt import (
+ CLICKUP_FOLDER_CREATE_PROMPT,
+ CLICKUP_GET_ALL_TEAMS_PROMPT,
+ CLICKUP_GET_FOLDERS_PROMPT,
+ CLICKUP_GET_LIST_PROMPT,
+ CLICKUP_GET_SPACES_PROMPT,
+ CLICKUP_GET_TASK_ATTRIBUTE_PROMPT,
+ CLICKUP_GET_TASK_PROMPT,
+ CLICKUP_LIST_CREATE_PROMPT,
+ CLICKUP_TASK_CREATE_PROMPT,
+ CLICKUP_UPDATE_TASK_ASSIGNEE_PROMPT,
+ CLICKUP_UPDATE_TASK_PROMPT,
+)
+from langchain_community.tools.clickup.tool import ClickupAction
+from langchain_community.utilities.clickup import ClickupAPIWrapper
+
+
+class ClickupToolkit(BaseToolkit):
+ """Clickup Toolkit.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by reading, creating, updating, deleting
+ data associated with this service.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_clickup_api_wrapper(
+ cls, clickup_api_wrapper: ClickupAPIWrapper
+ ) -> "ClickupToolkit":
+ """Create a ClickupToolkit from a ClickupAPIWrapper.
+
+ Args:
+ clickup_api_wrapper: ClickupAPIWrapper. The Clickup API wrapper.
+
+ Returns:
+ ClickupToolkit. The Clickup toolkit.
+ """
+ operations: List[Dict] = [
+ {
+ "mode": "get_task",
+ "name": "Get task",
+ "description": CLICKUP_GET_TASK_PROMPT,
+ },
+ {
+ "mode": "get_task_attribute",
+ "name": "Get task attribute",
+ "description": CLICKUP_GET_TASK_ATTRIBUTE_PROMPT,
+ },
+ {
+ "mode": "get_teams",
+ "name": "Get Teams",
+ "description": CLICKUP_GET_ALL_TEAMS_PROMPT,
+ },
+ {
+ "mode": "create_task",
+ "name": "Create Task",
+ "description": CLICKUP_TASK_CREATE_PROMPT,
+ },
+ {
+ "mode": "create_list",
+ "name": "Create List",
+ "description": CLICKUP_LIST_CREATE_PROMPT,
+ },
+ {
+ "mode": "create_folder",
+ "name": "Create Folder",
+ "description": CLICKUP_FOLDER_CREATE_PROMPT,
+ },
+ {
+ "mode": "get_list",
+ "name": "Get all lists in the space",
+ "description": CLICKUP_GET_LIST_PROMPT,
+ },
+ {
+ "mode": "get_folders",
+ "name": "Get all folders in the workspace",
+ "description": CLICKUP_GET_FOLDERS_PROMPT,
+ },
+ {
+ "mode": "get_spaces",
+ "name": "Get all spaces in the workspace",
+ "description": CLICKUP_GET_SPACES_PROMPT,
+ },
+ {
+ "mode": "update_task",
+ "name": "Update task",
+ "description": CLICKUP_UPDATE_TASK_PROMPT,
+ },
+ {
+ "mode": "update_task_assignees",
+ "name": "Update task assignees",
+ "description": CLICKUP_UPDATE_TASK_ASSIGNEE_PROMPT,
+ },
+ ]
+ tools = [
+ ClickupAction(
+ name=action["name"],
+ description=action["description"],
+ mode=action["mode"],
+ api_wrapper=clickup_api_wrapper,
+ )
+ for action in operations
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..df1d84976c49a8fd9f1c3bc0c8190b65a46c7df6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__init__.py
@@ -0,0 +1 @@
+"""CogniSwitch Toolkit"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..97fd8aab9ba72326bbcdb0d25cd231c44b84ce34
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7863f13771000defe54d225f6acbb7b0d8a4d242
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..b5ed20f5d5c137ec51febc1efab544d9dc07b523
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/cogniswitch/toolkit.py
@@ -0,0 +1,45 @@
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.cogniswitch.tool import (
+ CogniswitchKnowledgeRequest,
+ CogniswitchKnowledgeSourceFile,
+ CogniswitchKnowledgeSourceURL,
+ CogniswitchKnowledgeStatus,
+)
+
+
+class CogniswitchToolkit(BaseToolkit):
+ """Toolkit for CogniSwitch.
+
+ Use the toolkit to get all the tools present in the Cogniswitch and
+ use them to interact with your knowledge.
+
+ Parameters:
+ cs_token: str. The Cogniswitch token.
+ OAI_token: str. The OpenAI API token.
+ apiKey: str. The Cogniswitch OAuth token.
+ """
+
+ cs_token: str
+ OAI_token: str
+ apiKey: str
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ CogniswitchKnowledgeStatus(
+ cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
+ ),
+ CogniswitchKnowledgeRequest(
+ cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
+ ),
+ CogniswitchKnowledgeSourceFile(
+ cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
+ ),
+ CogniswitchKnowledgeSourceURL(
+ cs_token=self.cs_token, OAI_token=self.OAI_token, apiKey=self.apiKey
+ ),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1839897c39472e86614b6b91e83701242ce1fe0a
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__init__.py
@@ -0,0 +1,7 @@
+"""
+This module contains the ConneryToolkit.
+"""
+
+from .toolkit import ConneryToolkit
+
+__all__ = ["ConneryToolkit"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bbc976e9c107d67e191d890e7469273dcee15971
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..70083ce65f5da5ae151d201b6b7ab349fc305dca
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..05b15d18c269b779877b87ff9c2e7369b9dfc788
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/connery/toolkit.py
@@ -0,0 +1,60 @@
+from typing import Any, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import model_validator
+
+from langchain_community.tools.connery import ConneryService
+
+
+class ConneryToolkit(BaseToolkit):
+ """
+ Toolkit with a list of Connery Actions as tools.
+
+ Parameters:
+ tools (List[BaseTool]): The list of Connery Actions.
+ """
+
+ tools: List[BaseTool]
+
+ def get_tools(self) -> List[BaseTool]:
+ """
+ Returns the list of Connery Actions.
+ """
+ return self.tools
+
+ @model_validator(mode="before")
+ @classmethod
+ def validate_attributes(cls, values: dict) -> Any:
+ """
+ Validate the attributes of the ConneryToolkit class.
+
+ Args:
+ values (dict): The arguments to validate.
+ Returns:
+ dict: The validated arguments.
+
+ Raises:
+ ValueError: If the 'tools' attribute is not set
+ """
+
+ if not values.get("tools"):
+ raise ValueError("The attribute 'tools' must be set.")
+
+ return values
+
+ @classmethod
+ def create_instance(cls, connery_service: ConneryService) -> "ConneryToolkit":
+ """
+ Creates a Connery Toolkit using a Connery Service.
+
+ Parameters:
+ connery_service (ConneryService): The Connery Service
+ to get the list of Connery Actions.
+ Returns:
+ ConneryToolkit: The Connery Toolkit.
+ """
+
+ instance = cls(tools=connery_service.list_actions()) # type: ignore[arg-type]
+
+ return instance
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/csv/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/csv/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..4b049802888eaf0e8800d0ddfa29ec9b4ff4a42b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/csv/__init__.py
@@ -0,0 +1,26 @@
+from pathlib import Path
+from typing import Any
+
+from langchain_core._api.path import as_import_path
+
+
+def __getattr__(name: str) -> Any:
+ """Get attr name."""
+
+ if name == "create_csv_agent":
+ # Get directory of langchain package
+ HERE = Path(__file__).parents[3]
+ here = as_import_path(Path(__file__).parent, relative_to=HERE)
+
+ old_path = "langchain." + here + "." + name
+ new_path = "langchain_experimental." + here + "." + name
+ raise ImportError(
+ "This agent has been moved to langchain experiment. "
+ "This agent relies on python REPL tool under the hood, so to use it "
+ "safely please sandbox the python REPL. "
+ "Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md "
+ "and https://github.com/langchain-ai/langchain/discussions/11680"
+ "To keep using this code as is, install langchain experimental and "
+ f"update your import statement from:\n `{old_path}` to `{new_path}`."
+ )
+ raise AttributeError(f"{name} does not exist")
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/csv/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/csv/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6a0627a7b07a76207d5abffcff45bcbc17b60034
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/csv/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..53ce9329f914837adb259a2754cd522b62015c77
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__init__.py
@@ -0,0 +1,7 @@
+"""Local file management toolkit."""
+
+from langchain_community.agent_toolkits.file_management.toolkit import (
+ FileManagementToolkit,
+)
+
+__all__ = ["FileManagementToolkit"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..96bfab867f8da8a0da5ed892b2e6d9cb98729457
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e070f3ad532e265bfe53ca6b0612efc0a2310392
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..82c4f3d5cc9db7621f4b8e44b38834d5b734bd06
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/file_management/toolkit.py
@@ -0,0 +1,88 @@
+from __future__ import annotations
+
+from typing import Any, Dict, List, Optional, Type
+
+from langchain_core.tools import BaseTool, BaseToolkit
+from langchain_core.utils.pydantic import get_fields
+from pydantic import model_validator
+
+from langchain_community.tools.file_management.copy import CopyFileTool
+from langchain_community.tools.file_management.delete import DeleteFileTool
+from langchain_community.tools.file_management.file_search import FileSearchTool
+from langchain_community.tools.file_management.list_dir import ListDirectoryTool
+from langchain_community.tools.file_management.move import MoveFileTool
+from langchain_community.tools.file_management.read import ReadFileTool
+from langchain_community.tools.file_management.write import WriteFileTool
+
+_FILE_TOOLS: List[Type[BaseTool]] = [
+ CopyFileTool,
+ DeleteFileTool,
+ FileSearchTool,
+ MoveFileTool,
+ ReadFileTool,
+ WriteFileTool,
+ ListDirectoryTool,
+]
+_FILE_TOOLS_MAP: Dict[str, Type[BaseTool]] = {
+ get_fields(tool_cls)["name"].default: tool_cls for tool_cls in _FILE_TOOLS
+}
+
+
+class FileManagementToolkit(BaseToolkit):
+ """Toolkit for interacting with local files.
+
+ *Security Notice*: This toolkit provides methods to interact with local files.
+ If providing this toolkit to an agent on an LLM, ensure you scope
+ the agent's permissions to only include the necessary permissions
+ to perform the desired operations.
+
+ By **default** the agent will have access to all files within
+ the root dir and will be able to Copy, Delete, Move, Read, Write
+ and List files in that directory.
+
+ Consider the following:
+ - Limit access to particular directories using `root_dir`.
+ - Use filesystem permissions to restrict access and permissions to only
+ the files and directories required by the agent.
+ - Limit the tools available to the agent to only the file operations
+ necessary for the agent's intended use.
+ - Sandbox the agent by running it in a container.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ root_dir: Optional. The root directory to perform file operations.
+ If not provided, file operations are performed relative to the current
+ working directory.
+ selected_tools: Optional. The tools to include in the toolkit. If not
+ provided, all tools are included.
+ """
+
+ root_dir: Optional[str] = None
+ """If specified, all file operations are made relative to root_dir."""
+ selected_tools: Optional[List[str]] = None
+ """If provided, only provide the selected tools. Defaults to all."""
+
+ @model_validator(mode="before")
+ @classmethod
+ def validate_tools(cls, values: dict) -> Any:
+ selected_tools = values.get("selected_tools") or []
+ for tool_name in selected_tools:
+ if tool_name not in _FILE_TOOLS_MAP:
+ raise ValueError(
+ f"File Tool of name {tool_name} not supported."
+ f" Permitted tools: {list(_FILE_TOOLS_MAP)}"
+ )
+ return values
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ allowed_tools = self.selected_tools or _FILE_TOOLS_MAP
+ tools: List[BaseTool] = []
+ for tool in allowed_tools:
+ tool_cls = _FILE_TOOLS_MAP[tool]
+ tools.append(tool_cls(root_dir=self.root_dir))
+ return tools
+
+
+__all__ = ["FileManagementToolkit"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..7121e6ee32003677b86bf38fa429d8710811430b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__init__.py
@@ -0,0 +1 @@
+"""financial datasets toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f6dafc724a1fb4ecce75b9bd7d8d5b8aef41967a
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b1d01eafd86a8199c3ad33daa6df76225e63a670
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..0fd509d0017cb5fe6acaf7cd457b20f456536aea
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/financial_datasets/toolkit.py
@@ -0,0 +1,44 @@
+from __future__ import annotations
+
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.financial_datasets.balance_sheets import BalanceSheets
+from langchain_community.tools.financial_datasets.cash_flow_statements import (
+ CashFlowStatements,
+)
+from langchain_community.tools.financial_datasets.income_statements import (
+ IncomeStatements,
+)
+from langchain_community.utilities.financial_datasets import FinancialDatasetsAPIWrapper
+
+
+class FinancialDatasetsToolkit(BaseToolkit):
+ """Toolkit for interacting with financialdatasets.ai.
+
+ Parameters:
+ api_wrapper: The FinancialDatasets API Wrapper.
+ """
+
+ api_wrapper: FinancialDatasetsAPIWrapper = Field(
+ default_factory=FinancialDatasetsAPIWrapper
+ )
+
+ def __init__(self, api_wrapper: FinancialDatasetsAPIWrapper):
+ super().__init__()
+ self.api_wrapper = api_wrapper
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ BalanceSheets(api_wrapper=self.api_wrapper),
+ CashFlowStatements(api_wrapper=self.api_wrapper),
+ IncomeStatements(api_wrapper=self.api_wrapper),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..bcd9368a52a4c85c4ce4703be431d8e32f1b959b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__init__.py
@@ -0,0 +1 @@
+"""GitHub Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..40a8dc268dc73aa96f068175741cb816eba17265
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8e64b1e1f12ae4152d13b10bfa32f86e059ed8d6
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..7bc9bca042522b271125ad7d676ce69860788734
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/github/toolkit.py
@@ -0,0 +1,479 @@
+"""GitHub Toolkit."""
+
+from typing import Dict, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import BaseModel, Field
+
+from langchain_community.tools.github.prompt import (
+ COMMENT_ON_ISSUE_PROMPT,
+ CREATE_BRANCH_PROMPT,
+ CREATE_FILE_PROMPT,
+ CREATE_PULL_REQUEST_PROMPT,
+ CREATE_REVIEW_REQUEST_PROMPT,
+ DELETE_FILE_PROMPT,
+ GET_FILES_FROM_DIRECTORY_PROMPT,
+ GET_ISSUE_PROMPT,
+ GET_ISSUES_PROMPT,
+ GET_LATEST_RELEASE_PROMPT,
+ GET_PR_PROMPT,
+ GET_RELEASE_PROMPT,
+ GET_RELEASES_PROMPT,
+ LIST_BRANCHES_IN_REPO_PROMPT,
+ LIST_PRS_PROMPT,
+ LIST_PULL_REQUEST_FILES,
+ OVERVIEW_EXISTING_FILES_BOT_BRANCH,
+ OVERVIEW_EXISTING_FILES_IN_MAIN,
+ READ_FILE_PROMPT,
+ SEARCH_CODE_PROMPT,
+ SEARCH_ISSUES_AND_PRS_PROMPT,
+ SET_ACTIVE_BRANCH_PROMPT,
+ UPDATE_FILE_PROMPT,
+)
+from langchain_community.tools.github.tool import GitHubAction
+from langchain_community.utilities.github import GitHubAPIWrapper
+
+
+class NoInput(BaseModel):
+ """Schema for operations that do not require any input."""
+
+ no_input: str = Field("", description="No input required, e.g. `` (empty string).")
+
+
+class GetIssue(BaseModel):
+ """Schema for operations that require an issue number as input."""
+
+ issue_number: int = Field(0, description="Issue number as an integer, e.g. `42`")
+
+
+class CommentOnIssue(BaseModel):
+ """Schema for operations that require a comment as input."""
+
+ input: str = Field(..., description="Follow the required formatting.")
+
+
+class GetPR(BaseModel):
+ """Schema for operations that require a PR number as input."""
+
+ pr_number: int = Field(0, description="The PR number as an integer, e.g. `12`")
+
+
+class CreatePR(BaseModel):
+ """Schema for operations that require a PR title and body as input."""
+
+ formatted_pr: str = Field(..., description="Follow the required formatting.")
+
+
+class CreateFile(BaseModel):
+ """Schema for operations that require a file path and content as input."""
+
+ formatted_file: str = Field(..., description="Follow the required formatting.")
+
+
+class ReadFile(BaseModel):
+ """Schema for operations that require a file path as input."""
+
+ formatted_filepath: str = Field(
+ ...,
+ description=(
+ "The full file path of the file you would like to read where the "
+ "path must NOT start with a slash, e.g. `some_dir/my_file.py`."
+ ),
+ )
+
+
+class UpdateFile(BaseModel):
+ """Schema for operations that require a file path and content as input."""
+
+ formatted_file_update: str = Field(
+ ..., description="Strictly follow the provided rules."
+ )
+
+
+class DeleteFile(BaseModel):
+ """Schema for operations that require a file path as input."""
+
+ formatted_filepath: str = Field(
+ ...,
+ description=(
+ "The full file path of the file you would like to delete"
+ " where the path must NOT start with a slash, e.g."
+ " `some_dir/my_file.py`. Only input a string,"
+ " not the param name."
+ ),
+ )
+
+
+class DirectoryPath(BaseModel):
+ """Schema for operations that require a directory path as input."""
+
+ input: str = Field(
+ "",
+ description=(
+ "The path of the directory, e.g. `some_dir/inner_dir`."
+ " Only input a string, do not include the parameter name."
+ ),
+ )
+
+
+class BranchName(BaseModel):
+ """Schema for operations that require a branch name as input."""
+
+ branch_name: str = Field(
+ ..., description="The name of the branch, e.g. `my_branch`."
+ )
+
+
+class SearchCode(BaseModel):
+ """Schema for operations that require a search query as input."""
+
+ search_query: str = Field(
+ ...,
+ description=(
+ "A keyword-focused natural language search"
+ "query for code, e.g. `MyFunctionName()`."
+ ),
+ )
+
+
+class CreateReviewRequest(BaseModel):
+ """Schema for operations that require a username as input."""
+
+ username: str = Field(
+ ...,
+ description="GitHub username of the user being requested, e.g. `my_username`.",
+ )
+
+
+class SearchIssuesAndPRs(BaseModel):
+ """Schema for operations that require a search query as input."""
+
+ search_query: str = Field(
+ ...,
+ description="Natural language search query, e.g. `My issue title or topic`.",
+ )
+
+
+class TagName(BaseModel):
+ """Schema for operations that require a tag name as input."""
+
+ tag_name: str = Field(
+ ...,
+ description="The tag name of the release, e.g. `v1.0.0`.",
+ )
+
+
+class GitHubToolkit(BaseToolkit):
+ """GitHub Toolkit.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by creating, deleting, or updating,
+ reading underlying data.
+
+ For example, this toolkit can be used to create issues, pull requests,
+ and comments on GitHub.
+
+ See [Security](https://python.langchain.com/docs/security) for more information.
+
+ Setup:
+ See detailed installation instructions here:
+ https://python.langchain.com/docs/integrations/tools/github/#installation
+
+ You will need to install ``pygithub`` and set the following environment
+ variables:
+
+ .. code-block:: bash
+
+ pip install -U pygithub
+ export GITHUB_APP_ID="your-app-id"
+ export GITHUB_APP_PRIVATE_KEY="path-to-private-key"
+ export GITHUB_REPOSITORY="your-github-repository"
+
+ Instantiate:
+ .. code-block:: python
+
+ from langchain_community.agent_toolkits.github.toolkit import GitHubToolkit
+ from langchain_community.utilities.github import GitHubAPIWrapper
+
+ github = GitHubAPIWrapper()
+ toolkit = GitHubToolkit.from_github_api_wrapper(github)
+
+ Tools:
+ .. code-block:: python
+
+ tools = toolkit.get_tools()
+ for tool in tools:
+ print(tool.name)
+
+ .. code-block:: none
+
+ Get Issues
+ Get Issue
+ Comment on Issue
+ List open pull requests (PRs)
+ Get Pull Request
+ Overview of files included in PR
+ Create Pull Request
+ List Pull Requests' Files
+ Create File
+ Read File
+ Update File
+ Delete File
+ Overview of existing files in Main branch
+ Overview of files in current working branch
+ List branches in this repository
+ Set active branch
+ Create a new branch
+ Get files from a directory
+ Search issues and pull requests
+ Search code
+ Create review request
+
+ Include release tools:
+ By default, the toolkit does not include release-related tools.
+ You can include them by setting ``include_release_tools=True`` when
+ initializing the toolkit:
+
+ .. code-block:: python
+
+ toolkit = GitHubToolkit.from_github_api_wrapper(
+ github, include_release_tools=True
+ )
+
+ Setting ``include_release_tools=True`` will include the following tools:
+
+ .. code-block:: none
+
+ Get latest release
+ Get releases
+ Get release
+
+ Use within an agent:
+ .. code-block:: python
+
+ from langchain_openai import ChatOpenAI
+ from langgraph.prebuilt import create_react_agent
+
+ # Select example tool
+ tools = [tool for tool in toolkit.get_tools() if tool.name == "Get Issue"]
+ assert len(tools) == 1
+ tools[0].name = "get_issue"
+
+ llm = ChatOpenAI(model="gpt-4o-mini")
+ agent_executor = create_react_agent(llm, tools)
+
+ example_query = "What is the title of issue 24888?"
+
+ events = agent_executor.stream(
+ {"messages": [("user", example_query)]},
+ stream_mode="values",
+ )
+ for event in events:
+ event["messages"][-1].pretty_print()
+
+ .. code-block:: none
+
+ ================================[1m Human Message [0m=================================
+
+ What is the title of issue 24888?
+ ==================================[1m Ai Message [0m==================================
+ Tool Calls:
+ get_issue (call_iSYJVaM7uchfNHOMJoVPQsOi)
+ Call ID: call_iSYJVaM7uchfNHOMJoVPQsOi
+ Args:
+ issue_number: 24888
+ =================================[1m Tool Message [0m=================================
+ Name: get_issue
+
+ {"number": 24888, "title": "Standardize KV-Store Docs", "body": "..."
+ ==================================[1m Ai Message [0m==================================
+
+ The title of issue 24888 is "Standardize KV-Store Docs".
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """ # noqa: E501
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_github_api_wrapper(
+ cls, github_api_wrapper: GitHubAPIWrapper, include_release_tools: bool = False
+ ) -> "GitHubToolkit":
+ """Create a GitHubToolkit from a GitHubAPIWrapper.
+
+ Args:
+ github_api_wrapper: GitHubAPIWrapper. The GitHub API wrapper.
+ include_release_tools: bool. Whether to include release-related tools.
+ Defaults to False.
+
+ Returns:
+ GitHubToolkit. The GitHub toolkit.
+ """
+ operations: List[Dict] = [
+ {
+ "mode": "get_issues",
+ "name": "Get Issues",
+ "description": GET_ISSUES_PROMPT,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "get_issue",
+ "name": "Get Issue",
+ "description": GET_ISSUE_PROMPT,
+ "args_schema": GetIssue,
+ },
+ {
+ "mode": "comment_on_issue",
+ "name": "Comment on Issue",
+ "description": COMMENT_ON_ISSUE_PROMPT,
+ "args_schema": CommentOnIssue,
+ },
+ {
+ "mode": "list_open_pull_requests",
+ "name": "List open pull requests (PRs)",
+ "description": LIST_PRS_PROMPT,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "get_pull_request",
+ "name": "Get Pull Request",
+ "description": GET_PR_PROMPT,
+ "args_schema": GetPR,
+ },
+ {
+ "mode": "list_pull_request_files",
+ "name": "Overview of files included in PR",
+ "description": LIST_PULL_REQUEST_FILES,
+ "args_schema": GetPR,
+ },
+ {
+ "mode": "create_pull_request",
+ "name": "Create Pull Request",
+ "description": CREATE_PULL_REQUEST_PROMPT,
+ "args_schema": CreatePR,
+ },
+ {
+ "mode": "list_pull_request_files",
+ "name": "List Pull Requests' Files",
+ "description": LIST_PULL_REQUEST_FILES,
+ "args_schema": GetPR,
+ },
+ {
+ "mode": "create_file",
+ "name": "Create File",
+ "description": CREATE_FILE_PROMPT,
+ "args_schema": CreateFile,
+ },
+ {
+ "mode": "read_file",
+ "name": "Read File",
+ "description": READ_FILE_PROMPT,
+ "args_schema": ReadFile,
+ },
+ {
+ "mode": "update_file",
+ "name": "Update File",
+ "description": UPDATE_FILE_PROMPT,
+ "args_schema": UpdateFile,
+ },
+ {
+ "mode": "delete_file",
+ "name": "Delete File",
+ "description": DELETE_FILE_PROMPT,
+ "args_schema": DeleteFile,
+ },
+ {
+ "mode": "list_files_in_main_branch",
+ "name": "Overview of existing files in Main branch",
+ "description": OVERVIEW_EXISTING_FILES_IN_MAIN,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "list_files_in_bot_branch",
+ "name": "Overview of files in current working branch",
+ "description": OVERVIEW_EXISTING_FILES_BOT_BRANCH,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "list_branches_in_repo",
+ "name": "List branches in this repository",
+ "description": LIST_BRANCHES_IN_REPO_PROMPT,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "set_active_branch",
+ "name": "Set active branch",
+ "description": SET_ACTIVE_BRANCH_PROMPT,
+ "args_schema": BranchName,
+ },
+ {
+ "mode": "create_branch",
+ "name": "Create a new branch",
+ "description": CREATE_BRANCH_PROMPT,
+ "args_schema": BranchName,
+ },
+ {
+ "mode": "get_files_from_directory",
+ "name": "Get files from a directory",
+ "description": GET_FILES_FROM_DIRECTORY_PROMPT,
+ "args_schema": DirectoryPath,
+ },
+ {
+ "mode": "search_issues_and_prs",
+ "name": "Search issues and pull requests",
+ "description": SEARCH_ISSUES_AND_PRS_PROMPT,
+ "args_schema": SearchIssuesAndPRs,
+ },
+ {
+ "mode": "search_code",
+ "name": "Search code",
+ "description": SEARCH_CODE_PROMPT,
+ "args_schema": SearchCode,
+ },
+ {
+ "mode": "create_review_request",
+ "name": "Create review request",
+ "description": CREATE_REVIEW_REQUEST_PROMPT,
+ "args_schema": CreateReviewRequest,
+ },
+ ]
+
+ release_operations: List[Dict] = [
+ {
+ "mode": "get_latest_release",
+ "name": "Get latest release",
+ "description": GET_LATEST_RELEASE_PROMPT,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "get_releases",
+ "name": "Get releases",
+ "description": GET_RELEASES_PROMPT,
+ "args_schema": NoInput,
+ },
+ {
+ "mode": "get_release",
+ "name": "Get release",
+ "description": GET_RELEASE_PROMPT,
+ "args_schema": TagName,
+ },
+ ]
+
+ operations = operations + (release_operations if include_release_tools else [])
+ tools = [
+ GitHubAction(
+ name=action["name"],
+ description=action["description"],
+ mode=action["mode"],
+ api_wrapper=github_api_wrapper,
+ args_schema=action.get("args_schema", None),
+ )
+ for action in operations
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..7d3ca720636309ecfe762283732a06cfc68f3294
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__init__.py
@@ -0,0 +1 @@
+"""GitLab Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..59cdf5d722bfb7563d390f1d470e4e78b50b0f0a
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9bf8c9f58e2f913a86ecbb754b940dc1b931bdbf
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..8e50610770aabf3d9068bbee884e7c0af7a0c62b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gitlab/toolkit.py
@@ -0,0 +1,170 @@
+"""GitLab Toolkit."""
+
+from typing import Dict, List, Optional
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.gitlab.prompt import (
+ COMMENT_ON_ISSUE_PROMPT,
+ CREATE_FILE_PROMPT,
+ CREATE_PULL_REQUEST_PROMPT,
+ CREATE_REPO_BRANCH,
+ DELETE_FILE_PROMPT,
+ GET_ISSUE_PROMPT,
+ GET_ISSUES_PROMPT,
+ GET_REPO_FILES_FROM_DIRECTORY,
+ GET_REPO_FILES_IN_BOT_BRANCH,
+ GET_REPO_FILES_IN_MAIN,
+ LIST_REPO_BRANCES,
+ READ_FILE_PROMPT,
+ SET_ACTIVE_BRANCH,
+ UPDATE_FILE_PROMPT,
+)
+from langchain_community.tools.gitlab.tool import GitLabAction
+from langchain_community.utilities.gitlab import GitLabAPIWrapper
+
+# only include a subset of tools by default to avoid a breaking change, where
+# new tools are added to the toolkit and the user's code breaks because of
+# the new tools
+DEFAULT_INCLUDED_TOOLS = [
+ "get_issues",
+ "get_issue",
+ "comment_on_issue",
+ "create_pull_request",
+ "create_file",
+ "read_file",
+ "update_file",
+ "delete_file",
+]
+
+
+class GitLabToolkit(BaseToolkit):
+ """GitLab Toolkit.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by creating, deleting, or updating,
+ reading underlying data.
+
+ For example, this toolkit can be used to create issues, pull requests,
+ and comments on GitLab.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_gitlab_api_wrapper(
+ cls,
+ gitlab_api_wrapper: GitLabAPIWrapper,
+ *,
+ included_tools: Optional[List[str]] = None,
+ ) -> "GitLabToolkit":
+ """Create a GitLabToolkit from a GitLabAPIWrapper.
+
+ Args:
+ gitlab_api_wrapper: GitLabAPIWrapper. The GitLab API wrapper.
+
+ Returns:
+ GitLabToolkit. The GitLab toolkit.
+ """
+
+ tools_to_include = (
+ included_tools if included_tools is not None else DEFAULT_INCLUDED_TOOLS
+ )
+
+ operations: List[Dict] = [
+ {
+ "mode": "get_issues",
+ "name": "Get Issues",
+ "description": GET_ISSUES_PROMPT,
+ },
+ {
+ "mode": "get_issue",
+ "name": "Get Issue",
+ "description": GET_ISSUE_PROMPT,
+ },
+ {
+ "mode": "comment_on_issue",
+ "name": "Comment on Issue",
+ "description": COMMENT_ON_ISSUE_PROMPT,
+ },
+ {
+ "mode": "create_pull_request",
+ "name": "Create Pull Request",
+ "description": CREATE_PULL_REQUEST_PROMPT,
+ },
+ {
+ "mode": "create_file",
+ "name": "Create File",
+ "description": CREATE_FILE_PROMPT,
+ },
+ {
+ "mode": "read_file",
+ "name": "Read File",
+ "description": READ_FILE_PROMPT,
+ },
+ {
+ "mode": "update_file",
+ "name": "Update File",
+ "description": UPDATE_FILE_PROMPT,
+ },
+ {
+ "mode": "delete_file",
+ "name": "Delete File",
+ "description": DELETE_FILE_PROMPT,
+ },
+ {
+ "mode": "create_branch",
+ "name": "Create a new branch",
+ "description": CREATE_REPO_BRANCH,
+ },
+ {
+ "mode": "list_branches_in_repo",
+ "name": "Get the list of branches",
+ "description": LIST_REPO_BRANCES,
+ },
+ {
+ "mode": "set_active_branch",
+ "name": "Change the active branch",
+ "description": SET_ACTIVE_BRANCH,
+ },
+ {
+ "mode": "list_files_in_main_branch",
+ "name": "Overview of existing files in Main branch",
+ "description": GET_REPO_FILES_IN_MAIN,
+ },
+ {
+ "mode": "list_files_in_bot_branch",
+ "name": "Overview of files in current working branch",
+ "description": GET_REPO_FILES_IN_BOT_BRANCH,
+ },
+ {
+ "mode": "list_files_from_directory",
+ "name": "Overview of files in current working branch from a specific path", # noqa: E501
+ "description": GET_REPO_FILES_FROM_DIRECTORY,
+ },
+ ]
+ operations_filtered = [
+ operation
+ for operation in operations
+ if operation["mode"] in tools_to_include
+ ]
+ tools = [
+ GitLabAction(
+ name=action["name"],
+ description=action["description"],
+ mode=action["mode"],
+ api_wrapper=gitlab_api_wrapper,
+ )
+ for action in operations_filtered
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..02e7f81659f5a224cb8aa3d3a661e99972d6b0e6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__init__.py
@@ -0,0 +1 @@
+"""Gmail toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..504f6234d5956ee5e9d98816a0d6e20281f1617d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5910fdadafae3c569fda9f457f6544e761f7b234
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..d9dea07de1a06970f40212f333e620fe36a18342
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/gmail/toolkit.py
@@ -0,0 +1,132 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.gmail.create_draft import GmailCreateDraft
+from langchain_community.tools.gmail.get_message import GmailGetMessage
+from langchain_community.tools.gmail.get_thread import GmailGetThread
+from langchain_community.tools.gmail.search import GmailSearch
+from langchain_community.tools.gmail.send_message import GmailSendMessage
+from langchain_community.tools.gmail.utils import build_resource_service
+
+if TYPE_CHECKING:
+ # This is for linting and IDE typehints
+ from googleapiclient.discovery import Resource
+else:
+ try:
+ # We do this so pydantic can resolve the types when instantiating
+ from googleapiclient.discovery import Resource
+ except ImportError:
+ pass
+
+
+SCOPES = ["https://mail.google.com/"]
+
+
+class GmailToolkit(BaseToolkit):
+ """Toolkit for interacting with Gmail.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by reading, creating, updating, deleting
+ data associated with this service.
+
+ For example, this toolkit can be used to send emails on behalf of the
+ associated account.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Setup:
+ You will need a Google credentials.json file to use this toolkit.
+ See instructions here: https://python.langchain.com/docs/integrations/tools/gmail/#setup
+
+ Key init args:
+ api_resource: Optional. The Google API resource. Default is None.
+
+ Instantiate:
+ .. code-block:: python
+
+ from langchain_google_community import GmailToolkit
+
+ toolkit = GmailToolkit()
+
+ Tools:
+ .. code-block:: python
+
+ toolkit.get_tools()
+
+ .. code-block:: none
+
+ [GmailCreateDraft(api_resource=),
+ GmailSendMessage(api_resource=),
+ GmailSearch(api_resource=),
+ GmailGetMessage(api_resource=),
+ GmailGetThread(api_resource=)]
+
+ Use within an agent:
+ .. code-block:: python
+
+ from langchain_openai import ChatOpenAI
+ from langgraph.prebuilt import create_react_agent
+
+ llm = ChatOpenAI(model="gpt-4o-mini")
+
+ agent_executor = create_react_agent(llm, tools)
+
+ example_query = "Draft an email to fake@fake.com thanking them for coffee."
+
+ events = agent_executor.stream(
+ {"messages": [("user", example_query)]},
+ stream_mode="values",
+ )
+ for event in events:
+ event["messages"][-1].pretty_print()
+
+ .. code-block:: none
+
+ ================================[1m Human Message [0m=================================
+
+ Draft an email to fake@fake.com thanking them for coffee.
+ ==================================[1m Ai Message [0m==================================
+ Tool Calls:
+ create_gmail_draft (call_slGkYKZKA6h3Mf1CraUBzs6M)
+ Call ID: call_slGkYKZKA6h3Mf1CraUBzs6M
+ Args:
+ message: Dear Fake,
+
+ I wanted to take a moment to thank you for the coffee yesterday. It was a pleasure catching up with you. Let's do it again soon!
+
+ Best regards,
+ [Your Name]
+ to: ['fake@fake.com']
+ subject: Thank You for the Coffee
+ =================================[1m Tool Message [0m=================================
+ Name: create_gmail_draft
+
+ Draft created. Draft Id: r-7233782721440261513
+ ==================================[1m Ai Message [0m==================================
+
+ I have drafted an email to fake@fake.com thanking them for the coffee. You can review and send it from your email draft with the subject "Thank You for the Coffee".
+
+ Parameters:
+ api_resource: Optional. The Google API resource. Default is None.
+ """ # noqa: E501
+
+ api_resource: Resource = Field(default_factory=build_resource_service)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ GmailCreateDraft(api_resource=self.api_resource),
+ GmailSendMessage(api_resource=self.api_resource),
+ GmailSearch(api_resource=self.api_resource),
+ GmailGetMessage(api_resource=self.api_resource),
+ GmailGetThread(api_resource=self.api_resource),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..9f7c67558fa53f59b5b7ac36f0c47a2dfe26f554
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__init__.py
@@ -0,0 +1 @@
+"""Jira Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9c65ca9a95ea984f1c0123db2b4985bb545728a3
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f87adae44161235fc168ed669031814fbc18b81a
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..204a11d6a2d0ac77bb507db8bc92fddffe8b1be1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/jira/toolkit.py
@@ -0,0 +1,83 @@
+from typing import Dict, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.jira.prompt import (
+ JIRA_CATCH_ALL_PROMPT,
+ JIRA_CONFLUENCE_PAGE_CREATE_PROMPT,
+ JIRA_GET_ALL_PROJECTS_PROMPT,
+ JIRA_ISSUE_CREATE_PROMPT,
+ JIRA_JQL_PROMPT,
+)
+from langchain_community.tools.jira.tool import JiraAction
+from langchain_community.utilities.jira import JiraAPIWrapper
+
+
+class JiraToolkit(BaseToolkit):
+ """Jira Toolkit.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by creating, deleting, or updating,
+ reading underlying data.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_jira_api_wrapper(cls, jira_api_wrapper: JiraAPIWrapper) -> "JiraToolkit":
+ """Create a JiraToolkit from a JiraAPIWrapper.
+
+ Args:
+ jira_api_wrapper: JiraAPIWrapper. The Jira API wrapper.
+
+ Returns:
+ JiraToolkit. The Jira toolkit.
+ """
+
+ operations: List[Dict] = [
+ {
+ "mode": "jql",
+ "name": "jql_query",
+ "description": JIRA_JQL_PROMPT,
+ },
+ {
+ "mode": "get_projects",
+ "name": "get_projects",
+ "description": JIRA_GET_ALL_PROJECTS_PROMPT,
+ },
+ {
+ "mode": "create_issue",
+ "name": "create_issue",
+ "description": JIRA_ISSUE_CREATE_PROMPT,
+ },
+ {
+ "mode": "other",
+ "name": "catch_all_jira_api",
+ "description": JIRA_CATCH_ALL_PROMPT,
+ },
+ {
+ "mode": "create_page",
+ "name": "create_confluence_page",
+ "description": JIRA_CONFLUENCE_PAGE_CREATE_PROMPT,
+ },
+ ]
+ tools = [
+ JiraAction(
+ name=action["name"],
+ description=action["description"],
+ mode=action["mode"],
+ api_wrapper=jira_api_wrapper,
+ )
+ for action in operations
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..bfab0ec6f83a544f93a19dc036a188cb08b82433
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__init__.py
@@ -0,0 +1 @@
+"""Json agent."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f30232f043f67712112e45f60f53fdb9531e5483
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3ddf38480d4974606ffb77ed40c040032d968f69
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..81f968d0f021b458f42cb03dcd70d9a8febaebb0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b1b2f7da5d94dd4c79a63cd3ed0a286d6c75f25e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..2e398ce103265c35050bf1f3e60e78cc0617c826
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/base.py
@@ -0,0 +1,76 @@
+"""Json agent."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Dict, List, Optional
+
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models import BaseLanguageModel
+
+from langchain_community.agent_toolkits.json.prompt import JSON_PREFIX, JSON_SUFFIX
+from langchain_community.agent_toolkits.json.toolkit import JsonToolkit
+
+if TYPE_CHECKING:
+ from langchain_classic.agents.agent import AgentExecutor
+
+
+def create_json_agent(
+ llm: BaseLanguageModel,
+ toolkit: JsonToolkit,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ prefix: str = JSON_PREFIX,
+ suffix: str = JSON_SUFFIX,
+ format_instructions: Optional[str] = None,
+ input_variables: Optional[List[str]] = None,
+ verbose: bool = False,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Construct a json agent from an LLM and tools.
+
+ Args:
+ llm: The language model to use.
+ toolkit: The toolkit to use.
+ callback_manager: The callback manager to use. Default is None.
+ prefix: The prefix to use. Default is JSON_PREFIX.
+ suffix: The suffix to use. Default is JSON_SUFFIX.
+ format_instructions: The format instructions to use. Default is None.
+ input_variables: The input variables to use. Default is None.
+ verbose: Whether to print verbose output. Default is False.
+ agent_executor_kwargs: Optional additional arguments for the agent executor.
+ kwargs: Additional arguments for the agent.
+
+ Returns:
+ The agent executor.
+ """
+ from langchain_classic.agents.agent import AgentExecutor
+ from langchain_classic.agents.mrkl.base import ZeroShotAgent
+ from langchain_classic.chains.llm import LLMChain
+
+ tools = toolkit.get_tools()
+ prompt_params = (
+ {"format_instructions": format_instructions}
+ if format_instructions is not None
+ else {}
+ )
+ prompt = ZeroShotAgent.create_prompt(
+ tools,
+ prefix=prefix,
+ suffix=suffix,
+ input_variables=input_variables,
+ **prompt_params,
+ )
+ llm_chain = LLMChain(
+ llm=llm,
+ prompt=prompt,
+ callback_manager=callback_manager,
+ )
+ tool_names = [tool.name for tool in tools]
+ agent = ZeroShotAgent(llm_chain=llm_chain, allowed_tools=tool_names, **kwargs)
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ verbose=verbose,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..a3b7584aca222a88b2035af48657a7d00558b5e5
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/prompt.py
@@ -0,0 +1,25 @@
+# flake8: noqa
+
+JSON_PREFIX = """You are an agent designed to interact with JSON.
+Your goal is to return a final answer by interacting with the JSON.
+You have access to the following tools which help you learn more about the JSON you are interacting with.
+Only use the below tools. Only use the information returned by the below tools to construct your final answer.
+Do not make up any information that is not contained in the JSON.
+Your input to the tools should be in the form of `data["key"][0]` where `data` is the JSON blob you are interacting with, and the syntax used is Python.
+You should only use keys that you know for a fact exist. You must validate that a key exists by seeing it previously when calling `json_spec_list_keys`.
+If you have not seen a key in one of those responses, you cannot use it.
+You should only add one key at a time to the path. You cannot add multiple keys at once.
+If you encounter a "KeyError", go back to the previous key, look at the available keys, and try again.
+
+If the question does not seem to be related to the JSON, just return "I don't know" as the answer.
+Always begin your interaction with the `json_spec_list_keys` tool with input "data" to see what keys exist in the JSON.
+
+Note that sometimes the value at a given path is large. In this case, you will get an error "Value is a large dictionary, should explore its keys directly".
+In this case, you should ALWAYS follow up by using the `json_spec_list_keys` tool to see what keys exist at that path.
+Do not simply refer the user to the JSON or a section of the JSON, as this is not a valid answer. Keep digging until you find the answer and explicitly return it.
+"""
+JSON_SUFFIX = """Begin!"
+
+Question: {input}
+Thought: I should look at the keys that exist in data to see what I have access to
+{agent_scratchpad}"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..a6a9849831219a86f74235aca8ddd21a0d716302
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/json/toolkit.py
@@ -0,0 +1,29 @@
+from __future__ import annotations
+
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.json.tool import (
+ JsonGetValueTool,
+ JsonListKeysTool,
+ JsonSpec,
+)
+
+
+class JsonToolkit(BaseToolkit):
+ """Toolkit for interacting with a JSON spec.
+
+ Parameters:
+ spec: The JSON spec.
+ """
+
+ spec: JsonSpec
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ JsonListKeysTool(spec=self.spec),
+ JsonGetValueTool(spec=self.spec),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..56c7215199b05cf9a03832da4b24c928b771ece9
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__init__.py
@@ -0,0 +1 @@
+"""MultiOn Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..df5923260eb95fec14da74d6136927e9ef98ac71
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e09b0d6c6746b46df07c95e5c5b38c57cbc01c84
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..5a67cb13f112161b154df683415c823939ae657f
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/multion/toolkit.py
@@ -0,0 +1,35 @@
+"""MultiOn agent."""
+
+from __future__ import annotations
+
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict
+
+from langchain_community.tools.multion.close_session import MultionCloseSession
+from langchain_community.tools.multion.create_session import MultionCreateSession
+from langchain_community.tools.multion.update_session import MultionUpdateSession
+
+
+class MultionToolkit(BaseToolkit):
+ """Toolkit for interacting with the Browser Agent.
+
+ **Security Note**: This toolkit contains tools that interact with the
+ user's browser via the multion API which grants an agent
+ access to the user's browser.
+
+ Please review the documentation for the multion API to understand
+ the security implications of using this toolkit.
+
+ See https://python.langchain.com/docs/security for more information.
+ """
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [MultionCreateSession(), MultionUpdateSession(), MultionCloseSession()]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..a13c3ec706c6d8773162ca325f1ceac2a7840315
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__init__.py
@@ -0,0 +1 @@
+"""NASA Toolkit"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..77804938f0abde94a3d1b244500b5f8f8a94318b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..aeea4085efa128363c36481951eba9a907df4fa7
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..aabb3b55b62ea920020be9ad6606f302bef8946e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nasa/toolkit.py
@@ -0,0 +1,62 @@
+from typing import Dict, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.nasa.prompt import (
+ NASA_CAPTIONS_PROMPT,
+ NASA_MANIFEST_PROMPT,
+ NASA_METADATA_PROMPT,
+ NASA_SEARCH_PROMPT,
+)
+from langchain_community.tools.nasa.tool import NasaAction
+from langchain_community.utilities.nasa import NasaAPIWrapper
+
+
+class NasaToolkit(BaseToolkit):
+ """Nasa Toolkit.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_nasa_api_wrapper(cls, nasa_api_wrapper: NasaAPIWrapper) -> "NasaToolkit":
+ operations: List[Dict] = [
+ {
+ "mode": "search_media",
+ "name": "Search NASA Image and Video Library media",
+ "description": NASA_SEARCH_PROMPT,
+ },
+ {
+ "mode": "get_media_metadata_manifest",
+ "name": "Get NASA Image and Video Library media metadata manifest",
+ "description": NASA_MANIFEST_PROMPT,
+ },
+ {
+ "mode": "get_media_metadata_location",
+ "name": "Get NASA Image and Video Library media metadata location",
+ "description": NASA_METADATA_PROMPT,
+ },
+ {
+ "mode": "get_video_captions_location",
+ "name": "Get NASA Image and Video Library video captions location",
+ "description": NASA_CAPTIONS_PROMPT,
+ },
+ ]
+ tools = [
+ NasaAction(
+ name=action["name"],
+ description=action["description"],
+ mode=action["mode"],
+ api_wrapper=nasa_api_wrapper,
+ )
+ for action in operations
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c45528af9a8dd88b7a6af706ed33fa081b51ec35
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/tool.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/tool.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2abcd0070c47caa84ed7fe280211755564974d63
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/tool.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..17b987dd56dd8ae9450f2ca3aef679b98daa3f47
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/tool.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/tool.py
new file mode 100644
index 0000000000000000000000000000000000000000..c1206d947581e3c180e354c1b180daf489c4bbf6
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/tool.py
@@ -0,0 +1,79 @@
+"""Tool for interacting with a single API with natural language definition."""
+
+from __future__ import annotations
+
+from typing import Any, Optional
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import Tool
+
+from langchain_community.chains.openapi.chain import OpenAPIEndpointChain
+from langchain_community.tools.openapi.utils.api_models import APIOperation
+from langchain_community.tools.openapi.utils.openapi_utils import OpenAPISpec
+from langchain_community.utilities.requests import Requests
+
+
+class NLATool(Tool):
+ """Natural Language API Tool."""
+
+ @classmethod
+ def from_open_api_endpoint_chain(
+ cls, chain: OpenAPIEndpointChain, api_title: str
+ ) -> "NLATool":
+ """Convert an endpoint chain to an API endpoint tool.
+
+ Args:
+ chain: The endpoint chain.
+ api_title: The title of the API.
+
+ Returns:
+ The API endpoint tool.
+ """
+ expanded_name = (
+ f"{api_title.replace(' ', '_')}.{chain.api_operation.operation_id}"
+ )
+ description = (
+ f"I'm an AI from {api_title}. Instruct what you want,"
+ " and I'll assist via an API with description:"
+ f" {chain.api_operation.description}"
+ )
+ return cls(name=expanded_name, func=chain.run, description=description)
+
+ @classmethod
+ def from_llm_and_method(
+ cls,
+ llm: BaseLanguageModel,
+ path: str,
+ method: str,
+ spec: OpenAPISpec,
+ requests: Optional[Requests] = None,
+ verbose: bool = False,
+ return_intermediate_steps: bool = False,
+ **kwargs: Any,
+ ) -> "NLATool":
+ """Instantiate the tool from the specified path and method.
+
+ Args:
+ llm: The language model to use.
+ path: The path of the API.
+ method: The method of the API.
+ spec: The OpenAPI spec.
+ requests: Optional requests object. Default is None.
+ verbose: Whether to print verbose output. Default is False.
+ return_intermediate_steps: Whether to return intermediate steps.
+ Default is False.
+ kwargs: Additional arguments.
+
+ Returns:
+ The tool.
+ """
+ api_operation = APIOperation.from_openapi_spec(spec, path, method)
+ chain = OpenAPIEndpointChain.from_api_operation(
+ api_operation,
+ llm,
+ requests=requests,
+ verbose=verbose,
+ return_intermediate_steps=return_intermediate_steps,
+ **kwargs,
+ )
+ return cls.from_open_api_endpoint_chain(chain, spec.info.title)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..88fb6e87fbf6bd97bca776c05f0b18becae78df1
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/nla/toolkit.py
@@ -0,0 +1,150 @@
+from __future__ import annotations
+
+from typing import Any, List, Optional, Sequence
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import Field
+
+from langchain_community.agent_toolkits.nla.tool import NLATool
+from langchain_community.tools.openapi.utils.openapi_utils import OpenAPISpec
+from langchain_community.tools.plugin import AIPlugin
+from langchain_community.utilities.requests import Requests
+
+
+class NLAToolkit(BaseToolkit):
+ """Natural Language API Toolkit.
+
+ *Security Note*: This toolkit creates tools that enable making calls
+ to an Open API compliant API.
+
+ The tools created by this toolkit may be able to make GET, POST,
+ PATCH, PUT, DELETE requests to any of the exposed endpoints on
+ the API.
+
+ Control access to who can use this toolkit.
+
+ See https://python.langchain.com/docs/security for more information.
+ """
+
+ nla_tools: Sequence[NLATool] = Field(...)
+ """List of API Endpoint Tools."""
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools for all the API operations."""
+ return list(self.nla_tools)
+
+ @staticmethod
+ def _get_http_operation_tools(
+ llm: BaseLanguageModel,
+ spec: OpenAPISpec,
+ requests: Optional[Requests] = None,
+ verbose: bool = False,
+ **kwargs: Any,
+ ) -> List[NLATool]:
+ """Get the tools for all the API operations."""
+ if not spec.paths:
+ return []
+ http_operation_tools = []
+ for path in spec.paths:
+ for method in spec.get_methods_for_path(path):
+ endpoint_tool = NLATool.from_llm_and_method(
+ llm=llm,
+ path=path,
+ method=method,
+ spec=spec,
+ requests=requests,
+ verbose=verbose,
+ **kwargs,
+ )
+ http_operation_tools.append(endpoint_tool)
+ return http_operation_tools
+
+ @classmethod
+ def from_llm_and_spec(
+ cls,
+ llm: BaseLanguageModel,
+ spec: OpenAPISpec,
+ requests: Optional[Requests] = None,
+ verbose: bool = False,
+ **kwargs: Any,
+ ) -> NLAToolkit:
+ """Instantiate the toolkit by creating tools for each operation.
+
+ Args:
+ llm: The language model to use.
+ spec: The OpenAPI spec.
+ requests: Optional requests object. Default is None.
+ verbose: Whether to print verbose output. Default is False.
+ kwargs: Additional arguments.
+
+ Returns:
+ The toolkit.
+ """
+ http_operation_tools = cls._get_http_operation_tools(
+ llm=llm, spec=spec, requests=requests, verbose=verbose, **kwargs
+ )
+ return cls(nla_tools=http_operation_tools)
+
+ @classmethod
+ def from_llm_and_url(
+ cls,
+ llm: BaseLanguageModel,
+ open_api_url: str,
+ requests: Optional[Requests] = None,
+ verbose: bool = False,
+ **kwargs: Any,
+ ) -> NLAToolkit:
+ """Instantiate the toolkit from an OpenAPI Spec URL.
+
+ Args:
+ llm: The language model to use.
+ open_api_url: The URL of the OpenAPI spec.
+ requests: Optional requests object. Default is None.
+ verbose: Whether to print verbose output. Default is False.
+ kwargs: Additional arguments.
+
+ Returns:
+ The toolkit.
+ """
+
+ spec = OpenAPISpec.from_url(open_api_url)
+ return cls.from_llm_and_spec(
+ llm=llm, spec=spec, requests=requests, verbose=verbose, **kwargs
+ )
+
+ @classmethod
+ def from_llm_and_ai_plugin(
+ cls,
+ llm: BaseLanguageModel,
+ ai_plugin: AIPlugin,
+ requests: Optional[Requests] = None,
+ verbose: bool = False,
+ **kwargs: Any,
+ ) -> NLAToolkit:
+ """Instantiate the toolkit from an OpenAPI Spec URL"""
+ spec = OpenAPISpec.from_url(ai_plugin.api.url)
+ # TODO: Merge optional Auth information with the `requests` argument
+ return cls.from_llm_and_spec(
+ llm=llm,
+ spec=spec,
+ requests=requests,
+ verbose=verbose,
+ **kwargs,
+ )
+
+ @classmethod
+ def from_llm_and_ai_plugin_url(
+ cls,
+ llm: BaseLanguageModel,
+ ai_plugin_url: str,
+ requests: Optional[Requests] = None,
+ verbose: bool = False,
+ **kwargs: Any,
+ ) -> NLAToolkit:
+ """Instantiate the toolkit from an OpenAPI Spec URL"""
+ plugin = AIPlugin.from_url(ai_plugin_url)
+ return cls.from_llm_and_ai_plugin(
+ llm=llm, ai_plugin=plugin, requests=requests, verbose=verbose, **kwargs
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..acd0a87f955a214ef62fa32a0813971802cd96de
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__init__.py
@@ -0,0 +1 @@
+"""Office365 toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7921ab4a6b688bd7df02f25405cb2b161e1f0884
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..88ddb214193a55d9ae57e34ac46bd30275b9257d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..4bd826591d6bab4fc363915d8ed1dcc0a3e07844
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/office365/toolkit.py
@@ -0,0 +1,55 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.office365.create_draft_message import (
+ O365CreateDraftMessage,
+)
+from langchain_community.tools.office365.events_search import O365SearchEvents
+from langchain_community.tools.office365.messages_search import O365SearchEmails
+from langchain_community.tools.office365.send_event import O365SendEvent
+from langchain_community.tools.office365.send_message import O365SendMessage
+from langchain_community.tools.office365.utils import authenticate
+
+if TYPE_CHECKING:
+ from O365 import Account
+
+
+class O365Toolkit(BaseToolkit):
+ """Toolkit for interacting with Office 365.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by reading, creating, updating, deleting
+ data associated with this service.
+
+ For example, this toolkit can be used search through emails and events,
+ send messages and event invites, and create draft messages.
+
+ Please make sure that the permissions given by this toolkit
+ are appropriate for your use case.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ account: Optional. The Office 365 account. Default is None.
+ """
+
+ account: Account = Field(default_factory=authenticate)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ O365SearchEvents(),
+ O365CreateDraftMessage(),
+ O365SearchEmails(),
+ O365SendEvent(),
+ O365SendMessage(),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..5d06e271cd00be5bc75dd27398a5fff15de1afbf
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__init__.py
@@ -0,0 +1 @@
+"""OpenAPI spec agent."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d6fe50888b67e45c70593f6ac4df7b641b91d083
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ff06fba87573b3d0f056e76415243ce42579f43e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/planner.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/planner.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..22b72f008a901817723d2b5b02c520648208e92e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/planner.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/planner_prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/planner_prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..85f8905d64b8ba91ae2e7ab80fa5f4b0a3fdabab
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/planner_prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..49915c7ac23b86b5846d829c0670e88ca9f151aa
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/spec.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/spec.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ebf4d240f6e938f3c03b59313fa2038b39023083
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/spec.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a6398654fb662e0727a7a6cb6d762f54fd454c3c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..e4bb66d0811ac35d7ee490a1a65ed046d8398c01
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/base.py
@@ -0,0 +1,106 @@
+"""OpenAPI spec agent."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Dict, List, Optional
+
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models import BaseLanguageModel
+
+from langchain_community.agent_toolkits.openapi.prompt import (
+ OPENAPI_PREFIX,
+ OPENAPI_SUFFIX,
+)
+from langchain_community.agent_toolkits.openapi.toolkit import OpenAPIToolkit
+
+if TYPE_CHECKING:
+ from langchain_classic.agents.agent import AgentExecutor
+
+
+def create_openapi_agent(
+ llm: BaseLanguageModel,
+ toolkit: OpenAPIToolkit,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ prefix: str = OPENAPI_PREFIX,
+ suffix: str = OPENAPI_SUFFIX,
+ format_instructions: Optional[str] = None,
+ input_variables: Optional[List[str]] = None,
+ max_iterations: Optional[int] = 15,
+ max_execution_time: Optional[float] = None,
+ early_stopping_method: str = "force",
+ verbose: bool = False,
+ return_intermediate_steps: bool = False,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Construct an OpenAPI agent from an LLM and tools.
+
+ *Security Note*: When creating an OpenAPI agent, check the permissions
+ and capabilities of the underlying toolkit.
+
+ For example, if the default implementation of OpenAPIToolkit
+ uses the RequestsToolkit which contains tools to make arbitrary
+ network requests against any URL (e.g., GET, POST, PATCH, PUT, DELETE),
+
+ Control access to who can submit issue requests using this toolkit and
+ what network access it has.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Args:
+ llm: The language model to use.
+ toolkit: The OpenAPI toolkit.
+ callback_manager: Optional. The callback manager. Default is None.
+ prefix: Optional. The prefix for the prompt. Default is OPENAPI_PREFIX.
+ suffix: Optional. The suffix for the prompt. Default is OPENAPI_SUFFIX.
+ format_instructions: Optional. The format instructions for the prompt.
+ Default is None.
+ input_variables: Optional. The input variables for the prompt. Default is None.
+ max_iterations: Optional. The maximum number of iterations. Default is 15.
+ max_execution_time: Optional. The maximum execution time. Default is None.
+ early_stopping_method: Optional. The early stopping method. Default is "force".
+ verbose: Optional. Whether to print verbose output. Default is False.
+ return_intermediate_steps: Optional. Whether to return intermediate steps.
+ Default is False.
+ agent_executor_kwargs: Optional. Additional keyword arguments
+ for the agent executor.
+ kwargs: Additional arguments.
+
+ Returns:
+ The agent executor.
+ """
+ from langchain_classic.agents.agent import AgentExecutor
+ from langchain_classic.agents.mrkl.base import ZeroShotAgent
+ from langchain_classic.chains.llm import LLMChain
+
+ tools = toolkit.get_tools()
+ prompt_params = (
+ {"format_instructions": format_instructions}
+ if format_instructions is not None
+ else {}
+ )
+ prompt = ZeroShotAgent.create_prompt(
+ tools,
+ prefix=prefix,
+ suffix=suffix,
+ input_variables=input_variables,
+ **prompt_params,
+ )
+ llm_chain = LLMChain(
+ llm=llm,
+ prompt=prompt,
+ callback_manager=callback_manager,
+ )
+ tool_names = [tool.name for tool in tools]
+ agent = ZeroShotAgent(llm_chain=llm_chain, allowed_tools=tool_names, **kwargs)
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ verbose=verbose,
+ return_intermediate_steps=return_intermediate_steps,
+ max_iterations=max_iterations,
+ max_execution_time=max_execution_time,
+ early_stopping_method=early_stopping_method,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/planner.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/planner.py
new file mode 100644
index 0000000000000000000000000000000000000000..7fc224db1affba6135400bfe762fee3eeedf9c0b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/planner.py
@@ -0,0 +1,464 @@
+"""Agent that interacts with OpenAPI APIs via a hierarchical planning approach."""
+
+import json
+import re
+from functools import partial
+from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, cast
+
+import yaml
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.prompts import BasePromptTemplate, PromptTemplate
+from langchain_core.tools import BaseTool, Tool
+from pydantic import Field
+
+from langchain_community.agent_toolkits.openapi.planner_prompt import (
+ API_CONTROLLER_PROMPT,
+ API_CONTROLLER_TOOL_DESCRIPTION,
+ API_CONTROLLER_TOOL_NAME,
+ API_ORCHESTRATOR_PROMPT,
+ API_PLANNER_PROMPT,
+ API_PLANNER_TOOL_DESCRIPTION,
+ API_PLANNER_TOOL_NAME,
+ PARSING_DELETE_PROMPT,
+ PARSING_GET_PROMPT,
+ PARSING_PATCH_PROMPT,
+ PARSING_POST_PROMPT,
+ PARSING_PUT_PROMPT,
+ REQUESTS_DELETE_TOOL_DESCRIPTION,
+ REQUESTS_GET_TOOL_DESCRIPTION,
+ REQUESTS_PATCH_TOOL_DESCRIPTION,
+ REQUESTS_POST_TOOL_DESCRIPTION,
+ REQUESTS_PUT_TOOL_DESCRIPTION,
+)
+from langchain_community.agent_toolkits.openapi.spec import ReducedOpenAPISpec
+from langchain_community.llms import OpenAI
+from langchain_community.tools.requests.tool import BaseRequestsTool
+from langchain_community.utilities.requests import RequestsWrapper
+
+#
+# Requests tools with LLM-instructed extraction of truncated responses.
+#
+# Of course, truncating so bluntly may lose a lot of valuable
+# information in the response.
+# However, the goal for now is to have only a single inference step.
+MAX_RESPONSE_LENGTH = 5000
+"""Maximum length of the response to be returned."""
+
+Operation = Literal["GET", "POST", "PUT", "DELETE", "PATCH"]
+
+
+def _get_default_llm_chain(prompt: BasePromptTemplate) -> Any:
+ from langchain_classic.chains.llm import LLMChain
+
+ return LLMChain(
+ llm=OpenAI(),
+ prompt=prompt,
+ )
+
+
+def _get_default_llm_chain_factory(
+ prompt: BasePromptTemplate,
+) -> Callable[[], Any]:
+ """Returns a default LLMChain factory."""
+ return partial(_get_default_llm_chain, prompt)
+
+
+class RequestsGetToolWithParsing(BaseRequestsTool, BaseTool):
+ """Requests GET tool with LLM-instructed extraction of truncated responses."""
+
+ name: str = "requests_get"
+ """Tool name."""
+ description: str = REQUESTS_GET_TOOL_DESCRIPTION
+ """Tool description."""
+ response_length: int = MAX_RESPONSE_LENGTH
+ """Maximum length of the response to be returned."""
+ llm_chain: Any = Field(
+ default_factory=_get_default_llm_chain_factory(PARSING_GET_PROMPT)
+ )
+ """LLMChain used to extract the response."""
+
+ def _run(self, text: str) -> str:
+ from langchain_classic.output_parsers.json import parse_json_markdown
+
+ try:
+ data = parse_json_markdown(text)
+ except json.JSONDecodeError as e:
+ raise e
+ data_params = data.get("params")
+ response: str = cast(
+ str, self.requests_wrapper.get(data["url"], params=data_params)
+ )
+ response = response[: self.response_length]
+ return self.llm_chain.predict(
+ response=response, instructions=data["output_instructions"]
+ ).strip()
+
+ async def _arun(self, text: str) -> str:
+ raise NotImplementedError()
+
+
+class RequestsPostToolWithParsing(BaseRequestsTool, BaseTool):
+ """Requests POST tool with LLM-instructed extraction of truncated responses."""
+
+ name: str = "requests_post"
+ """Tool name."""
+ description: str = REQUESTS_POST_TOOL_DESCRIPTION
+ """Tool description."""
+ response_length: int = MAX_RESPONSE_LENGTH
+ """Maximum length of the response to be returned."""
+ llm_chain: Any = Field(
+ default_factory=_get_default_llm_chain_factory(PARSING_POST_PROMPT)
+ )
+ """LLMChain used to extract the response."""
+
+ def _run(self, text: str) -> str:
+ from langchain_classic.output_parsers.json import parse_json_markdown
+
+ try:
+ data = parse_json_markdown(text)
+ except json.JSONDecodeError as e:
+ raise e
+ response: str = cast(str, self.requests_wrapper.post(data["url"], data["data"]))
+ response = response[: self.response_length]
+ return self.llm_chain.predict(
+ response=response, instructions=data["output_instructions"]
+ ).strip()
+
+ async def _arun(self, text: str) -> str:
+ raise NotImplementedError()
+
+
+class RequestsPatchToolWithParsing(BaseRequestsTool, BaseTool):
+ """Requests PATCH tool with LLM-instructed extraction of truncated responses."""
+
+ name: str = "requests_patch"
+ """Tool name."""
+ description: str = REQUESTS_PATCH_TOOL_DESCRIPTION
+ """Tool description."""
+ response_length: int = MAX_RESPONSE_LENGTH
+ """Maximum length of the response to be returned."""
+ llm_chain: Any = Field(
+ default_factory=_get_default_llm_chain_factory(PARSING_PATCH_PROMPT)
+ )
+ """LLMChain used to extract the response."""
+
+ def _run(self, text: str) -> str:
+ from langchain_classic.output_parsers.json import parse_json_markdown
+
+ try:
+ data = parse_json_markdown(text)
+ except json.JSONDecodeError as e:
+ raise e
+ response: str = cast(
+ str, self.requests_wrapper.patch(data["url"], data["data"])
+ )
+ response = response[: self.response_length]
+ return self.llm_chain.predict(
+ response=response, instructions=data["output_instructions"]
+ ).strip()
+
+ async def _arun(self, text: str) -> str:
+ raise NotImplementedError()
+
+
+class RequestsPutToolWithParsing(BaseRequestsTool, BaseTool):
+ """Requests PUT tool with LLM-instructed extraction of truncated responses."""
+
+ name: str = "requests_put"
+ """Tool name."""
+ description: str = REQUESTS_PUT_TOOL_DESCRIPTION
+ """Tool description."""
+ response_length: int = MAX_RESPONSE_LENGTH
+ """Maximum length of the response to be returned."""
+ llm_chain: Any = Field(
+ default_factory=_get_default_llm_chain_factory(PARSING_PUT_PROMPT)
+ )
+ """LLMChain used to extract the response."""
+
+ def _run(self, text: str) -> str:
+ from langchain_classic.output_parsers.json import parse_json_markdown
+
+ try:
+ data = parse_json_markdown(text)
+ except json.JSONDecodeError as e:
+ raise e
+ response: str = cast(str, self.requests_wrapper.put(data["url"], data["data"]))
+ response = response[: self.response_length]
+ return self.llm_chain.predict(
+ response=response, instructions=data["output_instructions"]
+ ).strip()
+
+ async def _arun(self, text: str) -> str:
+ raise NotImplementedError()
+
+
+class RequestsDeleteToolWithParsing(BaseRequestsTool, BaseTool):
+ """Tool that sends a DELETE request and parses the response."""
+
+ name: str = "requests_delete"
+ """The name of the tool."""
+ description: str = REQUESTS_DELETE_TOOL_DESCRIPTION
+ """The description of the tool."""
+
+ response_length: Optional[int] = MAX_RESPONSE_LENGTH
+ """The maximum length of the response."""
+ llm_chain: Any = Field(
+ default_factory=_get_default_llm_chain_factory(PARSING_DELETE_PROMPT)
+ )
+ """The LLM chain used to parse the response."""
+
+ def _run(self, text: str) -> str:
+ from langchain_classic.output_parsers.json import parse_json_markdown
+
+ try:
+ data = parse_json_markdown(text)
+ except json.JSONDecodeError as e:
+ raise e
+ response: str = cast(str, self.requests_wrapper.delete(data["url"]))
+ response = response[: self.response_length]
+ return self.llm_chain.predict(
+ response=response, instructions=data["output_instructions"]
+ ).strip()
+
+ async def _arun(self, text: str) -> str:
+ raise NotImplementedError()
+
+
+#
+# Orchestrator, planner, controller.
+#
+def _create_api_planner_tool(
+ api_spec: ReducedOpenAPISpec, llm: BaseLanguageModel
+) -> Tool:
+ from langchain_classic.chains.llm import LLMChain
+
+ endpoint_descriptions = [
+ f"{name} {description}" for name, description, _ in api_spec.endpoints
+ ]
+ prompt = PromptTemplate(
+ template=API_PLANNER_PROMPT,
+ input_variables=["query"],
+ partial_variables={"endpoints": "- " + "- ".join(endpoint_descriptions)},
+ )
+ chain = LLMChain(llm=llm, prompt=prompt)
+ tool = Tool(
+ name=API_PLANNER_TOOL_NAME,
+ description=API_PLANNER_TOOL_DESCRIPTION,
+ func=chain.run,
+ )
+ return tool
+
+
+def _create_api_controller_agent(
+ api_url: str,
+ api_docs: str,
+ requests_wrapper: RequestsWrapper,
+ llm: BaseLanguageModel,
+ allow_dangerous_requests: bool,
+ allowed_operations: Sequence[Operation],
+) -> Any:
+ from langchain_classic.agents.agent import AgentExecutor
+ from langchain_classic.agents.mrkl.base import ZeroShotAgent
+ from langchain_classic.chains.llm import LLMChain
+
+ tools: List[BaseTool] = []
+ if "GET" in allowed_operations:
+ get_llm_chain = LLMChain(llm=llm, prompt=PARSING_GET_PROMPT)
+ tools.append(
+ RequestsGetToolWithParsing(
+ requests_wrapper=requests_wrapper,
+ llm_chain=get_llm_chain,
+ allow_dangerous_requests=allow_dangerous_requests,
+ )
+ )
+ if "POST" in allowed_operations:
+ post_llm_chain = LLMChain(llm=llm, prompt=PARSING_POST_PROMPT)
+ tools.append(
+ RequestsPostToolWithParsing(
+ requests_wrapper=requests_wrapper,
+ llm_chain=post_llm_chain,
+ allow_dangerous_requests=allow_dangerous_requests,
+ )
+ )
+ if "PUT" in allowed_operations:
+ put_llm_chain = LLMChain(llm=llm, prompt=PARSING_PUT_PROMPT)
+ tools.append(
+ RequestsPutToolWithParsing(
+ requests_wrapper=requests_wrapper,
+ llm_chain=put_llm_chain,
+ allow_dangerous_requests=allow_dangerous_requests,
+ )
+ )
+ if "DELETE" in allowed_operations:
+ delete_llm_chain = LLMChain(llm=llm, prompt=PARSING_DELETE_PROMPT)
+ tools.append(
+ RequestsDeleteToolWithParsing(
+ requests_wrapper=requests_wrapper,
+ llm_chain=delete_llm_chain,
+ allow_dangerous_requests=allow_dangerous_requests,
+ )
+ )
+ if "PATCH" in allowed_operations:
+ patch_llm_chain = LLMChain(llm=llm, prompt=PARSING_PATCH_PROMPT)
+ tools.append(
+ RequestsPatchToolWithParsing(
+ requests_wrapper=requests_wrapper,
+ llm_chain=patch_llm_chain,
+ allow_dangerous_requests=allow_dangerous_requests,
+ )
+ )
+ if not tools:
+ raise ValueError("Tools not found")
+ prompt = PromptTemplate(
+ template=API_CONTROLLER_PROMPT,
+ input_variables=["input", "agent_scratchpad"],
+ partial_variables={
+ "api_url": api_url,
+ "api_docs": api_docs,
+ "tool_names": ", ".join([tool.name for tool in tools]),
+ "tool_descriptions": "\n".join(
+ [f"{tool.name}: {tool.description}" for tool in tools]
+ ),
+ },
+ )
+ agent = ZeroShotAgent(
+ llm_chain=LLMChain(llm=llm, prompt=prompt),
+ allowed_tools=[tool.name for tool in tools],
+ )
+ return AgentExecutor.from_agent_and_tools(agent=agent, tools=tools, verbose=True)
+
+
+def _create_api_controller_tool(
+ api_spec: ReducedOpenAPISpec,
+ requests_wrapper: RequestsWrapper,
+ llm: BaseLanguageModel,
+ allow_dangerous_requests: bool,
+ allowed_operations: Sequence[Operation],
+) -> Tool:
+ """Expose controller as a tool.
+
+ The tool is invoked with a plan from the planner, and dynamically
+ creates a controller agent with relevant documentation only to
+ constrain the context.
+ """
+
+ base_url = api_spec.servers[0]["url"] # TODO: do better.
+
+ def _create_and_run_api_controller_agent(plan_str: str) -> str:
+ pattern = r"\b(GET|POST|PATCH|DELETE|PUT)\s+(/\S+)*"
+ matches = re.findall(pattern, plan_str)
+ endpoint_names = [
+ "{method} {route}".format(method=method, route=route.split("?")[0])
+ for method, route in matches
+ ]
+ docs_str = ""
+ for endpoint_name in endpoint_names:
+ found_match = False
+ for name, _, docs in api_spec.endpoints:
+ regex_name = re.compile(re.sub("\\{.*?\\}", ".*", name))
+ if regex_name.match(endpoint_name):
+ found_match = True
+ docs_str += f"== Docs for {endpoint_name} == \n{yaml.dump(docs)}\n"
+ if not found_match:
+ raise ValueError(f"{endpoint_name} endpoint does not exist.")
+
+ agent = _create_api_controller_agent(
+ base_url,
+ docs_str,
+ requests_wrapper,
+ llm,
+ allow_dangerous_requests,
+ allowed_operations,
+ )
+ return agent.run(plan_str)
+
+ return Tool(
+ name=API_CONTROLLER_TOOL_NAME,
+ func=_create_and_run_api_controller_agent,
+ description=API_CONTROLLER_TOOL_DESCRIPTION,
+ )
+
+
+def create_openapi_agent(
+ api_spec: ReducedOpenAPISpec,
+ requests_wrapper: RequestsWrapper,
+ llm: BaseLanguageModel,
+ shared_memory: Optional[Any] = None,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ verbose: bool = True,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ allow_dangerous_requests: bool = False,
+ allowed_operations: Sequence[Operation] = ("GET", "POST"),
+ **kwargs: Any,
+) -> Any:
+ """Construct an OpenAI API planner and controller for a given spec.
+
+ Inject credentials via requests_wrapper.
+
+ We use a top-level "orchestrator" agent to invoke the planner and controller,
+ rather than a top-level planner
+ that invokes a controller with its plan. This is to keep the planner simple.
+
+ You need to set allow_dangerous_requests to True to use Agent with BaseRequestsTool.
+ Requests can be dangerous and can lead to security vulnerabilities.
+ For example, users can ask a server to make a request to an internal
+ server. It's recommended to use requests through a proxy server
+ and avoid accepting inputs from untrusted sources without proper sandboxing.
+ Please see: https://python.langchain.com/docs/security
+ for further security information.
+
+ Args:
+ api_spec: The OpenAPI spec.
+ requests_wrapper: The requests wrapper.
+ llm: The language model.
+ shared_memory: Optional. The shared memory. Default is None.
+ callback_manager: Optional. The callback manager. Default is None.
+ verbose: Optional. Whether to print verbose output. Default is True.
+ agent_executor_kwargs: Optional. Additional keyword arguments
+ for the agent executor.
+ allow_dangerous_requests: Optional. Whether to allow dangerous requests.
+ Default is False.
+ allowed_operations: Optional. The allowed operations.
+ Default is ("GET", "POST").
+ kwargs: Additional arguments.
+
+ Returns:
+ The agent executor.
+ """
+ from langchain_classic.agents.agent import AgentExecutor
+ from langchain_classic.agents.mrkl.base import ZeroShotAgent
+ from langchain_classic.chains.llm import LLMChain
+
+ tools = [
+ _create_api_planner_tool(api_spec, llm),
+ _create_api_controller_tool(
+ api_spec,
+ requests_wrapper,
+ llm,
+ allow_dangerous_requests,
+ allowed_operations,
+ ),
+ ]
+ prompt = PromptTemplate(
+ template=API_ORCHESTRATOR_PROMPT,
+ input_variables=["input", "agent_scratchpad"],
+ partial_variables={
+ "tool_names": ", ".join([tool.name for tool in tools]),
+ "tool_descriptions": "\n".join(
+ [f"{tool.name}: {tool.description}" for tool in tools]
+ ),
+ },
+ )
+ agent = ZeroShotAgent(
+ llm_chain=LLMChain(llm=llm, prompt=prompt, memory=shared_memory),
+ allowed_tools=[tool.name for tool in tools],
+ **kwargs,
+ )
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ verbose=verbose,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/planner_prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/planner_prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..666260f5040a6109806a9088bcfb9f9f812578f0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/planner_prompt.py
@@ -0,0 +1,235 @@
+# flake8: noqa
+
+from langchain_core.prompts.prompt import PromptTemplate
+
+
+API_PLANNER_PROMPT = """You are a planner that plans a sequence of API calls to assist with user queries against an API.
+
+You should:
+1) evaluate whether the user query can be solved by the API documented below. If no, say why.
+2) if yes, generate a plan of API calls and say what they are doing step by step.
+3) If the plan includes a DELETE call, you should always return an ask from the User for authorization first unless the User has specifically asked to delete something.
+
+You should only use API endpoints documented below ("Endpoints you can use:").
+You can only use the DELETE tool if the User has specifically asked to delete something. Otherwise, you should return a request authorization from the User first.
+Some user queries can be resolved in a single API call, but some will require several API calls.
+The plan will be passed to an API controller that can format it into web requests and return the responses.
+
+----
+
+Here are some examples:
+
+Fake endpoints for examples:
+GET /user to get information about the current user
+GET /products/search search across products
+POST /users/{{id}}/cart to add products to a user's cart
+PATCH /users/{{id}}/cart to update a user's cart
+PUT /users/{{id}}/coupon to apply idempotent coupon to a user's cart
+DELETE /users/{{id}}/cart to delete a user's cart
+
+User query: tell me a joke
+Plan: Sorry, this API's domain is shopping, not comedy.
+
+User query: I want to buy a couch
+Plan: 1. GET /products with a query param to search for couches
+2. GET /user to find the user's id
+3. POST /users/{{id}}/cart to add a couch to the user's cart
+
+User query: I want to add a lamp to my cart
+Plan: 1. GET /products with a query param to search for lamps
+2. GET /user to find the user's id
+3. PATCH /users/{{id}}/cart to add a lamp to the user's cart
+
+User query: I want to add a coupon to my cart
+Plan: 1. GET /user to find the user's id
+2. PUT /users/{{id}}/coupon to apply the coupon
+
+User query: I want to delete my cart
+Plan: 1. GET /user to find the user's id
+2. DELETE required. Did user specify DELETE or previously authorize? Yes, proceed.
+3. DELETE /users/{{id}}/cart to delete the user's cart
+
+User query: I want to start a new cart
+Plan: 1. GET /user to find the user's id
+2. DELETE required. Did user specify DELETE or previously authorize? No, ask for authorization.
+3. Are you sure you want to delete your cart?
+----
+
+Here are endpoints you can use. Do not reference any of the endpoints above.
+
+{endpoints}
+
+----
+
+User query: {query}
+Plan:"""
+API_PLANNER_TOOL_NAME = "api_planner"
+API_PLANNER_TOOL_DESCRIPTION = f"Can be used to generate the right API calls to assist with a user query, like {API_PLANNER_TOOL_NAME}(query). Should always be called before trying to call the API controller."
+
+# Execution.
+API_CONTROLLER_PROMPT = """You are an agent that gets a sequence of API calls and given their documentation, should execute them and return the final response.
+If you cannot complete them and run into issues, you should explain the issue. If you're unable to resolve an API call, you can retry the API call. When interacting with API objects, you should extract ids for inputs to other API calls but ids and names for outputs returned to the User.
+
+
+Here is documentation on the API:
+Base url: {api_url}
+Endpoints:
+{api_docs}
+
+
+Here are tools to execute requests against the API: {tool_descriptions}
+
+
+Starting below, you should follow this format:
+
+Plan: the plan of API calls to execute
+Thought: you should always think about what to do
+Action: the action to take, should be one of the tools [{tool_names}]
+Action Input: the input to the action
+Observation: the output of the action
+... (this Thought/Action/Action Input/Observation can repeat N times)
+Thought: I am finished executing the plan (or, I cannot finish executing the plan without knowing some other information.)
+Final Answer: the final output from executing the plan or missing information I'd need to re-plan correctly.
+
+
+Begin!
+
+Plan: {input}
+Thought:
+{agent_scratchpad}
+"""
+API_CONTROLLER_TOOL_NAME = "api_controller"
+API_CONTROLLER_TOOL_DESCRIPTION = f"Can be used to execute a plan of API calls, like {API_CONTROLLER_TOOL_NAME}(plan)."
+
+# Orchestrate planning + execution.
+# The goal is to have an agent at the top-level (e.g. so it can recover from errors and re-plan) while
+# keeping planning (and specifically the planning prompt) simple.
+API_ORCHESTRATOR_PROMPT = """You are an agent that assists with user queries against API, things like querying information or creating resources.
+Some user queries can be resolved in a single API call, particularly if you can find appropriate params from the OpenAPI spec; though some require several API calls.
+You should always plan your API calls first, and then execute the plan second.
+If the plan includes a DELETE call, be sure to ask the User for authorization first unless the User has specifically asked to delete something.
+You should never return information without executing the api_controller tool.
+
+
+Here are the tools to plan and execute API requests: {tool_descriptions}
+
+
+Starting below, you should follow this format:
+
+User query: the query a User wants help with related to the API
+Thought: you should always think about what to do
+Action: the action to take, should be one of the tools [{tool_names}]
+Action Input: the input to the action
+Observation: the result of the action
+... (this Thought/Action/Action Input/Observation can repeat N times)
+Thought: I am finished executing a plan and have the information the user asked for or the data the user asked to create
+Final Answer: the final output from executing the plan
+
+
+Example:
+User query: can you add some trendy stuff to my shopping cart.
+Thought: I should plan API calls first.
+Action: api_planner
+Action Input: I need to find the right API calls to add trendy items to the users shopping cart
+Observation: 1) GET /items with params 'trending' is 'True' to get trending item ids
+2) GET /user to get user
+3) POST /cart to post the trending items to the user's cart
+Thought: I'm ready to execute the API calls.
+Action: api_controller
+Action Input: 1) GET /items params 'trending' is 'True' to get trending item ids
+2) GET /user to get user
+3) POST /cart to post the trending items to the user's cart
+...
+
+Begin!
+
+User query: {input}
+Thought: I should generate a plan to help with this query and then copy that plan exactly to the controller.
+{agent_scratchpad}"""
+
+REQUESTS_GET_TOOL_DESCRIPTION = """Use this to GET content from a website.
+Input to the tool should be a json string with 3 keys: "url", "params" and "output_instructions".
+The value of "url" should be a string.
+The value of "params" should be a dict of the needed and available parameters from the OpenAPI spec related to the endpoint.
+If parameters are not needed, or not available, leave it empty.
+The value of "output_instructions" should be instructions on what information to extract from the response,
+for example the id(s) for a resource(s) that the GET request fetches.
+"""
+
+PARSING_GET_PROMPT = PromptTemplate(
+ template="""Here is an API response:\n\n{response}\n\n====
+Your task is to extract some information according to these instructions: {instructions}
+When working with API objects, you should usually use ids over names.
+If the response indicates an error, you should instead output a summary of the error.
+
+Output:""",
+ input_variables=["response", "instructions"],
+)
+
+REQUESTS_POST_TOOL_DESCRIPTION = """Use this when you want to POST to a website.
+Input to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".
+The value of "url" should be a string.
+The value of "data" should be a dictionary of key-value pairs you want to POST to the url.
+The value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the POST request creates.
+Always use double quotes for strings in the json string."""
+
+PARSING_POST_PROMPT = PromptTemplate(
+ template="""Here is an API response:\n\n{response}\n\n====
+Your task is to extract some information according to these instructions: {instructions}
+When working with API objects, you should usually use ids over names. Do not return any ids or names that are not in the response.
+If the response indicates an error, you should instead output a summary of the error.
+
+Output:""",
+ input_variables=["response", "instructions"],
+)
+
+REQUESTS_PATCH_TOOL_DESCRIPTION = """Use this when you want to PATCH content on a website.
+Input to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".
+The value of "url" should be a string.
+The value of "data" should be a dictionary of key-value pairs of the body params available in the OpenAPI spec you want to PATCH the content with at the url.
+The value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the PATCH request creates.
+Always use double quotes for strings in the json string."""
+
+PARSING_PATCH_PROMPT = PromptTemplate(
+ template="""Here is an API response:\n\n{response}\n\n====
+Your task is to extract some information according to these instructions: {instructions}
+When working with API objects, you should usually use ids over names. Do not return any ids or names that are not in the response.
+If the response indicates an error, you should instead output a summary of the error.
+
+Output:""",
+ input_variables=["response", "instructions"],
+)
+
+REQUESTS_PUT_TOOL_DESCRIPTION = """Use this when you want to PUT to a website.
+Input to the tool should be a json string with 3 keys: "url", "data", and "output_instructions".
+The value of "url" should be a string.
+The value of "data" should be a dictionary of key-value pairs you want to PUT to the url.
+The value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the PUT request creates.
+Always use double quotes for strings in the json string."""
+
+PARSING_PUT_PROMPT = PromptTemplate(
+ template="""Here is an API response:\n\n{response}\n\n====
+Your task is to extract some information according to these instructions: {instructions}
+When working with API objects, you should usually use ids over names. Do not return any ids or names that are not in the response.
+If the response indicates an error, you should instead output a summary of the error.
+
+Output:""",
+ input_variables=["response", "instructions"],
+)
+
+REQUESTS_DELETE_TOOL_DESCRIPTION = """ONLY USE THIS TOOL WHEN THE USER HAS SPECIFICALLY REQUESTED TO DELETE CONTENT FROM A WEBSITE.
+Input to the tool should be a json string with 2 keys: "url", and "output_instructions".
+The value of "url" should be a string.
+The value of "output_instructions" should be instructions on what information to extract from the response, for example the id(s) for a resource(s) that the DELETE request creates.
+Always use double quotes for strings in the json string.
+ONLY USE THIS TOOL IF THE USER HAS SPECIFICALLY REQUESTED TO DELETE SOMETHING."""
+
+PARSING_DELETE_PROMPT = PromptTemplate(
+ template="""Here is an API response:\n\n{response}\n\n====
+Your task is to extract some information according to these instructions: {instructions}
+When working with API objects, you should usually use ids over names. Do not return any ids or names that are not in the response.
+If the response indicates an error, you should instead output a summary of the error.
+
+Output:""",
+ input_variables=["response", "instructions"],
+)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..2b4f90f55c5aa4996625146fc0afa307ef73fcbe
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/prompt.py
@@ -0,0 +1,29 @@
+# flake8: noqa
+
+OPENAPI_PREFIX = """You are an agent designed to answer questions by making web requests to an API given the openapi spec.
+
+If the question does not seem related to the API, return I don't know. Do not make up an answer.
+Only use information provided by the tools to construct your response.
+
+First, find the base URL needed to make the request.
+
+Second, find the relevant paths needed to answer the question. Take note that, sometimes, you might need to make more than one request to more than one path to answer the question.
+
+Third, find the required parameters needed to make the request. For GET requests, these are usually URL parameters and for POST requests, these are request body parameters.
+
+Fourth, make the requests needed to answer the question. Ensure that you are sending the correct parameters to the request by checking which parameters are required. For parameters with a fixed set of values, please use the spec to look at which values are allowed.
+
+Use the exact parameter names as listed in the spec, do not make up any names or abbreviate the names of parameters.
+If you get a not found error, ensure that you are using a path that actually exists in the spec.
+"""
+OPENAPI_SUFFIX = """Begin!
+
+Question: {input}
+Thought: I should explore the spec to find the base server url for the API in the servers node.
+{agent_scratchpad}"""
+
+DESCRIPTION = """Can be used to answer questions about the openapi spec for the API. Always use this tool before trying to make a request.
+Example inputs to this tool:
+ 'What are the required query parameters for a GET request to the /bar endpoint?`
+ 'What are the required parameters in the request body for a POST request to the /foo endpoint?'
+Always give this tool a specific question."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/spec.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/spec.py
new file mode 100644
index 0000000000000000000000000000000000000000..befdf0215400e23dd2c3c0ab367bcd8087e2c736
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/spec.py
@@ -0,0 +1,82 @@
+"""Quick and dirty representation for OpenAPI specs."""
+
+from dataclasses import dataclass
+from typing import List, Tuple
+
+from langchain_core.utils.json_schema import dereference_refs
+
+
+@dataclass(frozen=True)
+class ReducedOpenAPISpec:
+ """A reduced OpenAPI spec.
+
+ This is a quick and dirty representation for OpenAPI specs.
+
+ Parameters:
+ servers: The servers in the spec.
+ description: The description of the spec.
+ endpoints: The endpoints in the spec.
+ """
+
+ servers: List[dict]
+ description: str
+ endpoints: List[Tuple[str, str, dict]]
+
+
+def reduce_openapi_spec(spec: dict, dereference: bool = True) -> ReducedOpenAPISpec:
+ """Simplify/distill/minify a spec somehow.
+
+ I want a smaller target for retrieval and (more importantly)
+ I want smaller results from retrieval.
+ I was hoping https://openapi.tools/ would have some useful bits
+ to this end, but doesn't seem so.
+
+ Args:
+ spec: The OpenAPI spec.
+ dereference: Whether to dereference the spec. Default is True.
+
+ Returns:
+ ReducedOpenAPISpec: The reduced OpenAPI spec.
+ """
+ # 1. Consider only get, post, patch, put, delete endpoints.
+ endpoints = [
+ (f"{operation_name.upper()} {route}", docs.get("description"), docs)
+ for route, operation in spec["paths"].items()
+ for operation_name, docs in operation.items()
+ if operation_name in ["get", "post", "patch", "put", "delete"]
+ ]
+
+ # 2. Replace any refs so that complete docs are retrieved.
+ # Note: probably want to do this post-retrieval, it blows up the size of the spec.
+ if dereference:
+ endpoints = [
+ (name, description, dereference_refs(docs, full_schema=spec))
+ for name, description, docs in endpoints
+ ]
+
+ # 3. Strip docs down to required request args + happy path response.
+ def reduce_endpoint_docs(docs: dict) -> dict:
+ out = {}
+ if docs.get("description"):
+ out["description"] = docs.get("description")
+ if docs.get("parameters"):
+ out["parameters"] = [
+ parameter
+ for parameter in docs.get("parameters", [])
+ if parameter.get("required")
+ ]
+ if "200" in docs["responses"]:
+ out["responses"] = docs["responses"]["200"]
+ if docs.get("requestBody"):
+ out["requestBody"] = docs.get("requestBody")
+ return out
+
+ endpoints = [
+ (name, description, reduce_endpoint_docs(docs))
+ for name, description, docs in endpoints
+ ]
+ return ReducedOpenAPISpec(
+ servers=spec["servers"],
+ description=spec["info"].get("description", ""),
+ endpoints=endpoints,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..2c888700462fffc03506f77495282d5136040131
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/openapi/toolkit.py
@@ -0,0 +1,238 @@
+"""Requests toolkit."""
+
+from __future__ import annotations
+
+from typing import Any, List
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import BaseTool, Tool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.agent_toolkits.json.base import create_json_agent
+from langchain_community.agent_toolkits.json.toolkit import JsonToolkit
+from langchain_community.agent_toolkits.openapi.prompt import DESCRIPTION
+from langchain_community.tools.json.tool import JsonSpec
+from langchain_community.tools.requests.tool import (
+ RequestsDeleteTool,
+ RequestsGetTool,
+ RequestsPatchTool,
+ RequestsPostTool,
+ RequestsPutTool,
+)
+from langchain_community.utilities.requests import TextRequestsWrapper
+
+
+class RequestsToolkit(BaseToolkit):
+ """Toolkit for making REST requests.
+
+ *Security Note*: This toolkit contains tools to make GET, POST, PATCH, PUT,
+ and DELETE requests to an API.
+
+ Exercise care in who is allowed to use this toolkit. If exposing
+ to end users, consider that users will be able to make arbitrary
+ requests on behalf of the server hosting the code. For example,
+ users could ask the server to make a request to a private API
+ that is only accessible from the server.
+
+ Control access to who can submit issue requests using this toolkit and
+ what network access it has.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Setup:
+ Install ``langchain-community``.
+
+ .. code-block:: bash
+
+ pip install -U langchain-community
+
+ Key init args:
+ requests_wrapper: langchain_community.utilities.requests.GenericRequestsWrapper
+ wrapper for executing requests.
+ allow_dangerous_requests: bool
+ Defaults to False. Must "opt-in" to using dangerous requests by setting to True.
+
+ Instantiate:
+ .. code-block:: python
+
+ from langchain_community.agent_toolkits.openapi.toolkit import RequestsToolkit
+ from langchain_community.utilities.requests import TextRequestsWrapper
+
+ toolkit = RequestsToolkit(
+ requests_wrapper=TextRequestsWrapper(headers={}),
+ allow_dangerous_requests=ALLOW_DANGEROUS_REQUEST,
+ )
+
+ Tools:
+ .. code-block:: python
+
+ tools = toolkit.get_tools()
+ tools
+
+ .. code-block:: none
+
+ [RequestsGetTool(requests_wrapper=TextRequestsWrapper(headers={}, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),
+ RequestsPostTool(requests_wrapper=TextRequestsWrapper(headers={}, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),
+ RequestsPatchTool(requests_wrapper=TextRequestsWrapper(headers={}, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),
+ RequestsPutTool(requests_wrapper=TextRequestsWrapper(headers={}, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True),
+ RequestsDeleteTool(requests_wrapper=TextRequestsWrapper(headers={}, aiosession=None, auth=None, response_content_type='text', verify=True), allow_dangerous_requests=True)]
+
+ Use within an agent:
+ .. code-block:: python
+
+ from langchain_openai import ChatOpenAI
+ from langgraph.prebuilt import create_react_agent
+
+
+ api_spec = \"\"\"
+ openapi: 3.0.0
+ info:
+ title: JSONPlaceholder API
+ version: 1.0.0
+ servers:
+ - url: https://jsonplaceholder.typicode.com
+ paths:
+ /posts:
+ get:
+ summary: Get posts
+ parameters: &id001
+ - name: _limit
+ in: query
+ required: false
+ schema:
+ type: integer
+ example: 2
+ description: Limit the number of results
+ \"\"\"
+
+ system_message = \"\"\"
+ You have access to an API to help answer user queries.
+ Here is documentation on the API:
+ {api_spec}
+ \"\"\".format(api_spec=api_spec)
+
+ llm = ChatOpenAI(model="gpt-4o-mini")
+ agent_executor = create_react_agent(llm, tools, state_modifier=system_message)
+
+ example_query = "Fetch the top two posts. What are their titles?"
+
+ events = agent_executor.stream(
+ {"messages": [("user", example_query)]},
+ stream_mode="values",
+ )
+ for event in events:
+ event["messages"][-1].pretty_print()
+
+ .. code-block:: none
+
+ ================================[1m Human Message [0m=================================
+
+ Fetch the top two posts. What are their titles?
+ ==================================[1m Ai Message [0m==================================
+ Tool Calls:
+ requests_get (call_RV2SOyzCnV5h2sm4WPgG8fND)
+ Call ID: call_RV2SOyzCnV5h2sm4WPgG8fND
+ Args:
+ url: https://jsonplaceholder.typicode.com/posts?_limit=2
+ =================================[1m Tool Message [0m=================================
+ Name: requests_get
+
+ [
+ {
+ "userId": 1,
+ "id": 1,
+ "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
+ "body": "quia et suscipit..."
+ },
+ {
+ "userId": 1,
+ "id": 2,
+ "title": "qui est esse",
+ "body": "est rerum tempore vitae..."
+ }
+ ]
+ ==================================[1m Ai Message [0m==================================
+
+ The titles of the top two posts are:
+ 1. "sunt aut facere repellat provident occaecati excepturi optio reprehenderit"
+ 2. "qui est esse"
+ """ # noqa: E501
+
+ requests_wrapper: TextRequestsWrapper
+ """The requests wrapper."""
+ allow_dangerous_requests: bool = False
+ """Allow dangerous requests. See documentation for details."""
+
+ def get_tools(self) -> List[BaseTool]:
+ """Return a list of tools."""
+ return [
+ RequestsGetTool(
+ requests_wrapper=self.requests_wrapper,
+ allow_dangerous_requests=self.allow_dangerous_requests,
+ ),
+ RequestsPostTool(
+ requests_wrapper=self.requests_wrapper,
+ allow_dangerous_requests=self.allow_dangerous_requests,
+ ),
+ RequestsPatchTool(
+ requests_wrapper=self.requests_wrapper,
+ allow_dangerous_requests=self.allow_dangerous_requests,
+ ),
+ RequestsPutTool(
+ requests_wrapper=self.requests_wrapper,
+ allow_dangerous_requests=self.allow_dangerous_requests,
+ ),
+ RequestsDeleteTool(
+ requests_wrapper=self.requests_wrapper,
+ allow_dangerous_requests=self.allow_dangerous_requests,
+ ),
+ ]
+
+
+class OpenAPIToolkit(BaseToolkit):
+ """Toolkit for interacting with an OpenAPI API.
+
+ *Security Note*: This toolkit contains tools that can read and modify
+ the state of a service; e.g., by creating, deleting, or updating,
+ reading underlying data.
+
+ For example, this toolkit can be used to delete data exposed via
+ an OpenAPI compliant API.
+ """
+
+ json_agent: Any
+ """The JSON agent."""
+ requests_wrapper: TextRequestsWrapper
+ """The requests wrapper."""
+ allow_dangerous_requests: bool = False
+ """Allow dangerous requests. See documentation for details."""
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ json_agent_tool = Tool(
+ name="json_explorer",
+ func=self.json_agent.run,
+ description=DESCRIPTION,
+ )
+ request_toolkit = RequestsToolkit(
+ requests_wrapper=self.requests_wrapper,
+ allow_dangerous_requests=self.allow_dangerous_requests,
+ )
+ return [*request_toolkit.get_tools(), json_agent_tool]
+
+ @classmethod
+ def from_llm(
+ cls,
+ llm: BaseLanguageModel,
+ json_spec: JsonSpec,
+ requests_wrapper: TextRequestsWrapper,
+ allow_dangerous_requests: bool = False,
+ **kwargs: Any,
+ ) -> OpenAPIToolkit:
+ """Create json agent from llm, then initialize."""
+ json_agent = create_json_agent(llm, JsonToolkit(spec=json_spec), **kwargs)
+ return cls(
+ json_agent=json_agent,
+ requests_wrapper=requests_wrapper,
+ allow_dangerous_requests=allow_dangerous_requests,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..5ab9dfcd0aae5b0256326117f5b29eae9d987b88
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__init__.py
@@ -0,0 +1,7 @@
+"""Playwright browser toolkit."""
+
+from langchain_community.agent_toolkits.playwright.toolkit import (
+ PlayWrightBrowserToolkit,
+)
+
+__all__ = ["PlayWrightBrowserToolkit"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..35000f364aa94063f2e4ee84a9d3c17aed37f1bc
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c4f63b091a71e1924b9b098ae67696873ba48724
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..6d69383e469cb354756ad2256e846a59675a0909
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/playwright/toolkit.py
@@ -0,0 +1,122 @@
+"""Playwright web browser toolkit."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, List, Optional, Type, cast
+
+from langchain_core.tools import BaseTool, BaseToolkit
+from pydantic import ConfigDict, model_validator
+
+from langchain_community.tools.playwright.base import (
+ BaseBrowserTool,
+ lazy_import_playwright_browsers,
+)
+from langchain_community.tools.playwright.click import ClickTool
+from langchain_community.tools.playwright.current_page import CurrentWebPageTool
+from langchain_community.tools.playwright.extract_hyperlinks import (
+ ExtractHyperlinksTool,
+)
+from langchain_community.tools.playwright.extract_text import ExtractTextTool
+from langchain_community.tools.playwright.get_elements import GetElementsTool
+from langchain_community.tools.playwright.navigate import NavigateTool
+from langchain_community.tools.playwright.navigate_back import NavigateBackTool
+
+if TYPE_CHECKING:
+ from playwright.async_api import Browser as AsyncBrowser
+ from playwright.sync_api import Browser as SyncBrowser
+else:
+ try:
+ # We do this so pydantic can resolve the types when instantiating
+ from playwright.async_api import Browser as AsyncBrowser
+ from playwright.sync_api import Browser as SyncBrowser
+ except ImportError:
+ pass
+
+
+class PlayWrightBrowserToolkit(BaseToolkit):
+ """Toolkit for PlayWright browser tools.
+
+ **Security Note**: This toolkit provides code to control a web-browser.
+
+ Careful if exposing this toolkit to end-users. The tools in the toolkit
+ are capable of navigating to arbitrary webpages, clicking on arbitrary
+ elements, and extracting arbitrary text and hyperlinks from webpages.
+
+ Specifically, by default this toolkit allows navigating to:
+
+ - Any URL (including any internal network URLs)
+ - And local files
+
+ If exposing to end-users, consider limiting network access to the
+ server that hosts the agent; in addition, consider it is advised
+ to create a custom NavigationTool wht an args_schema that limits the URLs
+ that can be navigated to (e.g., only allow navigating to URLs that
+ start with a particular prefix).
+
+ Remember to scope permissions to the minimal permissions necessary for
+ the application. If the default tool selection is not appropriate for
+ the application, consider creating a custom toolkit with the appropriate
+ tools.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ sync_browser: Optional. The sync browser. Default is None.
+ async_browser: Optional. The async browser. Default is None.
+ """
+
+ sync_browser: Optional["SyncBrowser"] = None
+ async_browser: Optional["AsyncBrowser"] = None
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ extra="forbid",
+ )
+
+ @model_validator(mode="before")
+ @classmethod
+ def validate_imports_and_browser_provided(cls, values: dict) -> Any:
+ """Check that the arguments are valid."""
+ lazy_import_playwright_browsers()
+ if values.get("async_browser") is None and values.get("sync_browser") is None:
+ raise ValueError("Either async_browser or sync_browser must be specified.")
+ return values
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ tool_classes: List[Type[BaseBrowserTool]] = [
+ ClickTool,
+ NavigateTool,
+ NavigateBackTool,
+ ExtractTextTool,
+ ExtractHyperlinksTool,
+ GetElementsTool,
+ CurrentWebPageTool,
+ ]
+
+ tools = [
+ tool_cls.from_browser(
+ sync_browser=self.sync_browser, async_browser=self.async_browser
+ )
+ for tool_cls in tool_classes
+ ]
+ return cast(List[BaseTool], tools)
+
+ @classmethod
+ def from_browser(
+ cls,
+ sync_browser: Optional[SyncBrowser] = None,
+ async_browser: Optional[AsyncBrowser] = None,
+ ) -> PlayWrightBrowserToolkit:
+ """Instantiate the toolkit.
+
+ Args:
+ sync_browser: Optional. The sync browser. Default is None.
+ async_browser: Optional. The async browser. Default is None.
+
+ Returns:
+ The toolkit.
+ """
+ # This is to raise a better error than the forward ref ones Pydantic would have
+ lazy_import_playwright_browsers()
+ return cls(sync_browser=sync_browser, async_browser=async_browser)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..b9a3bf13b76c581775bf6c33abe9fd2c33f11deb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__init__.py
@@ -0,0 +1 @@
+"""Polygon Toolkit"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ce8cd16d267724c2de8d0e6d5b39b7045a2321d7
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..12c6d418f89b2c338745111ee70629790d106653
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..f2a4ebb911040dc9f175b5d77860fbf8535265be
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/polygon/toolkit.py
@@ -0,0 +1,54 @@
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.polygon import (
+ PolygonAggregates,
+ PolygonFinancials,
+ PolygonLastQuote,
+ PolygonTickerNews,
+)
+from langchain_community.utilities.polygon import PolygonAPIWrapper
+
+
+class PolygonToolkit(BaseToolkit):
+ """Polygon Toolkit.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_polygon_api_wrapper(
+ cls, polygon_api_wrapper: PolygonAPIWrapper
+ ) -> "PolygonToolkit":
+ """Create a Polygon Toolkit from a Polygon API Wrapper.
+
+ Args:
+ polygon_api_wrapper: PolygonAPIWrapper. The Polygon API Wrapper.
+
+ Returns:
+ PolygonToolkit. The Polygon Toolkit.
+ """
+ tools = [
+ PolygonAggregates(
+ api_wrapper=polygon_api_wrapper,
+ ),
+ PolygonLastQuote(
+ api_wrapper=polygon_api_wrapper,
+ ),
+ PolygonTickerNews(
+ api_wrapper=polygon_api_wrapper,
+ ),
+ PolygonFinancials(
+ api_wrapper=polygon_api_wrapper,
+ ),
+ ]
+ return cls(tools=tools)
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..42a9b09ac7e41e5899830f0b2f7be4820207ebdd
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__init__.py
@@ -0,0 +1 @@
+"""Power BI agent."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..75ce70a5f1bd5735f6aca35fbb3874a251e89d7f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..277b48b2e0baa9063a919600ea600fdbabfbbab0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/chat_base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/chat_base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4c465c3075cbc0cf3454df9cd5d361f8533dfeb5
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/chat_base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..55126c5247eccafddda355923fbdaf7db1f169fe
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..671d4a50eaee8aadf967766af545ba9183216fa0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..2fd8f3fa1284e489d684a425de7bacd493f52661
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/base.py
@@ -0,0 +1,94 @@
+"""Power BI agent."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Dict, List, Optional
+
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models import BaseLanguageModel
+
+from langchain_community.agent_toolkits.powerbi.prompt import (
+ POWERBI_PREFIX,
+ POWERBI_SUFFIX,
+)
+from langchain_community.agent_toolkits.powerbi.toolkit import PowerBIToolkit
+from langchain_community.utilities.powerbi import PowerBIDataset
+
+if TYPE_CHECKING:
+ from langchain_classic.agents import AgentExecutor
+
+
+def create_pbi_agent(
+ llm: BaseLanguageModel,
+ toolkit: Optional[PowerBIToolkit] = None,
+ powerbi: Optional[PowerBIDataset] = None,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ prefix: str = POWERBI_PREFIX,
+ suffix: str = POWERBI_SUFFIX,
+ format_instructions: Optional[str] = None,
+ examples: Optional[str] = None,
+ input_variables: Optional[List[str]] = None,
+ top_k: int = 10,
+ verbose: bool = False,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Construct a Power BI agent from an LLM and tools.
+
+ Args:
+ llm: The language model to use.
+ toolkit: Optional. The Power BI toolkit. Default is None.
+ powerbi: Optional. The Power BI dataset. Default is None.
+ callback_manager: Optional. The callback manager. Default is None.
+ prefix: Optional. The prefix for the prompt. Default is POWERBI_PREFIX.
+ suffix: Optional. The suffix for the prompt. Default is POWERBI_SUFFIX.
+ format_instructions: Optional. The format instructions for the prompt.
+ Default is None.
+ examples: Optional. The examples for the prompt. Default is None.
+ input_variables: Optional. The input variables for the prompt. Default is None.
+ top_k: Optional. The top k for the prompt. Default is 10.
+ verbose: Optional. Whether to print verbose output. Default is False.
+ agent_executor_kwargs: Optional. The agent executor kwargs. Default is None.
+ kwargs: Any. Additional keyword arguments.
+
+ Returns:
+ The agent executor.
+ """
+ from langchain_classic.agents import AgentExecutor
+ from langchain_classic.agents.mrkl.base import ZeroShotAgent
+ from langchain_classic.chains.llm import LLMChain
+
+ if toolkit is None:
+ if powerbi is None:
+ raise ValueError("Must provide either a toolkit or powerbi dataset")
+ toolkit = PowerBIToolkit(powerbi=powerbi, llm=llm, examples=examples)
+ tools = toolkit.get_tools()
+ tables = powerbi.table_names if powerbi else toolkit.powerbi.table_names
+ prompt_params = (
+ {"format_instructions": format_instructions}
+ if format_instructions is not None
+ else {}
+ )
+ agent = ZeroShotAgent(
+ llm_chain=LLMChain(
+ llm=llm,
+ prompt=ZeroShotAgent.create_prompt(
+ tools,
+ prefix=prefix.format(top_k=top_k).format(tables=tables),
+ suffix=suffix,
+ input_variables=input_variables,
+ **prompt_params,
+ ),
+ callback_manager=callback_manager,
+ verbose=verbose,
+ ),
+ allowed_tools=[tool.name for tool in tools],
+ **kwargs,
+ )
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ verbose=verbose,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/chat_base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/chat_base.py
new file mode 100644
index 0000000000000000000000000000000000000000..5ad1ce434695b85edec8f7cd081476ad6182a7a7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/chat_base.py
@@ -0,0 +1,93 @@
+"""Power BI agent."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Dict, List, Optional
+
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models.chat_models import BaseChatModel
+
+from langchain_community.agent_toolkits.powerbi.prompt import (
+ POWERBI_CHAT_PREFIX,
+ POWERBI_CHAT_SUFFIX,
+)
+from langchain_community.agent_toolkits.powerbi.toolkit import PowerBIToolkit
+from langchain_community.utilities.powerbi import PowerBIDataset
+
+if TYPE_CHECKING:
+ from langchain_classic.agents import AgentExecutor
+ from langchain_classic.agents.agent import AgentOutputParser
+ from langchain_classic.memory.chat_memory import BaseChatMemory
+
+
+def create_pbi_chat_agent(
+ llm: BaseChatModel,
+ toolkit: Optional[PowerBIToolkit] = None,
+ powerbi: Optional[PowerBIDataset] = None,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ output_parser: Optional[AgentOutputParser] = None,
+ prefix: str = POWERBI_CHAT_PREFIX,
+ suffix: str = POWERBI_CHAT_SUFFIX,
+ examples: Optional[str] = None,
+ input_variables: Optional[List[str]] = None,
+ memory: Optional[BaseChatMemory] = None,
+ top_k: int = 10,
+ verbose: bool = False,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Construct a Power BI agent from a Chat LLM and tools.
+
+ If you supply only a toolkit and no Power BI dataset, the same LLM is used for both.
+
+ Args:
+ llm: The language model to use.
+ toolkit: Optional. The Power BI toolkit. Default is None.
+ powerbi: Optional. The Power BI dataset. Default is None.
+ callback_manager: Optional. The callback manager. Default is None.
+ output_parser: Optional. The output parser. Default is None.
+ prefix: Optional. The prefix for the prompt. Default is POWERBI_CHAT_PREFIX.
+ suffix: Optional. The suffix for the prompt. Default is POWERBI_CHAT_SUFFIX.
+ examples: Optional. The examples for the prompt. Default is None.
+ input_variables: Optional. The input variables for the prompt. Default is None.
+ memory: Optional. The memory. Default is None.
+ top_k: Optional. The top k for the prompt. Default is 10.
+ verbose: Optional. Whether to print verbose output. Default is False.
+ agent_executor_kwargs: Optional. The agent executor kwargs. Default is None.
+ kwargs: Any. Additional keyword arguments.
+
+ Returns:
+ The agent executor.
+ """
+ from langchain_classic.agents import AgentExecutor
+ from langchain_classic.agents.conversational_chat.base import (
+ ConversationalChatAgent,
+ )
+ from langchain_classic.memory import ConversationBufferMemory
+
+ if toolkit is None:
+ if powerbi is None:
+ raise ValueError("Must provide either a toolkit or powerbi dataset")
+ toolkit = PowerBIToolkit(powerbi=powerbi, llm=llm, examples=examples)
+ tools = toolkit.get_tools()
+ tables = powerbi.table_names if powerbi else toolkit.powerbi.table_names
+ agent = ConversationalChatAgent.from_llm_and_tools(
+ llm=llm,
+ tools=tools,
+ system_message=prefix.format(top_k=top_k).format(tables=tables),
+ human_message=suffix,
+ input_variables=input_variables,
+ callback_manager=callback_manager,
+ output_parser=output_parser,
+ verbose=verbose,
+ **kwargs,
+ )
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ memory=memory
+ or ConversationBufferMemory(memory_key="chat_history", return_messages=True),
+ verbose=verbose,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..b633a3c1382da74ce1d1ff21d4d93fc2e0a4c6e4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/prompt.py
@@ -0,0 +1,37 @@
+# flake8: noqa
+"""Prompts for PowerBI agent."""
+
+POWERBI_PREFIX = """You are an agent designed to help users interact with a PowerBI Dataset.
+
+Agent has access to a tool that can write a query based on the question and then run those against PowerBI, Microsofts business intelligence tool. The questions from the users should be interpreted as related to the dataset that is available and not general questions about the world. If the question does not seem related to the dataset, return "This does not appear to be part of this dataset." as the answer.
+
+Given an input question, ask to run the questions against the dataset, then look at the results and return the answer, the answer should be a complete sentence that answers the question, if multiple rows are asked find a way to write that in a easily readable format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000. Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.
+"""
+
+POWERBI_SUFFIX = """Begin!
+
+Question: {input}
+Thought: I can first ask which tables I have, then how each table is defined and then ask the query tool the question I need, and finally create a nice sentence that answers the question.
+{agent_scratchpad}"""
+
+POWERBI_CHAT_PREFIX = """Assistant is a large language model built to help users interact with a PowerBI Dataset.
+
+Assistant should try to create a correct and complete answer to the question from the user. If the user asks a question not related to the dataset it should return "This does not appear to be part of this dataset." as the answer. The user might make a mistake with the spelling of certain values, if you think that is the case, ask the user to confirm the spelling of the value and then run the query again. Unless the user specifies a specific number of examples they wish to obtain, and the results are too large, limit your query to at most {top_k} results, but make it clear when answering which field was used for the filtering. The user has access to these tables: {{tables}}.
+
+The answer should be a complete sentence that answers the question, if multiple rows are asked find a way to write that in a easily readable format for a human, also make sure to represent numbers in readable ways, like 1M instead of 1000000.
+"""
+
+POWERBI_CHAT_SUFFIX = """TOOLS
+------
+Assistant can ask the user to use tools to look up information that may be helpful in answering the users original question. The tools the human can use are:
+
+{{tools}}
+
+{format_instructions}
+
+USER'S INPUT
+--------------------
+Here is the user's input (remember to respond with a markdown code snippet of a json blob with a single action, and NOTHING else):
+
+{{{{input}}}}
+"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..25019c54f63029615367a7652cbce1af62dce21d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/powerbi/toolkit.py
@@ -0,0 +1,117 @@
+"""Toolkit for interacting with a Power BI dataset."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List, Optional, Union
+
+from langchain_core.callbacks import BaseCallbackManager
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.language_models.chat_models import BaseChatModel
+from langchain_core.prompts import PromptTemplate
+from langchain_core.prompts.chat import (
+ ChatPromptTemplate,
+ HumanMessagePromptTemplate,
+ SystemMessagePromptTemplate,
+)
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.powerbi.prompt import (
+ QUESTION_TO_QUERY_BASE,
+ SINGLE_QUESTION_TO_QUERY,
+ USER_INPUT,
+)
+from langchain_community.tools.powerbi.tool import (
+ InfoPowerBITool,
+ ListPowerBITool,
+ QueryPowerBITool,
+)
+from langchain_community.utilities.powerbi import PowerBIDataset
+
+if TYPE_CHECKING:
+ from langchain_classic.chains.llm import LLMChain
+
+
+class PowerBIToolkit(BaseToolkit):
+ """Toolkit for interacting with Power BI dataset.
+
+ *Security Note*: This toolkit interacts with an external service.
+
+ Control access to who can use this toolkit.
+
+ Make sure that the capabilities given by this toolkit to the calling
+ code are appropriately scoped to the application.
+
+ See https://python.langchain.com/docs/security for more information.
+
+ Parameters:
+ powerbi: The Power BI dataset.
+ llm: The language model to use.
+ examples: Optional. The examples for the prompt. Default is None.
+ max_iterations: Optional. The maximum iterations to run. Default is 5.
+ callback_manager: Optional. The callback manager. Default is None.
+ output_token_limit: The output token limit. Default is 4000.
+ tiktoken_model_name: Optional. The TikToken model name. Default is None.
+ """
+
+ powerbi: PowerBIDataset = Field(exclude=True)
+ llm: Union[BaseLanguageModel, BaseChatModel] = Field(exclude=True)
+ examples: Optional[str] = None
+ max_iterations: int = 5
+ callback_manager: Optional[BaseCallbackManager] = None
+ output_token_limit: int = 4000
+ tiktoken_model_name: Optional[str] = None
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ QueryPowerBITool(
+ llm_chain=self._get_chain(),
+ powerbi=self.powerbi,
+ examples=self.examples,
+ max_iterations=self.max_iterations,
+ output_token_limit=self.output_token_limit,
+ tiktoken_model_name=self.tiktoken_model_name,
+ ),
+ InfoPowerBITool(powerbi=self.powerbi),
+ ListPowerBITool(powerbi=self.powerbi),
+ ]
+
+ def _get_chain(self) -> LLMChain:
+ """Construct the chain based on the callback manager and model type."""
+ from langchain_classic.chains.llm import LLMChain
+
+ if isinstance(self.llm, BaseLanguageModel):
+ return LLMChain(
+ llm=self.llm,
+ callback_manager=self.callback_manager
+ if self.callback_manager
+ else None,
+ prompt=PromptTemplate(
+ template=SINGLE_QUESTION_TO_QUERY,
+ input_variables=["tool_input", "tables", "schemas", "examples"],
+ ),
+ )
+
+ system_prompt = SystemMessagePromptTemplate(
+ prompt=PromptTemplate(
+ template=QUESTION_TO_QUERY_BASE,
+ input_variables=["tables", "schemas", "examples"],
+ )
+ )
+ human_prompt = HumanMessagePromptTemplate(
+ prompt=PromptTemplate(
+ template=USER_INPUT,
+ input_variables=["tool_input"],
+ )
+ )
+ return LLMChain(
+ llm=self.llm,
+ callback_manager=self.callback_manager if self.callback_manager else None,
+ prompt=ChatPromptTemplate.from_messages([system_prompt, human_prompt]),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1ec5ae704ce5eb6ba87c7061da65aec216915295
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__init__.py
@@ -0,0 +1 @@
+"""Slack toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5b640f2bc10cb4b2a1864f9cda3b104336148b8e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..17d84fa7866d9ff8fb9eced2ef475f605a48d515
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..a8ca7f564192b12bf2a925726ad30981dd8418bc
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/slack/toolkit.py
@@ -0,0 +1,112 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.slack.get_channel import SlackGetChannel
+from langchain_community.tools.slack.get_message import SlackGetMessage
+from langchain_community.tools.slack.schedule_message import SlackScheduleMessage
+from langchain_community.tools.slack.send_message import SlackSendMessage
+from langchain_community.tools.slack.utils import login
+
+if TYPE_CHECKING:
+ # This is for linting and IDE typehints
+ from slack_sdk import WebClient
+else:
+ try:
+ # We do this so pydantic can resolve the types when instantiating
+ from slack_sdk import WebClient
+ except ImportError:
+ pass
+
+
+class SlackToolkit(BaseToolkit):
+ """Toolkit for interacting with Slack.
+
+ Parameters:
+ client: The Slack client.
+
+ Setup:
+ Install ``slack_sdk`` and set environment variable ``SLACK_USER_TOKEN``.
+
+ .. code-block:: bash
+
+ pip install -U slack_sdk
+ export SLACK_USER_TOKEN="your-user-token"
+
+ Key init args:
+ client: slack_sdk.WebClient
+ The Slack client.
+
+ Instantiate:
+ .. code-block:: python
+
+ from langchain_community.agent_toolkits import SlackToolkit
+
+ toolkit = SlackToolkit()
+
+ Tools:
+ .. code-block:: python
+
+ tools = toolkit.get_tools()
+ tools
+
+ .. code-block:: none
+
+ [SlackGetChannel(client=),
+ SlackGetMessage(client=),
+ SlackScheduleMessage(client=),
+ SlackSendMessage(client=)]
+
+ Use within an agent:
+ .. code-block:: python
+
+ from langchain_openai import ChatOpenAI
+ from langgraph.prebuilt import create_react_agent
+
+ llm = ChatOpenAI(model="gpt-4o-mini")
+ agent_executor = create_react_agent(llm, tools)
+
+ example_query = "When was the #general channel created?"
+
+ events = agent_executor.stream(
+ {"messages": [("user", example_query)]},
+ stream_mode="values",
+ )
+ for event in events:
+ message = event["messages"][-1]
+ if message.type != "tool": # mask sensitive information
+ event["messages"][-1].pretty_print()
+
+ .. code-block:: none
+
+ ================================[1m Human Message [0m=================================
+
+ When was the #general channel created?
+ ==================================[1m Ai Message [0m==================================
+ Tool Calls:
+ get_channelid_name_dict (call_NXDkALjoOx97uF1v0CoZTqtJ)
+ Call ID: call_NXDkALjoOx97uF1v0CoZTqtJ
+ Args:
+ ==================================[1m Ai Message [0m==================================
+
+ The #general channel was created on timestamp 1671043305.
+ """ # noqa: E501
+
+ client: WebClient = Field(default_factory=login)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ SlackGetChannel(),
+ SlackGetMessage(),
+ SlackScheduleMessage(),
+ SlackSendMessage(),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..4308c079443cbd52500cbbc928422c3ce7506db3
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__init__.py
@@ -0,0 +1 @@
+"""Spark SQL agent."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fab67226c78d2c499744e8c44b0e4d5126663e3b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6b811884c340cbdb78bf261332f0a17abd82bc62
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..baee0bce902c9b557e349a168c7c8c8795e829f8
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d3c5f099282142e263917e40cadeae6d1418ccc5
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..15896384a4a47c6cb8636e3343660406221bf5a4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/base.py
@@ -0,0 +1,93 @@
+"""Spark SQL agent."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Any, Dict, List, Optional
+
+from langchain_core.callbacks import BaseCallbackManager, Callbacks
+from langchain_core.language_models import BaseLanguageModel
+
+from langchain_community.agent_toolkits.spark_sql.prompt import SQL_PREFIX, SQL_SUFFIX
+from langchain_community.agent_toolkits.spark_sql.toolkit import SparkSQLToolkit
+
+if TYPE_CHECKING:
+ from langchain_classic.agents.agent import AgentExecutor
+
+
+def create_spark_sql_agent(
+ llm: BaseLanguageModel,
+ toolkit: SparkSQLToolkit,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ callbacks: Callbacks = None,
+ prefix: str = SQL_PREFIX,
+ suffix: str = SQL_SUFFIX,
+ format_instructions: Optional[str] = None,
+ input_variables: Optional[List[str]] = None,
+ top_k: int = 10,
+ max_iterations: Optional[int] = 15,
+ max_execution_time: Optional[float] = None,
+ early_stopping_method: str = "force",
+ verbose: bool = False,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Construct a Spark SQL agent from an LLM and tools.
+
+ Args:
+ llm: The language model to use.
+ toolkit: The Spark SQL toolkit.
+ callback_manager: Optional. The callback manager. Default is None.
+ callbacks: Optional. The callbacks. Default is None.
+ prefix: Optional. The prefix for the prompt. Default is SQL_PREFIX.
+ suffix: Optional. The suffix for the prompt. Default is SQL_SUFFIX.
+ format_instructions: Optional. The format instructions for the prompt.
+ Default is None.
+ input_variables: Optional. The input variables for the prompt. Default is None.
+ top_k: Optional. The top k for the prompt. Default is 10.
+ max_iterations: Optional. The maximum iterations to run. Default is 15.
+ max_execution_time: Optional. The maximum execution time. Default is None.
+ early_stopping_method: Optional. The early stopping method. Default is "force".
+ verbose: Optional. Whether to print verbose output. Default is False.
+ agent_executor_kwargs: Optional. The agent executor kwargs. Default is None.
+ kwargs: Any. Additional keyword arguments.
+
+ Returns:
+ The agent executor.
+ """
+ from langchain_classic.agents.agent import AgentExecutor
+ from langchain_classic.agents.mrkl.base import ZeroShotAgent
+ from langchain_classic.chains.llm import LLMChain
+
+ tools = toolkit.get_tools()
+ prefix = prefix.format(top_k=top_k)
+ prompt_params = (
+ {"format_instructions": format_instructions}
+ if format_instructions is not None
+ else {}
+ )
+ prompt = ZeroShotAgent.create_prompt(
+ tools,
+ prefix=prefix,
+ suffix=suffix,
+ input_variables=input_variables,
+ **prompt_params,
+ )
+ llm_chain = LLMChain(
+ llm=llm,
+ prompt=prompt,
+ callback_manager=callback_manager,
+ callbacks=callbacks,
+ )
+ tool_names = [tool.name for tool in tools]
+ agent = ZeroShotAgent(llm_chain=llm_chain, allowed_tools=tool_names, **kwargs)
+ return AgentExecutor.from_agent_and_tools(
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ callbacks=callbacks,
+ verbose=verbose,
+ max_iterations=max_iterations,
+ max_execution_time=max_execution_time,
+ early_stopping_method=early_stopping_method,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..b499085d3fe7c83d4621d3c817cfc2fa4e75099d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/prompt.py
@@ -0,0 +1,21 @@
+# flake8: noqa
+
+SQL_PREFIX = """You are an agent designed to interact with Spark SQL.
+Given an input question, create a syntactically correct Spark SQL query to run, then look at the results of the query and return the answer.
+Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.
+You can order the results by a relevant column to return the most interesting examples in the database.
+Never query for all the columns from a specific table, only ask for the relevant columns given the question.
+You have access to tools for interacting with the database.
+Only use the below tools. Only use the information returned by the below tools to construct your final answer.
+You MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.
+
+DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.
+
+If the question does not seem related to the database, just return "I don't know" as the answer.
+"""
+
+SQL_SUFFIX = """Begin!
+
+Question: {input}
+Thought: I should look at the tables in the database to see what I can query.
+{agent_scratchpad}"""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..a339307452e0855701270cf9cae4aec68f570d1c
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/spark_sql/toolkit.py
@@ -0,0 +1,41 @@
+"""Toolkit for interacting with Spark SQL."""
+
+from typing import List
+
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.spark_sql.tool import (
+ InfoSparkSQLTool,
+ ListSparkSQLTool,
+ QueryCheckerTool,
+ QuerySparkSQLTool,
+)
+from langchain_community.utilities.spark_sql import SparkSQL
+
+
+class SparkSQLToolkit(BaseToolkit):
+ """Toolkit for interacting with Spark SQL.
+
+ Parameters:
+ db: SparkSQL. The Spark SQL database.
+ llm: BaseLanguageModel. The language model.
+ """
+
+ db: SparkSQL = Field(exclude=True)
+ llm: BaseLanguageModel = Field(exclude=True)
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return [
+ QuerySparkSQLTool(db=self.db),
+ InfoSparkSQLTool(db=self.db),
+ ListSparkSQLTool(db=self.db),
+ QueryCheckerTool(db=self.db, llm=self.llm),
+ ]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..74293a52391557789bd62c6885ecd91f04b89dc8
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__init__.py
@@ -0,0 +1 @@
+"""SQL agent."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..698164a0024b0d6541bb60939a222c5cec6ace6e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2023239abcd95b84fc9a360841b934cc5625f661
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..300ce99a442332f99dd28f358566104f68cbed1c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0c20613f386315805441403ec517d2d0361b97df
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..caea0181fcbde4a045d2715091e8d34db621e28e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/base.py
@@ -0,0 +1,241 @@
+"""SQL agent."""
+
+from __future__ import annotations
+
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Dict,
+ List,
+ Literal,
+ Optional,
+ Sequence,
+ Union,
+ cast,
+)
+
+from langchain_core.messages import AIMessage, SystemMessage
+from langchain_core.prompts import BasePromptTemplate, PromptTemplate
+from langchain_core.prompts.chat import (
+ ChatPromptTemplate,
+ HumanMessagePromptTemplate,
+ MessagesPlaceholder,
+)
+
+from langchain_community.agent_toolkits.sql.prompt import (
+ SQL_FUNCTIONS_SUFFIX,
+ SQL_PREFIX,
+ SQL_SUFFIX,
+)
+from langchain_community.agent_toolkits.sql.toolkit import SQLDatabaseToolkit
+from langchain_community.tools.sql_database.tool import (
+ InfoSQLDatabaseTool,
+ ListSQLDatabaseTool,
+)
+
+if TYPE_CHECKING:
+ from langchain_classic.agents.agent import AgentExecutor
+ from langchain_classic.agents.agent_types import AgentType
+ from langchain_core.callbacks import BaseCallbackManager
+ from langchain_core.language_models import BaseLanguageModel
+ from langchain_core.tools import BaseTool
+
+ from langchain_community.utilities.sql_database import SQLDatabase
+
+
+def create_sql_agent(
+ llm: BaseLanguageModel,
+ toolkit: Optional[SQLDatabaseToolkit] = None,
+ agent_type: Optional[
+ Union[AgentType, Literal["openai-tools", "tool-calling"]]
+ ] = None,
+ callback_manager: Optional[BaseCallbackManager] = None,
+ prefix: Optional[str] = None,
+ suffix: Optional[str] = None,
+ format_instructions: Optional[str] = None,
+ input_variables: Optional[List[str]] = None,
+ top_k: int = 10,
+ max_iterations: Optional[int] = 15,
+ max_execution_time: Optional[float] = None,
+ early_stopping_method: str = "force",
+ verbose: bool = False,
+ agent_executor_kwargs: Optional[Dict[str, Any]] = None,
+ extra_tools: Sequence[BaseTool] = (),
+ *,
+ db: Optional[SQLDatabase] = None,
+ prompt: Optional[BasePromptTemplate] = None,
+ **kwargs: Any,
+) -> AgentExecutor:
+ """Construct a SQL agent from an LLM and toolkit or database.
+
+ Args:
+ llm: Language model to use for the agent. If agent_type is "tool-calling" then
+ llm is expected to support tool calling.
+ toolkit: SQLDatabaseToolkit for the agent to use. Must provide exactly one of
+ 'toolkit' or 'db'. Specify 'toolkit' if you want to use a different model
+ for the agent and the toolkit.
+ agent_type: One of "tool-calling", "openai-tools", "openai-functions", or
+ "zero-shot-react-description". Defaults to "zero-shot-react-description".
+ "tool-calling" is recommended over the legacy "openai-tools" and
+ "openai-functions" types.
+ callback_manager: DEPRECATED. Pass "callbacks" key into 'agent_executor_kwargs'
+ instead to pass constructor callbacks to AgentExecutor.
+ prefix: Prompt prefix string. Must contain variables "top_k" and "dialect".
+ suffix: Prompt suffix string. Default depends on agent type.
+ format_instructions: Formatting instructions to pass to
+ ZeroShotAgent.create_prompt() when 'agent_type' is
+ "zero-shot-react-description". Otherwise ignored.
+ input_variables: DEPRECATED.
+ top_k: Number of rows to query for by default.
+ max_iterations: Passed to AgentExecutor init.
+ max_execution_time: Passed to AgentExecutor init.
+ early_stopping_method: Passed to AgentExecutor init.
+ verbose: AgentExecutor verbosity.
+ agent_executor_kwargs: Arbitrary additional AgentExecutor args.
+ extra_tools: Additional tools to give to agent on top of the ones that come with
+ SQLDatabaseToolkit.
+ db: SQLDatabase from which to create a SQLDatabaseToolkit. Toolkit is created
+ using 'db' and 'llm'. Must provide exactly one of 'db' or 'toolkit'.
+ prompt: Complete agent prompt. prompt and {prefix, suffix, format_instructions,
+ input_variables} are mutually exclusive.
+ **kwargs: Arbitrary additional Agent args.
+
+ Returns:
+ An AgentExecutor with the specified agent_type agent.
+
+ Example:
+
+ .. code-block:: python
+
+ from langchain_openai import ChatOpenAI
+ from langchain_community.agent_toolkits import create_sql_agent
+ from langchain_community.utilities import SQLDatabase
+
+ db = SQLDatabase.from_uri("sqlite:///Chinook.db")
+ llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)
+ agent_executor = create_sql_agent(llm, db=db, agent_type="tool-calling", verbose=True)
+
+ """ # noqa: E501
+ from langchain_classic.agents import (
+ create_openai_functions_agent,
+ create_openai_tools_agent,
+ create_react_agent,
+ create_tool_calling_agent,
+ )
+ from langchain_classic.agents.agent import (
+ AgentExecutor,
+ RunnableAgent,
+ RunnableMultiActionAgent,
+ )
+ from langchain_classic.agents.agent_types import AgentType
+
+ if toolkit is None and db is None:
+ raise ValueError(
+ "Must provide exactly one of 'toolkit' or 'db'. Received neither."
+ )
+ if toolkit and db:
+ raise ValueError(
+ "Must provide exactly one of 'toolkit' or 'db'. Received both."
+ )
+
+ toolkit = toolkit or SQLDatabaseToolkit(llm=llm, db=db) # type: ignore[arg-type]
+ agent_type = agent_type or AgentType.ZERO_SHOT_REACT_DESCRIPTION
+ tools = toolkit.get_tools() + list(extra_tools)
+ if prefix is None:
+ prefix = SQL_PREFIX
+ if prompt is None:
+ prefix = prefix.format(dialect=toolkit.dialect, top_k=top_k)
+ else:
+ if "top_k" in prompt.input_variables:
+ prompt = prompt.partial(top_k=str(top_k))
+ if "dialect" in prompt.input_variables:
+ prompt = prompt.partial(dialect=toolkit.dialect)
+ if any(key in prompt.input_variables for key in ["table_info", "table_names"]):
+ db_context = toolkit.get_context()
+ if "table_info" in prompt.input_variables:
+ prompt = prompt.partial(table_info=db_context["table_info"])
+ tools = [
+ tool for tool in tools if not isinstance(tool, InfoSQLDatabaseTool)
+ ]
+ if "table_names" in prompt.input_variables:
+ prompt = prompt.partial(table_names=db_context["table_names"])
+ tools = [
+ tool for tool in tools if not isinstance(tool, ListSQLDatabaseTool)
+ ]
+
+ if agent_type == AgentType.ZERO_SHOT_REACT_DESCRIPTION:
+ if prompt is None:
+ from langchain_classic.agents.mrkl import prompt as react_prompt
+
+ format_instructions = (
+ format_instructions or react_prompt.FORMAT_INSTRUCTIONS
+ )
+ template = "\n\n".join(
+ [
+ prefix,
+ "{tools}",
+ format_instructions,
+ suffix or SQL_SUFFIX,
+ ]
+ )
+ prompt = PromptTemplate.from_template(template)
+ agent = RunnableAgent(
+ runnable=create_react_agent(llm, tools, prompt),
+ input_keys_arg=["input"],
+ return_keys_arg=["output"],
+ **kwargs,
+ )
+
+ elif agent_type == AgentType.OPENAI_FUNCTIONS:
+ if prompt is None:
+ messages: List = [
+ SystemMessage(content=cast(str, prefix)),
+ HumanMessagePromptTemplate.from_template("{input}"),
+ AIMessage(content=suffix or SQL_FUNCTIONS_SUFFIX),
+ MessagesPlaceholder(variable_name="agent_scratchpad"),
+ ]
+ prompt = ChatPromptTemplate.from_messages(messages)
+ agent = RunnableAgent(
+ runnable=create_openai_functions_agent(llm, tools, prompt), # type: ignore[arg-type]
+ input_keys_arg=["input"],
+ return_keys_arg=["output"],
+ **kwargs,
+ )
+ elif agent_type in ("openai-tools", "tool-calling"):
+ if prompt is None:
+ messages = [
+ SystemMessage(content=cast(str, prefix)),
+ HumanMessagePromptTemplate.from_template("{input}"),
+ AIMessage(content=suffix or SQL_FUNCTIONS_SUFFIX),
+ MessagesPlaceholder(variable_name="agent_scratchpad"),
+ ]
+ prompt = ChatPromptTemplate.from_messages(messages)
+ if agent_type == "openai-tools":
+ runnable = create_openai_tools_agent(llm, tools, prompt) # type: ignore[arg-type]
+ else:
+ runnable = create_tool_calling_agent(llm, tools, prompt) # type: ignore[arg-type]
+ agent = RunnableMultiActionAgent( # type: ignore[assignment]
+ runnable=runnable,
+ input_keys_arg=["input"],
+ return_keys_arg=["output"],
+ **kwargs,
+ )
+
+ else:
+ raise ValueError(
+ f"Agent type {agent_type} not supported at the moment. Must be one of "
+ "'tool-calling', 'openai-tools', 'openai-functions', or "
+ "'zero-shot-react-description'."
+ )
+
+ return AgentExecutor(
+ name="SQL Agent Executor",
+ agent=agent,
+ tools=tools,
+ callback_manager=callback_manager,
+ verbose=verbose,
+ max_iterations=max_iterations,
+ max_execution_time=max_execution_time,
+ early_stopping_method=early_stopping_method,
+ **(agent_executor_kwargs or {}),
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/prompt.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/prompt.py
new file mode 100644
index 0000000000000000000000000000000000000000..92464da4b9b9f3eeb128cd216b5701d6cc2e5761
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/prompt.py
@@ -0,0 +1,23 @@
+# flake8: noqa
+
+SQL_PREFIX = """You are an agent designed to interact with a SQL database.
+Given an input question, create a syntactically correct {dialect} query to run, then look at the results of the query and return the answer.
+Unless the user specifies a specific number of examples they wish to obtain, always limit your query to at most {top_k} results.
+You can order the results by a relevant column to return the most interesting examples in the database.
+Never query for all the columns from a specific table, only ask for the relevant columns given the question.
+You have access to tools for interacting with the database.
+Only use the below tools. Only use the information returned by the below tools to construct your final answer.
+You MUST double check your query before executing it. If you get an error while executing a query, rewrite the query and try again.
+
+DO NOT make any DML statements (INSERT, UPDATE, DELETE, DROP etc.) to the database.
+
+If the question does not seem related to the database, just return "I don't know" as the answer.
+"""
+
+SQL_SUFFIX = """Begin!
+
+Question: {input}
+Thought: I should look at the tables in the database to see what I can query. Then I should query the schema of the most relevant tables.
+{agent_scratchpad}"""
+
+SQL_FUNCTIONS_SUFFIX = """I should look at the tables in the database to see what I can query. Then I should query the schema of the most relevant tables."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..aa4df2663f2f4da92205339e9c11b737f9d4d419
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/sql/toolkit.py
@@ -0,0 +1,139 @@
+"""Toolkit for interacting with an SQL database."""
+
+from typing import List
+
+from langchain_core.caches import BaseCache as BaseCache
+from langchain_core.callbacks import Callbacks as Callbacks
+from langchain_core.language_models import BaseLanguageModel
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+from pydantic import ConfigDict, Field
+
+from langchain_community.tools.sql_database.tool import (
+ InfoSQLDatabaseTool,
+ ListSQLDatabaseTool,
+ QuerySQLCheckerTool,
+ QuerySQLDatabaseTool,
+)
+from langchain_community.tools.sql_database.tool import (
+ QuerySQLDataBaseTool as QuerySQLDataBaseTool, # keep import for backwards compat.
+)
+from langchain_community.utilities.sql_database import SQLDatabase
+
+
+class SQLDatabaseToolkit(BaseToolkit):
+ """SQLDatabaseToolkit for interacting with SQL databases.
+
+ Setup:
+ Install ``langchain-community``.
+
+ .. code-block:: bash
+
+ pip install -U langchain-community
+
+ Key init args:
+ db: SQLDatabase
+ The SQL database.
+ llm: BaseLanguageModel
+ The language model (for use with QuerySQLCheckerTool)
+
+ Instantiate:
+ .. code-block:: python
+
+ from langchain_community.agent_toolkits.sql.toolkit import SQLDatabaseToolkit
+ from langchain_community.utilities.sql_database import SQLDatabase
+ from langchain_openai import ChatOpenAI
+
+ db = SQLDatabase.from_uri("sqlite:///Chinook.db")
+ llm = ChatOpenAI(temperature=0)
+
+ toolkit = SQLDatabaseToolkit(db=db, llm=llm)
+
+ Tools:
+ .. code-block:: python
+
+ toolkit.get_tools()
+
+ Use within an agent:
+ .. code-block:: python
+
+ from langchain import hub
+ from langgraph.prebuilt import create_react_agent
+
+ # Pull prompt (or define your own)
+ prompt_template = hub.pull("langchain-ai/sql-agent-system-prompt")
+ system_message = prompt_template.format(dialect="SQLite", top_k=5)
+
+ # Create agent
+ agent_executor = create_react_agent(
+ llm, toolkit.get_tools(), state_modifier=system_message
+ )
+
+ # Query agent
+ example_query = "Which country's customers spent the most?"
+
+ events = agent_executor.stream(
+ {"messages": [("user", example_query)]},
+ stream_mode="values",
+ )
+ for event in events:
+ event["messages"][-1].pretty_print()
+ """ # noqa: E501
+
+ db: SQLDatabase = Field(exclude=True)
+ llm: BaseLanguageModel = Field(exclude=True)
+
+ @property
+ def dialect(self) -> str:
+ """Return string representation of SQL dialect to use."""
+ return self.db.dialect
+
+ model_config = ConfigDict(
+ arbitrary_types_allowed=True,
+ )
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ list_sql_database_tool = ListSQLDatabaseTool(db=self.db)
+ info_sql_database_tool_description = (
+ "Input to this tool is a comma-separated list of tables, output is the "
+ "schema and sample rows for those tables. "
+ "Be sure that the tables actually exist by calling "
+ f"{list_sql_database_tool.name} first! "
+ "Example Input: table1, table2, table3"
+ )
+ info_sql_database_tool = InfoSQLDatabaseTool(
+ db=self.db, description=info_sql_database_tool_description
+ )
+ query_sql_database_tool_description = (
+ "Input to this tool is a detailed and correct SQL query, output is a "
+ "result from the database. If the query is not correct, an error message "
+ "will be returned. If an error is returned, rewrite the query, check the "
+ "query, and try again. If you encounter an issue with Unknown column "
+ f"'xxxx' in 'field list', use {info_sql_database_tool.name} "
+ "to query the correct table fields."
+ )
+ query_sql_database_tool = QuerySQLDatabaseTool(
+ db=self.db, description=query_sql_database_tool_description
+ )
+ query_sql_checker_tool_description = (
+ "Use this tool to double check if your query is correct before executing "
+ "it. Always use this tool before executing a query with "
+ f"{query_sql_database_tool.name}!"
+ )
+ query_sql_checker_tool = QuerySQLCheckerTool(
+ db=self.db, llm=self.llm, description=query_sql_checker_tool_description
+ )
+ return [
+ query_sql_database_tool,
+ info_sql_database_tool,
+ list_sql_database_tool,
+ query_sql_checker_tool,
+ ]
+
+ def get_context(self) -> dict:
+ """Return db context that you may want in agent prompt."""
+ return self.db.get_context()
+
+
+SQLDatabaseToolkit.model_rebuild()
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..f99981082424ee0a70e444573cb3b4f6f2de4947
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__init__.py
@@ -0,0 +1 @@
+"""Steam Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..32e5f107bdf800160852af9755e9799757a9b374
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..063acd837453fd961082d85b5aa341ef6a0133ed
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..54c3ff4612417996acb3ad849000662f55fe8141
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/steam/toolkit.py
@@ -0,0 +1,62 @@
+"""Steam Toolkit."""
+
+from typing import List
+
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.steam.prompt import (
+ STEAM_GET_GAMES_DETAILS,
+ STEAM_GET_RECOMMENDED_GAMES,
+)
+from langchain_community.tools.steam.tool import SteamWebAPIQueryRun
+from langchain_community.utilities.steam import SteamWebAPIWrapper
+
+
+class SteamToolkit(BaseToolkit):
+ """Steam Toolkit.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_steam_api_wrapper(
+ cls, steam_api_wrapper: SteamWebAPIWrapper
+ ) -> "SteamToolkit":
+ """Create a Steam Toolkit from a Steam API Wrapper.
+
+ Args:
+ steam_api_wrapper: SteamWebAPIWrapper. The Steam API Wrapper.
+
+ Returns:
+ SteamToolkit. The Steam Toolkit.
+ """
+ operations: List[dict] = [
+ {
+ "mode": "get_games_details",
+ "name": "Get Games Details",
+ "description": STEAM_GET_GAMES_DETAILS,
+ },
+ {
+ "mode": "get_recommended_games",
+ "name": "Get Recommended Games",
+ "description": STEAM_GET_RECOMMENDED_GAMES,
+ },
+ ]
+ tools = [
+ SteamWebAPIQueryRun(
+ name=action["name"],
+ description=action["description"],
+ mode=action["mode"],
+ api_wrapper=steam_api_wrapper,
+ )
+ for action in operations
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/xorbits/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/xorbits/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..fd8fc13ba0da8082657c3e2ba2bd7a33b75c94d4
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/xorbits/__init__.py
@@ -0,0 +1,26 @@
+from pathlib import Path
+from typing import Any
+
+from langchain_core._api.path import as_import_path
+
+
+def __getattr__(name: str) -> Any:
+ """Get attr name."""
+
+ if name == "create_xorbits_agent":
+ # Get directory of langchain package
+ HERE = Path(__file__).parents[3]
+ here = as_import_path(Path(__file__).parent, relative_to=HERE)
+
+ old_path = "langchain." + here + "." + name
+ new_path = "langchain_experimental." + here + "." + name
+ raise ImportError(
+ "This agent has been moved to langchain experiment. "
+ "This agent relies on python REPL tool under the hood, so to use it "
+ "safely please sandbox the python REPL. "
+ "Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md "
+ "and https://github.com/langchain-ai/langchain/discussions/11680"
+ "To keep using this code as is, install langchain experimental and "
+ f"update your import statement from:\n `{old_path}` to `{new_path}`."
+ )
+ raise AttributeError(f"{name} does not exist")
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/xorbits/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/xorbits/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..431fafaddd124d61736ee41a2c6b2225a30655bd
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/xorbits/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..faef4a3253167aa6767779fbd32292cedcfc4a4e
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__init__.py
@@ -0,0 +1 @@
+"""Zapier Toolkit."""
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ed545a1e86e0dd8b4cd033dfbe299cfbacf7c56f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__pycache__/toolkit.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__pycache__/toolkit.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2caf31be7d21bcfd0b2b8cac51fe7d90f7263df2
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/__pycache__/toolkit.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/toolkit.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/toolkit.py
new file mode 100644
index 0000000000000000000000000000000000000000..7569c9a2686605745e5fed2f4d556b57a5b3f0c0
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agent_toolkits/zapier/toolkit.py
@@ -0,0 +1,79 @@
+"""[DEPRECATED] Zapier Toolkit."""
+
+from typing import List
+
+from langchain_core._api import warn_deprecated
+from langchain_core.tools import BaseTool
+from langchain_core.tools.base import BaseToolkit
+
+from langchain_community.tools.zapier.tool import ZapierNLARunAction
+from langchain_community.utilities.zapier import ZapierNLAWrapper
+
+
+class ZapierToolkit(BaseToolkit):
+ """Zapier Toolkit.
+
+ Parameters:
+ tools: List[BaseTool]. The tools in the toolkit. Default is an empty list.
+ """
+
+ tools: List[BaseTool] = []
+
+ @classmethod
+ def from_zapier_nla_wrapper(
+ cls, zapier_nla_wrapper: ZapierNLAWrapper
+ ) -> "ZapierToolkit":
+ """Create a toolkit from a ZapierNLAWrapper.
+
+ Args:
+ zapier_nla_wrapper: ZapierNLAWrapper. The Zapier NLA wrapper.
+
+ Returns:
+ ZapierToolkit. The Zapier toolkit.
+ """
+ actions = zapier_nla_wrapper.list()
+ tools = [
+ ZapierNLARunAction(
+ action_id=action["id"],
+ zapier_description=action["description"],
+ params_schema=action["params"],
+ api_wrapper=zapier_nla_wrapper,
+ )
+ for action in actions
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ @classmethod
+ async def async_from_zapier_nla_wrapper(
+ cls, zapier_nla_wrapper: ZapierNLAWrapper
+ ) -> "ZapierToolkit":
+ """Async create a toolkit from a ZapierNLAWrapper.
+
+ Args:
+ zapier_nla_wrapper: ZapierNLAWrapper. The Zapier NLA wrapper.
+
+ Returns:
+ ZapierToolkit. The Zapier toolkit.
+ """
+ actions = await zapier_nla_wrapper.alist()
+ tools = [
+ ZapierNLARunAction(
+ action_id=action["id"],
+ zapier_description=action["description"],
+ params_schema=action["params"],
+ api_wrapper=zapier_nla_wrapper,
+ )
+ for action in actions
+ ]
+ return cls(tools=tools) # type: ignore[arg-type]
+
+ def get_tools(self) -> List[BaseTool]:
+ """Get the tools in the toolkit."""
+ warn_deprecated(
+ since="0.0.319",
+ message=(
+ "This tool will be deprecated on 2023-11-17. See "
+ " for details"
+ ),
+ )
+ return self.tools
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0f060fa92b9a79480963d80aa19109080ee0872b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..f7fdcbdd864904042cbe26a0c39435ed2b06214b
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__init__.py
@@ -0,0 +1,3 @@
+from langchain_community.agents.openai_assistant.base import OpenAIAssistantV2Runnable
+
+__all__ = ["OpenAIAssistantV2Runnable"]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3446df088613285e09766d7f6f08890b41cf4dd3
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c32588a1882d0de00110521c65c42fce906385b8
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/base.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/base.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c86415491c42aa298867a6d17fe7a1653d4fe98
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/agents/openai_assistant/base.py
@@ -0,0 +1,631 @@
+from __future__ import annotations
+
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Callable,
+ Dict,
+ Optional,
+ Sequence,
+ Type,
+ Union,
+)
+
+from langchain_classic.agents.openai_assistant.base import (
+ OpenAIAssistantRunnable,
+ OutputType,
+)
+from langchain_core._api import beta
+from langchain_core.callbacks import CallbackManager
+from langchain_core.load import dumpd
+from langchain_core.runnables import RunnableConfig, ensure_config
+from langchain_core.tools import BaseTool
+from langchain_core.utils.function_calling import convert_to_openai_tool
+from pydantic import BaseModel, Field, model_validator
+from typing_extensions import Self
+
+if TYPE_CHECKING:
+ import openai
+ from openai._types import NotGiven
+ from openai.types.beta.assistant import ToolResources as AssistantToolResources
+
+
+def _get_openai_client() -> openai.OpenAI:
+ """Get the OpenAI client.
+
+ Returns:
+ openai.OpenAI: OpenAI client
+
+ Raises:
+ ImportError: If `openai` is not installed.
+ AttributeError: If the installed `openai` version is not compatible.
+ """
+ try:
+ import openai
+
+ return openai.OpenAI(default_headers={"OpenAI-Beta": "assistants=v2"})
+ except ImportError as e:
+ raise ImportError(
+ "Unable to import openai, please install with `pip install openai`."
+ ) from e
+ except AttributeError as e:
+ raise AttributeError(
+ "Please make sure you are using a v1.23-compatible version of openai. You "
+ 'can install with `pip install "openai>=1.23"`.'
+ ) from e
+
+
+def _get_openai_async_client() -> openai.AsyncOpenAI:
+ """Get the async OpenAI client.
+
+ Returns:
+ openai.AsyncOpenAI: Async OpenAI client
+
+ Raises:
+ ImportError: If `openai` is not installed.
+ AttributeError: If the installed `openai` version is not compatible.
+ """
+ try:
+ import openai
+
+ return openai.AsyncOpenAI(default_headers={"OpenAI-Beta": "assistants=v2"})
+ except ImportError as e:
+ raise ImportError(
+ "Unable to import openai, please install with `pip install openai`."
+ ) from e
+ except AttributeError as e:
+ raise AttributeError(
+ "Please make sure you are using a v1.23-compatible version of openai. You "
+ 'can install with `pip install "openai>=1.23"`.'
+ ) from e
+
+
+def _convert_file_ids_into_attachments(file_ids: list) -> list:
+ """Convert file_ids into attachments
+ File search and Code interpreter will be turned on by default.
+
+ Args:
+ file_ids (list): List of file_ids that need to be converted into attachments.
+
+ Returns:
+ list: List of attachments converted from file_ids.
+ """
+ attachments = []
+ for id in file_ids:
+ attachments.append(
+ {
+ "file_id": id,
+ "tools": [{"type": "file_search"}, {"type": "code_interpreter"}],
+ }
+ )
+ return attachments
+
+
+def _is_assistants_builtin_tool(
+ tool: Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool],
+) -> bool:
+ """Determine if tool corresponds to OpenAI Assistants built-in.
+
+ Args:
+ tool (Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]):
+ Tool that needs to be determined.
+
+ Returns:
+ A boolean response of true or false indicating if the tool corresponds to
+ OpenAI Assistants built-in.
+ """
+ assistants_builtin_tools = ("code_interpreter", "retrieval", "file_search")
+ return (
+ isinstance(tool, dict)
+ and ("type" in tool)
+ and (tool["type"] in assistants_builtin_tools)
+ )
+
+
+def _get_assistants_tool(
+ tool: Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool],
+) -> Dict[str, Any]:
+ """Convert a raw function/class to an OpenAI tool.
+
+ Note that OpenAI assistants supports several built-in tools,
+ such as "code_interpreter" and "retrieval."
+
+ Args:
+ tool (Union[Dict[str, Any], Type[BaseModel], Callable, BaseTool]):
+ Tools or functions that need to be converted to OpenAI tools.
+
+ Returns:
+ Dict[str, Any]: A dictionary of tools that are converted into OpenAI tools.
+ """
+ if _is_assistants_builtin_tool(tool):
+ return tool # type: ignore[return-value]
+ else:
+ return convert_to_openai_tool(tool)
+
+
+@beta()
+class OpenAIAssistantV2Runnable(OpenAIAssistantRunnable):
+ """Run an OpenAI Assistant.
+
+ Attributes:
+ client (Any): OpenAI or AzureOpenAI client.
+ async_client (Any): Async OpenAI or AzureOpenAI client.
+ assistant_id (str): OpenAI assistant ID.
+ check_every_ms (float): Frequency to check progress in milliseconds.
+ as_agent (bool): Whether to use the assistant as a LangChain agent.
+
+ Example using OpenAI tools:
+ .. code-block:: python
+
+ from langchain_classic.agents.openai_assistant import OpenAIAssistantV2Runnable
+
+ assistant = OpenAIAssistantV2Runnable.create_assistant(
+ name="math assistant",
+ instructions="You are a personal math tutor. Write and run code to answer math questions.",
+ tools=[{"type": "code_interpreter"}],
+ model="gpt-4-1106-preview"
+ )
+ output = assistant.invoke({"content": "What's 10 - 4 raised to the 2.7"})
+
+ Example using custom tools and AgentExecutor:
+ .. code-block:: python
+
+ from langchain_classic.agents.openai_assistant import OpenAIAssistantV2Runnable
+ from langchain_classic.agents import AgentExecutor
+ from langchain_classic.tools import E2BDataAnalysisTool
+
+
+ tools = [E2BDataAnalysisTool(api_key="...")]
+ agent = OpenAIAssistantV2Runnable.create_assistant(
+ name="langchain assistant e2b tool",
+ instructions="You are a personal math tutor. Write and run code to answer math questions.",
+ tools=tools,
+ model="gpt-4-1106-preview",
+ as_agent=True
+ )
+
+ agent_executor = AgentExecutor(agent=agent, tools=tools)
+ agent_executor.invoke({"content": "Analyze the data..."})
+
+ Example using custom tools and custom execution:
+ .. code-block:: python
+
+ from langchain_classic.agents.openai_assistant import OpenAIAssistantV2Runnable
+ from langchain_classic.agents import AgentExecutor
+ from langchain_core.agents import AgentFinish
+ from langchain_classic.tools import E2BDataAnalysisTool
+
+
+ tools = [E2BDataAnalysisTool(api_key="...")]
+ agent = OpenAIAssistantV2Runnable.create_assistant(
+ name="langchain assistant e2b tool",
+ instructions="You are a personal math tutor. Write and run code to answer math questions.",
+ tools=tools,
+ model="gpt-4-1106-preview",
+ as_agent=True
+ )
+
+ def execute_agent(agent, tools, input):
+ tool_map = {tool.name: tool for tool in tools}
+ response = agent.invoke(input)
+ while not isinstance(response, AgentFinish):
+ tool_outputs = []
+ for action in response:
+ tool_output = tool_map[action.tool].invoke(action.tool_input)
+ tool_outputs.append({"output": tool_output, "tool_call_id": action.tool_call_id})
+ response = agent.invoke(
+ {
+ "tool_outputs": tool_outputs,
+ "run_id": action.run_id,
+ "thread_id": action.thread_id
+ }
+ )
+
+ return response
+
+ response = execute_agent(agent, tools, {"content": "What's 10 - 4 raised to the 2.7"})
+ next_response = execute_agent(agent, tools, {"content": "now add 17.241", "thread_id": response.thread_id})
+
+ """ # noqa: E501
+
+ client: Any = Field(default_factory=_get_openai_client)
+ """OpenAI or AzureOpenAI client."""
+ async_client: Any = None
+ """OpenAI or AzureOpenAI async client."""
+ assistant_id: str
+ """OpenAI assistant id."""
+ check_every_ms: float = 1_000.0
+ """Frequency with which to check run progress in milliseconds."""
+ as_agent: bool = False
+ """Use as a LangChain agent, compatible with the AgentExecutor."""
+
+ @model_validator(mode="after")
+ def validate_async_client(self) -> Self:
+ """Validate that the async client is set, otherwise initialize it."""
+ if self.async_client is None:
+ import openai
+
+ api_key = self.client.api_key
+ self.async_client = openai.AsyncOpenAI(api_key=api_key)
+ return self
+
+ @classmethod
+ def create_assistant(
+ cls,
+ name: str,
+ instructions: str,
+ tools: Sequence[Union[BaseTool, dict]],
+ model: str,
+ *,
+ model_kwargs: dict[str, float] = {},
+ client: Optional[Union[openai.OpenAI, openai.AzureOpenAI]] = None,
+ tool_resources: Optional[Union[AssistantToolResources, dict, NotGiven]] = None,
+ extra_body: Optional[object] = None,
+ **kwargs: Any,
+ ) -> OpenAIAssistantRunnable:
+ """Create an OpenAI Assistant and instantiate the Runnable.
+
+ Args:
+ name (str): Assistant name.
+ instructions (str): Assistant instructions.
+ tools (Sequence[Union[BaseTool, dict]]): Assistant tools. Can be passed
+ in OpenAI format or as BaseTools.
+ tool_resources (Optional[Union[AssistantToolResources, dict, NotGiven]]):
+ Assistant tool resources. Can be passed in OpenAI format.
+ model (str): Assistant model to use.
+ client (Optional[Union[openai.OpenAI, openai.AzureOpenAI]]): OpenAI or
+ AzureOpenAI client. Will create default OpenAI client (Assistant v2)
+ if not specified.
+ model_kwargs: Additional model arguments. Only available for temperature
+ and top_p parameters.
+ extra_body: Additional body parameters to be passed to the assistant.
+
+ Returns:
+ OpenAIAssistantRunnable: The configured assistant runnable.
+ """
+ client = client or _get_openai_client()
+ if tool_resources is None:
+ from openai._types import NOT_GIVEN
+
+ tool_resources = NOT_GIVEN
+ assistant = client.beta.assistants.create(
+ name=name,
+ instructions=instructions,
+ tools=[_get_assistants_tool(tool) for tool in tools],
+ tool_resources=tool_resources,
+ model=model,
+ extra_body=extra_body,
+ **model_kwargs,
+ )
+ return cls(assistant_id=assistant.id, client=client, **kwargs)
+
+ def invoke(
+ self, input: dict, config: Optional[RunnableConfig] = None, **kwargs: Any
+ ) -> OutputType:
+ """Invoke the assistant.
+
+ Args:
+ input (dict): Runnable input dict that can have:
+ content: User message when starting a new run.
+ thread_id: Existing thread to use.
+ run_id: Existing run to use. Should only be supplied when providing
+ the tool output for a required action after an initial invocation.
+ file_ids: (deprecated) File ids to include in new run. Use
+ 'attachments' instead
+ attachments: Assistant files to include in new run. (v2 API).
+ message_metadata: Metadata to associate with new message.
+ thread_metadata: Metadata to associate with new thread. Only relevant
+ when new thread being created.
+ instructions: Additional run instructions.
+ model: Override Assistant model for this run.
+ tools: Override Assistant tools for this run.
+ tool_resources: Override Assistant tool resources for this run (v2 API).
+ run_metadata: Metadata to associate with new run.
+ config (Optional[RunnableConfig]): Configuration for the run.
+
+ Returns:
+ OutputType: If self.as_agent, will return
+ Union[List[OpenAIAssistantAction], OpenAIAssistantFinish]. Otherwise,
+ will return OpenAI types
+ Union[List[ThreadMessage], List[RequiredActionFunctionToolCall]].
+
+ Raises:
+ BaseException: If an error occurs during the invocation.
+ """
+ config = ensure_config(config)
+ callback_manager = CallbackManager.configure(
+ inheritable_callbacks=config.get("callbacks"),
+ inheritable_tags=config.get("tags"),
+ inheritable_metadata=config.get("metadata"),
+ )
+ run_manager = callback_manager.on_chain_start(
+ dumpd(self), input, name=config.get("run_name") or self.get_name()
+ )
+
+ files = _convert_file_ids_into_attachments(kwargs.get("file_ids", []))
+ attachments = kwargs.get("attachments", []) + files
+
+ try:
+ # Being run within AgentExecutor and there are tool outputs to submit.
+ if self.as_agent and input.get("intermediate_steps"):
+ tool_outputs = self._parse_intermediate_steps(
+ input["intermediate_steps"]
+ )
+ run = self.client.beta.threads.runs.submit_tool_outputs(**tool_outputs)
+ # Starting a new thread and a new run.
+ elif "thread_id" not in input:
+ thread = {
+ "messages": [
+ {
+ "role": "user",
+ "content": input["content"],
+ "attachments": attachments,
+ "metadata": input.get("message_metadata"),
+ }
+ ],
+ "metadata": input.get("thread_metadata"),
+ }
+ run = self._create_thread_and_run(input, thread)
+ # Starting a new run in an existing thread.
+ elif "run_id" not in input:
+ _ = self.client.beta.threads.messages.create(
+ input["thread_id"],
+ content=input["content"],
+ role="user",
+ attachments=attachments,
+ metadata=input.get("message_metadata"),
+ )
+ run = self._create_run(input)
+ # Submitting tool outputs to an existing run, outside the AgentExecutor
+ # framework.
+ else:
+ run = self.client.beta.threads.runs.submit_tool_outputs(**input)
+ run = self._wait_for_run(run.id, run.thread_id)
+ except BaseException as e:
+ run_manager.on_chain_error(e)
+ raise e
+ try:
+ response = self._get_response(run)
+ except BaseException as e:
+ run_manager.on_chain_error(e, metadata=run.dict())
+ raise e
+ else:
+ run_manager.on_chain_end(response)
+ return response
+
+ @classmethod
+ async def acreate_assistant(
+ cls,
+ name: str,
+ instructions: str,
+ tools: Sequence[Union[BaseTool, dict]],
+ model: str,
+ *,
+ async_client: Optional[
+ Union[openai.AsyncOpenAI, openai.AsyncAzureOpenAI]
+ ] = None,
+ tool_resources: Optional[Union[AssistantToolResources, dict, NotGiven]] = None,
+ **kwargs: Any,
+ ) -> OpenAIAssistantRunnable:
+ """Create an AsyncOpenAI Assistant and instantiate the Runnable.
+
+ Args:
+ name (str): Assistant name.
+ instructions (str): Assistant instructions.
+ tools (Sequence[Union[BaseTool, dict]]): Assistant tools. Can be passed
+ in OpenAI format or as BaseTools.
+ tool_resources (Optional[Union[AssistantToolResources, dict, NotGiven]]):
+ Assistant tool resources. Can be passed in OpenAI format.
+ model (str): Assistant model to use.
+ async_client (Optional[Union[openai.OpenAI, openai.AzureOpenAI]]): OpenAI or
+ AzureOpenAI async client. Will create default async_client if not specified.
+
+ Returns:
+ AsyncOpenAIAssistantRunnable: The configured assistant runnable.
+ """
+ async_client = async_client or _get_openai_async_client()
+ if tool_resources is None:
+ from openai._types import NOT_GIVEN
+
+ tool_resources = NOT_GIVEN
+ openai_tools = [_get_assistants_tool(tool) for tool in tools]
+
+ assistant = await async_client.beta.assistants.create(
+ name=name,
+ instructions=instructions,
+ tools=openai_tools,
+ tool_resources=tool_resources,
+ model=model,
+ )
+ return cls(assistant_id=assistant.id, async_client=async_client, **kwargs)
+
+ async def ainvoke(
+ self, input: dict, config: Optional[RunnableConfig] = None, **kwargs: Any
+ ) -> OutputType:
+ """Async invoke assistant.
+
+ Args:
+ input (dict): Runnable input dict that can have:
+ content: User message when starting a new run.
+ thread_id: Existing thread to use.
+ run_id: Existing run to use. Should only be supplied when providing
+ the tool output for a required action after an initial invocation.
+ file_ids: (deprecated) File ids to include in new run. Use
+ 'attachments' instead
+ attachments: Assistant files to include in new run. (v2 API).
+ message_metadata: Metadata to associate with new message.
+ thread_metadata: Metadata to associate with new thread. Only relevant
+ when new thread being created.
+ instructions: Additional run instructions.
+ model: Override Assistant model for this run.
+ tools: Override Assistant tools for this run.
+ tool_resources: Override Assistant tool resources for this run (v2 API).
+ run_metadata: Metadata to associate with new run.
+ config (Optional[RunnableConfig]): Configuration for the run.
+
+ Returns:
+ OutputType: If self.as_agent, will return
+ Union[List[OpenAIAssistantAction], OpenAIAssistantFinish]. Otherwise,
+ will return OpenAI types
+ Union[List[ThreadMessage], List[RequiredActionFunctionToolCall]].
+
+ Raises:
+ BaseException: If an error occurs during the invocation.
+ """
+ config = config or {}
+ callback_manager = CallbackManager.configure(
+ inheritable_callbacks=config.get("callbacks"),
+ inheritable_tags=config.get("tags"),
+ inheritable_metadata=config.get("metadata"),
+ )
+ run_manager = callback_manager.on_chain_start(
+ dumpd(self), input, name=config.get("run_name") or self.get_name()
+ )
+
+ files = _convert_file_ids_into_attachments(kwargs.get("file_ids", []))
+ attachments = kwargs.get("attachments", []) + files
+
+ try:
+ # Being run within AgentExecutor and there are tool outputs to submit.
+ if self.as_agent and input.get("intermediate_steps"):
+ tool_outputs = self._parse_intermediate_steps(
+ input["intermediate_steps"]
+ )
+ run = await self.async_client.beta.threads.runs.submit_tool_outputs(
+ **tool_outputs
+ )
+ # Starting a new thread and a new run.
+ elif "thread_id" not in input:
+ thread = {
+ "messages": [
+ {
+ "role": "user",
+ "content": input["content"],
+ "attachments": attachments,
+ "metadata": input.get("message_metadata"),
+ }
+ ],
+ "metadata": input.get("thread_metadata"),
+ }
+ run = await self._acreate_thread_and_run(input, thread)
+ # Starting a new run in an existing thread.
+ elif "run_id" not in input:
+ _ = await self.async_client.beta.threads.messages.create(
+ input["thread_id"],
+ content=input["content"],
+ role="user",
+ attachments=attachments,
+ metadata=input.get("message_metadata"),
+ )
+ run = await self._acreate_run(input)
+ # Submitting tool outputs to an existing run, outside the AgentExecutor
+ # framework.
+ else:
+ run = await self.async_client.beta.threads.runs.submit_tool_outputs(
+ **input
+ )
+ run = await self._await_for_run(run.id, run.thread_id)
+ except BaseException as e:
+ run_manager.on_chain_error(e)
+ raise e
+ try:
+ response = self._get_response(run)
+ except BaseException as e:
+ run_manager.on_chain_error(e, metadata=run.dict())
+ raise e
+ else:
+ run_manager.on_chain_end(response)
+ return response
+
+ def _create_run(self, input: dict) -> Any:
+ """Create a new run within an existing thread.
+
+ Args:
+ input (dict): The input data for the new run.
+
+ Returns:
+ Any: The created run object.
+ """
+ allowed_assistant_params = (
+ "instructions",
+ "model",
+ "tools",
+ "tool_resources",
+ "run_metadata",
+ "truncation_strategy",
+ "max_prompt_tokens",
+ )
+ params = {k: v for k, v in input.items() if k in allowed_assistant_params}
+ return self.client.beta.threads.runs.create(
+ input["thread_id"],
+ assistant_id=self.assistant_id,
+ **params,
+ )
+
+ def _create_thread_and_run(self, input: dict, thread: dict) -> Any:
+ """Create a new thread and run.
+
+ Args:
+ input (dict): The input data for the run.
+ thread (dict): The thread data to create.
+
+ Returns:
+ Any: The created thread and run.
+ """
+ params = {
+ k: v
+ for k, v in input.items()
+ if k in ("instructions", "model", "tools", "run_metadata")
+ }
+ if tool_resources := input.get("tool_resources"):
+ thread["tool_resources"] = tool_resources
+ run = self.client.beta.threads.create_and_run(
+ assistant_id=self.assistant_id,
+ thread=thread,
+ **params,
+ )
+ return run
+
+ async def _acreate_run(self, input: dict) -> Any:
+ """Asynchronously create a new run within an existing thread.
+
+ Args:
+ input (dict): The input data for the new run.
+
+ Returns:
+ Any: The created run object.
+ """
+ params = {
+ k: v
+ for k, v in input.items()
+ if k in ("instructions", "model", "tools", "tool_resources", "run_metadata")
+ }
+ return await self.async_client.beta.threads.runs.create(
+ input["thread_id"],
+ assistant_id=self.assistant_id,
+ **params,
+ )
+
+ async def _acreate_thread_and_run(self, input: dict, thread: dict) -> Any:
+ """Asynchronously create a new thread and run simultaneously.
+
+ Args:
+ input (dict): The input data for the run.
+ thread (dict): The thread data to create.
+
+ Returns:
+ Any: The created thread and run.
+ """
+ params = {
+ k: v
+ for k, v in input.items()
+ if k in ("instructions", "model", "tools", "run_metadata")
+ }
+ if tool_resources := input.get("tool_resources"):
+ thread["tool_resources"] = tool_resources
+ run = await self.async_client.beta.threads.create_and_run(
+ assistant_id=self.assistant_id,
+ thread=thread,
+ **params,
+ )
+ return run
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a758050cb00b36923783ccc0e94afcfee9e8b410
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/aim_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/aim_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..dc2393b3ce0f6070153971fc29f6c0f6591d2ed6
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/aim_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/argilla_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/argilla_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8f616fb0a5f600e5bc5459e3591bc339dffa0311
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/argilla_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/arize_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/arize_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1033c5421d4ca66413cc3907f10ff25ea77e86eb
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/arize_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/arthur_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/arthur_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..314d0e19447dadc96d9eb0138f0e19c29d4af994
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/arthur_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/bedrock_anthropic_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/bedrock_anthropic_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b706be13f3d056c8892a24a41c44cb28501b6422
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/bedrock_anthropic_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/clearml_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/clearml_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4289edccf8145b4804400cd02365de82ead2837f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/clearml_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/comet_ml_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/comet_ml_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..603a62d23eb9e0297351f6f7b01dd932f451fd5f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/comet_ml_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/confident_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/confident_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d1ec3640c3fc61937b996004e1ea1ba8f9d9b9cd
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/confident_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/context_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/context_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..663903959959e58a4a612cbccaa3cac350f645c4
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/context_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/fiddler_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/fiddler_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a2ed757d5602651988e05b8c7f3f1e701257118d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/fiddler_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/flyte_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/flyte_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..50405cb2b9710cd2c6a089dfdf104759e5ceab6c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/flyte_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/human.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/human.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..40ce60ed80ec355de3698e5a0425acc4bb9d1d8d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/human.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/infino_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/infino_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6f715dd3b861bad0c6a937c94b74c0b8d44877e7
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/infino_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/labelstudio_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/labelstudio_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f66f3b35a28c01b86b284c8f71b3bc683780eb34
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/labelstudio_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/llmonitor_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/llmonitor_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0dc4068e0419e8732d85d709dba99a27b4315b77
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/llmonitor_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/manager.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/manager.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d77de465d39373aa3d07f473f1ef31467a1c672a
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/manager.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/mlflow_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/mlflow_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b63ad4dc8656b5ae007efe2290626c2c205a249d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/mlflow_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/openai_info.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/openai_info.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..31810bb6bd7cee9d28e0d6e00891e47a931d1128
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/openai_info.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/promptlayer_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/promptlayer_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6bcbc0ca5bdcfdc161114dd5be1b3318fdd677d4
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/promptlayer_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/sagemaker_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/sagemaker_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5a8756b2cff0e11ba9c4dec539a17fae89294f6d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/sagemaker_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/trubrics_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/trubrics_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8a428966ca8cf8957f9725c7182cc4d574f7092b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/trubrics_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/upstash_ratelimit_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/upstash_ratelimit_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..07e50103a03a9f61623c413c59b76d8885092162
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/upstash_ratelimit_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/uptrain_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/uptrain_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8086db02e03d8db97a4c29aa6f390e501b52aaac
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/uptrain_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/utils.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/utils.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1deb496bdafd4036c91778712f650e213fbe50e2
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/utils.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/wandb_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/wandb_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e08bc9852d7f40de6ebed4dcfe98db67efd4a396
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/wandb_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/whylabs_callback.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/whylabs_callback.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..44892d4c24d5020e3a115fe742d2e88feaba8508
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/__pycache__/whylabs_callback.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..4ee2ea5a9fb2deed660fc6409d97e66fc88b0bf2
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__init__.py
@@ -0,0 +1,82 @@
+from __future__ import annotations
+
+from typing import TYPE_CHECKING, Optional
+
+from langchain_core.callbacks import BaseCallbackHandler
+
+from langchain_community.callbacks.streamlit.streamlit_callback_handler import (
+ LLMThoughtLabeler as LLMThoughtLabeler,
+)
+from langchain_community.callbacks.streamlit.streamlit_callback_handler import (
+ StreamlitCallbackHandler as _InternalStreamlitCallbackHandler,
+)
+
+if TYPE_CHECKING:
+ from streamlit.delta_generator import DeltaGenerator
+
+
+def StreamlitCallbackHandler(
+ parent_container: DeltaGenerator,
+ *,
+ max_thought_containers: int = 4,
+ expand_new_thoughts: bool = True,
+ collapse_completed_thoughts: bool = True,
+ thought_labeler: Optional[LLMThoughtLabeler] = None,
+) -> BaseCallbackHandler:
+ """Callback Handler that writes to a Streamlit app.
+
+ This CallbackHandler is geared towards
+ use with a LangChain Agent; it displays the Agent's LLM and tool-usage "thoughts"
+ inside a series of Streamlit expanders.
+
+ Parameters
+ ----------
+ parent_container
+ The `st.container` that will contain all the Streamlit elements that the
+ Handler creates.
+ max_thought_containers
+ The max number of completed LLM thought containers to show at once. When this
+ threshold is reached, a new thought will cause the oldest thoughts to be
+ collapsed into a "History" expander. Defaults to 4.
+ expand_new_thoughts
+ Each LLM "thought" gets its own `st.expander`. This param controls whether that
+ expander is expanded by default. Defaults to True.
+ collapse_completed_thoughts
+ If True, LLM thought expanders will be collapsed when completed.
+ Defaults to True.
+ thought_labeler
+ An optional custom LLMThoughtLabeler instance. If unspecified, the handler
+ will use the default thought labeling logic. Defaults to None.
+
+ Returns
+ -------
+ A new StreamlitCallbackHandler instance.
+
+ Note that this is an "auto-updating" API: if the installed version of Streamlit
+ has a more recent StreamlitCallbackHandler implementation, an instance of that class
+ will be used.
+
+ """
+ # If we're using a version of Streamlit that implements StreamlitCallbackHandler,
+ # delegate to it instead of using our built-in handler. The official handler is
+ # guaranteed to support the same set of kwargs.
+ try:
+ from streamlit.external.langchain import (
+ StreamlitCallbackHandler as OfficialStreamlitCallbackHandler,
+ )
+
+ return OfficialStreamlitCallbackHandler(
+ parent_container,
+ max_thought_containers=max_thought_containers,
+ expand_new_thoughts=expand_new_thoughts,
+ collapse_completed_thoughts=collapse_completed_thoughts,
+ thought_labeler=thought_labeler,
+ )
+ except ImportError:
+ return _InternalStreamlitCallbackHandler(
+ parent_container,
+ max_thought_containers=max_thought_containers,
+ expand_new_thoughts=expand_new_thoughts,
+ collapse_completed_thoughts=collapse_completed_thoughts,
+ thought_labeler=thought_labeler,
+ )
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c3d9986d9032f58e96b6375d57215c60fe9e10ac
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/mutable_expander.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/mutable_expander.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e6da678a99a4484af4f1a4c59ab4bb7a2e23eb92
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/mutable_expander.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/streamlit_callback_handler.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/streamlit_callback_handler.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..09a8d6b10e722f44b0659d2742f7f506c1090f7f
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/__pycache__/streamlit_callback_handler.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/mutable_expander.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/mutable_expander.py
new file mode 100644
index 0000000000000000000000000000000000000000..9870e472242e8868f7a9f3b70bf6146323470464
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/mutable_expander.py
@@ -0,0 +1,156 @@
+from __future__ import annotations
+
+from enum import Enum
+from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional
+
+if TYPE_CHECKING:
+ from streamlit.delta_generator import DeltaGenerator
+ from streamlit.type_util import SupportsStr
+
+
+class ChildType(Enum):
+ """Enumerator of the child type."""
+
+ MARKDOWN = "MARKDOWN"
+ EXCEPTION = "EXCEPTION"
+
+
+class ChildRecord(NamedTuple):
+ """Child record as a NamedTuple."""
+
+ type: ChildType
+ kwargs: Dict[str, Any]
+ dg: DeltaGenerator
+
+
+class MutableExpander:
+ """Streamlit expander that can be renamed and dynamically expanded/collapsed."""
+
+ def __init__(self, parent_container: DeltaGenerator, label: str, expanded: bool):
+ """Create a new MutableExpander.
+
+ Parameters
+ ----------
+ parent_container
+ The `st.container` that the expander will be created inside.
+
+ The expander transparently deletes and recreates its underlying
+ `st.expander` instance when its label changes, and it uses
+ `parent_container` to ensure it recreates this underlying expander in the
+ same location onscreen.
+ label
+ The expander's initial label.
+ expanded
+ The expander's initial `expanded` value.
+ """
+ self._label = label
+ self._expanded = expanded
+ self._parent_cursor = parent_container.empty()
+ self._container = self._parent_cursor.expander(label, expanded)
+ self._child_records: List[ChildRecord] = []
+
+ @property
+ def label(self) -> str:
+ """Expander's label string."""
+ return self._label
+
+ @property
+ def expanded(self) -> bool:
+ """True if the expander was created with `expanded=True`."""
+ return self._expanded
+
+ def clear(self) -> None:
+ """Remove the container and its contents entirely. A cleared container can't
+ be reused.
+ """
+ self._container = self._parent_cursor.empty()
+ self._child_records.clear()
+
+ def append_copy(self, other: MutableExpander) -> None:
+ """Append a copy of another MutableExpander's children to this
+ MutableExpander.
+ """
+ other_records = other._child_records.copy()
+ for record in other_records:
+ self._create_child(record.type, record.kwargs)
+
+ def update(
+ self, *, new_label: Optional[str] = None, new_expanded: Optional[bool] = None
+ ) -> None:
+ """Change the expander's label and expanded state"""
+ if new_label is None:
+ new_label = self._label
+ if new_expanded is None:
+ new_expanded = self._expanded
+
+ if self._label == new_label and self._expanded == new_expanded:
+ # No change!
+ return
+
+ self._label = new_label
+ self._expanded = new_expanded
+ self._container = self._parent_cursor.expander(new_label, new_expanded)
+
+ prev_records = self._child_records
+ self._child_records = []
+
+ # Replay all children into the new container
+ for record in prev_records:
+ self._create_child(record.type, record.kwargs)
+
+ def markdown(
+ self,
+ body: SupportsStr,
+ unsafe_allow_html: bool = False,
+ *,
+ help: Optional[str] = None,
+ index: Optional[int] = None,
+ ) -> int:
+ """Add a Markdown element to the container and return its index."""
+ kwargs = {"body": body, "unsafe_allow_html": unsafe_allow_html, "help": help}
+ new_dg = self._get_dg(index).markdown(**kwargs)
+ record = ChildRecord(ChildType.MARKDOWN, kwargs, new_dg)
+ return self._add_record(record, index)
+
+ def exception(
+ self, exception: BaseException, *, index: Optional[int] = None
+ ) -> int:
+ """Add an Exception element to the container and return its index."""
+ kwargs = {"exception": exception}
+ new_dg = self._get_dg(index).exception(**kwargs)
+ record = ChildRecord(ChildType.EXCEPTION, kwargs, new_dg)
+ return self._add_record(record, index)
+
+ def _create_child(self, type: ChildType, kwargs: Dict[str, Any]) -> None:
+ """Create a new child with the given params"""
+ if type == ChildType.MARKDOWN:
+ self.markdown(**kwargs)
+ elif type == ChildType.EXCEPTION:
+ self.exception(**kwargs)
+ else:
+ raise RuntimeError(f"Unexpected child type {type}")
+
+ def _add_record(self, record: ChildRecord, index: Optional[int]) -> int:
+ """Add a ChildRecord to self._children. If `index` is specified, replace
+ the existing record at that index. Otherwise, append the record to the
+ end of the list.
+
+ Return the index of the added record.
+ """
+ if index is not None:
+ # Replace existing child
+ self._child_records[index] = record
+ return index
+
+ # Append new child
+ self._child_records.append(record)
+ return len(self._child_records) - 1
+
+ def _get_dg(self, index: Optional[int]) -> DeltaGenerator:
+ if index is not None:
+ # Existing index: reuse child's DeltaGenerator
+ assert 0 <= index < len(self._child_records), f"Bad index: {index}"
+ return self._child_records[index].dg
+
+ # No index: use container's DeltaGenerator
+ return self._container
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/streamlit_callback_handler.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/streamlit_callback_handler.py
new file mode 100644
index 0000000000000000000000000000000000000000..4747bfc2f690d674d3f4a709ca438c512527bcb7
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/streamlit/streamlit_callback_handler.py
@@ -0,0 +1,419 @@
+"""Callback Handler that prints to streamlit."""
+
+from __future__ import annotations
+
+from enum import Enum
+from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional
+
+from langchain_core.agents import AgentAction, AgentFinish
+from langchain_core.callbacks import BaseCallbackHandler
+from langchain_core.outputs import LLMResult
+
+from langchain_community.callbacks.streamlit.mutable_expander import MutableExpander
+
+if TYPE_CHECKING:
+ from streamlit.delta_generator import DeltaGenerator
+
+
+def _convert_newlines(text: str) -> str:
+ """Convert newline characters to markdown newline sequences
+ (space, space, newline).
+ """
+ return text.replace("\n", " \n")
+
+
+CHECKMARK_EMOJI = "✅"
+THINKING_EMOJI = ":thinking_face:"
+HISTORY_EMOJI = ":books:"
+EXCEPTION_EMOJI = "⚠️"
+
+
+class LLMThoughtState(Enum):
+ """Enumerator of the LLMThought state."""
+
+ # The LLM is thinking about what to do next. We don't know which tool we'll run.
+ THINKING = "THINKING"
+ # The LLM has decided to run a tool. We don't have results from the tool yet.
+ RUNNING_TOOL = "RUNNING_TOOL"
+ # We have results from the tool.
+ COMPLETE = "COMPLETE"
+
+
+class ToolRecord(NamedTuple):
+ """Tool record as a NamedTuple."""
+
+ name: str
+ input_str: str
+
+
+class LLMThoughtLabeler:
+ """
+ Generates markdown labels for LLMThought containers. Pass a custom
+ subclass of this to StreamlitCallbackHandler to override its default
+ labeling logic.
+ """
+
+ @staticmethod
+ def get_initial_label() -> str:
+ """Return the markdown label for a new LLMThought that doesn't have
+ an associated tool yet.
+ """
+ return f"{THINKING_EMOJI} **Thinking...**"
+
+ @staticmethod
+ def get_tool_label(tool: ToolRecord, is_complete: bool) -> str:
+ """Return the label for an LLMThought that has an associated
+ tool.
+
+ Parameters
+ ----------
+ tool
+ The tool's ToolRecord
+
+ is_complete
+ True if the thought is complete; False if the thought
+ is still receiving input.
+
+ Returns
+ -------
+ The markdown label for the thought's container.
+
+ """
+ input = tool.input_str
+ name = tool.name
+ emoji = CHECKMARK_EMOJI if is_complete else THINKING_EMOJI
+ if name == "_Exception":
+ emoji = EXCEPTION_EMOJI
+ name = "Parsing error"
+ idx = min([60, len(input)])
+ input = input[0:idx]
+ if len(tool.input_str) > idx:
+ input = input + "..."
+ input = input.replace("\n", " ")
+ label = f"{emoji} **{name}:** {input}"
+ return label
+
+ @staticmethod
+ def get_history_label() -> str:
+ """Return a markdown label for the special 'history' container
+ that contains overflow thoughts.
+ """
+ return f"{HISTORY_EMOJI} **History**"
+
+ @staticmethod
+ def get_final_agent_thought_label() -> str:
+ """Return the markdown label for the agent's final thought -
+ the "Now I have the answer" thought, that doesn't involve
+ a tool.
+ """
+ return f"{CHECKMARK_EMOJI} **Complete!**"
+
+
+class LLMThought:
+ """A thought in the LLM's thought stream."""
+
+ def __init__(
+ self,
+ parent_container: DeltaGenerator,
+ labeler: LLMThoughtLabeler,
+ expanded: bool,
+ collapse_on_complete: bool,
+ ):
+ """Initialize the LLMThought.
+
+ Args:
+ parent_container: The container we're writing into.
+ labeler: The labeler to use for this thought.
+ expanded: Whether the thought should be expanded by default.
+ collapse_on_complete: Whether the thought should be collapsed.
+ """
+ self._container = MutableExpander(
+ parent_container=parent_container,
+ label=labeler.get_initial_label(),
+ expanded=expanded,
+ )
+ self._state = LLMThoughtState.THINKING
+ self._llm_token_stream = ""
+ self._llm_token_writer_idx: Optional[int] = None
+ self._last_tool: Optional[ToolRecord] = None
+ self._collapse_on_complete = collapse_on_complete
+ self._labeler = labeler
+
+ @property
+ def container(self) -> MutableExpander:
+ """The container we're writing into."""
+ return self._container
+
+ @property
+ def last_tool(self) -> Optional[ToolRecord]:
+ """The last tool executed by this thought"""
+ return self._last_tool
+
+ def _reset_llm_token_stream(self) -> None:
+ self._llm_token_stream = ""
+ self._llm_token_writer_idx = None
+
+ def on_llm_start(self, serialized: Dict[str, Any], prompts: List[str]) -> None:
+ self._reset_llm_token_stream()
+
+ def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
+ # This is only called when the LLM is initialized with `streaming=True`
+ self._llm_token_stream += _convert_newlines(token)
+ self._llm_token_writer_idx = self._container.markdown(
+ self._llm_token_stream, index=self._llm_token_writer_idx
+ )
+
+ def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None:
+ # `response` is the concatenation of all the tokens received by the LLM.
+ # If we're receiving streaming tokens from `on_llm_new_token`, this response
+ # data is redundant
+ self._reset_llm_token_stream()
+
+ def on_llm_error(self, error: BaseException, **kwargs: Any) -> None:
+ self._container.markdown("**LLM encountered an error...**")
+ self._container.exception(error)
+
+ def on_tool_start(
+ self, serialized: Dict[str, Any], input_str: str, **kwargs: Any
+ ) -> None:
+ # Called with the name of the tool we're about to run (in `serialized[name]`),
+ # and its input. We change our container's label to be the tool name.
+ self._state = LLMThoughtState.RUNNING_TOOL
+ tool_name = serialized["name"]
+ self._last_tool = ToolRecord(name=tool_name, input_str=input_str)
+ self._container.update(
+ new_label=self._labeler.get_tool_label(self._last_tool, is_complete=False)
+ )
+
+ def on_tool_end(
+ self,
+ output: Any,
+ color: Optional[str] = None,
+ observation_prefix: Optional[str] = None,
+ llm_prefix: Optional[str] = None,
+ **kwargs: Any,
+ ) -> None:
+ self._container.markdown(f"**{str(output)}**")
+
+ def on_tool_error(self, error: BaseException, **kwargs: Any) -> None:
+ self._container.markdown("**Tool encountered an error...**")
+ self._container.exception(error)
+
+ def on_agent_action(
+ self, action: AgentAction, color: Optional[str] = None, **kwargs: Any
+ ) -> Any:
+ # Called when we're about to kick off a new tool. The `action` data
+ # tells us the tool we're about to use, and the input we'll give it.
+ # We don't output anything here, because we'll receive this same data
+ # when `on_tool_start` is called immediately after.
+ pass
+
+ def complete(self, final_label: Optional[str] = None) -> None:
+ """Finish the thought."""
+ if final_label is None and self._state == LLMThoughtState.RUNNING_TOOL:
+ assert self._last_tool is not None, (
+ "_last_tool should never be null when _state == RUNNING_TOOL"
+ )
+ final_label = self._labeler.get_tool_label(
+ self._last_tool, is_complete=True
+ )
+ self._state = LLMThoughtState.COMPLETE
+ if self._collapse_on_complete:
+ self._container.update(new_label=final_label, new_expanded=False)
+ else:
+ self._container.update(new_label=final_label)
+
+ def clear(self) -> None:
+ """Remove the thought from the screen. A cleared thought can't be reused."""
+ self._container.clear()
+
+
+class StreamlitCallbackHandler(BaseCallbackHandler):
+ """Callback handler that writes to a Streamlit app."""
+
+ def __init__(
+ self,
+ parent_container: DeltaGenerator,
+ *,
+ max_thought_containers: int = 4,
+ expand_new_thoughts: bool = True,
+ collapse_completed_thoughts: bool = True,
+ thought_labeler: Optional[LLMThoughtLabeler] = None,
+ ):
+ """Create a StreamlitCallbackHandler instance.
+
+ Parameters
+ ----------
+ parent_container
+ The `st.container` that will contain all the Streamlit elements that the
+ Handler creates.
+ max_thought_containers
+ The max number of completed LLM thought containers to show at once. When
+ this threshold is reached, a new thought will cause the oldest thoughts to
+ be collapsed into a "History" expander. Defaults to 4.
+ expand_new_thoughts
+ Each LLM "thought" gets its own `st.expander`. This param controls whether
+ that expander is expanded by default. Defaults to True.
+ collapse_completed_thoughts
+ If True, LLM thought expanders will be collapsed when completed.
+ Defaults to True.
+ thought_labeler
+ An optional custom LLMThoughtLabeler instance. If unspecified, the handler
+ will use the default thought labeling logic. Defaults to None.
+ """
+ self._parent_container = parent_container
+ self._history_parent = parent_container.container()
+ self._history_container: Optional[MutableExpander] = None
+ self._current_thought: Optional[LLMThought] = None
+ self._completed_thoughts: List[LLMThought] = []
+ self._max_thought_containers = max(max_thought_containers, 1)
+ self._expand_new_thoughts = expand_new_thoughts
+ self._collapse_completed_thoughts = collapse_completed_thoughts
+ self._thought_labeler = thought_labeler or LLMThoughtLabeler()
+
+ def _require_current_thought(self) -> LLMThought:
+ """Return our current LLMThought. Raise an error if we have no current
+ thought.
+ """
+ if self._current_thought is None:
+ raise RuntimeError("Current LLMThought is unexpectedly None!")
+ return self._current_thought
+
+ def _get_last_completed_thought(self) -> Optional[LLMThought]:
+ """Return our most recent completed LLMThought, or None if we don't have one."""
+ if len(self._completed_thoughts) > 0:
+ return self._completed_thoughts[len(self._completed_thoughts) - 1]
+ return None
+
+ @property
+ def _num_thought_containers(self) -> int:
+ """The number of 'thought containers' we're currently showing: the
+ number of completed thought containers, the history container (if it exists),
+ and the current thought container (if it exists).
+ """
+ count = len(self._completed_thoughts)
+ if self._history_container is not None:
+ count += 1
+ if self._current_thought is not None:
+ count += 1
+ return count
+
+ def _complete_current_thought(self, final_label: Optional[str] = None) -> None:
+ """Complete the current thought, optionally assigning it a new label.
+ Add it to our _completed_thoughts list.
+ """
+ thought = self._require_current_thought()
+ thought.complete(final_label)
+ self._completed_thoughts.append(thought)
+ self._current_thought = None
+
+ def _prune_old_thought_containers(self) -> None:
+ """If we have too many thoughts onscreen, move older thoughts to the
+ 'history container.'
+ """
+ while (
+ self._num_thought_containers > self._max_thought_containers
+ and len(self._completed_thoughts) > 0
+ ):
+ # Create our history container if it doesn't exist, and if
+ # max_thought_containers is > 1. (if max_thought_containers is 1, we don't
+ # have room to show history.)
+ if self._history_container is None and self._max_thought_containers > 1:
+ self._history_container = MutableExpander(
+ self._history_parent,
+ label=self._thought_labeler.get_history_label(),
+ expanded=False,
+ )
+
+ oldest_thought = self._completed_thoughts.pop(0)
+ if self._history_container is not None:
+ self._history_container.markdown(oldest_thought.container.label)
+ self._history_container.append_copy(oldest_thought.container)
+ oldest_thought.clear()
+
+ def on_llm_start(
+ self, serialized: Dict[str, Any], prompts: List[str], **kwargs: Any
+ ) -> None:
+ if self._current_thought is None:
+ self._current_thought = LLMThought(
+ parent_container=self._parent_container,
+ expanded=self._expand_new_thoughts,
+ collapse_on_complete=self._collapse_completed_thoughts,
+ labeler=self._thought_labeler,
+ )
+
+ self._current_thought.on_llm_start(serialized, prompts)
+
+ # We don't prune_old_thought_containers here, because our container won't
+ # be visible until it has a child.
+
+ def on_llm_new_token(self, token: str, **kwargs: Any) -> None:
+ self._require_current_thought().on_llm_new_token(token, **kwargs)
+ self._prune_old_thought_containers()
+
+ def on_llm_end(self, response: LLMResult, **kwargs: Any) -> None:
+ self._require_current_thought().on_llm_end(response, **kwargs)
+ self._prune_old_thought_containers()
+
+ def on_llm_error(self, error: BaseException, **kwargs: Any) -> None:
+ self._require_current_thought().on_llm_error(error, **kwargs)
+ self._prune_old_thought_containers()
+
+ def on_tool_start(
+ self, serialized: Dict[str, Any], input_str: str, **kwargs: Any
+ ) -> None:
+ self._require_current_thought().on_tool_start(serialized, input_str, **kwargs)
+ self._prune_old_thought_containers()
+
+ def on_tool_end(
+ self,
+ output: Any,
+ color: Optional[str] = None,
+ observation_prefix: Optional[str] = None,
+ llm_prefix: Optional[str] = None,
+ **kwargs: Any,
+ ) -> None:
+ output = str(output)
+ self._require_current_thought().on_tool_end(
+ output, color, observation_prefix, llm_prefix, **kwargs
+ )
+ self._complete_current_thought()
+
+ def on_tool_error(self, error: BaseException, **kwargs: Any) -> None:
+ self._require_current_thought().on_tool_error(error, **kwargs)
+ self._prune_old_thought_containers()
+
+ def on_text(
+ self,
+ text: str,
+ color: Optional[str] = None,
+ end: str = "",
+ **kwargs: Any,
+ ) -> None:
+ pass
+
+ def on_chain_start(
+ self, serialized: Dict[str, Any], inputs: Dict[str, Any], **kwargs: Any
+ ) -> None:
+ pass
+
+ def on_chain_end(self, outputs: Dict[str, Any], **kwargs: Any) -> None:
+ pass
+
+ def on_chain_error(self, error: BaseException, **kwargs: Any) -> None:
+ pass
+
+ def on_agent_action(
+ self, action: AgentAction, color: Optional[str] = None, **kwargs: Any
+ ) -> Any:
+ self._require_current_thought().on_agent_action(action, color, **kwargs)
+ self._prune_old_thought_containers()
+
+ def on_agent_finish(
+ self, finish: AgentFinish, color: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ if self._current_thought is not None:
+ self._current_thought.complete(
+ self._thought_labeler.get_final_agent_thought_label()
+ )
+ self._current_thought = None
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__init__.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..6cbed4ac5db4ff8290912d887f7d0278ce714d3d
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__init__.py
@@ -0,0 +1,16 @@
+"""Tracers that record execution of LangChain runs."""
+
+from langchain_core.tracers.langchain import LangChainTracer
+from langchain_core.tracers.stdout import (
+ ConsoleCallbackHandler,
+ FunctionCallbackHandler,
+)
+
+from langchain_community.callbacks.tracers.wandb import WandbTracer
+
+__all__ = [
+ "ConsoleCallbackHandler",
+ "FunctionCallbackHandler",
+ "LangChainTracer",
+ "WandbTracer",
+]
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..23ef0404f5cbe9b2e9853f5c96084407e646b8f1
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/comet.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/comet.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..cf90660d82067521c9cd17ee214e837e49851679
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/comet.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/wandb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/wandb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..806a5a540cf5739c419457ba628f1ceec8945f49
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/__pycache__/wandb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/comet.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/comet.py
new file mode 100644
index 0000000000000000000000000000000000000000..099f39f82bf03dff6d1162ec7a82c08da2debdba
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/comet.py
@@ -0,0 +1,135 @@
+from types import ModuleType, SimpleNamespace
+from typing import TYPE_CHECKING, Any, Callable, Dict
+
+from langchain_core.tracers import BaseTracer
+from langchain_core.utils import guard_import
+
+if TYPE_CHECKING:
+ from uuid import UUID
+
+ from comet_llm import Span
+ from comet_llm.chains.chain import Chain
+
+ from langchain_community.callbacks.tracers.schemas import Run
+
+
+def _get_run_type(run: "Run") -> str:
+ if isinstance(run.run_type, str):
+ return run.run_type
+ elif hasattr(run.run_type, "value"):
+ return run.run_type.value
+ else:
+ return str(run.run_type)
+
+
+def import_comet_llm_api() -> SimpleNamespace:
+ """Import comet_llm api and raise an error if it is not installed."""
+ comet_llm = guard_import("comet_llm")
+ comet_llm_chains = guard_import("comet_llm.chains")
+
+ return SimpleNamespace(
+ chain=comet_llm_chains.chain,
+ span=comet_llm_chains.span,
+ chain_api=comet_llm_chains.api,
+ experiment_info=comet_llm.experiment_info,
+ flush=comet_llm.flush,
+ )
+
+
+class CometTracer(BaseTracer):
+ """Comet Tracer."""
+
+ def __init__(self, **kwargs: Any) -> None:
+ """Initialize the Comet Tracer."""
+ super().__init__(**kwargs)
+ self._span_map: Dict["UUID", "Span"] = {}
+ """Map from run id to span."""
+ self._chains_map: Dict["UUID", "Chain"] = {}
+ """Map from run id to chain."""
+ self._initialize_comet_modules()
+
+ def _initialize_comet_modules(self) -> None:
+ comet_llm_api = import_comet_llm_api()
+ self._chain: ModuleType = comet_llm_api.chain
+ self._span: ModuleType = comet_llm_api.span
+ self._chain_api: ModuleType = comet_llm_api.chain_api
+ self._experiment_info: ModuleType = comet_llm_api.experiment_info
+ self._flush: Callable[[], None] = comet_llm_api.flush
+
+ def _persist_run(self, run: "Run") -> None:
+ run_dict: Dict[str, Any] = run.dict()
+ chain_ = self._chains_map[run.id]
+ chain_.set_outputs(outputs=run_dict["outputs"])
+ self._chain_api.log_chain(chain_)
+
+ def _process_start_trace(self, run: "Run") -> None:
+ run_dict: Dict[str, Any] = run.dict()
+ if not run.parent_run_id:
+ # This is the first run, which maps to a chain
+ metadata = run_dict["extra"].get("metadata", None)
+
+ chain_: "Chain" = self._chain.Chain(
+ inputs=run_dict["inputs"],
+ metadata=metadata,
+ experiment_info=self._experiment_info.get(),
+ )
+ self._chains_map[run.id] = chain_
+ else:
+ span: "Span" = self._span.Span(
+ inputs=run_dict["inputs"],
+ category=_get_run_type(run),
+ metadata=run_dict["extra"],
+ name=run.name,
+ )
+ span.__api__start__(self._chains_map[run.parent_run_id])
+ self._chains_map[run.id] = self._chains_map[run.parent_run_id]
+ self._span_map[run.id] = span
+
+ def _process_end_trace(self, run: "Run") -> None:
+ run_dict: Dict[str, Any] = run.dict()
+ if not run.parent_run_id:
+ pass
+ # Langchain will call _persist_run for us
+ else:
+ span = self._span_map[run.id]
+ span.set_outputs(outputs=run_dict["outputs"])
+ span.__api__end__()
+
+ def flush(self) -> None:
+ self._flush()
+
+ def _on_llm_start(self, run: "Run") -> None:
+ """Process the LLM Run upon start."""
+ self._process_start_trace(run)
+
+ def _on_llm_end(self, run: "Run") -> None:
+ """Process the LLM Run."""
+ self._process_end_trace(run)
+
+ def _on_llm_error(self, run: "Run") -> None:
+ """Process the LLM Run upon error."""
+ self._process_end_trace(run)
+
+ def _on_chain_start(self, run: "Run") -> None:
+ """Process the Chain Run upon start."""
+ self._process_start_trace(run)
+
+ def _on_chain_end(self, run: "Run") -> None:
+ """Process the Chain Run."""
+ self._process_end_trace(run)
+
+ def _on_chain_error(self, run: "Run") -> None:
+ """Process the Chain Run upon error."""
+ self._process_end_trace(run)
+
+ def _on_tool_start(self, run: "Run") -> None:
+ """Process the Tool Run upon start."""
+ self._process_start_trace(run)
+
+ def _on_tool_end(self, run: "Run") -> None:
+ """Process the Tool Run."""
+ self._process_end_trace(run)
+
+ def _on_tool_error(self, run: "Run") -> None:
+ """Process the Tool Run upon error."""
+ self._process_end_trace(run)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/wandb.py b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/wandb.py
new file mode 100644
index 0000000000000000000000000000000000000000..f552d37b4b554d0d4ad7a750508083155ecd2fcb
--- /dev/null
+++ b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/callbacks/tracers/wandb.py
@@ -0,0 +1,507 @@
+"""A Tracer Implementation that records activity to Weights & Biases."""
+
+from __future__ import annotations
+
+import json
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Callable,
+ Dict,
+ List,
+ Optional,
+ Sequence,
+ Tuple,
+ TypedDict,
+ Union,
+)
+
+from langchain_core._api import warn_deprecated
+from langchain_core.output_parsers.pydantic import PydanticBaseModel
+from langchain_core.tracers.base import BaseTracer
+from langchain_core.tracers.schemas import Run
+
+if TYPE_CHECKING:
+ from wandb import Settings as WBSettings
+ from wandb.sdk.data_types.trace_tree import Trace
+ from wandb.sdk.lib.paths import StrPath
+ from wandb.wandb_run import Run as WBRun
+
+PRINT_WARNINGS = True
+
+
+def _serialize_io(run_io: Optional[dict]) -> dict:
+ """Utility to serialize the input and output of a run to store in wandb.
+ Currently, supports serializing pydantic models and protobuf messages.
+
+ :param run_io: The inputs and outputs of the run.
+ :return: The serialized inputs and outputs.
+
+
+ """
+ if not run_io:
+ return {}
+ from google.protobuf.json_format import MessageToJson
+ from google.protobuf.message import Message
+
+ serialized_inputs = {}
+ for key, value in run_io.items():
+ if isinstance(value, Message):
+ serialized_inputs[key] = MessageToJson(value)
+
+ elif isinstance(value, PydanticBaseModel):
+ serialized_inputs[key] = (
+ value.model_dump_json()
+ if hasattr(value, "model_dump_json")
+ else value.json()
+ )
+
+ elif key == "input_documents":
+ serialized_inputs.update(
+ {f"input_document_{i}": doc.json() for i, doc in enumerate(value)}
+ )
+ else:
+ serialized_inputs[key] = value
+ return serialized_inputs
+
+
+def flatten_run(run: Dict[str, Any]) -> List[Dict[str, Any]]:
+ """Utility to flatten a nest run object into a list of runs.
+ :param run: The base run to flatten.
+ :return: The flattened list of runs.
+ """
+
+ def flatten(child_runs: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
+ """Utility to recursively flatten a list of child runs in a run.
+ :param child_runs: The list of child runs to flatten.
+ :return: The flattened list of runs.
+ """
+ if child_runs is None:
+ return []
+
+ result = []
+ for item in child_runs:
+ child_runs = item.pop("child_runs", [])
+ result.append(item)
+ result.extend(flatten(child_runs))
+
+ return result
+
+ return flatten([run])
+
+
+def truncate_run_iterative(
+ runs: List[Dict[str, Any]], keep_keys: Tuple[str, ...] = ()
+) -> List[Dict[str, Any]]:
+ """Utility to truncate a list of runs dictionaries to only keep the specified
+ keys in each run.
+ :param runs: The list of runs to truncate.
+ :param keep_keys: The keys to keep in each run.
+ :return: The truncated list of runs.
+ """
+
+ def truncate_single(run: Dict[str, Any]) -> Dict[str, Any]:
+ """Utility to truncate a single run dictionary to only keep the specified
+ keys.
+ :param run: The run dictionary to truncate.
+ :return: The truncated run dictionary
+ """
+ new_dict = {}
+ for key in run:
+ if key in keep_keys:
+ new_dict[key] = run.get(key)
+ return new_dict
+
+ return list(map(truncate_single, runs))
+
+
+def modify_serialized_iterative(
+ runs: List[Dict[str, Any]],
+ exact_keys: Tuple[str, ...] = (),
+ partial_keys: Tuple[str, ...] = (),
+) -> List[Dict[str, Any]]:
+ """Utility to modify the serialized field of a list of runs dictionaries.
+ removes any keys that match the exact_keys and any keys that contain any of the
+ partial_keys.
+ recursively moves the dictionaries under the kwargs key to the top level.
+ changes the "id" field to a string "_kind" field that tells WBTraceTree how to
+ visualize the run. promotes the "serialized" field to the top level.
+ :param runs: The list of runs to modify.
+ :param exact_keys: A tuple of keys to remove from the serialized field.
+ :param partial_keys: A tuple of partial keys to remove from the serialized
+ field.
+ :return: The modified list of runs.
+ """
+
+ def remove_exact_and_partial_keys(obj: Dict[str, Any]) -> Dict[str, Any]:
+ """Recursively removes exact and partial keys from a dictionary.
+ :param obj: The dictionary to remove keys from.
+ :return: The modified dictionary.
+ """
+ if isinstance(obj, dict):
+ obj = {
+ k: v
+ for k, v in obj.items()
+ if k not in exact_keys
+ and not any(partial in k for partial in partial_keys)
+ }
+ for k, v in obj.items():
+ obj[k] = remove_exact_and_partial_keys(v)
+ elif isinstance(obj, list):
+ obj = [remove_exact_and_partial_keys(x) for x in obj]
+ return obj
+
+ def handle_id_and_kwargs(obj: Dict[str, Any], root: bool = False) -> Dict[str, Any]:
+ """Recursively handles the id and kwargs fields of a dictionary.
+ changes the id field to a string "_kind" field that tells WBTraceTree how
+ to visualize the run. recursively moves the dictionaries under the kwargs
+ key to the top level.
+ :param obj: a run dictionary with id and kwargs fields.
+ :param root: whether this is the root dictionary or the serialized
+ dictionary.
+ :return: The modified dictionary.
+ """
+ if isinstance(obj, dict):
+ if "data" in obj and isinstance(obj["data"], dict):
+ obj = obj["data"]
+ if ("id" in obj or "name" in obj) and not root:
+ _kind = obj.get("id")
+ if not _kind:
+ _kind = [obj.get("name")]
+ if isinstance(_kind, list):
+ obj["_kind"] = _kind[-1]
+ obj.pop("id", None)
+ obj.pop("name", None)
+ if "kwargs" in obj:
+ kwargs = obj.pop("kwargs")
+ for k, v in kwargs.items():
+ obj[k] = v
+ for k, v in obj.items():
+ obj[k] = handle_id_and_kwargs(v)
+ elif isinstance(obj, list):
+ obj = [handle_id_and_kwargs(x) for x in obj]
+ return obj
+
+ def transform_serialized(serialized: Dict[str, Any]) -> Dict[str, Any]:
+ """Transforms the serialized field of a run dictionary to be compatible
+ with WBTraceTree.
+ :param serialized: The serialized field of a run dictionary.
+ :return: The transformed serialized field.
+ """
+ serialized = handle_id_and_kwargs(serialized, root=True)
+ serialized = remove_exact_and_partial_keys(serialized)
+ return serialized
+
+ def transform_run(run: Dict[str, Any]) -> Dict[str, Any]:
+ """Transforms a run dictionary to be compatible with WBTraceTree.
+ :param run: The run dictionary to transform.
+ :return: The transformed run dictionary.
+ """
+ transformed_dict = transform_serialized(run)
+
+ serialized = transformed_dict.pop("serialized")
+ for k, v in serialized.items():
+ transformed_dict[k] = v
+
+ _kind = transformed_dict.get("_kind", None)
+ name = transformed_dict.pop("name", None)
+
+ if not name:
+ name = _kind
+
+ output_dict = {
+ f"{name}": transformed_dict,
+ }
+ return output_dict
+
+ return list(map(transform_run, runs))
+
+
+def build_tree(runs: List[Dict[str, Any]]) -> Dict[str, Any]:
+ """Builds a nested dictionary from a list of runs.
+ :param runs: The list of runs to build the tree from.
+ :return: The nested dictionary representing the langchain Run in a tree
+ structure compatible with WBTraceTree.
+ """
+ id_to_data = {}
+ child_to_parent = {}
+
+ for entity in runs:
+ for key, data in entity.items():
+ id_val = data.pop("id", None)
+ parent_run_id = data.pop("parent_run_id", None)
+ id_to_data[id_val] = {key: data}
+ if parent_run_id:
+ child_to_parent[id_val] = parent_run_id
+
+ for child_id, parent_id in child_to_parent.items():
+ parent_dict = id_to_data[parent_id]
+ parent_dict[next(iter(parent_dict))][next(iter(id_to_data[child_id]))] = (
+ id_to_data[child_id][next(iter(id_to_data[child_id]))]
+ )
+
+ root_dict = next(
+ data for id_val, data in id_to_data.items() if id_val not in child_to_parent
+ )
+
+ return root_dict
+
+
+class WandbRunArgs(TypedDict):
+ """Arguments for the WandbTracer."""
+
+ job_type: Optional[str]
+ dir: Optional[StrPath]
+ config: Union[Dict, str, None]
+ project: Optional[str]
+ entity: Optional[str]
+ reinit: Optional[bool]
+ tags: Optional[Sequence]
+ group: Optional[str]
+ name: Optional[str]
+ notes: Optional[str]
+ magic: Optional[Union[dict, str, bool]]
+ config_exclude_keys: Optional[List[str]]
+ config_include_keys: Optional[List[str]]
+ anonymous: Optional[str]
+ mode: Optional[str]
+ allow_val_change: Optional[bool]
+ resume: Optional[Union[bool, str]]
+ force: Optional[bool]
+ tensorboard: Optional[bool]
+ sync_tensorboard: Optional[bool]
+ monitor_gym: Optional[bool]
+ save_code: Optional[bool]
+ id: Optional[str]
+ settings: Union[WBSettings, Dict[str, Any], None]
+
+
+class WandbTracer(BaseTracer):
+ """Callback Handler that logs to Weights and Biases.
+
+ This handler will log the model architecture and run traces to Weights and Biases.
+ This will ensure that all LangChain activity is logged to W&B.
+ """
+
+ _run: Optional[WBRun] = None
+ _run_args: Optional[WandbRunArgs] = None
+
+ def __init__(
+ self,
+ run_args: Optional[WandbRunArgs] = None,
+ io_serializer: Callable = _serialize_io,
+ **kwargs: Any,
+ ) -> None:
+ """Initializes the WandbTracer.
+
+ Parameters:
+ run_args: (dict, optional) Arguments to pass to `wandb.init()`. If not
+ provided, `wandb.init()` will be called with no arguments. Please
+ refer to the `wandb.init` for more details.
+ io_serializer: callable A function that serializes the input and outputs
+ of a run to store in wandb. Defaults to "_serialize_io"
+
+ To use W&B to monitor all LangChain activity, add this tracer like any other
+ LangChain callback:
+ ```
+ from wandb.integration.langchain import WandbTracer
+
+ tracer = WandbTracer()
+ chain = LLMChain(llm, callbacks=[tracer])
+ # ...end of notebook / script:
+ tracer.finish()
+ ```
+ """
+ super().__init__(**kwargs)
+ try:
+ import wandb
+ from wandb.sdk.data_types import trace_tree
+ except ImportError as e:
+ raise ImportError(
+ "Could not import wandb python package."
+ "Please install it with `pip install -U wandb`."
+ ) from e
+ self._wandb = wandb
+ self._trace_tree = trace_tree
+ self._run_args = run_args
+ self._ensure_run(should_print_url=(wandb.run is None))
+ self._io_serializer = io_serializer
+ warn_deprecated(
+ "0.3.8",
+ pending=False,
+ message=(
+ "Please use the `WeaveTracer` from the `weave` package instead of this."
+ "The `WeaveTracer` is a more flexible and powerful tool for logging "
+ "and tracing your LangChain callables."
+ "Find more information at https://weave-docs.wandb.ai/guides/integrations/langchain"
+ ),
+ alternative=(
+ "Please instantiate the WeaveTracer from "
+ "`weave.integrations.langchain import WeaveTracer` ."
+ "For autologging simply use `weave.init()` and log all traces "
+ "from your LangChain callables."
+ ),
+ )
+
+ def finish(self) -> None:
+ """Waits for all asynchronous processes to finish and data to upload.
+
+ Proxy for `wandb.finish()`.
+ """
+ self._wandb.finish()
+
+ def _ensure_run(self, should_print_url: bool = False) -> None:
+ """Ensures an active W&B run exists.
+
+ If not, will start a new run with the provided run_args.
+ """
+ if self._wandb.run is None:
+ run_args: Dict = {**(self._run_args or {})}
+
+ if "settings" not in run_args:
+ run_args["settings"] = {"silent": True}
+
+ self._wandb.init(**run_args)
+ if self._wandb.run is not None:
+ if should_print_url:
+ run_url = self._wandb.run.settings.run_url
+ self._wandb.termlog(
+ f"Streaming LangChain activity to W&B at {run_url}\n"
+ "`WandbTracer` is currently in beta.\n"
+ "Please report any issues to "
+ "https://github.com/wandb/wandb/issues with the tag "
+ "`langchain`."
+ )
+
+ self._wandb.run._label(repo="langchain")
+
+ def process_model_dict(self, run: Run) -> Optional[Dict[str, Any]]:
+ """Utility to process a run for wandb model_dict serialization.
+ :param run: The run to process.
+ :return: The convert model_dict to pass to WBTraceTree.
+ """
+ try:
+ data = json.loads(run.json())
+ processed = flatten_run(data)
+ keep_keys = (
+ "id",
+ "name",
+ "serialized",
+ "parent_run_id",
+ )
+ processed = truncate_run_iterative(processed, keep_keys=keep_keys)
+ exact_keys, partial_keys = (
+ ("lc", "type", "graph"),
+ (
+ "api_key",
+ "input",
+ "output",
+ ),
+ )
+ processed = modify_serialized_iterative(
+ processed, exact_keys=exact_keys, partial_keys=partial_keys
+ )
+ output = build_tree(processed)
+ return output
+ except Exception as e:
+ if PRINT_WARNINGS:
+ self._wandb.termerror(f"WARNING: Failed to serialize model: {e}")
+ return None
+
+ def _log_trace_from_run(self, run: Run) -> None:
+ """Logs a LangChain Run to W*B as a W&B Trace."""
+ self._ensure_run()
+
+ def create_trace(
+ run: "Run", parent: Optional["Trace"] = None
+ ) -> Optional["Trace"]:
+ """
+ Create a trace for a given run and its child runs.
+
+ Args:
+ run (Run): The run for which to create a trace.
+ parent (Optional[Trace]): The parent trace.
+ If provided, the created trace is added as a child to the parent trace.
+
+ Returns:
+ The created trace. If an error occurs during the creation of the trace,
+ None is returned.
+
+ Raises:
+ Exception: If an error occurs during the creation of the trace,
+ no exception is raised and a warning is printed.
+ """
+
+ def get_metadata_dict(r: "Run") -> Dict[str, Any]:
+ """
+ Extract metadata from a given run.
+
+ This function extracts metadata from a given run
+ and returns it as a dictionary.
+
+ Args:
+ r (Run): The run from which to extract metadata.
+
+ Returns:
+ `dict` containing the extracted metadata.
+ """
+ run_dict = json.loads(r.json())
+ metadata_dict = run_dict.get("metadata", {})
+ metadata_dict["run_id"] = run_dict.get("id")
+ metadata_dict["parent_run_id"] = run_dict.get("parent_run_id")
+ metadata_dict["tags"] = run_dict.get("tags")
+ metadata_dict["execution_order"] = run_dict.get(
+ "dotted_order", ""
+ ).count(".")
+ return metadata_dict
+
+ try:
+ if run.run_type in ["llm", "tool"]:
+ run_type = run.run_type
+ elif run.run_type == "chain":
+ run_type = "agent" if "agent" in run.name.lower() else "chain"
+ else:
+ run_type = None
+
+ metadata = get_metadata_dict(run)
+ trace_tree = self._trace_tree.Trace(
+ name=run.name,
+ kind=run_type,
+ status_code="error" if run.error else "success",
+ start_time_ms=int(run.start_time.timestamp() * 1000)
+ if run.start_time is not None
+ else None,
+ end_time_ms=int(run.end_time.timestamp() * 1000)
+ if run.end_time is not None
+ else None,
+ metadata=metadata,
+ inputs=self._io_serializer(run.inputs),
+ outputs=self._io_serializer(run.outputs),
+ )
+
+ # If the run has child runs, recursively create traces for them
+ for child_run in run.child_runs:
+ create_trace(child_run, trace_tree)
+
+ if parent is None:
+ return trace_tree
+ else:
+ parent.add_child(trace_tree)
+ return parent
+ except Exception as e:
+ if PRINT_WARNINGS:
+ self._wandb.termwarn(
+ f"WARNING: Failed to serialize trace for run due to: {e}"
+ )
+ return None
+
+ run_trace = create_trace(run)
+ model_dict = self.process_model_dict(run)
+ if model_dict is not None and run_trace is not None:
+ run_trace._model_dict = model_dict
+ if self._wandb.run is not None and run_trace is not None:
+ run_trace.log("langchain_trace")
+
+ def _persist_run(self, run: "Run") -> None:
+ """Persist a run."""
+ self._log_trace_from_run(run)
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/ernie_functions/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/ernie_functions/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8aa959b828b2ff4b6a3e659626a8f83a1e557f0c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/ernie_functions/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/ernie_functions/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/ernie_functions/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..517c4d81055c1cc3e8e7b108523db00c32b186ac
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/ernie_functions/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f2b2178157c01102fa0c321f0e076ae10aebad7b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/arangodb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/arangodb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c10fc0f0e6c6c4967693f2aeff50a5fad68b90aa
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/arangodb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a1d53a68dd9d863b56db2d04042eea95d14bd87c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/cypher.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/cypher.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5e143643c9b3019d9a2b64bb8af61e994aea038d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/cypher.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/cypher_utils.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/cypher_utils.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2f8389429acd18281412a8880834ba097e40cf07
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/cypher_utils.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/falkordb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/falkordb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..653e19c3c3ea31ddd90f423c2124d87933d91bdd
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/falkordb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/gremlin.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/gremlin.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..919dad163d17d1f87145da8c33d3f9d77ac791cb
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/gremlin.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/hugegraph.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/hugegraph.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6dfa2d2b04f49d084c86f64dea2386234ce878de
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/hugegraph.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/kuzu.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/kuzu.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e272e6f34d6c9386e452658475d43d52bbf0e625
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/kuzu.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/memgraph.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/memgraph.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bbec102fa71086e7fcfbfae279e84c3f3bfbeade
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/memgraph.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/nebulagraph.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/nebulagraph.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f665161e4f5ed52fbefe44fce63feae98e0db9d0
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/nebulagraph.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/neptune_cypher.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/neptune_cypher.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..317758d84be03c5e0312eaa6035e6738b299343e
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/neptune_cypher.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/neptune_sparql.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/neptune_sparql.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e6caa9a0dda33cc8ef6bf324eb8835875c1bf317
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/neptune_sparql.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/ontotext_graphdb.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/ontotext_graphdb.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..529d1b687c9fc639e35359f9e3ab3a96882079fe
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/ontotext_graphdb.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/prompts.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/prompts.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5fe09961ace8ac4ae0d2787413869586030416f1
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/prompts.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/sparql.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/sparql.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f744e06093897f843b79e70dd8319b1780d53449
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/graph_qa/__pycache__/sparql.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f0f2a466e0360ab8245d450941000b85be95eb93
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/base.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/base.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..df53229f62f9a72584afef407573d13fc16f17fa
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/base.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/crawler.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/crawler.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ae4d8b351fd54e839f9f1d762e8658af2b8d7919
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/crawler.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/prompt.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/prompt.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..cf23b71ca501cf952caa2f11a0838668d5de5c4d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/natbot/__pycache__/prompt.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5ab2c48291a1f8698dab84cb61c2dd5172e86c9d
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/__init__.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/chain.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/chain.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0d09f26760ecfc0beabaddc27d93d20c04119742
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/chain.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/prompts.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/prompts.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0fae11e485106d3eff365b869d55a119872a61aa
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/prompts.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/requests_chain.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/requests_chain.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..78d877c187dcec1f6983d4f9088e5d78e226409c
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/requests_chain.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/response_chain.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/response_chain.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9b1e0ef601a6542513cc85394ec1780e0541f69b
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/openapi/__pycache__/response_chain.cpython-311.pyc differ
diff --git a/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/pebblo_retrieval/__pycache__/__init__.cpython-311.pyc b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/pebblo_retrieval/__pycache__/__init__.cpython-311.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e84281f906c42b288425c74af0d0302415572931
Binary files /dev/null and b/micromamba_root/envs/pytorch_env/Lib/site-packages/langchain_community/chains/pebblo_retrieval/__pycache__/__init__.cpython-311.pyc differ