- **Help Agent** — A new agent that answers questions about Talemate itself — settings, agents, clients, the world editor — grounded in the bundled documentation, and able to change agent and application settings on request. - **Timeline Rollback** — Scrub a slider across a scene's automatic version history, preview the message history at any revision, then roll the scene back in place or fork the revision into a new save. - **Pi Bridge Client** — A new client type that drives generations through the pi coding agent's headless RPC mode, making any model pi can reach usable in Talemate. - **Application Settings** — Settings move out of their modal into an always-available Settings tab, with a single topic-grouped sidebar, a settings search, all API keys on one page, and unsaved-change tracking. - **Scene Library** — The home screen is rebuilt as a full-page landing view with a file-tree scene library, cover thumbnails and per-save metadata, scene and save deletion, and a drag-and-drop import dropzone. - **Fast Character Creation** — Generate a character in a single request instead of one prompt per aspect, with a Consolidate multi-select, a token budget, and a Fill in misses pass. Off by default. - **Scene Backdrop** — Set any scene illustration as a backdrop filling the scene view behind the messages, saved with the scene, with configurable text legibility and an Immersive quick-toggle. - **Scene Visual Manager** — World Editor → Scene gains a Visuals tab to browse, upload, generate and delete the scene's backgrounds and illustrations, and set the cover image and backdrop. - **Visual Prompt Finalization** — Post-processing actions — match and replace, or a free-form AI instruction — rewrite image prompts right before they reach the image backend, with per-scene and per-character overrides and reusable template sets. - fixes #271 - fixes #275 Plus 25 improvements and 39 bug fixes — see [CHANGELOG.md](https://github.com/vegu-ai/talemate/blob/prep-0.39.0/CHANGELOG.md#0390) for the full list.
9.0 KiB
Prompt Nodes
Build prompts and run generation from graphs: load and render prompt templates, assemble prompts dynamically (see Prompt Building), and generate a response with a client.
7 nodes.
| Node | Registry path |
|---|---|
| Build Prompt | prompt/BuildPrompt |
| Clean Response | prompt/CleanResponse |
| Generate Response | prompt/GenerateResponse |
| Load Template | prompt/LoadTemplate |
| Prompt From Template | prompt/PromptFromTemplate |
| Render Prompt | prompt/RenderPrompt |
| Template Variables | prompt/TemplateVariables |
Build Prompt
prompt/BuildPrompt
Builds a prompt from a jinja2 template, exposing common context building blocks (scene, memory, extra context, dynamic instructions etc.) as template variables that can be toggled through the node's properties.
Loads the template {scope}.{template_file} and renders it against the
active scene using the agent's client for token budgeting. Outputs both the
Prompt object and the rendered prompt text.
Inputs
| Input | Type | Description |
|---|---|---|
state |
any |
The graph state |
agent |
agent |
The agent whose client is used for rendering and token budgeting |
instructions |
str |
Task instructions made available to the template (optional) |
dynamic_context |
list |
List of DynamicInstruction objects injected as extra context (optional) |
dynamic_instructions |
list |
List of DynamicInstruction objects injected as instructions (optional) |
memory_prompt |
str |
Semantic query / retrieval prompt for the memory context (optional) |
Outputs
| Output | Type | Description |
|---|---|---|
state |
state |
The state input, passed through |
agent |
agent |
The agent input, passed through |
prompt |
prompt |
The built Prompt object |
rendered |
str |
The rendered prompt text |
response_length |
int |
The configured response length, passed through |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
template_file |
str |
"base" |
The template file to use |
scope |
str |
"common" |
The scope of the template |
instructions |
text |
"" |
The instructions to include in the prompt |
reserved_tokens |
int |
312 |
The number of tokens to reserve to account for any overhead. Range: 16 – 1024. |
limit_max_tokens |
int |
0 |
Limit the maximum number of tokens used for the prompt (0 = client context limit). Min: 0. |
include_scene_intent |
bool |
True |
Include the scene intent |
include_extra_context |
bool |
True |
Include the extra context (pins, reinforcements, content classification) |
include_memory_context |
bool |
True |
Include the memory context |
include_scene_context |
bool |
True |
Include the scene context |
include_character_context |
bool |
False |
Include the active character context |
include_gamestate_context |
bool |
False |
Include the game state context |
memory_prompt |
str |
"" |
Semantic query / retrieval prompt for memory |
prefill_prompt |
str |
"" |
Prefill the prompt with a response |
return_prefill_prompt |
bool |
False |
Return the prefill prompt with the response |
dedupe_enabled |
bool |
True |
Enable deduplication |
response_length |
int |
0 |
The length of the response |
technical |
bool |
False |
Include the technical context where applicable (ids, typing etc.) |
Clean Response
prompt/CleanResponse
Cleans a response
Inputs
| Input | Type | Description |
|---|---|---|
response |
str |
The response to clean |
Outputs
| Output | Type | Description |
|---|---|---|
cleaned |
str |
The cleaned response |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
partial_sentences |
bool |
True |
partial_sentences |
strip_partial_sentences |
bool |
True |
Strip partial sentences from the response |
Generate Response
prompt/GenerateResponse
Sends a prompt to the agent and generates a response
Retries up to attempts times on an empty response. When a
response_spec is provided its extractors are applied to the
response; otherwise, if the template produced a data structure,
that is used as the extracted value.
Inputs
| Input | Type | Description |
|---|---|---|
state |
any |
The graph state |
agent |
agent |
The agent to send the prompt to |
prompt |
prompt |
The prompt to send to the agent |
action_type |
str |
Classification of the generated response (optional) |
response_length |
int |
The maximum length of the response (optional) |
response_spec |
response/spec |
(optional) Optional ResponseSpec for extracting structured data from response |
Outputs
| Output | Type | Description |
|---|---|---|
state |
state |
The state input, passed through |
agent |
agent |
The agent that generated the response |
prompt |
prompt |
The Prompt object, passed through |
response |
str |
The response from the agent |
data_obj |
dict,list |
The data structure of the response (when data_output is enabled) |
captured_context |
str |
Context captured by the template during rendering |
rendered_prompt |
str |
The rendered prompt |
response_spec |
response/spec |
Pass-through of the input response spec |
extracted |
dict |
Dictionary of extracted values (when response_spec provided) |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
data_output |
bool |
False |
Output the response as a data structure |
data_multiple |
bool |
False |
Allow multiple data structures in the response |
response_length |
int |
256 |
The maximum length of the response |
action_type |
str |
"scene_direction" |
Classification of the generated response. Choices: analyze, conversation, create, edit, narrate, scene_direction, summarize, visualize, world_state. |
attempts |
int |
1 |
The number of attempts (retry on empty response) |
Load Template
prompt/LoadTemplate
Loads the raw unrendered jinja2 template content based on scope and name
Inputs
| Input | Type | Description |
|---|---|---|
name |
str |
(optional) The template name (without .jinja2 extension) |
scope |
str |
(optional) The template scope (optional, defaults to property) |
Outputs
| Output | Type | Description |
|---|---|---|
template_content |
str |
The raw unrendered template content as a string |
scope |
str |
The resolved template scope, passed through |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
scope |
str |
"scene" |
The template scope. Choices are generated at runtime. |
name |
str |
"" |
The template name to load (without .jinja2 extension) |
Prompt From Template
prompt/PromptFromTemplate
Loads a talemate template prompt
Either a template file or raw template text must be provided (but not both).
Inputs
| Input | Type | Description |
|---|---|---|
template_file |
str |
The template file to load (optional) |
template_text |
str |
Raw template text to use instead of a file (optional) |
variables |
dict |
The variables to use in the template (optional) |
Outputs
| Output | Type | Description |
|---|---|---|
prompt |
prompt |
The Prompt instance |
Properties
| Property | Type | Default | Description |
|---|---|---|---|
scope |
str |
"scene" |
The template scope. Choices are generated at runtime. |
template_file |
str |
"" |
The template to load |
template_text |
text |
"" |
The template text to use |
dedupe |
bool |
True |
Enable prompt deduplication |
Render Prompt
prompt/RenderPrompt
Renders a prompt
Inputs
| Input | Type | Description |
|---|---|---|
prompt |
prompt |
The prompt to render |
Outputs
| Output | Type | Description |
|---|---|---|
rendered |
str |
The rendered prompt |
Template Variables
prompt/TemplateVariables
Helper node that returns a pre defined set of common template variables
Variables:
- scene: The current scene
- scene_title: The scene title (falls back to the scene name)
- max_tokens: The maximum number of tokens in the response
- agent: The relevant agent
Inputs
| Input | Type | Description |
|---|---|---|
agent |
agent |
The relevant agent |
merge_with |
dict |
A dictionary of variables to merge with the pre defined variables (optional) |
Outputs
| Output | Type | Description |
|---|---|---|
variables |
dict |
A dictionary of variables |
agent |
agent |
The relevant agent |