Toggle Menu
Prev Up Next

# `langchain_community.llms.sambanova`.SVEndpointHandler

class langchain_community.llms.sambanova.SVEndpointHandler(host_url: str)

  SambaNova Systems Interface for Sambaverse endpoint.

  Parameters

    host_url (str) – Base URL of the DaaS API service

  Initialize the SVEndpointHandler.

  Parameters

    host_url (str) – Base URL of the DaaS API service

  Attributes

  `API_BASE_PATH` |

  Methods

  `__init__`(host_url) | Initialize the SVEndpointHandler.
  `nlp_predict`(key, sambaverse_model_name, input) | NLP predict using inline input string.
  `nlp_predict_stream`(key, ...[, params]) | NLP predict using inline input string.

  __init__(host_url: str)

    Initialize the SVEndpointHandler.

    Parameters

      host_url (str) – Base URL of the DaaS API service

  nlp_predict(key: str, sambaverse_model_name: Optional[str], input: Union[List[str], str], params: Optional[str] = '', stream: bool = False) → Dict

    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

      - sambaverse_model_name (Optional[str]) –

      - input (Union[List[str], str]) –

      - stream (bool) –

    Returns

      Prediction results

    Return type

      dict

  nlp_predict_stream(key: str, sambaverse_model_name: Optional[str], input: Union[List[str], str], params: Optional[str] = '') → Iterator[GenerationChunk]

    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

      - sambaverse_model_name (Optional[str]) –

      - input (Union[List[str], str]) –

    Returns

      Prediction results

    Return type

      dict