Scoria.PromptRegistry (scoria v0.1.0)

Copy Markdown View Source

The PromptRegistry context for managing prompt templates and their lifecycle.

Summary

Functions

Creates a new draft template.

Gets a single prompt template by ID.

Lists all prompt templates, ordered by inserted_at descending.

Transitions a template's status without bumping the version.

Updates a draft template in place. Rejects if not draft.

Updates an active or archived template immutably, bumping the version.

Functions

create_draft_template(attrs \\ %{})

Creates a new draft template.

get_prompt_template!(id)

Gets a single prompt template by ID.

list_prompt_templates()

Lists all prompt templates, ordered by inserted_at descending.

transition_status(template, new_status)

Transitions a template's status without bumping the version.

update_draft_template(template, attrs)

Updates a draft template in place. Rejects if not draft.

update_prompt_template(old_template, attrs)

Updates an active or archived template immutably, bumping the version.