This is an automated email from the ASF dual-hosted git repository. Croway pushed a commit to branch ai-tool-migration in repository https://gitbox.apache.org/repos/asf/camel-spring-boot-examples.git
commit 74160e737bdd71d8ea1e4512635ad52136d8f8fc Author: croway <[email protected]> AuthorDate: Fri Aug 7 09:40:49 2026 +0200 CAMEL-23382: migrate ai-agent example from spring-ai-tools to ai-tool --- ai-agent/README.adoc | 4 ++-- ai-agent/pom.xml | 4 ++-- ai-agent/src/main/java/sample/camel/ToolRoute.java | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ai-agent/README.adoc b/ai-agent/README.adoc index d0e3b08c..564f9e6b 100644 --- a/ai-agent/README.adoc +++ b/ai-agent/README.adoc @@ -58,7 +58,7 @@ Qdrant will be available on `http://localhost:6333`. * `camel-spring-ai-chat-starter` - Camel Spring AI chat integration * `camel-spring-ai-vector-store-starter` - Camel Spring AI vector store integration -* `camel-spring-ai-tools-starter` - Camel Spring AI tools/function calling +* `camel-ai-tool-starter` - Camel AI tools/function calling * `spring-ai-starter-model-ollama` - Spring AI Ollama model support * `spring-ai-starter-vector-store-qdrant` - Qdrant vector store integration @@ -70,7 +70,7 @@ NOTE: The routes use timer delays to ensure proper startup sequence. The chat ro Demonstrates basic chat functionality. Sends questions to the AI model and logs the responses. Executes immediately on startup. ==== ToolRoute -Shows how to define tools (functions) that the AI can call. The example includes a weather tool that the AI can invoke when asked about weather information. The tool is defined using the `spring-ai-tools` component with parameters. The tool chat route executes after a 20 second delay to ensure all services are ready. +Shows how to define tools (functions) that the AI can call. The example includes a weather tool that the AI can invoke when asked about weather information. The tool is defined using the `ai-tool` component with parameters. The tool chat route executes after a 20 second delay to ensure all services are ready. ==== VectorStoreRoute Demonstrates semantic search using vector embeddings with Qdrant: diff --git a/ai-agent/pom.xml b/ai-agent/pom.xml index dfb53c5e..117055fa 100644 --- a/ai-agent/pom.xml +++ b/ai-agent/pom.xml @@ -36,7 +36,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <spring-ai-version>2.0.0-M2</spring-ai-version> + <spring-ai-version>2.0.0</spring-ai-version> </properties> <dependencyManagement> @@ -91,7 +91,7 @@ </dependency> <dependency> <groupId>org.apache.camel.springboot</groupId> - <artifactId>camel-spring-ai-tools-starter</artifactId> + <artifactId>camel-ai-tool-starter</artifactId> </dependency> <dependency> <groupId>org.apache.camel.springboot</groupId> diff --git a/ai-agent/src/main/java/sample/camel/ToolRoute.java b/ai-agent/src/main/java/sample/camel/ToolRoute.java index 0b981f2a..cffe803b 100644 --- a/ai-agent/src/main/java/sample/camel/ToolRoute.java +++ b/ai-agent/src/main/java/sample/camel/ToolRoute.java @@ -20,7 +20,7 @@ import org.apache.camel.builder.RouteBuilder; import org.springframework.stereotype.Component; /** - * Route that demonstrates Spring AI tool/function calling capabilities. + * Route that demonstrates AI tool/function calling capabilities. * The AI can invoke the weather tool to get current weather information. */ @Component @@ -29,7 +29,7 @@ public class ToolRoute extends RouteBuilder { @Override public void configure() throws Exception { // Define the weather tool that can be called by the AI - from("spring-ai-tools:weatherTool?tags=weather&description=Get the current weather for a location" + from("ai-tool:weatherTool?tags=weather&description=Get the current weather for a location" + "¶meter.location=string" + "¶meter.location.description=The city, e.g. Rome" + "¶meter.location.required=true") @@ -53,7 +53,7 @@ public class ToolRoute extends RouteBuilder { from("direct:fetchWeather") .routeId("fetchWeatherRoute") .toD("https://api.open-meteo.com/v1/forecast?latitude=${header.latitude}&longitude=${header.longitude}¤t=temperature_2m,weather_code,precipitation,wind_speed_10m,wind_direction_10m,relative_humidity_2m,cloud_cover&temperature_unit=celsius&wind_speed_unit=kmh") - .setBody(simple("The weather in ${header.location} is ${jq(.current.temperature_2m)} degrees Celsius with ${jq(.current.relative_humidity_2m)}% humidity, ${jq(.current.cloud_cover)}% cloud cover, wind speed ${jq(.current.wind_speed_10m)} km/h from ${jq(.current.wind_direction_10m)} degrees, and ${jq(.current.precipitation)} mm precipitation.")); + .setBody(simple("The weather in ${header.savedLocation} is ${jq(.current.temperature_2m)} degrees Celsius with ${jq(.current.relative_humidity_2m)}% humidity, ${jq(.current.cloud_cover)}% cloud cover, wind speed ${jq(.current.wind_speed_10m)} km/h from ${jq(.current.wind_direction_10m)} degrees, and ${jq(.current.precipitation)} mm precipitation.")); // Route that uses AI with function calling from("timer:toolChat?repeatCount=1&delay=20000")
