Package ai.acolite.agentsdk.core
Interface FunctionTool<TContext,TInput,TOutput>
- All Superinterfaces:
Tool<TContext>
FunctionTool
Function-based tool that can be called by the model.
Source: https://github.com/openai/openai-agents-js/blob/main/packages/agents-core/src/tool.ts
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringerrorFunction(RunContext<TContext> context, Throwable error) Transforms tool execution errors into user-visible error messages.invoke(RunContext<TContext> context, TInput input) booleanisEnabled(RunContext<TContext> context) booleanisStrict()booleanneedsApproval(RunContext<TContext> context, TInput input) Methods inherited from interface ai.acolite.agentsdk.core.Tool
getDescription, getName, getType
-
Method Details
-
getParameters
Object getParameters() -
isStrict
boolean isStrict() -
invoke
-
needsApproval
-
isEnabled
-
errorFunction
Transforms tool execution errors into user-visible error messages.This method is called when invoke() throws an exception or returns a failed CompletableFuture. Return a helpful error message string that will be sent back to the model.
Default implementation returns the exception message. Override to provide custom error messages for specific failure cases.
- Parameters:
context- The run contexterror- The exception that occurred- Returns:
- User-visible error message
-