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 if the input data cannot be parsed to form a valid model.

param base_url: str = 'https://api.moonshot.cn/v1'#
param client: _MoonshotClient [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

Constraints:
  • type = string

  • writeOnly = True

  • format = password

param temperature: float = 0.3#

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