This project is not covered by Drupal’s security advisory policy.
AI block
Ai block gives you a block where you can configure a prompt.
You can provide data (programmatically) and the output will be the output of the prompt.
Usage
Similar to Strava's athlete intelligence (where it summarises data for you).
You could use it to summarise the views data on the page or other similar things.
Inspiration

Pre
- Make sure you have the AI module enabled.
- Make sure you have at least one ai provider module enabled.
Configuration
Step 1 Add the block to the page.
Step 2 Configure the block

Output
Output is just rendered (not streamed yet) to the frontpage

Hooks:
function hook_ai_block_prompt_alter(&$prompt, $blockId) {
This hook allows you to alter the prompt (if you want to create your own replacement tokens [view-data] or [my-whatever-data], you can then replace it in the alter function with the actual data.
function hook_ai_block_response_alter(&$aiResponse, $blockId) {
If you would want to alter the response, this is the place to be.
For example if the ai returns markdown and you want to turn it into something else.
| Attachment | Size |
|---|---|
| AI block | 14.37 KB |
| ai_block config with tokens | 61.3 KB |
| Strava athlete intelligence | 88.21 KB |
Project information
Seeking co-maintainer(s)
Maintainers are looking for help reviewing issues.- Project categories: Integrations
- Ecosystem: AI (Artificial Intelligence)
7 sites report using this module
- Created by wouters_f on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

