Skip to content

Conversation

@Jayanaka-98
Copy link
Collaborator

Enum Semantic Strings Support

Adds compile-time extraction of semantic strings from enum members, propagating them to LLM tool schemas.

Changes

  • Compiler: New _extract_enum_info() in MTIR pass extracts enum members, values, and semstrings
  • Schema: Updated _type_to_schema() to include enum member descriptions in generated schemas
  • Tests: 6 new tests covering enum extraction and schema generation

Example

enum Personality { INTROVERT, EXTROVERT, AMBIVERT }

sem Personality.INTROVERT = "Person who is reserved and prefers solitude.";
sem Personality.EXTROVERT = "Person who is outgoing and energized by interaction.";

These descriptions now appear in the LLM schema, improving enum selection accuracy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant