126 lines
4.4 KiB
Java
126 lines
4.4 KiB
Java
package com.ioa.tool;
|
|
|
|
import dev.langchain4j.agent.tool.Tool;
|
|
|
|
public class CommonTools {
|
|
|
|
@Tool("Search the web for information")
|
|
public String webSearch(String query) {
|
|
// Implement web search functionality
|
|
return "Web search results for: " + query;
|
|
}
|
|
|
|
@Tool("Get current weather information")
|
|
public String getWeather(String location) {
|
|
// Implement weather API call
|
|
return "Weather information for " + location;
|
|
}
|
|
|
|
@Tool("Set a reminder")
|
|
public String setReminder(String task, String time) {
|
|
// Implement reminder functionality
|
|
return "Reminder set for " + task + " at " + time;
|
|
}
|
|
|
|
@Tool("Calculate distances between locations")
|
|
public String calculateDistance(String from, String to) {
|
|
// Implement distance calculation
|
|
return "Distance from " + from + " to " + to;
|
|
}
|
|
|
|
@Tool("Translate text between languages")
|
|
public String translate(String text, String fromLang, String toLang) {
|
|
// Implement translation API call
|
|
return "Translated text from " + fromLang + " to " + toLang;
|
|
}
|
|
|
|
@Tool("Get recipe suggestions")
|
|
public String getRecipe(String ingredients) {
|
|
// Implement recipe suggestion logic
|
|
return "Recipe suggestions for: " + ingredients;
|
|
}
|
|
|
|
@Tool("Check product prices and compare")
|
|
public String compareProductPrices(String product) {
|
|
// Implement price comparison logic
|
|
return "Price comparison for: " + product;
|
|
}
|
|
|
|
@Tool("Book travel arrangements")
|
|
public String bookTravel(String destination, String dates) {
|
|
// Implement travel booking logic
|
|
return "Travel arrangements for " + destination + " on " + dates;
|
|
}
|
|
|
|
@Tool("Find nearby restaurants")
|
|
public String findRestaurants(String location, String cuisine) {
|
|
// Implement restaurant search
|
|
return "Restaurants near " + location + " serving " + cuisine;
|
|
}
|
|
|
|
@Tool("Schedule appointments")
|
|
public String scheduleAppointment(String service, String date) {
|
|
// Implement appointment scheduling
|
|
return "Appointment scheduled for " + service + " on " + date;
|
|
}
|
|
|
|
@Tool("Get movie recommendations")
|
|
public String getMovieRecommendations(String genres, String mood) {
|
|
// Implement movie recommendation logic
|
|
return "Movie recommendations for " + genres + " matching " + mood + " mood";
|
|
}
|
|
|
|
@Tool("Find and book fitness classes")
|
|
public String findFitnessClasses(String type, String location) {
|
|
// Implement fitness class search and booking
|
|
return "Fitness classes for " + type + " near " + location;
|
|
}
|
|
|
|
@Tool("Get public transport information")
|
|
public String getPublicTransport(String from, String to) {
|
|
// Implement public transport routing
|
|
return "Public transport options from " + from + " to " + to;
|
|
}
|
|
|
|
@Tool("Track package deliveries")
|
|
public String trackPackage(String trackingNumber) {
|
|
// Implement package tracking
|
|
return "Tracking information for package: " + trackingNumber;
|
|
}
|
|
|
|
@Tool("Get news updates")
|
|
public String getNewsUpdates(String topics) {
|
|
// Implement news aggregation
|
|
return "Latest news updates on: " + topics;
|
|
}
|
|
|
|
@Tool("Find and apply for jobs")
|
|
public String jobSearch(String field, String location) {
|
|
// Implement job search functionality
|
|
return "Job openings in " + field + " near " + location;
|
|
}
|
|
|
|
@Tool("Get health and medical advice")
|
|
public String getMedicalAdvice(String symptoms) {
|
|
// Implement medical advice lookup (with disclaimer)
|
|
return "General health information for symptoms: " + symptoms;
|
|
}
|
|
|
|
@Tool("Find and book event tickets")
|
|
public String findEventTickets(String event, String location) {
|
|
// Implement event ticket search and booking
|
|
return "Ticket options for " + event + " in " + location;
|
|
}
|
|
|
|
@Tool("Get financial advice and budgeting tips")
|
|
public String getFinancialAdvice(String income, String expenses) {
|
|
// Implement financial advice generation
|
|
return "Financial advice based on income: " + income + " and expenses: " + expenses;
|
|
}
|
|
|
|
@Tool("Find and book home services")
|
|
public String findHomeServices(String service, String location) {
|
|
// Implement home service search and booking
|
|
return "Home service options for " + service + " in " + location;
|
|
}
|
|
} |