类 DIfyApiServiceGenerator
java.lang.Object
io.github.chatpass.dify.DIfyApiServiceGenerator
-
嵌套类概要
嵌套类修饰符和类型类说明static interfacestatic interface -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidconfigureHttpClient(okhttp3.OkHttpClient client) static okhttp3.OkHttpClientstatic <S> ScreateService(Class<S> serviceClass, String apiKey, String baseUrl) static voidexecuteStreamRequest(retrofit2.Call<okhttp3.ResponseBody> call, DIfyApiServiceGenerator.LineProcessor lineProcessor, Consumer<Throwable> errorHandler) static <T> TexecuteSync(retrofit2.Call<T> call) static DifyApiErrorgetDifyApiError(retrofit2.Response<?> response) static booleanprocessStreamLine(String line, StreamCallback callback, DIfyApiServiceGenerator.EventProcessor eventProcessor) static voidsetHttpProxy(String host, int port, String username, String pwd) Sets http proxy for the shared client.
-
构造器详细资料
-
DIfyApiServiceGenerator
public DIfyApiServiceGenerator()
-
-
方法详细资料
-
createDefaultHttpClient
public static okhttp3.OkHttpClient createDefaultHttpClient() -
configureHttpClient
public static void configureHttpClient(okhttp3.OkHttpClient client) -
setHttpProxy
Sets http proxy for the shared client.If you need to use a proxy to connect to the internet, you can use this method to set it.
- If you want to use a proxy that requires authentication,
you can pass the username and password as parameters.
- If you want to use a proxy that does not require authentication,
you can pass
nullas parameters forusernameandpwd.
- 参数:
host- the host (Not null)port- the portusername- the usernamepwd- the pwd- 另请参阅:
- If you want to use a proxy that requires authentication,
you can pass the username and password as parameters.
-
createService
-
executeSync
public static <T> T executeSync(retrofit2.Call<T> call) -
executeStreamRequest
public static void executeStreamRequest(retrofit2.Call<okhttp3.ResponseBody> call, DIfyApiServiceGenerator.LineProcessor lineProcessor, Consumer<Throwable> errorHandler) -
processStreamLine
public static boolean processStreamLine(String line, StreamCallback callback, DIfyApiServiceGenerator.EventProcessor eventProcessor) -
getDifyApiError
public static DifyApiError getDifyApiError(retrofit2.Response<?> response) throws DifyApiException, IOException
-