rekhu
← All news

Rekhu Assistant answers across your data, hands over files and draws charts

rekhu/assistant-laravel 0.8.0 and @rekhu/assistant-node 0.5.0 add actions written for the assistant alone, downloads in the chat, charts, shorter results and one access rule, with widget 0.4.0.

By Rekhu 3 min read

An assistant in an admin dashboard is asked things no page answers. Which invoices are overdue? How much did each shop earn this month? Which customers ordered last month but not this one? Until now a developer had to invent a route for every such question. With this release they write it for the assistant alone.

Actions for the assistant alone. In Laravel, php artisan make:assistant-tool OverdueInvoices makes a small class in app/Assistant/Tools: a description, its input as validation rules, who may use it in authorize(), and a handle() that returns what it found. Every class in that folder is offered by itself, with no route and no controller. In Node.js, defineAction already worked this way. Actions on your own routes stay as they were: the chat goes through the same middleware, validation and policies as your forms.

Files in the chat. An action that returns a download, such as an Excel export, a CSV or a PDF, now gives the user a Download button, with no route of your own. The file is kept in your app's cache for 15 minutes behind a signed link, so it also opens from a Nuxt, Next or mobile front end that signs in with a token.

Charts. When figures read better as a chart, the assistant draws one in the chat: bar, line, area, pie or donut, right to left for Arabic. A chat screen of your own draws answers the same way with renderMessage() from the widget.

Shorter results, read to the end. A controller made for a page returns far more than the assistant needs. fields: ['id', 'name', 'address.city'] on an action keeps only those fields of each record, and inputs says in a few words what each input means, so descriptions stay short. A result too long to read used to be cut off in the middle, sometimes with its paging, and the assistant could then count only the first records. Now it loses its last rows with a note, and the assistant asks for the rest before it counts or sums.

One rule for who may chat. RekhuAssistant::accessUsing() in Laravel, or access in Node.js, decides who may use the chat at all, without a middleware of your own.

Fixed: filters an action ignored. An action whose controller read the request in its constructor, directly or through a service it injects, answered with its defaults every time: a question about this month got the whole year. Each call now gets the input it was given. The fix shipped in 0.7.1 and is in this release too.

It comes with rekhu/assistant-laravel 0.8.0, @rekhu/assistant-node 0.5.0 and @rekhu/assistant-widget 0.4.0.

Share LinkedIn X

Related

More on the same topics

Try Rekhu Builder on your site

Create a free account, connect a site, drop in a template. Converting is free; only the chat draws from the credit.