langchain/libs/community/tests/integration_tests/llms/test_baichuan.py
baichuan-assistant f8f2649f12
community: Add Baichuan LLM to community (#16724)
Replace this entire comment with:
- **Description:** Add Baichuan LLM to integration/llm, also updated
related docs.

Co-authored-by: BaiChuanHelper <wintergyc@WinterGYCs-MacBook-Pro.local>
2024-01-29 20:08:24 -08:00

20 lines
557 B
Python

"""Test Baichuan LLM Endpoint."""
from langchain_core.outputs import LLMResult
from langchain_community.llms.baichuan import BaichuanLLM
def test_call() -> None:
"""Test valid call to baichuan."""
llm = BaichuanLLM()
output = llm("Who won the second world war?")
assert isinstance(output, str)
def test_generate() -> None:
"""Test valid call to baichuan."""
llm = BaichuanLLM()
output = llm.generate(["Who won the second world war?"])
assert isinstance(output, LLMResult)
assert isinstance(output.generations, list)