Class ApplicationIntegrationToolset
- All Implemented Interfaces:
BaseToolset
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.fasterxml.jackson.databind.ObjectMapper
-
Constructor Summary
ConstructorsConstructorDescriptionApplicationIntegrationToolset
(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 generates tools from a given Application Integration resource. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Performs cleanup and releases resources held by the toolset.io.reactivex.rxjava3.core.Flowable
<BaseTool> getTools
(@Nullable ReadonlyContext readonlyContext) Return all tools in the toolset based on the provided context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.adk.tools.BaseToolset
isToolSelected
-
Field Details
-
OBJECT_MAPPER
public static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPER
-
-
Constructor Details
-
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 generates tools from a given Application Integration resource.Example Usage:
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,enitityOperations=null,actions=null,toolNamePrefix="test-integration-tool",toolInstructions="This tool is used to get response from test-integration.");
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="This tool is used to list, get and update issues in 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) Description copied from interface:BaseToolset
Return all tools in the toolset based on the provided context.- Specified by:
getTools
in interfaceBaseToolset
- Parameters:
readonlyContext
- Context used to filter tools available to the agent.- Returns:
- A Single emitting a list of tools available under the specified context.
-
close
Description copied from interface:BaseToolset
Performs cleanup and releases resources held by the toolset.NOTE: This method is invoked, for example, at the end of an agent server's lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseToolset
- Throws:
Exception
-