langchain/libs/community/tests/integration_tests/llms/test_sambanova.py
Jorge Piedrahita Ortiz 39956a3ef0
community: sambanovacloud llm integration (#27526)
- **Description:** SambaNovaCloud llm integration added, previously only
chat model integration

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
2024-11-15 16:58:11 +00:00

26 lines
777 B
Python

"""Test sambanova API llm wrappers.
In order to run this test, you need to have a sambastudio url, and api key
and a sambanova cloud api key.
You'll then need to set SAMBASTUDIO_URL, and SAMBASTUDIO_API_KEY,
and SAMBANOVA_API_KEY environment variables.
"""
from langchain_community.llms.sambanova import SambaNovaCloud, SambaStudio
def test_sambanova_cloud_call() -> None:
"""Test simple non-streaming call to sambastudio."""
llm = SambaNovaCloud()
output = llm.invoke("What is LangChain")
assert output
assert isinstance(output, str)
def test_sambastudio_call() -> None:
"""Test simple non-streaming call to sambastudio."""
llm = SambaStudio()
output = llm.invoke("What is LangChain")
assert output
assert isinstance(output, str)