Class OpenCodeOkHttpClientFactory

java.lang.Object
io.github.easy4j.opencode.OpenCodeOkHttpClientFactory

public final class OpenCodeOkHttpClientFactory extends Object
Factory for creating OkHttpClient instances used by the OpenCode SDK in standalone mode.

When a Spring container already provides an external OkHttpClient, the injection constructors should be used instead and this factory will not participate.

Since:
1.0.0
Author:
Loong Wan
See Also:
  • Method Details

    • create

      public static okhttp3.OkHttpClient create(OpenCodeHttpClientConfig config)
      根据 OpenCode HTTP 配置创建客户端。
      Parameters:
      config - 客户端配置;不得为 null
      Returns:
      OpenCode SDK 返回的OkHttp 客户端对象
    • shutdown

      public static void shutdown(okhttp3.OkHttpClient client)
      释放 SDK 自建客户端资源。
      Parameters:
      client - SDK 自建客户端