Class SkillToolset
java.lang.Object
com.google.adk.tools.skills.SkillToolset
- All Implemented Interfaces:
BaseToolset, AutoCloseable
A toolset for managing and interacting with agent skills. Provides tools to list, load, and run
skills.
-
Constructor Summary
ConstructorsConstructorDescriptionSkillToolset(SkillSource skillSource) Initializes the SkillToolset with a SkillSource and default execution settings.SkillToolset(SkillSource skillSource, String systemInstruction) Initializes the SkillToolset with a SkillSource. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Performs cleanup and releases resources held by the toolset.io.reactivex.rxjava3.core.Flowable<BaseTool> getTools(ReadonlyContext readonlyContext) Return all tools in the toolset based on the provided context.io.reactivex.rxjava3.core.CompletableprocessLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) Processes the outgoingLlmRequest.Builder.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BaseToolset
isToolSelectedModifier and TypeMethodDescriptiondefault booleanisToolSelected(BaseTool tool, @Nullable Object toolFilter, @Nullable ReadonlyContext readonlyContext) Checks if a tool should be selected based on a filter.
-
Constructor Details
-
SkillToolset
Initializes the SkillToolset with a SkillSource and default execution settings. -
SkillToolset
Initializes the SkillToolset with a SkillSource.
-
-
Method Details
-
getTools
Description copied from interface:BaseToolsetReturn all tools in the toolset based on the provided context.- Specified by:
getToolsin interfaceBaseToolset- Parameters:
readonlyContext- Context used to filter tools available to the agent.- Returns:
- A Flowable emitting tools available under the specified context.
-
processLlmRequest
public io.reactivex.rxjava3.core.Completable processLlmRequest(LlmRequest.Builder llmRequestBuilder, ToolContext toolContext) Description copied from interface:BaseToolsetProcesses the outgoingLlmRequest.Builder.- Specified by:
processLlmRequestin interfaceBaseToolset
-
close
Description copied from interface:BaseToolsetPerforms 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseToolset- Throws:
Exception
-