Function output

Specifies the output schema for a class.

  • A primitive type (String, Number, Boolean)
// Using primitive
@output(String)
class StringAgent extends Agent<string, string> {}

// Using schema-decorated class
@output(UserProfile)
class UserAgent extends Agent<string, UserProfile> {}

// Using Zod schema directly
@output(z.boolean())
class BooleanAgent extends Agent<string, boolean> {}
  • Parameters

    • type: InputOutputType

      The output type specification, which can be:

      • A Zod schema
      • A class decorated with

    Returns ClassDecorator