GenerationConfig: {
    frequency_penalty?: number;
    image_config?: ImageConfig;
    max_output_tokens?: number;
    presence_penalty?: number;
    seed?: number;
    speech_config?: SpeechConfig[];
    stop_sequences?: string[];
    temperature?: number;
    thinking_level?: ThinkingLevel;
    thinking_summaries?: ThinkingSummaries;
    tool_choice?: ToolChoiceType | ToolChoiceConfig;
    top_p?: number;
}

Configuration parameters for model interactions.

Type declaration

  • Optionalfrequency_penalty?: number

    Penalizes tokens based on their frequency in the generated text.

    A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].

  • Optionalimage_config?: ImageConfig

    The configuration for image interaction.

    field: This will be removed in a future release, please migrate away from it as soon as possible.

  • Optionalmax_output_tokens?: number

    The maximum number of tokens to include in the response.

  • Optionalpresence_penalty?: number

    Penalizes tokens that have already appeared in the generated

    text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].

  • Optionalseed?: number

    Seed used in decoding for reproducibility.

  • Optionalspeech_config?: SpeechConfig[]

    Configuration for speech interaction.

  • Optionalstop_sequences?: string[]

    A list of character sequences that will stop output interaction.

  • Optionaltemperature?: number

    Controls the randomness of the output.

  • Optionalthinking_level?: ThinkingLevel
  • Optionalthinking_summaries?: ThinkingSummaries
  • Optionaltool_choice?: ToolChoiceType | ToolChoiceConfig

    The tool choice configuration.

  • Optionaltop_p?: number

    The maximum cumulative probability of tokens to consider when sampling.