mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
f8f2649f12
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>
20 lines
557 B
Python
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)
|