Tool Approval
Review, approve, or deny selected tool calls before they execute.
use NeuronAI\Agent\Middleware\ToolApproval;
use NeuronAI\Chat\History\FileChatHistory;
use NeuronAI\Workflow\Persistence\FilePersistence;
class MyAgent extends Agent
{
...
/**
* Register tools
*/
protected function tools(): array
{
return [
BuyTicketTool::make(),
];
}
/**
* Durable chat history
*/
protected function chatHisotry(): ChatHistoryInterface
{
return new FileChatHistory(
directory: '/path-to-filesystem',
key: 'conversation ID',
);
}
/**
* Workflow persistence
*/
protected function persistence(): PersistenceInterface
{
return new FilePersistence(
directory: '/path-to-filesystem'
);
}
}Managing The Approval Flow
Detecting Approval on UI
The JSON you'll deal with
Rendering guidance
One endpoint for the whole conversation
Submitting decisions
You Send
Meaning
What the model sees
Last updated