feat(api): 支持 88code 所有镜像站并智能构造 API URL #28
Merged
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.
改动说明
本 PR 优化了 88code 镜像站的支持,提升了 API 配置的灵活性。
主要改动
移除硬编码域名
88code.org和88code.ai硬编码"88code"匹配所有 88code 镜像站88code.wu.ren、88code.ai、88code.org等所有镜像智能 URL 构造
ANTHROPIC_BASE_URL的不同格式自动构造正确的 API 路径/api结尾 →/api/usage/v1结尾 →/api/usage/api/usage自动推断 subscription_url
usage_url和subscription_url使用同一域名测试
https://www.88code.ai/api配置https://88code.wu.ren/api配置影响范围
src/api/mod.rs、src/core/segments/byebyecode_usage.rs、src/core/segments/byebyecode_subscription.rs相关 Issue
解决了使用非官方 88code 镜像站时无法正确识别的问题。