update
This commit is contained in:
@@ -119,7 +119,8 @@ function loadTools(dir::String)::Vector{agentTool}
|
||||
end
|
||||
|
||||
# Call getTool() — it runs in current scope where types are visible
|
||||
tool = getTool()
|
||||
# Use invokelatest to handle world-age semantics after include()
|
||||
tool = invokelatest(getTool)
|
||||
if !(tool isa agentTool)
|
||||
throw(ArgumentError(
|
||||
"getTool() in $(filepath) did not return an agentTool instance, got: $(typeof(tool))"
|
||||
|
||||
+11
@@ -269,6 +269,17 @@ struct agentTool # A tool available to the agent
|
||||
parallelToolExecute::Bool # Override: run tool calls sequentially or in parallel
|
||||
end
|
||||
|
||||
"""
|
||||
Keyword constructor for agentTool — allows `agentTool(name=..., label=..., ...)`.
|
||||
"""
|
||||
function agentTool(; name::String, label::String, description::String, inputSchema::Any,
|
||||
execute::Function, prepareArguments::Union{Function, Nothing}=nothing,
|
||||
validateRequiredArgs::Union{Function, Nothing}=nothing,
|
||||
parallelToolExecute::Bool=false)
|
||||
return agentTool(name, label, description, inputSchema, execute,
|
||||
prepareArguments, validateRequiredArgs, parallelToolExecute)
|
||||
end
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------------------------------ #
|
||||
# Agent context #
|
||||
|
||||
Reference in New Issue
Block a user