This commit is contained in:
2026-09-03 09:49:52 +07:00
parent 6db50b6a52
commit 4ac5b97d53
2 changed files with 25 additions and 25 deletions
+4 -8
View File
@@ -275,14 +275,10 @@ function beforeToolCall(context::beforeToolCallContext, signal::abortSignal)
end
```
"""
function beforeToolCall(context::beforeToolCallContext, signal::abortSignal
function beforeToolCall(context::beforeToolCallContext, signal::abortSignal, eventSink
)::beforeToolCallResult
# final context check
# seek user approval via UI
# other check
eventSink("beforeToolCall: $(context.toolCall.name) args=$(context.args)")
return beforeToolCallResult(false, "N/A")
end
@@ -311,10 +307,10 @@ Common use cases:
terminate flag can all be overridden).
""" #WORKING arrange result from searchWine tool
function afterToolCall(context::afterToolCallContext, signal::abortSignal
function afterToolCall(context::afterToolCallContext, signal::abortSignal, eventSink
)::Union{agentToolResult, Nothing}
# modify context.result if needed and return agentToolResult
eventSink("afterToolCall: $(context.toolCall.name) result=$(context.result) error=$(context.isError)")
return nothing
end