public final class SynchronizeHalfDuplexApi<ParamT extends HalfDuplexParamBase> extends Object
| 构造器和说明 |
|---|
SynchronizeHalfDuplexApi(ConnectionOptions connectionOptions,
ServiceOption serviceOptions)
Create custom client
|
SynchronizeHalfDuplexApi(ServiceOption serviceOptions)
Create default client, http or websocket.
|
| 限定符和类型 | 方法和说明 |
|---|---|
DashScopeResult |
call(ParamT param)
Call the server to get the whole result.
|
void |
call(ParamT param,
ResultCallback<DashScopeResult> callback)
Call the server to get the result in the callback function.
|
boolean |
close(int code,
String reason) |
io.reactivex.Flowable<DashScopeResult> |
streamCall(ParamT param)
Call the server to get the result by stream.
|
void |
streamCall(ParamT param,
ResultCallback<DashScopeResult> callback)
Call the server to get the result by stream.
|
public SynchronizeHalfDuplexApi(ServiceOption serviceOptions)
serviceOptions - The service option.public SynchronizeHalfDuplexApi(ConnectionOptions connectionOptions, ServiceOption serviceOptions)
connectionOptions - The client option.serviceOptions - The api service option.public DashScopeResult call(ParamT param) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `ConversationParam`.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public void call(ParamT param, ResultCallback<DashScopeResult> callback) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.callback - The callback to receive response, should be the subclass of `Result`.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public io.reactivex.Flowable<DashScopeResult> streamCall(ParamT param) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public void streamCall(ParamT param, ResultCallback<DashScopeResult> callback) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.callback - The result callback.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public boolean close(int code,
String reason)
Copyright © 2025. All rights reserved.