GenerationConfig interface

内容相关请求的配置选项

签名

export interface GenerationConfig 

属性

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

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;