feat(vertex): support OpenAI-compatible embeddings - #1
Open
jerry-airjelly wants to merge 3 commits into
Open
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.
Important
📝 变更描述 / Description
为 Vertex AI 渠道补充 OpenAI-compatible
/v1/embeddings支持。请求会转换为 Vertex:predict的instances格式,响应会转回 OpenAIdata[]格式,并传递 prompt token usage。实现对当前 Vertex
:predict能力保持明确边界:仅接受单个非空文本输入,验证encoding_format和dimensions,并在上游响应数量与请求不一致时返回带归因的错误。上游已有 QuantumNous#4640 尝试解决同一能力缺口。本 PR 是基于当前
main的替代实现,区别是将 Vertex request/response DTO 和转换边界放在 Vertex adaptor 中,并提供针对单输入、维度、usage 和无效响应的确定性回归测试,供维护者比较。🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
go test ./relay/channel/vertexGOWORK=off go test ./...