Package ai.acolite.agentsdk.core.runner
Class ToolExecutionUtils
java.lang.Object
ai.acolite.agentsdk.core.runner.ToolExecutionUtils
ToolExecutionUtils
Static utility methods for tool execution and parameter handling. Extracted from Runner for better testability and reusability.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectdeserializeParameters(Object parameters, Object parameterSchema) Deserialize parameters from Map/JSON to the tool's input type.static FunctionTool<?, ?, ?> findToolByName(Agent<?, ?> agent, String toolName) Find a tool by name in the agent's tool list.
-
Method Details
-
findToolByName
Find a tool by name in the agent's tool list.- Parameters:
agent- Agent containing toolstoolName- Name of the tool to find- Returns:
- FunctionTool if found, null otherwise
-
deserializeParameters
Deserialize parameters from Map/JSON to the tool's input type.Uses Jackson with FAIL_ON_UNKNOWN_PROPERTIES=false to handle API responses that may include extra fields.
- Parameters:
parameters- Raw parameters (typically Map from JSON)parameterSchema- Schema defining the parameter type (should be a Class)- Returns:
- Deserialized parameters as the target type
- Throws:
RuntimeException- if deserialization fails
-