Skip to content

[Platform] Backed Enums Support for Tool Arguments and Structured Output #492

@chr-hertel

Description

@chr-hertel

Json Schema supports defining enums on properties, which is even supported with our #[With] attribute to be configured explicitly. But it would also be great to support this without attribute, when a Backed Enum is used as type:

enum Mode: string
{
    case AND = 'and';
    case OR = 'or';
}

class MySearchTool
{
    public function __invoke(array $searchTerms, Mode $mode): array
    {
        // ...
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issueIdeal for your first contribution! (some Symfony experience may be required)PlatformIssues & PRs about the AI Platform component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions