@@ -54,16 +54,6 @@ public class ZaiConfig {
5454 */
5555 private String apiKey ;
5656
57- /**
58- * API id component.
59- */
60- private String apiId ;
61-
62- /**
63- * API secret component.
64- */
65- private String apiSecret ;
66-
6757 /**
6858 * Custom Http Request Headers
6959 */
@@ -84,7 +74,8 @@ public class ZaiConfig {
8474 /**
8575 * Flag to disable token caching.
8676 */
87- private boolean disableTokenCache ;
77+ @ Builder .Default
78+ private boolean disableTokenCache = true ;
8879
8980 /**
9081 * Maximum number of idle connections in the connection pool.
@@ -96,7 +87,7 @@ public class ZaiConfig {
9687 * Keep alive duration for connections in the pool (in seconds).
9788 */
9889 @ Builder .Default
99- private long connectionPoolKeepAliveDuration = 1 ;
90+ private long connectionPoolKeepAliveDuration = 10 ;
10091
10192 /**
10293 * Time unit for connection pool keep alive duration.
@@ -149,10 +140,8 @@ public ZaiConfig(String apiKey) {
149140 this .apiKey = apiKey ;
150141 String [] arrStr = apiKey .split ("\\ ." );
151142 if (arrStr .length != 2 ) {
152- throw new RuntimeException ("invalid apiSecretKey " );
143+ throw new RuntimeException ("invalid api Key " );
153144 }
154- this .apiId = arrStr [0 ];
155- this .apiSecret = arrStr [1 ];
156145 }
157146
158147 /**
@@ -166,8 +155,6 @@ public void setApiKey(String apiKey) {
166155 if (arrStr .length != 2 ) {
167156 throw new RuntimeException ("invalid api Key" );
168157 }
169- this .apiId = arrStr [0 ];
170- this .apiSecret = arrStr [1 ];
171158 }
172159
173160 /**
@@ -194,38 +181,10 @@ public String getApiKey() {
194181 if (value != null && !value .isEmpty ()) {
195182 // Parse value and set components
196183 this .apiKey = value ;
197- String [] arrStr = value .split ("\\ ." );
198- if (arrStr .length == 2 ) {
199- this .apiId = arrStr [0 ];
200- this .apiSecret = arrStr [1 ];
201- }
202- return value ;
203184 }
204185 return apiKey ;
205186 }
206187
207- /**
208- * Gets API key with system property and environment variable fallback.
209- */
210- public String getApiId () {
211- if (apiId != null && !apiId .isEmpty ()) {
212- return apiId ;
213- }
214- getApiKey ();
215- return apiId ;
216- }
217-
218- /**
219- * Gets API secret with system property and environment variable fallback.
220- */
221- public String getApiSecret () {
222- if (apiSecret != null && !apiSecret .isEmpty ()) {
223- return apiSecret ;
224- }
225- getApiKey ();
226- return apiSecret ;
227- }
228-
229188 /**
230189 * Gets expire millis with system property and environment variable fallback.
231190 */
0 commit comments