初始化
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.ai.util.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.ai.tool.annotation.ToolParam;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ToolParamQuery {
|
||||
|
||||
@ToolParam(required = false,description = "地区")
|
||||
private String currentTimeRegion;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.ruoyi.ai.util.service;
|
||||
|
||||
import com.ruoyi.stock.stock.domain.BasStock;
|
||||
import com.ruoyi.stock.stock.service.IBasStockService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.ai.tool.annotation.Tool;
|
||||
import org.springframework.ai.tool.annotation.ToolParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class BasStockToolService {
|
||||
|
||||
@Autowired
|
||||
private IBasStockService basStockService;
|
||||
|
||||
|
||||
@Tool(description = "根据仓库id查询库存信息")
|
||||
public List<BasStock> getStockInfo(@ToolParam(required = true, description = "仓库id") String warehouseId) {
|
||||
BasStock basStock = new BasStock();
|
||||
basStock.setWarehouseId(warehouseId);
|
||||
List<BasStock> basStocks = basStockService.selectBasStockListApi(basStock);
|
||||
return basStocks;
|
||||
}
|
||||
|
||||
@Tool(description = "根据库存id生成作业")
|
||||
public String createMydoJob(@ToolParam(required = true, description = "库存id") String stockId) {
|
||||
log.info("库存:{},已生成作业",stockId);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Tool(description = "根据单据状态查询单据")
|
||||
public String selectInStockInfo(@ToolParam(required = true, description = "单据状态") String status) {
|
||||
log.info("根据单据状态查询单据:{},已生成作业",status);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.ruoyi.ai.util.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.springframework.ai.tool.annotation.Tool;
|
||||
import org.springframework.ai.tool.annotation.ToolParam;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ToolService {
|
||||
|
||||
|
||||
@Tool(description = "根据地区,获取当前时间")
|
||||
public String getCurrentTime(@ToolParam(required = false, description = "地区") String currentTimeRegion) {
|
||||
System.out.println("getCurrentTime"+currentTimeRegion);
|
||||
return DateUtil.format(DateUtil.date(), "yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
|
||||
@Tool(description = "根据地区,获取当前天气")
|
||||
public String getTQ(@ToolParam(required = false, description = "地区") String currentTimeRegion) {
|
||||
System.out.println("getTQ"+currentTimeRegion);
|
||||
return "特大台风";
|
||||
}
|
||||
|
||||
@Tool(description = "根据地区,获取当前温度")
|
||||
public String getWD(@ToolParam(required = false, description = "地区") String currentTimeRegion) {
|
||||
System.out.println("getWD"+currentTimeRegion);
|
||||
return "500摄氏度";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user