This is what we do for validating a code we generate. This requires we have module <something>.<name>
agent workflowCreator {
instruction "${WORKFLOW_CREATOR_INSTRUCTION}",
llm "sonnet_llm",
validate agentlang/validateModule,
retry AgentCraft/classifyRetry,
responseSchema AgentCraft/Generated
}
We must support something like:
agent workflowCreator {
instruction "${WORKFLOW_CREATOR_INSTRUCTION}",
llm "sonnet_llm",
validate agentlang/validateSyntax,
retry AgentCraft/classifyRetry,
responseSchema AgentCraft/Generated
}
So, if it generates just this:
workflow createHubspotContact {
{hubspot/Contact {
email createHubspotContact.email,
first_name createHubspotContact.firstName,
last_name createHubspotContact.lastName
}} @as contact;
{ContactSearchResult {
contactFound true,
existingContactId contact.id
}}
}
The validator must work.