GenerationConfig interface

内容相关请求的配置选项

签名

export interface GenerationConfig 

属性

属性 类型 说明
candidateCount number
frequencyPenalty number
maxOutputToken number
在线状态惩罚 number
responseMimeType string 生成的候选文本的输出响应 MIME 类型。支持的 mime 类型包括 text/plain(默认,文本输出)和 application/json(候选项中的 JSON 响应)。需要提示模型输出适当的响应类型,否则行为将处于未定义状态。这是预览版功能。
stopSequence 字符串[]
温度 number
topK number
topP number

GenerationConfig.candidateCount

签名

candidateCount?: number;

GenerationConfig.frequencyPenalty

签名

frequencyPenalty?: number;

GenerationConfig.maxOutputTokens

签名

maxOutputTokens?: number;

GenerationConfig.presencePenalty

签名

presencePenalty?: number;

GenerationConfig.responseMimeType

生成的候选文本的输出响应 MIME 类型。支持的 mime 类型包括 text/plain(默认,文本输出)和 application/json(候选项中的 JSON 响应)。需要提示模型输出适当的响应类型,否则行为将处于未定义状态。这是预览版功能。

签名

responseMimeType?: string;

GenerationConfig.stopSequences

签名

stopSequences?: string[];

GenerationConfig.temperature

签名

temperature?: number;

GenerationConfig.topK

签名

topK?: number;

GenerationConfig.topP

签名

topP?: number;