Accept input and output as typed interfaces in the AI request events

Created on 15 January 2026, 6 days ago

[Tracker]
Update Summary: [One-line status update for stakeholders]
Short Description: [One-line issue summary for stakeholders]
Check-in Date: MM/DD/YYYY
Metadata is used by the AI Tracker. Docs and additional fields here.
[/Tracker]

Problem/Motivation

Now the AI Event constructors accept the $input argument as mixed type in the class Drupal\ai\Event\AiProviderRequestBaseEvent, and the same for $output in the Drupal\ai\Event\AiProviderResponseBaseEvent.

There should be always typed data, as I understand:
- input: Drupal\ai\OperationType\InputInterface
- output: Drupal\ai\OperationType\OutputInterface

Keeping this as mixed requires adding additional checks on each function that works with input and output data, and producing questions on how to process data that doesn't implement those interfaces.

Proposed resolution

Set types for the input and output attributes:
- input: Drupal\ai\OperationType\InputInterface
- output: Drupal\ai\OperationType\OutputInterface

Remaining tasks

Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)

📌 Task
Status

Active

Version

2.0

Component

AI Core module

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024