Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/adapter-gemini/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface Config extends ChatLunaPlugin.Config {
codeExecution: boolean
urlContext: boolean
imageGeneration: boolean
agenticVideo: boolean
imageModelSearch: boolean
thinkingBudget: number
includeThoughts: boolean
Expand Down Expand Up @@ -123,15 +124,15 @@ export const Config: Schema<Config> = Schema.intersect([
imageModelSearch: Schema.boolean().default(false),
groundingContentDisplay: Schema.boolean().default(false),
imageGeneration: Schema.boolean().default(false),
agenticVideo: Schema.boolean().default(false),
useCamelCaseSystemInstruction: Schema.boolean().default(false),
useCamelCaseMediaFields: Schema.boolean().default(false),
nonStreaming: Schema.boolean().default(false)
})
]).i18n({
'zh-CN': require('./locales/zh-CN.schema.yml'),
'en-US': require('./locales/en-US.schema.yml')
// eslint-disable-next-line @typescript-eslint/no-explicit-any
}) as any
}) as Schema<Config>

export const usage = `
## Gemini 适配器说明
Expand Down
5 changes: 3 additions & 2 deletions packages/adapter-gemini/src/locales/en-US.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ $inner:
thinkingBudget: 'Thinking budget (-1-24576). (0: dynamic thinking) Higher: more tokens spent on thinking. Currently only supports `gemini-2.5` series models.'
groundingContentDisplay: 'Enable display of search results'
imageGeneration: 'Enable image generation (only for `gemini-*-image-*` and `gemini-2.5-flash-image-preview` model)'
agenticVideo: 'Enable on-demand video analysis. The model selects segments to examine, reducing long-video input costs. It may miss the overall context of short videos and respond more slowly. Supports Gemini 3.5 Flash Lite and Gemini 3.6, 3.7 and 3.8 Flash.'
imageModelSearch: 'Enable search for image generation models. When enabled, supported image models will generate additional variants with a `-search` suffix (e.g. `gemini-3-pro-image-search`).'
includeThoughts: 'Enable retrieval of model thoughts'
codeExecution: 'Enable code execution tool'
urlContext: 'Enable URL context retrieval tool'
useCamelCaseSystemInstruction: 'Use camelCase systemInstruction instead of snake_case system_instruction'
useCamelCaseMediaFields: 'Use camelCase inlineData and mimeType instead of snake_case inline_data and mime_type'
useCamelCaseSystemInstruction: 'Use camelCase field names such as systemInstruction for compatibility with third-party APIs.'
useCamelCaseMediaFields: 'Use camelCase media fields such as inlineData, mimeType and mediaProcessing for compatibility with third-party APIs.'
nonStreaming: 'Force disable streaming response. When enabled, requests will always be made in non-streaming mode, even if the stream parameter is configured.'
5 changes: 3 additions & 2 deletions packages/adapter-gemini/src/locales/zh-CN.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ $inner:
temperature: '回复的随机性程度,数值越高,回复越随机(范围:0~2)。'
googleSearch: '为模型启用谷歌搜索。'
imageGeneration: '为模型启用图像生成。目前仅支持 `gemini-*-image-*` 和 `gemini-2.5-flash-image-preview` 模型。'
agenticVideo: '为视频输入启用 Agentic 视频理解功能。开启后,模型可以挑选音频/视频片段查看,或仅查看视频的音频转录文本,减少长视频的输入费用。在需要查看高速片段时,还能提高片段的采样帧率。此功能可能导致模型忽略视频的整体内容,并增加回复延迟。目前仅支持 Gemini 3.5 Flash Lite 和 Gemini 3.6、3.7、3.8 Flash。'
thinkingBudget: '思考预算,范围:(-1~24576),设置的数值越大,思考时花费的 Token 越多,-1 为动态思考。目前仅支持 gemini 2.5 系列模型。'
groundingContentDisplay: '是否显示谷歌搜索结果。'
imageModelSearch: '为图片生成模型启用搜索功能。开启后,支持搜索的图片模型将额外生成带 `-search` 后缀的变体(如 `gemini-3-pro-image-search`)。'
includeThoughts: '是否获取模型的思考内容。'
codeExecution: '为模型启用代码执行工具。'
urlContext: '为模型启用 URL 内容获取工具。'
useCamelCaseSystemInstruction: 使用大写的 systemInstruction 而不是小写的 system_instruction
useCamelCaseMediaFields: 使用大写的 inlineData 和 mimeType,而不是小写的 inline_data 和 mime_type
useCamelCaseSystemInstruction: '使用 systemInstruction 等驼峰字段名,兼容部分第三方接口。'
useCamelCaseMediaFields: '媒体请求使用 inlineData、mimeType、mediaProcessing 等驼峰字段名,兼容部分第三方接口。'
nonStreaming: 强制不启用流式返回。开启后,将总是以非流式发起请求,即便配置了 stream 参数。
Loading
Loading