Repository navigation
fix(cloudflare): 保留 embeddings 响应数据与 usage - #175
Merged
Merged
Conversation
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.
🔗 关联任务 / Related Issue
Closes #165
上游:b08ee86fe2a899dcf9060d8cde7858c93c2b770c(QuantumNous#8041)
🚀 变更类型 / Type of change
📝 变更描述 / Description
Cloudflare embeddings 原先进入聊天响应转换,导致向量数据丢失并覆盖上游 usage。改用现有 OpenAI handler,保留单条、批量、base64 embedding 和额外字段;缺失 usage 时沿用输入估算。
仅移植指定上游的两个文件,patch-id 与上游一致;保留 fork 既有兼容性用例。AI 辅助移植与验证,人工独立审查待完成。
📸 运行证明 / Proof of Work
仓库根目录执行:
仅加入回归测试、尚未修改 adaptor 时,4 个子用例全部失败,复现数据丢失及 usage 不匹配。
修复后执行:
结果:controller 所选测试全部通过;cloudflare 包编译通过(无独立测试);差异检查通过。未运行完整套件或真实 Cloudflare 网络请求;不涉及数据库行为、独立模块或认证修改。
✅ 提交前检查项 / Checklist