mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6912] [Feature]: "include" prompt macro #3876
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3876
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @usagirei on GitHub (Sep 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6912
Originally assigned to: @SpicyMarinara on GitHub.
What problem does this solve?
Allow users to include content from a lorebook entry via prompt macros, possibly from lorebooks not included in the chat settings.
Powerful when paired with conditionals / decisions, constant entries, and entries that never match (no triggers / disabled)
Or to simply have an entry include content from another, without having recursive matching enabled and controlling where it appears
This allows for reusable snippets of content without repeating yourself and having divergent sources of truth
Proposed solution
Two new macros in the form of
{{include::ENTRY_NAME_OR_ID}}- Include entry(name/id) from the current lorebook{{include::BOOK_NAME_OR_ID::ENTRY_NAME}}- Include entry(name) from book(name/id)ID lookup first as it's likely a O(1) lookup,
If no matches, look for entry/book by name ( O(n) search ),
If no matches still, return an empty value
Optionally notify the user on generation that the entry was not matched [1]
This macro should probably be evaluated in a dedicated step before or after all others, since it can potentially be recursive.
(Before / After determines if an entry/book name could be a macro by itself)
To avoid cases where
A -> B -> ... -> AorA -> Alooping indefinitely, recursive include calls should keep a "seen" list.If self-recursion is detected, either:
[1]: Maybe a .env setting, or a toggle in advanced settings
Alternatives considered
Additional context
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: