Source code for langchain_community.llms.volcengine_maas
from __future__ import annotations
from typing import Any, Dict, Iterator, List, Optional
from langchain_core.callbacks import CallbackManagerForLLMRun
from langchain_core.language_models.llms import LLM
from langchain_core.outputs import GenerationChunk
from langchain_core.pydantic_v1 import BaseModel, Field, root_validator
from langchain_core.utils import get_from_dict_or_env
[docs]class VolcEngineMaasBase(BaseModel):
    """Base class for VolcEngineMaas models."""
    client: Any
    volc_engine_maas_ak: Optional[str] = None
    """access key for volc engine"""
    volc_engine_maas_sk: Optional[str] = None
    """secret key for volc engine"""
    endpoint: Optional[str] = "maas-api.ml-platform-cn-beijing.volces.com"
    """Endpoint of the VolcEngineMaas LLM."""
    region: Optional[str] = "Region"
    """Region of the VolcEngineMaas LLM."""
    model: str = "skylark-lite-public"
    """Model name. you could check this model details here 
    https://www.volcengine.com/docs/82379/1133187
    and you could choose other models by change this field"""
    model_version: Optional[str] = None
    """Model version. Only used in moonshot large language model. 
    you could check details here https://www.volcengine.com/docs/82379/1158281"""
    top_p: Optional[float] = 0.8
    """Total probability mass of tokens to consider at each step."""
    temperature: Optional[float] = 0.95
    """A non-negative float that tunes the degree of randomness in generation."""