Package com.axelor.workflow.spi
Interface WorkflowAgentInvoker
- All Known Implementing Classes:
WorkflowAgentInvokerImpl
public interface WorkflowAgentInvoker
SPI for invoking an AI agent from an
<agent> node, bound by the AI module. With no
binding, an <agent> node fails at runtime with a clear error.-
Method Summary
Modifier and TypeMethodDescriptionRunsagentCodewithmessageandcontext(record model/id and workflow variables) and returns the agent's text answer.default StringvalidateAgent(String agentCode) Checks at save time thatagentCodenames an enabled, invokable agent that is neither internal nor a template.
-
Method Details
-
invoke
String invoke(String agentCode, String message, Map<String, Object> context, List<AgentOutputField> output) RunsagentCodewithmessageandcontext(record model/id and workflow variables) and returns the agent's text answer.outputis the declared answer shape, empty when none, and is already described inmessage; an implementation may also constrain generation with it. -
validateAgent
Checks 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.
-