[Feature] Gemini 原生搜索:返回引用来源,并在配置提示中说明 Google 的展示条款
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend, documentation
Línea de trabajo
Start with astrbot/core/provider/sources/gemini_source.py, especially _process_content_parts, and the gm_native_search configuration hint in astrbot/core/config/default.py; read the linked Gemini terms and issue #9728 for the existing source field and card. Decide how to display both grounding sources and Search Suggestions across chat platforms, including the stated audience restriction, then update the implementation, configuration hint, and documentation to match that decision.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
功能描述
开启 gm_native_search 后,适配器会在请求里加上 google_search 工具(gemini_source.py#L252-L253),但解析响应时只读取 candidate.content.parts(_process_content_parts),candidate.grounding_metadata 被整个丢弃,仓库中没有任何读取它的代码。结果是:
- 回复里没有来源链接(
grounding_chunks[].web的uri、title),用户无法核查答案; - Search Suggestions(
search_entry_point.rendered_content)也被丢弃。
Gemini API 附加条款对 Grounding with Google Search 的要求:
You will only use Grounding with Google Search in an application that is owned and operated by you and will only display the Grounded Results with the associated Search Suggestion(s) to the end user who submitted the prompt.
Unless permitted by Google in writing, you: (1) will not modify, or intersperse any other content with, the Grounded Results or Search Suggestions; ...
AstrBot 常见的用法是在 QQ 群等聊天平台里回复:群里所有人都能看到回复,平台也渲染不了 Search Suggestions 的 HTML/CSS。按现在的实现,在群聊里开启这个开关无法满足上述条款,但配置提示只写了"启用后所有函数工具将全部失效,免费次数限制请查阅官方文档"(default.py#L2623),没有提到这一点。
建议
- 加个开关决定是否解析
grounding_metadata.grounding_chunks,把来源(标题和原始链接)附在回复里。#9728 为 xAI 新增了LLMResponse.web_search_sources和来源卡片,如果合并 Gemini 可以复用同一字段。 - 在
gm_native_search的配置提示和文档里写明条款限制:结果只能展示给提问者本人,并须同时展示 Search Suggestions;群聊场景得说明。 - 需要决定的是:在渲染不了 HTML 的平台上如何处理 Search Suggestions,例如只在 WebUI 渲染,或在群聊中禁用原生搜索。
使用场景
- 用 Gemini 原生搜索回答新闻、版本号等时效性问题时,用户需要知道来源才能判断答案是否可靠。
- 部署者在开启前需要知道:在群聊使用原生搜索与可能与 Google 条款冲突。
检查清单
- Lenguaje dominante
- Python
- Estrellas
- 46.4k
- Forks
- 3.4k
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 120
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AstrBotDevs/AstrBot
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
AstrBotDevs/AstrBot#11038 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
AstrBotDevs/AstrBot#11034 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
AstrBotDevs/AstrBot#10999 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] OpenAI-compatible Gemini 工具 schema const 导致 400Posiblemente ocupada @arccat-114 la tomó hace 17 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
AstrBotDevs/AstrBot#10720 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug] Discord slash command sync aborts with KeyError when a plugin handler is defined in a submodulePosiblemente ocupada @yuexia5 la tomó hace 21 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
AstrBotDevs/AstrBot#10626 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de AstrBotDevs/AstrBot
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bytedance/agentkit-samples#277 ·
-
ai-driven-fuzzing bug claude Minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
-
Edit: TVS Encarnacion [PY]Abiertochannels:edit check:passed
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
[Bug] The blue-green mitigation strategy lists catalog names and views before the source tablesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
aws-samples/sample-aws-genai-db-modernizer#2097 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día