File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 </executions >
7171 <configuration >
7272 <imageName >cooking-agent</imageName >
73- <mainClass >io.github .javaaidev.agent.SimpleAiAgentApplication</mainClass >
73+ <mainClass >com .javaaidev.agent.SimpleAiAgentApplication</mainClass >
7474 <fallback >false</fallback >
7575 </configuration >
7676 </plugin >
Original file line number Diff line number Diff line change 1- package io . github .javaaidev .agent ;
1+ package com .javaaidev .agent ;
22
33import java .net .http .HttpClient ;
44import java .time .Duration ;
1313@ Configuration
1414public class AppConfiguration {
1515
16+ private static final Duration API_TIMEOUT = Duration .ofMinutes (5 );
17+
1618 @ Bean
1719 public RestClient .Builder restClientBuilder (HttpClient httpClient ) {
1820 JdkClientHttpRequestFactory requestFactory = new JdkClientHttpRequestFactory (httpClient );
19- requestFactory .setReadTimeout (Duration . ofMinutes ( 3 ) );
21+ requestFactory .setReadTimeout (API_TIMEOUT );
2022 return RestClient .builder ().requestFactory (requestFactory );
2123 }
2224
2325 @ Bean
2426 public WebClient .Builder webClientBuilder (HttpClient httpClient ) {
2527 var connector = new JdkClientHttpConnector (httpClient );
26- connector .setReadTimeout (Duration . ofMinutes ( 3 ) );
28+ connector .setReadTimeout (API_TIMEOUT );
2729 return WebClient .builder ().clientConnector (connector );
2830 }
2931
@@ -33,7 +35,7 @@ public HttpClient httpClient() {
3335 executor .setVirtualThreads (true );
3436 return HttpClient .newBuilder ()
3537 .executor (executor )
36- .connectTimeout (Duration . ofMinutes ( 3 ) )
38+ .connectTimeout (API_TIMEOUT )
3739 .build ();
3840 }
3941}
Original file line number Diff line number Diff line change 1- package io . github .javaaidev .agent ;
1+ package com .javaaidev .agent ;
22
33import org .springframework .ai .chat .client .ChatClient ;
44import 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 ;
22
33import org .springframework .boot .SpringApplication ;
44import org .springframework .boot .autoconfigure .SpringBootApplication ;
55
66@ SpringBootApplication
77public class SimpleAiAgentApplication {
88
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+ }
1212
1313}
Original file line number Diff line number Diff line change 11spring :
22 application :
3- name : native -ai-agent
3+ name : simple -ai-agent
44 threads.virtual.enabled : true
55 ai :
66 openai :
You can’t perform that action at this time.
0 commit comments