public class ChatGPT extends Object
| Modifier and Type | Field and Description |
|---|---|
private Api |
apiClient |
private String |
apiHost
自定义api host使用builder的方式构造client
|
private String |
apiKey
keys
|
private List<String> |
apiKeyList |
private okhttp3.OkHttpClient |
okHttpClient |
private Proxy |
proxy
okhttp 代理
|
private long |
timeout
超时 默认300
|
| Constructor and Description |
|---|
ChatGPT() |
private String apiKey
private String apiHost
private Api apiClient
private okhttp3.OkHttpClient okHttpClient
private long timeout
private Proxy proxy
public ChatGPT init()
public ChatCompletionResponse chatCompletion(ChatCompletion chatCompletion)
chatCompletion - 问答参数,即咨询的内容public ChatCompletionResponse chatCompletion(List<Message> messages)
messages - 问答参数,即咨询的内容public String chat(String message)
message - 问答参数,即咨询的内容public EmbeddingResult createEmbeddings(EmbeddingRequest request)
public EmbeddingResult createEmbeddings(String input, String user)
public ImagesRensponse imageGeneration(Generations generations)
public ImagesRensponse imageEdit(File image, File mask, Edits edits)
public ImagesRensponse imageVariation(File image, Variations variations)
public AudioResponse audioTranscription(File audio, Transcriptions transcriptions)
public InputStream audioSpeech(SpeechRequest speechRequest)
public AudioResponse audioTranslation(File audio, Transcriptions transcriptions)
@Deprecated public BigDecimal balance()
@Deprecated public static BigDecimal balance(String key)
@Deprecated public CreditGrantsResponse creditGrants()
public BaseResponse<FileResponse> listFiles()
public FileResponse uploadFile(String purpose, okhttp3.MultipartBody.Part file)
purpose - 文件用途
The purpose of the filefile - 文件部分
The file partpublic DeleteResponse deleteFile(String fileId)
fileId - 文件ID
The file IDpublic FileResponse retrieveFile(String fileId)
fileId - 文件ID
The file IDpublic okhttp3.ResponseBody retrieveFileContent(String fileId)
fileId - 文件ID
The file IDCopyright © 2024. All rights reserved.