mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-02 03:26:17 +00:00
BUGFIX: llm backwards compat imports (#13698)
This commit is contained in:
19
libs/core/tests/unit_tests/language_models/llms/test_base.py
Normal file
19
libs/core/tests/unit_tests/language_models/llms/test_base.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from tests.unit_tests.fake.llm import FakeListLLM
|
||||
|
||||
|
||||
def test_batch() -> None:
|
||||
llm = FakeListLLM(responses=["foo"] * 3)
|
||||
output = llm.batch(["foo", "bar", "foo"])
|
||||
assert output == ["foo"] * 3
|
||||
|
||||
output = llm.batch(["foo", "bar", "foo"], config={"max_concurrency": 2})
|
||||
assert output == ["foo"] * 3
|
||||
|
||||
|
||||
async def test_abatch() -> None:
|
||||
llm = FakeListLLM(responses=["foo"] * 3)
|
||||
output = await llm.abatch(["foo", "bar", "foo"])
|
||||
assert output == ["foo"] * 3
|
||||
|
||||
output = await llm.abatch(["foo", "bar", "foo"], config={"max_concurrency": 2})
|
||||
assert output == ["foo"] * 3
|
Reference in New Issue
Block a user