Custom Bot Macros

splitclover@proton.me mail me some time

About this rentry

Creating greetings for bots meant for the general public comes with a set of challenges if one wants to do it well. With the current popular frontends there's just not enough ways to customize the greetings. To keep things compatible with all frontends the writer is restricted to only {{char}} and {{user}} macros. While this is better than nothing, this leads to a trade-off.
Either the user is left as a non-descript character only addressed by name, because we don't have any other information at hand, not even pronouns ("they" is a workaround for that, but some users might take issue with that).
Or the writer has to resort to assumptions about {{user}}, which in some scenarios is viable ({{user}} is an adventurer in a fantasy world), but this would potentially clash with the user persona in the end.

A possible approach to fix this

This is inspired by novel ai, they call it placeholders which the user can edit when starting a new story

The idea to add custom macros that the writer can create and use in his greeting would be to open a dialogue box for each newly created chat as seen here using pitanon's Kanako:
Catbox video
The video should be pretty self-explanatory and serve only as a proof of concept using qr.

Technical aspects

These are some ideas on how to implement it, this differs from the video.
To make things easier on the writer we propose an extra menu that's located near the greeting-section of the bot defs (possibly inside the menu for alt-greetings). Inside the menu one could set custom variables that might look something like this:

Variable name Plain text name (optional) default value (optional) short description/example usage (optional)
The name used for macros The plain text name for UI The default/fallback value to avoid broken greetings A short description if needed, possibly with example usage for e.g. proper grammer (see below)
ageGroup Age group young adult The age group of your character. "{{user}}, the young adult was crossing the street to meet {{char}}."

Once the required variables are initialized, the writer could use these macros in greetings (or potentially even character definitions and example chats?):
"{{user}}, the {{getvar::ageGroup}} was crossing the street to meet {{char}}."

Grammar

The example sentence could be useful to have a greeting that's grammatically correct.
Consider this sentence:

"{{user}} is a mischievous adventurer."

Here we would like to replace "mischievous" with a macro. The issue? The article "a". If only the word "mischievous" got replaced, with "upstanding" for example, we'd end up with this sentence:

"{{user}} is a upstanding adventurer."

To fix this we would expand the first macro to include the article ("a mischievous"), it would be up to the user to correctly adjust it.
For clarity the writer could include an example sentence, showcasing how the macro would be used in the greeting:

"{{user}} is a great adventurer."

That way the users know how to properly enter custom values and they wouldn't have to worry about grammar.

Edit Report
Pub: 22 May 2024 12:05 UTC
Edit: 23 May 2024 10:53 UTC
Views: 726