public class DIfyApiServiceGenerator extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
DIfyApiServiceGenerator.EventProcessor |
static interface |
DIfyApiServiceGenerator.LineProcessor |
| 构造器和说明 |
|---|
DIfyApiServiceGenerator() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
configureHttpClient(okhttp3.OkHttpClient client) |
static okhttp3.OkHttpClient |
createDefaultHttpClient() |
static <S> S |
createService(Class<S> serviceClass,
String apiKey,
String baseUrl) |
static void |
executeStreamRequest(retrofit2.Call<okhttp3.ResponseBody> call,
DIfyApiServiceGenerator.LineProcessor lineProcessor,
Consumer<Throwable> errorHandler) |
static <T> T |
executeSync(retrofit2.Call<T> call) |
static DifyApiError |
getDifyApiError(retrofit2.Response<?> response) |
static boolean |
processStreamLine(String line,
StreamCallback callback,
DIfyApiServiceGenerator.EventProcessor eventProcessor) |
static void |
setHttpProxy(String host,
int port,
String username,
String pwd)
Sets http proxy for the shared client.
|
public static okhttp3.OkHttpClient createDefaultHttpClient()
public static void configureHttpClient(okhttp3.OkHttpClient client)
public static void setHttpProxy(String host, int port, String username, String pwd)
If you need to use a proxy to connect to the internet, you can use this method to set it.
null as parameters for username and pwd.
host - the host (Not null)port - the portusername - the usernamepwd - the pwdpublic static <S> S createService(Class<S> serviceClass, String apiKey, String baseUrl)
public static <T> T executeSync(retrofit2.Call<T> call)
public static void executeStreamRequest(retrofit2.Call<okhttp3.ResponseBody> call,
DIfyApiServiceGenerator.LineProcessor lineProcessor,
Consumer<Throwable> errorHandler)
public static boolean processStreamLine(String line, StreamCallback callback, DIfyApiServiceGenerator.EventProcessor eventProcessor)
public static DifyApiError getDifyApiError(retrofit2.Response<?> response) throws DifyApiException, IOException
Copyright © 2025. All rights reserved.