community: sambanovacloud llm integration (#27526)

- **Description:** SambaNovaCloud llm integration added, previously only
chat model integration

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Jorge Piedrahita Ortiz
2024-11-15 11:58:11 -05:00
committed by GitHub
parent d696728278
commit 39956a3ef0
5 changed files with 604 additions and 7 deletions

View File

@@ -1,13 +1,20 @@
"""Test sambanova API wrapper.
"""Test sambanova API llm wrappers.
In order to run this test, you need to have a sambastudio base url,
project id, endpoint id, and api key.
You'll then need to set SAMBASTUDIO_BASE_URL, SAMBASTUDIO_BASE_URI
SAMBASTUDIO_PROJECT_ID, SAMBASTUDIO_ENDPOINT_ID, and SAMBASTUDIO_API_KEY
environment variables.
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 SambaStudio
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: