Repository navigation
feat(ai): YAML prompt templates with a Jinja2 dialect - #482
Conversation
- Templates pick their chain's user inputs by name (hint, useBacklinks, texts); each runs as the chain defines it, in the chain's order. Unknown names, repeats and attributes are refused on save; stored templates drop names the chain no longer has. - Rename variables: doc-update wikitext -> body, backlinkTitles -> backlinks, readBacklinks -> useBacklinks. Built-in chains drop the request input. Stored templates and older run forms keep working through renames. - User messages headed by variable names; the editor generates them from the picked inputs, with the system block first. - Chains tab: one editor seen and edited in place, system and user rows beside their rendered messages, sample document and user input tables, inline clone, unsaved-change guard, model saved with the form. - AI loop interval options gain 20 minutes.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb11cd44e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…eal placeholders
- A template seen (not edited) previews the messages it runs with, rendered
as they are (check with stored), instead of regenerated ones.
- Older variable names in stored templates are renamed only as {name}
placeholders (prompts.RenamePlaceholders) and editor headings, leaving
wiki markup such as {{wikitext}} intact.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d067a4c23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n their live model - The skin's clone sends input names; PickUserInputs also accepts an input sent exactly as the chain defines it, so skins loaded before this release still clone. - Cloning a built-in chain reads its model live, and a model change in its open row updates the row.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 346558a2bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ving - Store checks the editor's system-then-user order only for messages it builds (auto_messages); messages given as they are, as a skin's clone of an older template, are saved as they run. - While a template saves, rows do not open, close or clone, and the editor reopens the saved template only if it is still the one shown.
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Chain steps and AI edit prompt templates are now Semantic Kernel style
prompt documents: a jinja2 template of <message role> blocks, rendered by
a small dialect (goapp/prompts/jinja) that leaves wiki markup such as
{{틀|a}} as text and reports unknown names on load and save.
- Chain files use snake_case keys, user_inputs and inputs with a closed
json_schema subset and A2UI TextField ui hints, and output_variable.
Function steps and derived inputs are gone: lengths stand in the
template ({{ wikitext[:2000] }}), and backlinks are a run form value
filled by GET /api/ai-edit/backlinks.
- User messages of every built-in chain list their variables in tags
under "# 변수" (minor version bumps).
- A template is stored as one YAML spec (aiedit_prompts.spec); its model
stays a setting of its own. tool migrate converts templates saved
before specs.
- The chains tab edits the spec as YAML with the template syntax marked,
beside preview values and the rendered messages.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 051d88d5e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ki parameters as text
- Legacy conversion keeps each stored message in its role and order, its if
and each as blocks around it, so instructions saved in a user message
(skin clones of content-only templates) survive. The variables' heading
is sent only with a variable under it.
- {{{ is always text, so named wiki parameters ({{{title}}}) are not read
as output.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac6eadca86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08f5133996
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7c9173387
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Reworks AI edit prompt templates and their chains around YAML documents using a small Jinja2 dialect, and updates the chains tab editor.
Templates and the jinja2 dialect
template_format: jinja2and atemplateof<message role="system|user">blocks.goapp/prompts/jinjarenders a small Jinja2 dialect: output with dotted names and character slices,if/elif/else,forwithloop.*,raw, comments,-markers, withtrim_blocksandlstrip_blockson and nothing escaped. Where it overlaps Jinja2 the output matches Jinja2 3.1.{{ … }}is output only when its inside reads as an expression, so{{틀|a}},{{{1}}},{{#if:x}}and{{틀|{{ title }}}}keep working. A name the template is not given ({{ titel }},{{PAGENAME}}) is an error on load and save;{% raw %}holds wiki markup that reads as a name.prompts.ParseChat), so a value holding</message>stays in its message. A message that renders blank is not sent.Chain files
description,version,user_inputs,inputs,stepswithtemplate_format,templateandoutput_variable(name,format).json_schemasubset (string, string withenum, boolean, array of strings) and an optionaluiwith A2UITextFieldnames (variant: shortText|longText,placeholder). The API also sends the type read from them.{{ wikitext[:1000] }},{{ wikitext[:2000] }}). Backlinks are a run form value: the skin's run form has a fetch button callingGET /api/ai-edit/backlinksand lets the requester edit the list. Run form lists hold at most 20 items, and values at most 100,000 characters.# 변수(<title>…</title>). Minor bumps only, so stored definitions, evaluations and rubrics stay current: doc-define and doc-eval v2.3, doc-create and doc-update v2.5.Stored templates
aiedit_prompts.spec):name,description,template_format,template,input_variablespicking the chain's variables by name. Saving checks it against the chain (Chain.WithTemplate). The model stays a setting of its own (aiedit_prompts.model), outside the spec, and does not bump the version.202611100001addsspec.tool migratethen converts templates saved before (aiedit.ConvertLegacyPrompts): instructions become the system message with{name}→{{ name }}and older names renamed, wiki markup that would read as template syntax goes in{% raw %}, and the user message lists the variables the instructions do not read. The old columns stay for now and will be dropped later.Chains tab
POST /api/ai-prompts/checktakesrequest_type,specandpreview_values. Editing also offers the model and the version bump.<source>-<user name>and the model the source runs on now.Other
docs/chain.mdrewritten.Verification
make checks GROUP=goapp(lint and tests) passes.tool migrateconverted all six stored templates. The chains tab and run form still need checking by hand.