3737import io .reactivex .rxjava3 .core .Flowable ;
3838import java .util .List ;
3939import java .util .Map ;
40- import java .util .Objects ;
4140import java .util .Optional ;
4241import org .junit .jupiter .api .Test ;
4342import org .junit .jupiter .api .condition .EnabledIfEnvironmentVariable ;
4443
4544class LangChain4jIntegrationTest {
4645
4746 public static final String CLAUDE_4_6_SONNET = "claude-sonnet-4-6" ;
48- public static final String GEMINI_2_0_FLASH = "gemini-2.0 -flash" ;
47+ public static final String GEMINI_3_8_FLASH = "gemini-3.8 -flash" ;
4948 public static final String GPT_4_O_MINI = "gpt-4o-mini" ;
5049
5150 @ Test
@@ -161,6 +160,7 @@ void testSingleAgentWithTools() {
161160 }
162161
163162 @ Test
163+ @ EnabledIfEnvironmentVariable (named = "GOOGLE_API_KEY" , matches = "\\ S+" )
164164 @ EnabledIfEnvironmentVariable (named = "OPENAI_API_KEY" , matches = "\\ S+" )
165165 void testAgentTool () {
166166 // given
@@ -174,7 +174,7 @@ void testAgentTool() {
174174 LlmAgent .builder ()
175175 .name ("weather-agent" )
176176 .description ("Weather agent" )
177- .model (GEMINI_2_0_FLASH )
177+ .model (GEMINI_3_8_FLASH )
178178 .instruction (
179179 """
180180 Your role is to always answer that the weather is sunny and 20°C.
@@ -239,8 +239,7 @@ void testSubAgent() {
239239 // given
240240 OpenAiChatModel gptModel =
241241 OpenAiChatModel .builder ()
242- .baseUrl ("http://langchain4j.dev/demo/openai/v1" )
243- .apiKey (Objects .requireNonNullElse (System .getenv ("OPENAI_API_KEY" ), "demo" ))
242+ .apiKey (System .getenv ("OPENAI_API_KEY" ))
244243 .modelName (GPT_4_O_MINI )
245244 .build ();
246245
@@ -270,7 +269,7 @@ void testSubAgent() {
270269 LlmAgent .builder ()
271270 .name ("coordinator-agent" )
272271 .description ("Coordinator agent" )
273- .model (GEMINI_2_0_FLASH )
272+ .model (GEMINI_3_8_FLASH )
274273 .instruction (
275274 """
276275 Your role is to coordinate 2 agents:
@@ -391,8 +390,7 @@ void testStreamingRunConfig() {
391390 // given
392391 OpenAiStreamingChatModel streamingModel =
393392 OpenAiStreamingChatModel .builder ()
394- .baseUrl ("http://langchain4j.dev/demo/openai/v1" )
395- .apiKey (Objects .requireNonNullElse (System .getenv ("OPENAI_API_KEY" ), "demo" ))
393+ .apiKey (System .getenv ("OPENAI_API_KEY" ))
396394 .modelName (GPT_4_O_MINI )
397395 .build ();
398396
0 commit comments