Skip to content

feat: add typed_struct_to_schema for converting Ash TypedStructs to NimbleOptions schema#3

Merged
pcharbon70 merged 2 commits intoagentjido:mainfrom
Munksgaard:add-typed-struct-to-schema-2
Mar 18, 2026
Merged

feat: add typed_struct_to_schema for converting Ash TypedStructs to NimbleOptions schema#3
pcharbon70 merged 2 commits intoagentjido:mainfrom
Munksgaard:add-typed-struct-to-schema-2

Conversation

@Munksgaard
Copy link
Copy Markdown
Contributor

Converts Ash TypedStruct modules (used for structured LLM output) to
NimbleOptions keyword list schemas that Jido actions accept directly.

This enables using Ash TypedStructs as the single source of truth for both
Elixir type validation and LLM structured output schemas.

Features:

  • typed_struct_to_schema/1 converts a TypedStruct module to keyword schema
  • Preserves field descriptions, required status, and defaults

Depends on #2

Ash.Type.Atom fields with one_of constraints are now converted to
{:in, string_values} directly by ash_type_to_nimble_options, so all
callers benefit from enum constraint handling automatically.
…imbleOptions schema

Converts Ash TypedStruct modules (used for structured LLM output) to
NimbleOptions keyword list schemas that Jido actions accept directly.

This enables using Ash TypedStructs as the single source of truth for both
Elixir type validation and LLM structured output schemas.

Features:
- typed_struct_to_schema/1 converts a TypedStruct module to keyword schema
- Preserves field descriptions, required status, and defaults
@pcharbon70 pcharbon70 merged commit 3e3a055 into agentjido:main Mar 18, 2026
8 checks passed
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.

2 participants