public class ArkService extends ArkBaseService implements ArkBaseServiceImpl
| Modifier and Type | Class and Description |
|---|---|
static class |
ArkService.Builder |
BASE_REGION, BASE_URL, DEFAULT_CONNECT_TIMEOUT, DEFAULT_RETRY_TIMES, DEFAULT_TIMEOUT| Constructor and Description |
|---|
ArkService(ArkApi api) |
ArkService(ArkApi api,
ExecutorService executorService) |
ArkService(String apiKey) |
ArkService(String apiKey,
Duration timeout) |
ArkService(String ak,
String sk) |
ArkService(String ak,
String sk,
Duration timeout) |
| Modifier and Type | Method and Description |
|---|---|
static ArkService.Builder |
builder() |
ChatCompletionResult |
createChatCompletion(ChatCompletionRequest request) |
ChatCompletionResult |
createChatCompletion(ChatCompletionRequest request,
Map<String,String> customHeaders) |
CreateContextResult |
createContext(CreateContextRequest request) |
CreateContextResult |
createContext(CreateContextRequest request,
Map<String,String> customHeaders) |
ChatCompletionResult |
createContextChatCompletion(ContextChatCompletionRequest request) |
ChatCompletionResult |
createContextChatCompletion(ContextChatCompletionRequest request,
Map<String,String> customHeaders) |
static okhttp3.OkHttpClient |
defaultApiKeyClient(String apiKey,
Duration timeout) |
static com.fasterxml.jackson.databind.ObjectMapper |
defaultObjectMapper() |
static okhttp3.OkHttpClient |
defaultResourceStsClient(String ak,
String sk,
Duration timeout,
String region) |
static retrofit2.Retrofit |
defaultRetrofit(okhttp3.OkHttpClient client,
com.fasterxml.jackson.databind.ObjectMapper mapper,
String baseUrl) |
static <T> T |
execute(io.reactivex.Single<T> apiCall) |
void |
shutdownExecutor() |
static io.reactivex.Flowable<SSE> |
stream(retrofit2.Call<okhttp3.ResponseBody> apiCall) |
static io.reactivex.Flowable<SSE> |
stream(retrofit2.Call<okhttp3.ResponseBody> apiCall,
boolean emitDone) |
static <T> io.reactivex.Flowable<T> |
stream(retrofit2.Call<okhttp3.ResponseBody> apiCall,
Class<T> cl) |
io.reactivex.Flowable<ChatCompletionChunk> |
streamChatCompletion(ChatCompletionRequest request) |
io.reactivex.Flowable<ChatCompletionChunk> |
streamChatCompletion(ChatCompletionRequest request,
Map<String,String> customHeaders) |
io.reactivex.Flowable<ChatCompletionChunk> |
streamContextChatCompletion(ContextChatCompletionRequest request) |
io.reactivex.Flowable<ChatCompletionChunk> |
streamContextChatCompletion(ContextChatCompletionRequest request,
Map<String,String> customHeaders) |
public ArkService(String apiKey)
public ArkService(ArkApi api)
public ArkService(ArkApi api, ExecutorService executorService)
public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()
public static okhttp3.OkHttpClient defaultApiKeyClient(String apiKey, Duration timeout)
public static okhttp3.OkHttpClient defaultResourceStsClient(String ak, String sk, Duration timeout, String region)
public static retrofit2.Retrofit defaultRetrofit(okhttp3.OkHttpClient client,
com.fasterxml.jackson.databind.ObjectMapper mapper,
String baseUrl)
public static <T> T execute(io.reactivex.Single<T> apiCall)
public static io.reactivex.Flowable<SSE> stream(retrofit2.Call<okhttp3.ResponseBody> apiCall)
public static io.reactivex.Flowable<SSE> stream(retrofit2.Call<okhttp3.ResponseBody> apiCall, boolean emitDone)
public static <T> io.reactivex.Flowable<T> stream(retrofit2.Call<okhttp3.ResponseBody> apiCall,
Class<T> cl)
public ChatCompletionResult createChatCompletion(ChatCompletionRequest request)
createChatCompletion in interface ArkBaseServiceImplpublic ChatCompletionResult createChatCompletion(ChatCompletionRequest request, Map<String,String> customHeaders)
public io.reactivex.Flowable<ChatCompletionChunk> streamChatCompletion(ChatCompletionRequest request)
streamChatCompletion in interface ArkBaseServiceImplpublic io.reactivex.Flowable<ChatCompletionChunk> streamChatCompletion(ChatCompletionRequest request, Map<String,String> customHeaders)
public CreateContextResult createContext(CreateContextRequest request)
createContext in interface ArkBaseServiceImplpublic CreateContextResult createContext(CreateContextRequest request, Map<String,String> customHeaders)
public ChatCompletionResult createContextChatCompletion(ContextChatCompletionRequest request)
createContextChatCompletion in interface ArkBaseServiceImplpublic ChatCompletionResult createContextChatCompletion(ContextChatCompletionRequest request, Map<String,String> customHeaders)
public io.reactivex.Flowable<ChatCompletionChunk> streamContextChatCompletion(ContextChatCompletionRequest request)
streamContextChatCompletion in interface ArkBaseServiceImplpublic io.reactivex.Flowable<ChatCompletionChunk> streamContextChatCompletion(ContextChatCompletionRequest request, Map<String,String> customHeaders)
public void shutdownExecutor()
public static ArkService.Builder builder()
Copyright © 2025. All rights reserved.