Add include_anote kwarg to lua_compute_context.
Add an optional keyword argument to lua_compute_context to control whether the author's note should be included in the context. The default value is true, so if the include_anote kwarg is not specified then the author's note will be included, which was the default behavior prior to this change. Also update the Lua API documentation to describe this kwarg.
This commit is contained in:
parent
d5143eeb80
commit
4a01f345de
|
@ -3046,6 +3046,8 @@ def lua_compute_context(submission, entries, folders, kwargs):
|
||||||
force_use_txt=True,
|
force_use_txt=True,
|
||||||
scan_story=kwargs["scan_story"] if kwargs["scan_story"] != None else True,
|
scan_story=kwargs["scan_story"] if kwargs["scan_story"] != None else True,
|
||||||
)
|
)
|
||||||
|
if kwargs["include_anote"] is not None and not kwargs["include_anote"]:
|
||||||
|
anotetxt = ""
|
||||||
txt, _, _ = calcsubmitbudget(
|
txt, _, _ = calcsubmitbudget(
|
||||||
len(actions),
|
len(actions),
|
||||||
winfo,
|
winfo,
|
||||||
|
|
|
@ -500,6 +500,7 @@
|
||||||
<li>kwargs? (<code>table<string, any></code>): Table of optional keyword arguments from the following list. Defaults to <code>{}</code>.
|
<li>kwargs? (<code>table<string, any></code>): Table of optional keyword arguments from the following list. Defaults to <code>{}</code>.
|
||||||
<ul>
|
<ul>
|
||||||
<li>scan_story? (<code>boolean</code>): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to <code>false</code>, only the <code>submission</code> is scanned for world info keys. Defaults to <code>true</code>.</li>
|
<li>scan_story? (<code>boolean</code>): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to <code>false</code>, only the <code>submission</code> is scanned for world info keys. Defaults to <code>true</code>.</li>
|
||||||
|
<li>include_anote? (<code>boolean</code>): Whether to include the author's note in the story. Defaults to <code>true</code>, pass <code>false</code> to suppress including the author's note.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -574,6 +575,7 @@
|
||||||
<li>kwargs? (<code>table<string, any></code>): Table of optional keyword arguments from the following list. Defaults to <code>{}</code>.
|
<li>kwargs? (<code>table<string, any></code>): Table of optional keyword arguments from the following list. Defaults to <code>{}</code>.
|
||||||
<ul>
|
<ul>
|
||||||
<li>scan_story? (<code>boolean</code>): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to <code>false</code>, only the <code>submission</code> is scanned for world info keys. Defaults to <code>true</code>.</li>
|
<li>scan_story? (<code>boolean</code>): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to <code>false</code>, only the <code>submission</code> is scanned for world info keys. Defaults to <code>true</code>.</li>
|
||||||
|
<li>include_anote? (<code>boolean</code>): Whether to include the author's note in the story. Defaults to <code>true</code>, pass <code>false</code> to suppress including the author's note.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -687,6 +689,7 @@
|
||||||
<li>kwargs? (<code>table<string, any></code>): Table of optional keyword arguments from the following list. Defaults to <code>{}</code>.
|
<li>kwargs? (<code>table<string, any></code>): Table of optional keyword arguments from the following list. Defaults to <code>{}</code>.
|
||||||
<ul>
|
<ul>
|
||||||
<li>scan_story? (<code>boolean</code>): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to <code>false</code>, only the <code>submission</code> is scanned for world info keys. Defaults to <code>true</code>.</li>
|
<li>scan_story? (<code>boolean</code>): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to <code>false</code>, only the <code>submission</code> is scanned for world info keys. Defaults to <code>true</code>.</li>
|
||||||
|
<li>include_anote? (<code>boolean</code>): Whether to include the author's note in the story. Defaults to <code>true</code>, pass <code>false</code> to suppress including the author's note.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -538,6 +538,7 @@ Computes the context that would be sent to the generator with the user's current
|
||||||
* entries? (`KoboldWorldInfoEntry|table<any, KoboldWorldInfoEntry>`): A `KoboldWorldInfoEntry` or table thereof that indicates an allowed subset of world info entries to include in the context. Defaults to all world info entries.
|
* entries? (`KoboldWorldInfoEntry|table<any, KoboldWorldInfoEntry>`): A `KoboldWorldInfoEntry` or table thereof that indicates an allowed subset of world info entries to include in the context. Defaults to all world info entries.
|
||||||
* kwargs? (`table<string, any>`): Table of optional keyword arguments from the following list. Defaults to `{}`.
|
* kwargs? (`table<string, any>`): Table of optional keyword arguments from the following list. Defaults to `{}`.
|
||||||
* scan_story? (`boolean`): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to `false`, only the `submission` is scanned for world info keys. Defaults to `true`.
|
* scan_story? (`boolean`): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to `false`, only the `submission` is scanned for world info keys. Defaults to `true`.
|
||||||
|
* include_anote? (`boolean`): Whether to include the author's note in the story. Defaults to `true`, pass `false` to suppress including the author's note.
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -636,6 +637,7 @@ The same as calling `kobold.worldinfo:compute_context()` with this world info en
|
||||||
* submission (`string`): String to use as simulated user's input after being formatted by input formatting.
|
* submission (`string`): String to use as simulated user's input after being formatted by input formatting.
|
||||||
* kwargs? (`table<string, any>`): Table of optional keyword arguments from the following list. Defaults to `{}`.
|
* kwargs? (`table<string, any>`): Table of optional keyword arguments from the following list. Defaults to `{}`.
|
||||||
* scan_story? (`boolean`): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to `false`, only the `submission` is scanned for world info keys. Defaults to `true`.
|
* scan_story? (`boolean`): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to `false`, only the `submission` is scanned for world info keys. Defaults to `true`.
|
||||||
|
* include_anote? (`boolean`): Whether to include the author's note in the story. Defaults to `true`, pass `false` to suppress including the author's note.
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
@ -819,6 +821,7 @@ Unlike `kobold.worldinfo:compute_context()`, this function doesn't include world
|
||||||
* entries? (`KoboldWorldInfoEntry|table<any, KoboldWorldInfoEntry>`): A `KoboldWorldInfoEntry` or table thereof that indicates an allowed subset of world info entries to include in the context. Entries that are not inside of the folder are still not included. Defaults to all world info entries in the folder.
|
* entries? (`KoboldWorldInfoEntry|table<any, KoboldWorldInfoEntry>`): A `KoboldWorldInfoEntry` or table thereof that indicates an allowed subset of world info entries to include in the context. Entries that are not inside of the folder are still not included. Defaults to all world info entries in the folder.
|
||||||
* kwargs? (`table<string, any>`): Table of optional keyword arguments from the following list. Defaults to `{}`.
|
* kwargs? (`table<string, any>`): Table of optional keyword arguments from the following list. Defaults to `{}`.
|
||||||
* scan_story? (`boolean`): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to `false`, only the `submission` is scanned for world info keys. Defaults to `true`.
|
* scan_story? (`boolean`): Whether or not to scan the past few actions of the story for world info keys in addition to the submission like how world info normally behaves. If this is set to `false`, only the `submission` is scanned for world info keys. Defaults to `true`.
|
||||||
|
* include_anote? (`boolean`): Whether to include the author's note in the story. Defaults to `true`, pass `false` to suppress including the author's note.
|
||||||
|
|
||||||
### Returns
|
### Returns
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue