File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
core/src/main/java/com/google/adk/sessions Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ abstract class ApiClient {
6767 applyHttpOptions (customHttpOptions .get ());
6868 }
6969
70- this .httpClient = createHttpClient (httpOptions .timeout ());
70+ this .httpClient = createHttpClient (httpOptions .timeout (). orElse ( null ) );
7171 }
7272
7373 ApiClient (
@@ -113,13 +113,13 @@ abstract class ApiClient {
113113 }
114114 this .apiKey = Optional .empty ();
115115 this .vertexAI = true ;
116- this .httpClient = createHttpClient (httpOptions .timeout ());
116+ this .httpClient = createHttpClient (httpOptions .timeout (). orElse ( null ) );
117117 }
118118
119- private OkHttpClient createHttpClient (Optional < Integer > timeout ) {
119+ private OkHttpClient createHttpClient (@ Nullable Integer timeout ) {
120120 OkHttpClient .Builder builder = new OkHttpClient ().newBuilder ();
121- if (timeout . isPresent () ) {
122- builder .connectTimeout (Duration .ofMillis (timeout . get () ));
121+ if (timeout != null ) {
122+ builder .connectTimeout (Duration .ofMillis (timeout ));
123123 }
124124 return builder .build ();
125125 }
You can’t perform that action at this time.
0 commit comments