public class OpenAiClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
debug |
| Constructor and Description |
|---|
OpenAiClient() |
| Modifier and Type | Method and Description |
|---|---|
static OpenAiChatResponseVo |
chat(String prompt) |
static okhttp3.Response |
chatCompletions(Map<String,String> header,
String bodyString) |
static okhttp3.Call |
chatCompletions(Map<String,String> header,
String bodyString,
okhttp3.Callback callback) |
static OpenAiChatResponseVo |
chatCompletions(OpenAiChatRequestVo chatRequestVo) |
static okhttp3.Call |
chatCompletions(OpenAiChatRequestVo chatRequestVo,
okhttp3.Callback callback) |
static okhttp3.Response |
chatCompletions(String bodyString) |
static okhttp3.Call |
chatCompletions(String bodyString,
okhttp3.Callback callback) |
static OpenAiChatResponseVo |
chatCompletions(String model,
List<OpenAiChatMessage> messages) |
static okhttp3.Response |
chatCompletions(String uri,
Map<String,String> requestHeaders,
String bodyString) |
static okhttp3.Call |
chatCompletions(String apiPrefixUrl,
Map<String,String> requestHeaders,
String bodyString,
okhttp3.Callback callback) |
static OpenAiChatResponseVo |
chatCompletions(String model,
OpenAiChatMessage chatMessage) |
static OpenAiChatResponseVo |
chatCompletions(String apiKey,
OpenAiChatRequestVo chatRequestVo) |
static okhttp3.Response |
chatCompletions(String apiKey,
String bodyString) |
static OpenAiChatResponseVo |
chatCompletions(String model,
String systemPrompt,
List<OpenAiChatMessage> messages) |
static OpenAiChatResponseVo |
chatCompletions(String apiPerfixUrl,
String apiKey,
OpenAiChatRequestVo chatRequestVo) |
static okhttp3.Call |
chatCompletions(String serverUrl,
String apiKey,
OpenAiChatRequestVo chatRequestVo,
okhttp3.Callback callback) |
static okhttp3.Response |
chatCompletions(String apiPerfixUrl,
String apiKey,
String bodyString) |
static okhttp3.Call |
chatCompletions(String apiPerfixUrl,
String apiKey,
String bodyString,
okhttp3.Callback callback) |
static OpenAiChatResponseVo |
chatCompletions(String apiUrl,
String key,
String model,
List<OpenAiChatMessage> messages) |
static OpenAiChatResponseVo |
chatCompletions(String apiUrl,
String key,
String model,
OpenAiChatMessage chatMessage) |
static OpenAiChatResponseVo |
chatWithImage(String prompt,
byte[] bytes,
String suffix) |
static OpenAiChatResponseVo |
chatWithImage(String apiKey,
String prompt,
byte[] bytes,
String suffix) |
static OpenAiChatResponseVo |
chatWithImage(String apiKey,
String model,
String prompt,
byte[] bytes,
String suffix) |
static OpenAiChatResponseVo |
chatWithModel(String model,
String role,
String prompt) |
static OpenAiChatResponseVo |
chatWithModel(String apiUrl,
String key,
String model,
String role,
String prompt) |
static OpenAiChatResponseVo |
chatWithRole(String role,
String prompt) |
static float[] |
embeddingArray(String input) |
static float[] |
embeddingArray(String input,
String model) |
static float[] |
embeddingArray(String serverUrl,
String apiKey,
EmbeddingRequestVo reqVo) |
static float[] |
embeddingArray(String serverUrl,
String input,
String model) |
static float[] |
embeddingArray(String serverUrl,
String apiKey,
String input,
String model) |
static float[] |
embeddingArrayByLargeModel(String input) |
static EmbeddingResponseVo |
embeddings(EmbeddingRequestVo embeddingRequestVo) |
static okhttp3.Response |
embeddings(String bodyString) |
static EmbeddingResponseVo |
embeddings(String apiKey,
EmbeddingRequestVo reoVo) |
static okhttp3.Response |
embeddings(String apiKey,
String bodyString) |
static EmbeddingResponseVo |
embeddings(String serverUrl,
String apiKey,
EmbeddingRequestVo reoVo) |
static okhttp3.Response |
embeddings(String api_perfix_url,
String apiKey,
String bodyString) |
public static okhttp3.Response chatCompletions(String apiKey, String bodyString)
apiKey - bodyString - public static okhttp3.Response chatCompletions(Map<String,String> header, String bodyString)
header - bodyString - public static okhttp3.Response chatCompletions(String bodyString)
bodyString - public static okhttp3.Call chatCompletions(String bodyString, okhttp3.Callback callback)
bodyString - callback - public static okhttp3.Call chatCompletions(Map<String,String> header, String bodyString, okhttp3.Callback callback)
header - bodyString - callback - public static OpenAiChatResponseVo chatCompletions(String model, OpenAiChatMessage chatMessage)
model - chatMessage - public static OpenAiChatResponseVo chatCompletions(String model, List<OpenAiChatMessage> messages)
public static OpenAiChatResponseVo chatCompletions(String model, String systemPrompt, List<OpenAiChatMessage> messages)
public static OpenAiChatResponseVo chatCompletions(String apiKey, OpenAiChatRequestVo chatRequestVo)
apiKey - chatRequestVo - public static OpenAiChatResponseVo chatCompletions(OpenAiChatRequestVo chatRequestVo)
chatRequestVo - public static okhttp3.Call chatCompletions(OpenAiChatRequestVo chatRequestVo, okhttp3.Callback callback)
chatRequestVo - callback - public static OpenAiChatResponseVo chatCompletions(String apiPerfixUrl, String apiKey, OpenAiChatRequestVo chatRequestVo)
apiPerfixUrl - apiKey - chatRequestVo - public static okhttp3.Response chatCompletions(String apiPerfixUrl, String apiKey, String bodyString)
apiPerfixUrl - apiKey - bodyString - public static okhttp3.Call chatCompletions(String apiPerfixUrl, String apiKey, String bodyString, okhttp3.Callback callback)
apiPerfixUrl - apiKey - bodyString - callback - public static okhttp3.Response chatCompletions(String uri, Map<String,String> requestHeaders, String bodyString)
uri - requestHeaders - bodyString - public static okhttp3.Call chatCompletions(String serverUrl, String apiKey, OpenAiChatRequestVo chatRequestVo, okhttp3.Callback callback)
serverUrl - apiKey - chatRequestVo - callback - public static okhttp3.Call chatCompletions(String apiPrefixUrl, Map<String,String> requestHeaders, String bodyString, okhttp3.Callback callback)
apiPrefixUrl - requestHeaders - bodyString - callback - public static OpenAiChatResponseVo chat(String prompt)
role - prompt - public static OpenAiChatResponseVo chatWithRole(String role, String prompt)
role - prompt - public static OpenAiChatResponseVo chatWithModel(String model, String role, String prompt)
model - role - prompt - public static OpenAiChatResponseVo chatWithModel(String apiUrl, String key, String model, String role, String prompt)
public static OpenAiChatResponseVo chatCompletions(String apiUrl, String key, String model, OpenAiChatMessage chatMessage)
public static OpenAiChatResponseVo chatCompletions(String apiUrl, String key, String model, List<OpenAiChatMessage> messages)
public static okhttp3.Response embeddings(String bodyString)
public static okhttp3.Response embeddings(String api_perfix_url, String apiKey, String bodyString)
public static float[] embeddingArray(String input)
public static float[] embeddingArrayByLargeModel(String input)
public static EmbeddingResponseVo embeddings(EmbeddingRequestVo embeddingRequestVo)
public static EmbeddingResponseVo embeddings(String serverUrl, String apiKey, EmbeddingRequestVo reoVo)
public static EmbeddingResponseVo embeddings(String apiKey, EmbeddingRequestVo reoVo)
public static float[] embeddingArray(String serverUrl, String apiKey, String input, String model)
public static float[] embeddingArray(String serverUrl, String apiKey, EmbeddingRequestVo reqVo)
public static OpenAiChatResponseVo chatWithImage(String prompt, byte[] bytes, String suffix)
public static OpenAiChatResponseVo chatWithImage(String apiKey, String model, String prompt, byte[] bytes, String suffix)
public static OpenAiChatResponseVo chatWithImage(String apiKey, String prompt, byte[] bytes, String suffix)
Copyright © 2025. All rights reserved.