You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/community/tests/integration_tests/llms/test_chatglm.py

20 lines
557 B
Python

"""Test ChatGLM API wrapper."""
from langchain_core.outputs import LLMResult
from langchain_community.llms.chatglm import ChatGLM
def test_chatglm_call() -> None:
"""Test valid call to chatglm."""
llm = ChatGLM()
output = llm("北京和上海这两座城市有什么不同?")
assert isinstance(output, str)
def test_chatglm_generate() -> None:
"""Test valid call to chatglm."""
llm = ChatGLM()
output = llm.generate(["who are you"])
assert isinstance(output, LLMResult)
assert isinstance(output.generations, list)