You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "xiaochen-zhou (via GitHub)" <gi...@apache.org> on 2025/02/23 03:37:02 UTC

[PR] [Feature][Transform-v2] Add support for Zhipu AI in Embedding and LLM module [seatunnel]

xiaochen-zhou opened a new pull request, #8790:
URL: https://github.com/apache/seatunnel/pull/8790

   
   
   ### 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.
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   yes
   
   ### How was this patch tested?
   
   add new tests
   
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
   * [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Transform-v2] Add support for Zhipu AI in Embedding and LLM module [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #8790:
URL: https://github.com/apache/seatunnel/pull/8790#issuecomment-2769564527

   @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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Transform-v2] Add support for Zhipu AI in Embedding and LLM module [seatunnel]

Posted by "xiaochen-zhou (via GitHub)" <gi...@apache.org>.
xiaochen-zhou commented on code in PR #8790:
URL: https://github.com/apache/seatunnel/pull/8790#discussion_r1966970410


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/nlpmodel/embedding/remote/AbstractModel.java:
##########
@@ -42,23 +42,23 @@ protected AbstractModel(Integer singleVectorizedInputNumber) {
     public List<ByteBuffer> vectorization(Object[] fields) throws IOException {
         List<ByteBuffer> result = new ArrayList<>();
 
-        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);

Review Comment:
   > 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](https://github.com/user-attachments/assets/afc74922-1f0d-4e09-9951-d6b7a71ae8bb)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Transform-v2] Add support for Zhipu AI in Embedding and LLM module [seatunnel]

Posted by "liunaijie (via GitHub)" <gi...@apache.org>.
liunaijie commented on code in PR #8790:
URL: https://github.com/apache/seatunnel/pull/8790#discussion_r1966960501


##########
seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/nlpmodel/embedding/remote/AbstractModel.java:
##########
@@ -42,23 +42,23 @@ protected AbstractModel(Integer singleVectorizedInputNumber) {
     public List<ByteBuffer> vectorization(Object[] fields) throws IOException {
         List<ByteBuffer> result = new ArrayList<>();
 
-        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);

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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][Transform-v2] Add support for Zhipu AI in Embedding and LLM module [seatunnel]

Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 merged PR #8790:
URL: https://github.com/apache/seatunnel/pull/8790


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org