Interface defining the input to the MoonshotChatInput class.

interface ChatMoonshotParams {
    model: ModelName;
    modelName: ModelName;
    apiKey?: string;
    frequencyPenalty?: number;
    maxTokens?: number;
    messages?: MoonshotMessage[];
    moonshotApiKey?: string;
    n?: number;
    presencePenalty?: number;
    stop?: string[];
    streaming?: boolean;
    temperature?: number;
    topP?: number;
}

Implemented by

Properties

model: ModelName

Default

"moonshot-v1-8k"
modelName: ModelName

Default

"moonshot-v1-8k" Alias for model

apiKey?: string

API key to use when making requests. Defaults to the value of Moonshot_API_KEY environment variable.

frequencyPenalty?: number

Frequency penalty, a number between -2.0 and 2.0. Positive values ​penalize the newly generated words based on their existing frequency in the text, making the model less likely to repeat the same words verbatim. The default value is 0

maxTokens?: number

max value is 8192,defaults to 1024

messages?: MoonshotMessage[]

Messages to pass as a prefix to the prompt

moonshotApiKey?: string

API key to use when making requests. Defaults to the value of Moonshot_API_KEY environment variable. Alias for apiKey

n?: number

The default value is 1 and cannot be greater than 5. In particular, when temperature is very small and close to 0, we can only return 1 result. If n is already set and > 1, Moonshot will return an invalid input parameter (invalid_request_error).

presencePenalty?: number

There is a penalty, a number between -2.0 and 2.0. Positive values ​​penalize the newly generated words based on whether they appear in the text, increasing the likelihood that the model will discuss new topics. The default value is 0

stop?: string[]
streaming?: boolean

Whether to stream the results or not. Defaults to false.

temperature?: number

Amount of randomness injected into the response. Ranges from 0 to 1 (0 is not included). Use temp closer to 0 for analytical / multiple choice, and temp closer to 1 for creative and generative tasks. Defaults to 0.95

topP?: number

Total probability mass of tokens to consider at each step. Range from 0 to 1 Defaults to 0.7

Generated using TypeDoc