public final class AsynchronousApi<ParamT extends HalfDuplexParamBase> extends Object
| 构造器和说明 |
|---|
AsynchronousApi()
Create default http client.
|
AsynchronousApi(ConnectionOptions connectionOptions)
Create custom http client
|
| 限定符和类型 | 方法和说明 |
|---|---|
DashScopeResult |
asyncCall(ParamT param,
ServiceOption serviceOption)
Call async interface and return async task info.
|
DashScopeResult |
call(ParamT param,
ServiceOption serviceOption)
Call the server to get the whole result.
|
DashScopeResult |
cancel(DashScopeResult taskInfo,
String apiKey,
String baseUrl) |
DashScopeResult |
cancel(String taskId,
String apiKey,
String baseUrl) |
DashScopeResult |
fetch(DashScopeResult taskInfo,
String apiKey,
String baseUrl) |
DashScopeResult |
fetch(String taskId,
String apiKey,
String baseUrl)
Get the async task information, if the is completed will return the result, otherwise return
task status.
|
DashScopeResult |
fetch(String taskId,
String apiKey,
String baseUrl,
Map<String,String> customHeaders)
Get the async task information, if the is completed will return the result, otherwise return
task status.
|
String |
getTaskId(DashScopeResult task) |
DashScopeResult |
list(AsyncTaskListParam param,
String baseUrl) |
DashScopeResult |
list(String startTime,
String endTime,
String modelName,
String apiKeyId,
String region,
String status,
Integer pageNo,
Integer pageSize,
String baseUrl) |
DashScopeResult |
wait(DashScopeResult taskInfo,
String apiKey,
String baseUrl) |
DashScopeResult |
wait(String taskId,
String apiKey,
String baseUrl)
Wait for async task completed and return task result.
|
DashScopeResult |
wait(String taskId,
String apiKey,
String baseUrl,
Map<String,String> customHeaders)
Wait for async task completed and return task result.
|
public AsynchronousApi()
public AsynchronousApi(ConnectionOptions connectionOptions)
connectionOptions - The client option.public DashScopeResult call(ParamT param, ServiceOption serviceOption) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`.serviceOption - The service option.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult asyncCall(ParamT param, ServiceOption serviceOption) throws ApiException, NoApiKeyException
param - The input param, should be the subclass of `Param`serviceOption - The service option.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult wait(String taskId, String apiKey, String baseUrl, Map<String,String> customHeaders) throws ApiException, NoApiKeyException
taskId - The async task id.apiKey - The api-key.baseUrl - The base http url.customHeaders - The custom headers.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult wait(String taskId, String apiKey, String baseUrl) throws ApiException, NoApiKeyException
taskId - The async task id.apiKey - The api-key.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult wait(DashScopeResult taskInfo, String apiKey, String baseUrl) throws ApiException, NoApiKeyException
public DashScopeResult fetch(String taskId, String apiKey, String baseUrl, Map<String,String> customHeaders) throws ApiException, NoApiKeyException
taskId - The async task id.apiKey - The api key.baseUrl - The base http url.customHeaders - The custom headers.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult fetch(String taskId, String apiKey, String baseUrl) throws ApiException, NoApiKeyException
taskId - The async task id.apiKey - The api key.NoApiKeyException - Can not find api keyApiException - The request failed, possibly due to a network or data error.public DashScopeResult fetch(DashScopeResult taskInfo, String apiKey, String baseUrl) throws ApiException, NoApiKeyException
public DashScopeResult cancel(String taskId, String apiKey, String baseUrl) throws ApiException, NoApiKeyException
public DashScopeResult cancel(DashScopeResult taskInfo, String apiKey, String baseUrl) throws ApiException, NoApiKeyException
public DashScopeResult list(AsyncTaskListParam param, String baseUrl) throws ApiException, NoApiKeyException
public DashScopeResult list(String startTime, String endTime, String modelName, String apiKeyId, String region, String status, Integer pageNo, Integer pageSize, String baseUrl) throws ApiException, NoApiKeyException
public String getTaskId(DashScopeResult task)
Copyright © 2024. All rights reserved.