|
@@ -8,6 +8,7 @@ import com.qmth.ops.biz.ai.exception.OcrRateLimitExceeded;
|
|
|
import okhttp3.*;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.time.Duration;
|
|
|
|
|
|
/**
|
|
|
* 大模型chat类接口基础实现
|
|
@@ -23,7 +24,8 @@ public abstract class OcrApiClient {
|
|
|
private RateLimiter queryRateLimiter;
|
|
|
|
|
|
public OcrApiClient(OcrApiConfig config) {
|
|
|
- OkHttpClient.Builder buidler = new OkHttpClient.Builder().connectionPool(new ConnectionPool());
|
|
|
+ OkHttpClient.Builder buidler = new OkHttpClient.Builder().connectionPool(new ConnectionPool())
|
|
|
+ .connectTimeout(Duration.ofSeconds(10)).readTimeout(Duration.ofSeconds(50));
|
|
|
Interceptor interceptor = getInterceptor();
|
|
|
if (interceptor != null) {
|
|
|
buidler.addInterceptor(interceptor);
|