Skip to content

Support StandardSchema + StandardJSONSchema for result instead of only Valibot #65

@kerkzhan

Description

@kerkzhan

Problem

Internally, Flue calls toJsonSchema from Valibot's library (@valibot/to-json-schema). This forces the consumer to install Valibot as a dependency in their project even if they have an existing validation lib.

Suggestion

I think Flue should allow users to use any validation library they want by implementing the StandardJSONSchema & StandardSchema interface for the result object instead.

Benefits

  • flue/sdk reduces 2 runtime deps.
  • Allows users to use any lib that uses Standard Schema / Standard JSON Schema. They can reuse their existing validation lib, no extra dependency.

Breaking Changes

  • Existing Valibot users will encounter errors on upgrade. They need to install @valibot/to-json-schema in their own project and explicitly call toStandardJsonSchema in their agent.

If this is a welcome change, I'd be happy to look into it and create a PR.

PS: Loving Flue so far! Super clean abstractions, I think a framework for building agents is exactly what is needed now.

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