Package com.axelor.ai
Class WorkflowAgentInvokerImpl
java.lang.Object
com.axelor.ai.WorkflowAgentInvokerImpl
- All Implemented Interfaces:
WorkflowAgentInvoker
The AI implementation of the workflow
<agent> node SPI. Runs the agent through AiService: the workflow — not the agent — performs any record changes.
That rule is enforced where it cannot be argued with. Every call from here is programmatic,
and ToolAvailability.deniedToProgrammatic(com.axelor.ai.db.AiTool, com.axelor.ai.tool.system.SystemTool<?>) withholds any tool that
could write from the model entirely, with ToolExecutorPlugin refusing one called anyway.
The note below only explains the situation to the model so it answers usefully instead of
reaching for a tool it does not have; it is not what stops it.
-
Method Summary
Modifier and TypeMethodDescriptionoutputis ignored here: the declared shape is already described to the model insidemessage, and the engine checks the answer against it.validateAgent(String agentCode) Checks at save time thatagentCodenames an enabled, invokable agent that is neither internal nor a template.
-
Method Details
-
invoke
public String invoke(String agentCode, String message, Map<String, Object> context, List<AgentOutputField> output) outputis ignored here: the declared shape is already described to the model insidemessage, and the engine checks the answer against it. It reaches this method so that a later implementation can constrain generation provider-side where the provider supports it -- uneven across the sixAiProviderTypes today, and a feature that silently degrades on half of them is worse than one that behaves the same everywhere.- Specified by:
invokein interfaceWorkflowAgentInvoker
-
validateAgent
Description copied from interface:WorkflowAgentInvokerChecks at save time thatagentCodenames an enabled, invokable agent that is neither internal nor a template. Returns null when usable, else a short reason; the default accepts any.- Specified by:
validateAgentin interfaceWorkflowAgentInvoker
-