Source code for langchain_community.llms.titan_takeoff_pro
from typing import Any, Iterator, List, Mapping, Optional
import requests
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.outputs import GenerationChunk
from requests.exceptions import ConnectionError
from langchain_community.llms.utils import enforce_stop_tokens
[docs]class TitanTakeoffPro(LLM):
    base_url: Optional[str] = "http://localhost:3000"
    """Specifies the baseURL to use for the Titan Takeoff Pro API.
    Default = http://localhost:3000.
    """
    max_new_tokens: Optional[int] = None
    """Maximum tokens generated."""
    min_new_tokens: Optional[int] = None
    """Minimum tokens generated."""
    sampling_topk: Optional[int] = None
    """Sample predictions from the top K most probable candidates."""
    sampling_topp: Optional[float] = None
    """Sample from predictions whose cumulative probability exceeds this value.
    """
    sampling_temperature: Optional[float] = None
    """Sample with randomness. Bigger temperatures are associated with 
    more randomness and 'creativity'.
    """
    repetition_penalty: Optional[float] = None
    """Penalise the generation of tokens that have been generated before. 
    Set to > 1 to penalize.
    """
    regex_string: Optional[str] = None
    """A regex string for constrained generation."""
    no_repeat_ngram_size: Optional[int] = None
    """Prevent repetitions of ngrams of this size. Default = 0 (turned off)."""
    streaming: bool = False
    """Whether to stream the output. Default = False."""
    @property
    def _default_params(self) -> Mapping[str, Any]: