magnitude-core
Version:
Magnitude e2e testing agent
12 lines (11 loc) • 355 B
JavaScript
import { z } from "zod";
export function createAction(action) {
// Just a helper for automatic schema typing
return {
name: action.name,
description: action.description,
schema: action.schema ?? z.object({}),
resolver: action.resolver,
render: action.render ?? ((action) => JSON.stringify(action))
};
}