Skip to content

Conversation

@xiaochen-zhou
Copy link
Contributor

@xiaochen-zhou xiaochen-zhou commented Feb 23, 2025

Purpose of this pull request

Zhipu AI has launched Vector mode: Embedding-2 and Embedding-3, and Chat model: GLM series. Some well-known AI applications, such as Vanna, have already integrated Zhipu models.

image

Does this PR introduce any user-facing change?

yes

How was this patch tested?

add new tests

Check list

List<List<Float>> vectors = batchProcess(fields, singleVectorizedInputNumber);
for (List<Float> vector : vectors) {
result.add(BufferUtils.toByteBuffer(vector.toArray(new Float[0])));
List<List<Double>> vectors = batchProcess(fields, singleVectorizedInputNumber);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Only one question is why change this type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Only one question is why change this type?

In some models, such as the official SDK provided by Zhipu, the type returned after embedding is Double. Therefore, I think our current use of Float may not meet the requirements

image

Copy link
Member

@liunaijie liunaijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @xiaochen-zhou !

@hailin0 hailin0 merged commit 51ffc5a into apache:dev Feb 25, 2025
3 checks passed
@xiaochen-zhou xiaochen-zhou deleted the embedding_zhipu branch March 5, 2025 00:13
@davidzollo
Copy link
Contributor

@xiaochen-zhou ,good job.
Would you like to write an artice for SeaTunnel community to introduce this feature? Please feel free to contact me(Linkedin | WeChat: davidzollo) if you're interested in doing it

xiaochen-zhou added a commit to TongchengOpenSource/seatunnel that referenced this pull request Jul 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants