const headerAuditing = createStep({
id: "header-auditing",
description: "Diagnose the header",
inputSchema: productDataSchema,
outputSchema: scoreSchema,
execute: async ({ mastra, inputData }) => {
const agent = mastra.getAgent("headerAuditingAgent")
const message = `
### Attribute to evaluate
${inputData.header}
`
const score = await observe(async () => {
updateActiveObservation(
{ prompt: instructionsHeaderAuditing },
{ asType: "generation" },
)
return await agent.generate(message, {
structuredOutput: {
schema: scoreSchema,
},
})
})()
return score.object
},
})
const headerAuditing = createStep({
id: "header-auditing",
description: "Diagnose the header",
inputSchema: productDataSchema,
outputSchema: scoreSchema,
execute: async ({ mastra, inputData }) => {
const agent = mastra.getAgent("headerAuditingAgent")
const message = `
### Attribute to evaluate
${inputData.header}
`
const score = await observe(async () => {
updateActiveObservation(
{ prompt: instructionsHeaderAuditing },
{ asType: "generation" },
)
return await agent.generate(message, {
structuredOutput: {
schema: scoreSchema,
},
})
})()
return score.object
},
})