package cn.langchat.plugin.tool.weather;
import cn.langchat.plugin.tool.BaseTool;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;
/**
* 天气查询工具
*/
@Component
public class WeatherTool implements BaseTool {
@Tool("Get current weather information for a specific city")
public String getWeather(String city) {
// 实现具体的业务逻辑
return "The weather in " + city + " is Sunny.";
}
@Override
public String getName() {
return this.getClass().getSimpleName();
}
@Override
public String getLabel() {
return "天气插件";
}
@Override
public String getDescription() {
return "获取某个城市的天气信息";
}
}