类 DIfyApiServiceGenerator

java.lang.Object
io.github.chatpass.dify.DIfyApiServiceGenerator

public class DIfyApiServiceGenerator extends Object
  • 构造器详细资料

    • DIfyApiServiceGenerator

      public DIfyApiServiceGenerator()
  • 方法详细资料

    • createDefaultHttpClient

      public static okhttp3.OkHttpClient createDefaultHttpClient()
    • configureHttpClient

      public static void configureHttpClient(okhttp3.OkHttpClient client)
    • setHttpProxy

      public static void setHttpProxy(String host, int port, String username, String pwd)
      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 null as parameters for username and pwd.

      参数:
      host - the host (Not null)
      port - the port
      username - the username
      pwd - the pwd
      另请参阅:
    • createService

      public static <S> S createService(Class<S> serviceClass, String apiKey, String baseUrl)
    • 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
      抛出:
      DifyApiException
      IOException