feat(ai): 新增 Requesty 模型服务预设 - #159
Closed
Thibaultjaigu wants to merge 1 commit into
Closed
Thibaultjaigu wants to merge 1 commit into
Thibaultjaigu wants to merge 1 commit into
Conversation
与 OpenRouter 相同,使用 OpenAI 兼容接口 https://router.requesty.ai/v1,从上游 /models 获取模型列表。同步更新 provider 校验、设置页展示、预设测试与文档。
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.
概要
在「新增服务」中增加 Requesty 预设。Requesty 是 OpenAI 兼容的多模型聚合服务,接入方式与现有的 OpenRouter 预设完全一致,只是新增一项预设,不改动任何调用、推理参数或模型目录逻辑。
改动
src/wechat_decrypt_tool/ai/providers.py:在 OpenRouter 后新增预设,地址https://router.requesty.ai/v1,协议openaisrc/wechat_decrypt_tool/ai/schemas.py:ProviderInput.provider允许requestyfrontend/components/AiSettings.vue:providerPresentation增加 Requesty 的说明文字,与 OpenRouter 一致tests/test_ai_api.py:预设数量与名单更新为 16 项docs/chat-ai.md:预设列表加入 Requesty模型列表沿用通用的
GET /v1/models,与 OpenRouter 相同,无需额外代码。推理参数走默认的reasoning_effort(Requesty 原生支持),所以model_reasoning.py未改动。lobehub 图标库里没有 Requesty 图标,因此没有新增图标和配色,界面上会显示默认的插头图标;如需图标我可以补上。测试方法
openai/gpt-4o-mini等模型后保存验证
uv run pytest tests/test_ai*.py:648 passednpx vitest run(frontend):28 个文件,388 passed,其中ai-presets.test.js会自动覆盖新预设的预填、拉取模型与保存流程ModelService实测:拉取模型列表返回 762 个模型,使用openai/gpt-4o-mini对话调用成功Disclosure: I work at Requesty. Happy to adjust anything to match project conventions.