类:ApplicationIntegrationToolset

java.lang.Object
com.google.adk.tools.applicationintegrationtoolset.ApplicationIntegrationToolset
All Implemented Interfaces:
BaseToolset, AutoCloseable

public class ApplicationIntegrationToolset extends Object implements BaseToolset
应用程序集成工具集(Application Integration Toolset)
  • 字段详情

    • objectMapper

      public static final com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • 构造函数详细信息

    • ApplicationIntegrationToolset

      public ApplicationIntegrationToolset(String project, String location, String integration, List<String> triggers, String connection, Map<String, List<String>> entityOperations, List<String> actions, String serviceAccountJson, String toolNamePrefix, String toolInstructions)
      `ApplicationIntegrationToolset` 会根据给定的应用程序集成(Application Integration)资源生成相应的工具。

      示例用法:

      ```java integrationTool = new ApplicationIntegrationToolset( project = "test-project", location = "us-central1", integration = "test-integration", triggers = ImmutableList.of("api_trigger/test_trigger", "api_trigger/test_trigger_2"), serviceAccountJson = "{....}", connection = null, entityOperations = null, actions = null, toolNamePrefix = "test-integration-tool", toolInstructions = "此工具用于从 test-integration 获取响应。" ); ```

      ```java connectionTool = new ApplicationIntegrationToolset( project = "test-project", location = "us-central1", integration = null, triggers = null, connection = "test-connection", entityOperations = ImmutableMap.of( "Entity1", ImmutableList.of("LIST", "GET", "UPDATE"), "Entity2", ImmutableList.of() ), actions = ImmutableList.of("ExecuteCustomQuery"), serviceAccountJson = "{....}", toolNamePrefix = "test-tool", toolInstructions = "此工具用于在 Jira 中列出、获取和更新问题。" ); ```

      Parameters:
      project - The GCP project ID.
      location - The GCP location of integration.
      integration - The integration name.
      triggers - (Optional) The list of trigger ids in the integration.
      connection - (Optional) The connection name.
      entityOperations - (Optional) The entity operations.
      actions - (Optional) The actions.
      serviceAccountJson - (Optional) The service account configuration as a dictionary. Required if not using default service credential. Used for fetching the Application Integration or Integration Connector resource.
      toolNamePrefix - (Optional) The tool name prefix.
      toolInstructions - (Optional) The tool instructions.
  • 方法详细信息(Method Details)

    • getTools

      public io.reactivex.rxjava3.core.Flowable<BaseTool> getTools(@Nullable ReadonlyContext readonlyContext)
      描述内容复制自接口文档: BaseToolset
      根据所提供的上下文,返回工具集中的所有工具。
      Specified by:
      getTools in interface BaseToolset
      Parameters:
      readonlyContext - Context used to filter tools available to the agent.
      Returns:
      A Flowable emitting tools available under the specified context.
    • close

      public void close() throws Exception
      描述内容复制自接口文档: BaseToolset
      执行清理操作,并释放工具集所占用的资源。

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

      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface BaseToolset
      Throws:
      Exception