Conversation
1e19f2e to
1bf9cad
Compare
|
I was just working on implementing a mechanism for "tool approvals" and I think this might be it. |
that is next thing that can be added. Hence I have added the hasPendingTools variable which will be true if there are tool needing approval in llm response. a new helper requiresApproval will be added in tool. If true, call tools will emit tool approval required events instead of executing the tool can adding the output. frontend will render tool approval ui and add tool approval response after user confirms and then prism will execute approved tools or add approval denied output and continue llm flow in the next request. https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#tool-execution-approval |
1bf9cad to
299050e
Compare
Description
Summary
This PR introduces support for client-executed tools that are intended to be executed by the client/caller rather than by Prism.
Motivation
Client-executed tools enable scenarios where tool execution must happen on the client side, such as:
Changes
Core Implementation
src/Tool.phpclientExecuted()method to explicitly mark a tool as client-executedisClientExecuted()method that returnstruewhen no handler function is defined ($this->fn === null)src/Concerns/CallsTools.phpcallToolsAndYieldEvents()to filter out client-executed tools from executionBehavior:
FinishReason::ToolCallsUsage Example
Breaking Changes
None. This is a backward-compatible addition. Existing tools with handlers continue to work exactly as before.