Skip to content

Structured intent classification with union-type response schemas #556

Description

@flsh86

Support ResponseSchema derivation for Scala 3 union types (rendered as JSON-Schema anyOf with a discriminator), enabling classifier.run(msg): F[Refund | Complaint | GeneralQuery] followed by an exhaustive match. Combined with issue 5 this gives a type-safe version of Embabel’s “closed mode” agent routing: a router that dispatches each classified intent to a typed sub-agent, with unhandled intents caught by the compiler. Scala 2.13 can offer a sealed-trait equivalent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions