-
Notifications
You must be signed in to change notification settings - Fork 1.9k
optimize ZhiPu Embedding to support batch embedding. #4308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize ZhiPu Embedding to support batch embedding. #4308
Conversation
- support batch embedding - Make test adjustments based on the official demo Signed-off-by: YuJie Wan <[email protected]>
@mxsl-gr Could you help with the review of this PR? Thanks |
No problem, I’ve been busy with other tasks. I’ll review it later today. |
|
||
EmbeddingRequest embeddingRequest = buildEmbeddingRequest(request); | ||
var zhipuEmbeddingRequest = zhipuEmbeddingRequest(embeddingRequest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unnecessary. It might be cleaner to handle it in buildEmbeddingRequest
instead of wrapping it with another request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unnecessary. It might be cleaner to handle it in
buildEmbeddingRequest
instead of wrapping it with another request.
Influenced by the EmbeddingModelObservationContext, its context requirement mandates the use of org.springframework.ai.embedding.EmbeddingRequest
;
However, the ZhiPu API uses ZhiPuAiApi.EmbeddingRequest, so they cannot be directly integrated into a single method.
so, I try to adjusting the order of the code to improve its readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you‘re right, I really forgot about that. I think that works too.
Signed-off-by: YuJie Wan <[email protected]>
Fixes: #4232