Intro
Wappler’s AI Assistant has evolved quite a bit recently, giving users more flexibility in how they interact with it. There are now* a few different modes available, each tailored to a specific kind of task:
- Ask – great for when you want to discuss ideas, explore solutions, or get advice.
- Edit – lets you apply quick code changes in one go. This mode will be deprecated in favor of the Agent mode.
- Agent Mode – a smarter, more conversational mode where the assistant can actively interact with Wappler, fetch additional information, and carry out structured edits or commands.
In this article, we’ll take a closer look at Agent Mode and how it works.
*Wappler 7 beta 27.
Agent Mode
Agent mode is available in Wappler's AI Assistant for both Server Connect and App Connect.
App Connect
Open the AI Assistant:
Open the Mode Menu and select Agent:
Then select the AI Model which you want to use:
Enter your prompt and hit the send button:
The AI Agent will generate the code to you and will provide explanation about what has been added or modified:
In the Agent Chat you can see the commands being run with a success icons next to them - used for debug info. You can expand and see what changes have been made on the page:
Switching to code view you can see the Diff Toolbar which allows you to review, keep or discard the changes made on the page. Use the arrows to loop through the changes in the code:
Click Keep to keep these changes:
You can continue the conversation with the Agent, with the changes you need to be made next:
You can preview the changes in the code after every change made by the Agent:
Server Connect
The Agent Mode is also available in Server Connect.
Open a Server Action and click the AI Assistant icon:
Select the Agent mode from the dropdown:
Then select the AI Mode which you want to use:
Enter your prompt and hit the Send button. We asked the agent to output data from specific columns from a table in a database:
You can see a detailed descriptions of what changes have been made and what has been added as per your request:
Previewing the Server Action in the browser, you can see it outputs the data which we requested:
This is a simple example, but of course the AI Agent is capable of more complex tasks, such as generating CRUD operations, building conditions and other stuff you need on the server side.