public class ChatApiService extends Object
| 构造器和说明 |
|---|
ChatApiService(ChatApi api)
Creates a new ChatApiService that wraps ChatApi.
|
ChatApiService(ChatApi api,
ExecutorService executorService)
Creates a new ChatApiService that wraps ChatApi.
|
ChatApiService(String token)
Creates a new ChatApiService that wraps ChatApi
|
ChatApiService(String token,
java.time.Duration timeout)
Creates a new ChatApiService that wraps ChatApi
|
| 限定符和类型 | 方法和说明 |
|---|---|
ChatCompletionResult |
createChatCompletion(Map<String,Object> request) |
ChatCompletionAsyncResult |
createChatCompletionAsync(Map<String,Object> request) |
EmbeddingResult |
createEmbeddings(EmbeddingRequest request) |
FineTuningJob |
createFineTuningJob(FineTuningJobRequest request) |
ImageResult |
createImage(Map<String,Object> request) |
static okhttp3.OkHttpClient |
defaultClient(String token,
java.time.Duration timeout) |
static com.fasterxml.jackson.databind.ObjectMapper |
defaultObjectMapper() |
static retrofit2.Retrofit |
defaultRetrofit(okhttp3.OkHttpClient client,
com.fasterxml.jackson.databind.ObjectMapper mapper) |
static <T> T |
execute(io.reactivex.Single<T> apiCall) |
FineTuningEvent |
listFineTuningJobEvents(String fineTuningJobId,
Integer limit,
String after) |
io.reactivex.Flowable<ChatMessageAccumulator> |
mapStreamToAccumulator(io.reactivex.Flowable<ModelData> flowable) |
ChatCompletionResult |
queryAsyncResult(String id) |
QueryFileResult |
queryFileList(QueryFilesRequest queryFilesRequest) |
PersonalFineTuningJob |
queryPersonalFineTuningJobs(Integer limit,
String after) |
FineTuningJob |
retrieveFineTuningJob(String fineTuningJobId,
Integer limit,
String after) |
static io.reactivex.Flowable<SSE> |
stream(retrofit2.Call<okhttp3.ResponseBody> apiCall) |
static io.reactivex.Flowable<SSE> |
stream(retrofit2.Call<okhttp3.ResponseBody> apiCall,
boolean emitDone) |
io.reactivex.Flowable<ModelData> |
streamChatCompletion(Map<String,Object> request) |
File |
uploadFile(String purpose,
String filepath) |
public ChatApiService(String token)
public ChatApiService(String token, java.time.Duration timeout)
token - timeout - http read timeout, Duration.ZERO means no timeoutpublic ChatApiService(ChatApi api)
api - ChatApi instance to use for all methodspublic ChatApiService(ChatApi api, ExecutorService executorService)
Use this if you need more customization.
api - ChatApi instance to use for all methodsexecutorService - the ExecutorService from client.dispatcher().executorService()public static <T> T execute(io.reactivex.Single<T> apiCall)
public io.reactivex.Flowable<ModelData> streamChatCompletion(Map<String,Object> request)
public ChatCompletionAsyncResult createChatCompletionAsync(Map<String,Object> request)
public ChatCompletionResult createChatCompletion(Map<String,Object> request)
public EmbeddingResult createEmbeddings(EmbeddingRequest request)
public QueryFileResult queryFileList(QueryFilesRequest queryFilesRequest)
public FineTuningEvent listFineTuningJobEvents(String fineTuningJobId, Integer limit, String after)
public FineTuningJob retrieveFineTuningJob(String fineTuningJobId, Integer limit, String after)
public PersonalFineTuningJob queryPersonalFineTuningJobs(Integer limit, String after)
public ChatCompletionResult queryAsyncResult(String id)
public ImageResult createImage(Map<String,Object> request)
public FineTuningJob createFineTuningJob(FineTuningJobRequest request)
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 com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()
public static okhttp3.OkHttpClient defaultClient(String token, java.time.Duration timeout)
public static retrofit2.Retrofit defaultRetrofit(okhttp3.OkHttpClient client,
com.fasterxml.jackson.databind.ObjectMapper mapper)
public io.reactivex.Flowable<ChatMessageAccumulator> mapStreamToAccumulator(io.reactivex.Flowable<ModelData> flowable)
Copyright © 2024. All rights reserved.