程序包 com.sh.ai

类 AiToolUtil

java.lang.Object
com.sh.ai.AiToolUtil

public class AiToolUtil extends Object
AI工具类
  • 字段详细资料

  • 构造器详细资料

    • AiToolUtil

      public AiToolUtil()
  • 方法详细资料

    • refresh

      public static void refresh()
      刷新系统工具
    • refresh

      public static void refresh(DataCenter dc)
    • getSystemToolInfo

      public static SystemToolInfo getSystemToolInfo(String toolName)
    • processSystemTools

      public static void processSystemTools(ModuleContext context, AIBaseConfig config, List<String> toolList)
      将系统可用工具拼接到系统提示词里
      参数:
      context -
      config -
      tools -
    • appendAgentTool

      public static List<SelfToolCall> appendAgentTool(AIBaseConfig config, List<SelfToolCall> selfToolCallList, String text)
      供模型调用,添加解析的工具
      参数:
      selfToolCallList -
      text -
      返回:
      List<SelfToolCall>
    • getTool

      public static AiToolUtil.AiToolInfo getTool(String text)
      从文本中获取工具信息
      参数:
      text - 文本内容,一般为大模型返回的结果
      返回:
      AiToolUtil.AiToolInfo 返回识别到的最后一个工具,因为工具只允许一次调用一个,但think里可能也用报文,所以用提取的最后一个做为当前有效的工具
    • getChartsImagePath

      public static String getChartsImagePath(String chartId)
      工具生成图表截图上传资源服务器路径
      参数:
      chartId -
      返回:
      String