AI response: after provider call¶
Plugin ID: ai_eca_interceptor:ai_response
Available since: 2.0.0
Provided tokens
| Token | Description |
|---|---|
[user] |
The current user. Alias: current_user |
[htmx] |
Information about the current HTMX request. |
[htmx:is_request] |
Whether the current request was sent by HTMX ("1" or "0"). |
[htmx:boosted] |
Whether the current request was boosted by HTMX ("1" or "0"). |
[htmx:history_restore] |
Whether the current request is for HTMX history restoration ("1" or "0"). |
[htmx:target] |
The identifier of the element the response is targeted at. |
[htmx:trigger] |
The identifier of the element that triggered the request. On Drupal 11 this is the element id, on Drupal 12 and later it is the CSS selector that htmx 4 sends. Prefer "trigger_name", which means the same thing on both. |
[htmx:trigger_name] |
The name attribute of the element that triggered the request, or empty if it has none. This has the same meaning on all supported Drupal versions. |
[htmx:source] |
The CSS selector of the element that triggered the request, for example button[name="first_item"]. Empty on Drupal 11, which does not send this information. |
[htmx:request_type] |
Whether the request targets a full page or a fragment: "full" or "partial". Empty on Drupal 11, which does not send this information. |
[htmx:current_url] |
The URL of the page the request was sent from. |
[event] |
The AI event. |
[event:machine_name] |
Machine name of the triggered ECA event (e.g. ai.pre_generate_response). |
[event:request_thread_id] |
Unique id of the AI request thread. |
[event:request_parent_id] |
Parent request id if this request was initiated from another AI request. |
[event:provider_id] |
The AI provider id that will execute (or did execute) the call. |
[event:model_id] |
The AI model id. |
[event:operation_type] |
Operation type: chat, embeddings, moderation, speech_to_text, text_to_speech, etc. |
[event:tags] |
Tags attached to the request (array). |
[event:tag_count] |
Number of tags attached to the request. |
[event:configuration] |
Provider configuration array (temperature, max_tokens, …). |
[event:debug_data] |
Debug data attached to the request. |
[event:metadata] |
All metadata on the event, including reroute directives. |
[event:is_chat] |
1 when the operation type is "chat", 0 otherwise. |
[event:input] |
The raw input DTO flattened to an array (input->toArray()). |
[event:input_class] |
Fully qualified class name of the input DTO. |
[event:input_text] |
Best-effort textual representation of the input (chat prompts joined, summarization/translation/moderation text, etc.). |
[event:chat_tools] |
Chat only. The declared tools rendered to an array. |
[event:chat_tool_names] |
Chat only. The names of the declared tool functions (array). |
[event:chat_tool_count] |
Chat only. Number of declared tool functions. |
[event:chat_has_tools] |
Chat only. 1 when the request declares any tools, 0 otherwise. |
[event:chat_has_schema] |
Chat only. 1 when the request declares a structured JSON schema, 0 otherwise. |
[event:chat_streamed] |
Chat only. 1 when the request asked for streamed output, 0 otherwise. |
[event:output] |
Response only. The normalized output converted to an array. |
[event:output_class] |
Response only. Fully qualified class name of the output DTO. |
[event:output_normalized] |
Response only. The normalized output (array form where possible). |
[event:output_raw] |
Response only. The provider's raw output payload. |
[event:output_metadata] |
Response only. Metadata returned by the provider. |
[event:output_text] |
Response only. Best-effort textual representation of the output. |
[event:output_is_streamed] |
Response only, chat. 1 when the output is a streamed iterator, 0 otherwise. |
[event:token_usage] |
Response only, chat. Token usage DTO broken out to fields. |
[event:token_usage:input] |
Input tokens consumed. |
[event:token_usage:output] |
Output tokens produced. |
[event:token_usage:total] |
Total tokens used. |
[event:token_usage:reasoning] |
Reasoning tokens used (if reported). |
[event:token_usage:cached] |
Cached tokens reused (if reported). |
[event:rate_limits] |
Response only, chat. Provider rate limit DTO fields. |
[event:rate_limits:max_requests] |
Rate limit max requests window. |
[event:rate_limits:max_tokens] |
Rate limit max tokens window. |
[event:rate_limits:remaining_requests] |
Remaining requests in the current window. |
[event:rate_limits:remaining_tokens] |
Remaining tokens in the current window. |
[event:rate_limits:reset_requests] |
Seconds until the request window resets. |
[event:rate_limits:reset_tokens] |
Seconds until the token window resets. |
[event:moderation_flagged] |
Response only, moderation. 1 when the response is flagged, 0 otherwise. |
[event:moderation_message] |
Response only, moderation. The moderation response message. |
[event] |
The event. |
[event:machine_name] |
The machine name of the ECA event. |
[session_user] |
The user account that dispatched the event, regardless if ECA is processing models under a different account. This is only available if ECA is configured to always run under a specific account. |
Fields¶
Operation type filter— config key:operation_type-
Limit to a specific AI operation type (e.g. "chat", "embeddings"). Leave empty for any.
Type:
textfield· Required: no · Default: empty string Provider id filter— config key:provider_id-
Limit to a specific provider id. Leave empty for any.
Type:
textfield· Required: no · Default: empty string Model id filter— config key:model_id-
Limit to a specific model id. Leave empty for any.
Type:
textfield· Required: no · Default: empty string