MoonshotCommon#

class langchain_community.llms.moonshot.MoonshotCommon[source]#

Bases: BaseModel

Common parameters for Moonshot LLMs.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param base_url: str = 'https://api.moonshot.cn/v1'#
param client: Any [Required]#
param max_tokens: int = 1024#

Maximum number of tokens to generate.

param model_name: str = 'moonshot-v1-8k' (alias 'model')#

Model name. Available models listed here: https://platform.moonshot.cn/pricing

param moonshot_api_key: SecretStr | None = None (alias 'api_key')#

Moonshot API key. Get it here: https://platform.moonshot.cn/console/api-keys

param temperature: float = 0.3#

Temperature parameter (higher values make the model more creative).

classmethod validate_environment(values: Dict) Dict[source]#

Validate that api key and python package exists in environment.

Parameters:

values (Dict)

Return type:

Dict