MetaGLM / zhipuai-sdk-java-v4

68 stars 14 forks source link

UploadFileRequest for Batch Purpose Receive retrofit2.adapter.rxjava2.HttpException: HTTP 400 #27

Open allen6432 opened 5 days ago

allen6432 commented 5 days ago

UploadFileRequest request = UploadFileRequest.builder() .purpose("batch") .filePath(resource.getFile().getAbsolutePath()) .build();

Embedding file: {"custom_id": "request-1", "method": "POST", "url": "/v4/embeddings", "body": {"model": "embedding-2", "input": "hello"}}

error log: HTTP 400 retrofit2.adapter.rxjava2.HttpException: HTTP 400 at app//retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:57) at app//retrofit2.adapter.rxjava2.BodyObservable$BodyObserver.onNext(BodyObservable.java:38) at app//retrofit2.adapter.rxjava2.CallExecuteObservable.subscribeActual(CallExecuteObservable.java:48) at app//io.reactivex.Observable.subscribe(Observable.java:12284) at app//retrofit2.adapter.rxjava2.BodyObservable.subscribeActual(BodyObservable.java:35) at app//io.reactivex.Observable.subscribe(Observable.java:12284) at app//io.reactivex.internal.operators.observable.ObservableSingleSingle.subscribeActual(ObservableSingleSingle.java:35) at app//io.reactivex.Single.subscribe(Single.java:3666) at app//io.reactivex.Single.blockingGet(Single.java:2869) at app//com.zhipu.oapi.service.v4.api.ChatApiService.execute(ChatApiService.java:79) at app//com.zhipu.oapi.service.v4.api.ChatApiService.uploadFile(ChatApiService.java:222) at app//com.zhipu.oapi.ClientV4.invokeUploadFileApi(ClientV4.java:329)

allen6432 commented 5 days ago

The api is fine when I update the purpose field to "fine-tune" and jsonl file to following

"{"messages": [{"role": "system", "content": "你是一位乐于助人,知识渊博的全能AI助手。"},{"role": "user", "content": "请介绍一下AlphaGo的基本原理。"}, {"role": "assistant", "content": "AlphaGo利用深度神经网络与树搜索算法相结合,通过对弈数据进行训练,逐步提升游戏水平,能够对围棋局面进行判断并选择最佳落子位置。"}]} "

allen6432 commented 5 days ago

It seems the api failed after July 1st.

image