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_volcengine_maas.py

30 lines
809 B
Python

"""Test volc engine maas LLM model."""
from typing import Generator
from langchain_core.outputs import LLMResult
from langchain_community.llms.volcengine_maas import VolcEngineMaasLLM
def test_default_call() -> None:
"""Test valid call to volc engine."""
llm = VolcEngineMaasLLM()
output = llm("tell me a joke")
assert isinstance(output, str)
def test_generate() -> None:
"""Test valid call to volc engine."""
llm = VolcEngineMaasLLM()
output = llm.generate(["tell me a joke"])
assert isinstance(output, LLMResult)
assert isinstance(output.generations, list)
def test_generate_stream() -> None:
"""Test valid call to volc engine."""
llm = VolcEngineMaasLLM(streaming=True)
output = llm.stream("tell me a joke")
assert isinstance(output, Generator)