refactor(mcp): update to use Spring Boot autoconfiguration and rename tool callbacks

Update MCP examples to use Spring Boot autoconfiguration instead of manual configuration.
Replace deprecated defaultTools method with defaultToolCallbacks across all examples.
Update documentation to reflect these changes and provide more detailed configuration examples.

- Update API from defaultTools to defaultToolCallbacks in all MCP examples
- Update README files with more detailed configuration examples

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov
2025-05-02 14:28:17 +03:00
parent 2c9fa4d8fd
commit 234d3ff919
17 changed files with 95 additions and 217 deletions

View File

@@ -34,7 +34,7 @@ public class Application {
return args -> {
var chatClient = chatClientBuilder
.defaultTools(new SyncMcpToolCallbackProvider(mcpClients))
.defaultToolCallbacks(new SyncMcpToolCallbackProvider(mcpClients))
.defaultAdvisors(new MessageChatMemoryAdvisor(new InMemoryChatMemory()))
.build();

View File

@@ -30,7 +30,7 @@ public class Application {
return args -> {
var chatClient = chatClientBuilder
.defaultTools(new SyncMcpToolCallbackProvider(mcpClients))
.defaultToolCallbacks(new SyncMcpToolCallbackProvider(mcpClients))
.build();
System.out.println("Running predefined questions with AI model responses:\n");