Open
Conversation
- 新增 GROK_MODEL 环境变量支持(优先级:env > config.json > 默认值) - 自动检测 API 平台类型(xAI / OpenRouter / Generic) - OpenRouter :online 后缀启用原生实时搜索 - 解析 annotations 提取真实来源引用 - online 模式使用精简 system prompt Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- 新增多平台支持章节(OpenRouter / xAI / Generic) - 更新安装示例包含 GROK_MODEL 配置 - 新增环境变量说明表格 - 新增 OpenRouter :online 使用指南 - 新增常见问题(搜索不准确、平台支持、:online 后缀) Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Author
|
解决 openrouter 的 grok 模型不会调用 web search tool 问题 #13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GROK_API_URL自动识别 xAI 官方 / OpenRouter / 通用 OpenAI 兼容平台GROK_MODEL环境变量支持,OpenRouter 用户可通过:online后缀启用原生实时搜索GROK_PROVIDER环境变量,支持手动指定平台类型online_search_prompt/online_fetch_prompt),避免冗余指令干扰原生搜索能力Changes
src/grok_search/config.pygrok_model属性新增环境变量GROK_MODEL优先级(环境变量 > 配置文件 > 默认值)provider_type属性:自动检测或手动指定平台类型(xai/openrouter/generic)is_online_model属性:检测模型是否带:online后缀GROK_PROVIDER和GROK_ONLINE_SEARCH字段src/grok_search/providers/grok.pysearch()和fetch()方法根据is_online_model动态选择 system prompt_parse_streaming_response()新增 annotations 收集逻辑_append_citations()静态方法,将url_citation类型的 annotations 格式化为 Markdown 引用列表src/grok_search/utils.pyonline_search_prompt:面向有原生搜索能力的模型,输出纯 JSON 数组online_fetch_prompt:面向有原生抓取能力的模型,返回结构化 Markdown文档
README.md/docs/README_EN.md:新增多平台支持章节、环境变量说明表、OpenRouter 配置示例、FAQ