Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
5ac29ff
BAEL-9141 quarkus-infinispan module code started
vshanbha Jul 30, 2025
3d48491
BAEL-9141 quarkus-infinispan module moved to extensions
vshanbha Aug 2, 2025
ca85aeb
BAEL-9141 quarkus-infinispan test cases modified
vshanbha Aug 3, 2025
304fe44
Merge branch 'eugenp:master' into master
vshanbha Aug 6, 2025
b5784e0
Merge branch 'eugenp:master' into master
vshanbha Aug 7, 2025
e9528b8
checked implementation of annotation generated cache is indeed infini…
vshanbha Aug 7, 2025
927c9c4
tests related to quarkus-infinispan-cache extention
vshanbha Aug 8, 2025
74ab9ff
module renamed, removed references to quarkus-infinispan-cache
vshanbha Aug 10, 2025
2d5669a
Merge branch 'eugenp:master' into master
vshanbha Aug 10, 2025
d849494
BAEL-9141 services split into two classes
vshanbha Aug 10, 2025
ee5dd99
Merge branch 'eugenp:master' into master
vshanbha Aug 10, 2025
876bd0d
Merge branch 'eugenp:master' into master
vshanbha Aug 11, 2025
776c772
Merge branch 'eugenp:master' into master
vshanbha Aug 12, 2025
e6792f4
removed unwanted libraries, more tests added
vshanbha Aug 12, 2025
47da4e1
Merge branch 'eugenp:master' into master
vshanbha Aug 15, 2025
37a8b98
BAEL-9141 sysout and delay added to getValueFromCache to simulate lon…
vshanbha Aug 15, 2025
27f91f4
BAEL-9141 minor formatting and readability changes
vshanbha Aug 16, 2025
f796b8f
Merge branch 'eugenp:master' into master
vshanbha Aug 17, 2025
feeae2e
Merge branch 'eugenp:master' into master
vshanbha Aug 23, 2025
f5d07eb
BAEL-9141 unit test class name modified
vshanbha Aug 23, 2025
28b3890
Merge branch 'eugenp:master' into master
vshanbha Aug 24, 2025
2908648
BAEL-9141 junit dependency commented
vshanbha Aug 24, 2025
bd587d0
BAEL-9141 junit dependency uncommented
vshanbha Aug 24, 2025
9c6acc2
BAEL-9141 junit dependency setting changed
vshanbha Aug 24, 2025
355e37d
BAEL-9141 quarkus platform version changed
vshanbha Aug 24, 2025
a7edbe9
BAEL-9141 dependency versions of quarkus, junit modified to match ano…
vshanbha Aug 24, 2025
fae083b
remove overridden properties
lor6 Aug 25, 2025
d4ce954
update library versions
lor6 Aug 25, 2025
d8ded97
upgraded quarkus version, removed reference to infinispan-commons
vshanbha Aug 25, 2025
f12637b
BAEL-9141 moved quarkus-infinispan-embedded to quarkus-modules
vshanbha Aug 25, 2025
ea3e663
BAEL-9141 removed override of junit version
vshanbha Aug 25, 2025
e91da8e
update junit version
lor6 Aug 25, 2025
c85a5ee
BAEL-9141 removed native build config
vshanbha Aug 25, 2025
b00ec1f
BAEL-9141 system property added related to zipfs
vshanbha Aug 25, 2025
7770c94
BAEL-9141 unit tests disabled. Want to check if build passes without …
vshanbha Aug 25, 2025
e2d34a5
remove path config
lor6 Aug 25, 2025
888745e
BAEL-9141 removed all old code. basic hello world version to test if …
vshanbha Aug 25, 2025
a472b23
BAEL-9141 following configuration of quarkus-clientbasicauth
vshanbha Aug 25, 2025
27e6d71
BAEL-9141 using newer versions of quarkus
vshanbha Aug 25, 2025
8c0d89e
BAEL-9141 using older version of Junit
vshanbha Aug 25, 2025
1c794f6
BAEL-9141 infinispan code brought back
vshanbha Aug 25, 2025
b9a13c0
BAEL-9141 quarkus version changed
vshanbha Aug 25, 2025
c48251e
BAEL-9141 removed quarkus-rest dependency as we are not using it
vshanbha Aug 25, 2025
4dc9f6b
Merge branch 'eugenp:master' into master
vshanbha Sep 12, 2025
63f27e4
Merge branch 'eugenp:master' into master
vshanbha Oct 31, 2025
61b5937
Merge branch 'eugenp:master' into master
vshanbha Nov 5, 2025
cf5ee13
BAEL-7289 new quarkus-module created with basic hello world code
vshanbha Nov 5, 2025
1f3abe9
Merge branch 'eugenp:master' into master
vshanbha Nov 18, 2025
3bc93fb
Merge branch 'eugenp:master' into master
vshanbha Nov 25, 2025
aacd822
Merge branch 'eugenp:master' into master
vshanbha Nov 27, 2025
4067b10
Merge branch 'eugenp:master' into master
vshanbha Nov 27, 2025
5ef385f
code written for accessing resources
vshanbha Nov 27, 2025
993fd6a
BAEL-7289 modified file name for json file
vshanbha Nov 27, 2025
2f176b7
BAEL-7289 added rest-jackson dependency
vshanbha Nov 27, 2025
95e4b4c
BAEL-7289 removed unwanted hello world route
Nov 28, 2025
477ff99
BAEL-7289 added resource-config.json
Nov 28, 2025
ca990cc
BAEL-7289 added web resources
Nov 28, 2025
f6eafe2
Merge branch 'eugenp:master' into master
vshanbha Nov 29, 2025
c179c4c
Merge branch 'eugenp:master' into master
vshanbha Dec 1, 2025
ff49126
BAEL-7289 test case method names modified
Dec 1, 2025
e45981e
Merge branch 'eugenp:master' into master
vshanbha Dec 5, 2025
7d7321a
BAEL-7289 changes based on review of article
vshanbha Dec 5, 2025
62133e6
Merge branch 'eugenp:master' into master
vshanbha Dec 22, 2025
e388dd5
Merge branch 'eugenp:master' into master
vshanbha Feb 26, 2026
cdc2553
Merge branch 'eugenp:master' into master
vshanbha Mar 8, 2026
f301947
Merge branch 'eugenp:master' into master
vshanbha Jul 21, 2026
39cc05f
Merge branch 'eugenp:master' into master
vshanbha Jul 26, 2026
1587a92
Merge branch 'eugenp:master' into master
vshanbha Aug 9, 2026
8a9b28e
Merge branch 'eugenp:master' into master
vshanbha Aug 23, 2026
43ac8d6
Merge branch 'eugenp:master' into master
vshanbha Aug 30, 2026
eb81068
basic Spring AI AskUserQuestionTool module starting code
vshanbha Aug 30, 2026
d24977a
chat client wired together with AskUserQuestionTool
vshanbha Aug 30, 2026
19499c3
added debug logging for manual verification of tool calls
vshanbha Aug 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spring-ai-modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
<module>spring-ai-vector-stores</module>
<module>spring-ai-mcp-annotations</module>
<module>spring-ai-subagent-orchestrator</module>
<module>spring-ai-ask-user-question</module>
</modules>
</project>
70 changes: 70 additions & 0 deletions spring-ai-modules/spring-ai-ask-user-question/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.baeldung</groupId>
<artifactId>spring-ai-modules</artifactId>
<version>0.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>spring-ai-cli-agent</artifactId>
<name>spring-ai-ask-user-question</name>
<description>Spring AI AskUserQuestionTool reference implementation</description>

<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-model-ollama</artifactId>
</dependency>
<dependency>
<groupId>org.springaicommunity</groupId>
<artifactId>spring-ai-agent-utils</artifactId>
<version>0.10.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-bom</artifactId>
<version>${spring-ai.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<properties>
<spring-ai.version>2.0.0</spring-ai.version>
<spring-boot.version>4.1.1</spring-boot.version>
<logback.version>1.5.38</logback.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.baeldung.agent;

import org.springaicommunity.agent.tools.AskUserQuestionTool;
import org.springaicommunity.agent.utils.CommandLineQuestionHandler;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.memory.MessageWindowChatMemory;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
class AgentConfiguration {

@Bean
ChatClient chatClient(ChatModel chatModel) {
ChatMemory chatMemory = MessageWindowChatMemory.builder()
.maxMessages(20)
.build();

return ChatClient.builder(chatModel)
.defaultSystem("You are an interactive CLI assistant.\n"
+ "Be helpful, concise.\n"
+ "If you need information, a preference or disambiguation from the user,\n"
+ "Always use an available tool to ask - never ask in ordinary assistant text.\n"
+ "After receiving the tool result, continue with the response.\n")
.defaultTools(
AskUserQuestionTool.builder()
.questionHandler(new CommandLineQuestionHandler())
.build()
)
.defaultAdvisors(
MessageChatMemoryAdvisor.builder(chatMemory).build()
)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.baeldung.agent;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.baeldung.agent;

import java.util.Scanner;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
class ChatLoop implements CommandLineRunner {

private final ChatClient chatClient;

ChatLoop(ChatClient chatClient) {
this.chatClient = chatClient;
}

@Override
public void run(String... args) {
System.out.println("AI Agent (type 'exit' to quit)\n");
try (Scanner scanner = new Scanner(System.in)) {
while (true) {
System.out.print("You: ");
String input = scanner.nextLine();
if ("exit".equalsIgnoreCase(input.trim())) break;

String response = chatClient.prompt()
.user(input)
.advisors(a -> a.param(ChatMemory.CONVERSATION_ID, "session-1"))
.call()
.content();
System.out.println("AI: " + response + "\n");
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spring.ai.ollama.base-url=http://localhost:11434
spring.ai.ollama.chat.options.model=gemma4:e4b-mlx
logging.level.org.springframework.ai.model.tool=DEBUG