Interface BaseToolset

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ApplicationIntegrationToolset, ComputerUseToolset, McpAsyncToolset, McpToolset, SkillToolset, SpringAiToolset

public interface BaseToolset extends AutoCloseable
工具集的基础接口。
  • 方法概述

    Modifier and Type
    Method
    Description
    void
    执行清理操作,并释放工具集所占用的资源。
    io.reactivex.rxjava3.core.Flowable<BaseTool>
    getTools(ReadonlyContext readonlyContext)
    根据所提供的上下文,返回工具集中的所有工具。
    default boolean
    isToolSelected(BaseTool tool, @Nullable Object toolFilter, @Nullable ReadonlyContext readonlyContext)
    根据某个过滤器来判断是否应该选择某个工具。
    default io.reactivex.rxjava3.core.Completable
    processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)
    处理出站(即发送到外部系统的)数据/信息。 LlmRequest.Builder.
  • 方法详细信息(Method Details)

    • processLlmRequest

      default io.reactivex.rxjava3.core.Completable processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext)
      处理出站(即发送到外部系统的)数据/信息。 LlmRequest.Builder.
    • getTools

      io.reactivex.rxjava3.core.Flowable<BaseTool> getTools(ReadonlyContext readonlyContext)
      根据所提供的上下文,返回工具集中的所有工具。
      Parameters:
      readonlyContext - Context used to filter tools available to the agent.
      Returns:
      A Flowable emitting tools available under the specified context.
    • close

      void close() throws Exception
      执行清理操作,并释放工具集所占用的资源。

      注意:此方法会在代理服务器的生命周期结束时被调用,或者当工具集不再被需要时被调用。实现该功能时,必须确保所有打开的连接、文件以及其他被管理的资源都被正确释放,以防止资源泄漏。

      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • isToolSelected

      default boolean isToolSelected(BaseTool tool, @Nullable Object toolFilter, @Nullable ReadonlyContext readonlyContext)
      根据某个过滤器来判断是否应该选择某个工具。
      Parameters:
      tool - The tool to check.
      toolFilter - A ToolPredicate, a List of tool names, or null.
      readonlyContext - The context for checking the tool, or null.