AI Agents and AI Function Providers
When to Use
Use this when you want external platforms to invoke Drupal AI Agents or AI FunctionCall plugins via the Orchestration API.
Decision
| Scenario | Submodule |
|---|---|
| Invoke AI Agents defined in Drupal config | orchestration_ai_agents |
Call custom ai.function_calls plugins not covered by other providers |
orchestration_ai_function |
| Trigger ECA models that happen to call AI internally | orchestration_eca (the ECA model handles the AI) |
Pattern
AI Agents Provider (orchestration_ai_agents):
- Service UUID:
ai_agent::{agent_machine_name} - Required config fields per service:
| Key | Required | Notes |
|---|---|---|
instructions |
yes | The task prompt to send to the agent |
model |
yes | Select from provider--model options with JSON output support |
Execute workflow: load provider from model → instantiate agent via AiAgentManager → isAvailable() → determineSolvability() → on JOB_SOLVABLE: solve() → return result.
Successful response shape:
{
"success": true,
"result": {
"message": "...",
"tools": [{"name": "tool_name", "message": "..."}]
}
}
AI Function Call Provider (orchestration_ai_function):
- Service UUID:
ai_function::{plugin_id} - Acts as a catch-all for custom
ai.function_callsplugins - De-duplication: automatically skips plugins whose provider is
eca_base(iforchestration_ecaenabled),ai_agents(iforchestration_ai_agentsenabled), or starts withtool(iforchestration_toolenabled)
Common Mistakes
- Wrong: Enabling
orchestration_ai_agentswithout an AI provider module → Right: The service catalog lists agents butexecute()fails at provider load time - Wrong: Expecting
orchestration_ai_functionto expose AI Agents → Right: It explicitly excludesai_agents-provided plugins to avoid duplication - Wrong: Passing a
modelthat does not support JSON output mode → Right: The agent execution path requiresAiModelCapability::ChatJsonOutput - Wrong: Enabling both submodules when only AI Agents are needed → Right: The combination is safe (de-duplication prevents conflicts) but widens the service surface unnecessarily
See Also
- Installation and Setup
- Orchestration API Reference
- Reference:
modules/ai_agents/src/ServicesProvider.php,modules/ai_function/src/ServicesProvider.php