langchain_community.llms.sambanova
.SSEndpointHandler¶
- class langchain_community.llms.sambanova.SSEndpointHandler(host_url: str)[source]¶
SambaNova Systems Interface for SambaStudio model endpoints.
- Parameters
host_url (str) – Base URL of the DaaS API service
Initialize the SSEndpointHandler.
- Parameters
host_url (str) – Base URL of the DaaS API service
Attributes
API_BASE_PATH
Methods
__init__
(host_url)Initialize the SSEndpointHandler.
nlp_predict
(project, endpoint, key, input[, ...])NLP predict using inline input string.
nlp_predict_stream
(project, endpoint, key, input)NLP predict using inline input string.
- __init__(host_url: str)[source]¶
Initialize the SSEndpointHandler.
- Parameters
host_url (str) – Base URL of the DaaS API service
- nlp_predict(project: str, endpoint: str, key: str, input: Union[List[str], str], params: Optional[str] = '', stream: bool = False) Dict [source]¶
NLP predict using inline input string.
- Parameters
project (str) – Project ID in which the endpoint exists
endpoint (str) – Endpoint ID
key (str) – API Key
input_str (str) – Input string
params (str) – Input params string
input (Union[List[str], str]) –
stream (bool) –
- Returns
Prediction results
- Return type
dict
- nlp_predict_stream(project: str, endpoint: str, key: str, input: Union[List[str], str], params: Optional[str] = '') Iterator[GenerationChunk] [source]¶
NLP predict using inline input string.
- Parameters
project (str) – Project ID in which the endpoint exists
endpoint (str) – Endpoint ID
key (str) – API Key
input_str (str) – Input string
params (str) – Input params string
input (Union[List[str], str]) –
- Returns
Prediction results
- Return type
dict