mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-07-15 09:55:38 -04:00
cadfce295f
See discussion here: https://github.com/langchain-ai/langchain/discussions/11680 The code is available for usage from langchain_experimental. The reason for the deprecation is that the agents are relying on a Python REPL. The code can only be run safely with appropriate sandboxing. --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
24 lines
730 B
Python
24 lines
730 B
Python
from pathlib import Path
|
|
|
|
from langchain._api import path
|
|
|
|
HERE = Path(__file__).parent
|
|
|
|
ROOT = HERE.parent.parent.parent
|
|
|
|
|
|
def test_as_import_path() -> None:
|
|
"""Test that the path is converted to a LangChain import path."""
|
|
# Verify that default paths are correct
|
|
assert path.PACKAGE_DIR == ROOT / "langchain"
|
|
# Verify that as import path works correctly
|
|
assert path.as_import_path(HERE, relative_to=ROOT) == "tests.unit_tests._api"
|
|
assert (
|
|
path.as_import_path(__file__, relative_to=ROOT)
|
|
== "tests.unit_tests._api.test_path"
|
|
)
|
|
assert (
|
|
path.as_import_path(__file__, suffix="create_agent", relative_to=ROOT)
|
|
== "tests.unit_tests._api.test_path.create_agent"
|
|
)
|