File tree Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 70
70
</executions >
71
71
<configuration >
72
72
<imageName >cooking-agent</imageName >
73
- <mainClass >io.github .javaaidev.agent.SimpleAiAgentApplication</mainClass >
73
+ <mainClass >com .javaaidev.agent.SimpleAiAgentApplication</mainClass >
74
74
<fallback >false</fallback >
75
75
</configuration >
76
76
</plugin >
Original file line number Diff line number Diff line change 1
- package io . github .javaaidev .agent ;
1
+ package com .javaaidev .agent ;
2
2
3
3
import java .net .http .HttpClient ;
4
4
import java .time .Duration ;
13
13
@ Configuration
14
14
public class AppConfiguration {
15
15
16
+ private static final Duration API_TIMEOUT = Duration .ofMinutes (5 );
17
+
16
18
@ Bean
17
19
public RestClient .Builder restClientBuilder (HttpClient httpClient ) {
18
20
JdkClientHttpRequestFactory requestFactory = new JdkClientHttpRequestFactory (httpClient );
19
- requestFactory .setReadTimeout (Duration . ofMinutes ( 3 ) );
21
+ requestFactory .setReadTimeout (API_TIMEOUT );
20
22
return RestClient .builder ().requestFactory (requestFactory );
21
23
}
22
24
23
25
@ Bean
24
26
public WebClient .Builder webClientBuilder (HttpClient httpClient ) {
25
27
var connector = new JdkClientHttpConnector (httpClient );
26
- connector .setReadTimeout (Duration . ofMinutes ( 3 ) );
28
+ connector .setReadTimeout (API_TIMEOUT );
27
29
return WebClient .builder ().clientConnector (connector );
28
30
}
29
31
@@ -33,7 +35,7 @@ public HttpClient httpClient() {
33
35
executor .setVirtualThreads (true );
34
36
return HttpClient .newBuilder ()
35
37
.executor (executor )
36
- .connectTimeout (Duration . ofMinutes ( 3 ) )
38
+ .connectTimeout (API_TIMEOUT )
37
39
.build ();
38
40
}
39
41
}
Original file line number Diff line number Diff line change 1
- package io . github .javaaidev .agent ;
1
+ package com .javaaidev .agent ;
2
2
3
3
import org .springframework .ai .chat .client .ChatClient ;
4
4
import org .springframework .web .bind .annotation .PostMapping ;
Original file line number Diff line number Diff line change 1
- package io . github .javaaidev .agent ;
1
+ package com .javaaidev .agent ;
2
2
3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
5
6
6
@ SpringBootApplication
7
7
public class SimpleAiAgentApplication {
8
8
9
- public static void main (String [] args ) {
10
- SpringApplication .run (SimpleAiAgentApplication .class , args );
11
- }
9
+ public static void main (String [] args ) {
10
+ SpringApplication .run (SimpleAiAgentApplication .class , args );
11
+ }
12
12
13
13
}
Original file line number Diff line number Diff line change 1
1
spring :
2
2
application :
3
- name : native -ai-agent
3
+ name : simple -ai-agent
4
4
threads.virtual.enabled : true
5
5
ai :
6
6
openai :
You can’t perform that action at this time.
0 commit comments