Demeter29 / Voices_of_the_Court

LLM integration into Crusader Kings 3
GNU General Public License v3.0
12 stars 6 forks source link

[BUG] Some actions are missing in prompt's action list #1

Closed MrAndroPC closed 1 week ago

MrAndroPC commented 1 week ago

At first, pinning full log and action file: debug.log customtest.js.txt

I attempted to add a custom action, but according to the logs, the application doesn’t include the action in the prompt's actions list. All default actions (besides becomeCloseFriends) are included, but my custom action is missing, regardless of which folder I place it in. There are no warnings or errors, and the custom action file is loaded successfully (checked in the Actions window). However, it’s still not reflected in the list of actions available for the prompt.

Additionally, I've noticed that the becomeCloseFriends action is also missing from the prompt list, despite being loaded according to the logs.

Loaded action files in log:

[3:59:3] 'Run File cleared'
[3:59:3] 'loaded standard action: aiGetsWounded.js'
[3:59:3] 'loaded standard action: becomeCloseFriends.js'
[3:59:3] 'loaded standard action: becomeRivals.js'
[3:59:3] 'loaded standard action: emotionHappy.js'
[3:59:3] 'loaded standard action: emotionPain.js'
[3:59:3] 'loaded standard action: emotionSad.js'
[3:59:3] 'loaded standard action: emotionWorry.js'
[3:59:3] 'loaded standard action: improveOpinionOfPlayer.js'
[3:59:3] 'loaded standard action: intercourse.js'
[3:59:3] 'loaded standard action: lowerOpinionOfPlayer.js'
[3:59:3] 'loaded standard action: playerPaysGoldToAi.js'
[3:59:3] 'loaded standard action: undressAi.js'
[3:59:3] 'loaded custom action: customtest.js'
[3:59:3] 'Overwriting context size!'
[3:59:3] 'Overwriting context size!'
[3:59:3] 'Overwriting context size!'
[3:59:11] 'current tokens: 1372'

List of actions in prompt:

'List of actions Bakur can do:\n' +
  '- aiGetsWounded(): execute when Bakur gets seriously wounded. Takes no arguments.\n' +
  "- becomeRivals(reason): Trigger when something drastic happens and Queen Tamar and Bakur become rivals. Takes 1 argument: reason (string).\n" +
  '- emotionHappy(): execute when Bakur is feeling happy. Takes no arguments.\n' +
  '- emotionPain(): execute when Bakur is feeling pain or being hurt. Takes no arguments.\n' +
  '- emotionSad(): execute when Bakur is feeling sad. Takes no arguments.\n' +
  '- emotionWorry(): execute when Bakur is feeling worried. Takes no arguments.\n' +
  "- improveOpinionOfPlayer(opinion): Trigger when Bakur’s opinion of Queen Tamar improves. Takes 1 argument: opinion (number).\n" +
  '- intercourse(): Trigger after sexual intercourse between Bakur and Queen Tamar. Takes no arguments.\n' +
  "- lowerOpinionOfPlayer(opinion): Trigger when Bakur’s opinion of Queen Tamar lowers. Takes 1 argument: opinion (number).\n" +
  '- playerPaysGoldToAi(amount): Trigger when Queen Tamar pays gold to Bakur. Takes 1 argument: amount (number).\n' +
  '- undressAi(): Trigger when Bakur gets undressed. Takes no arguments.\n' +
  '- noop(): Trigger when none of the previous actions fit the context.\n'

All actions are checked in app and reloaded, app was re-opened: image

What I've already tried:

Demeter29 commented 1 week ago

The check function of the action module doesn't have args. The check function simply checks if the action should be available for the llm to trigger. Because the args is actually undefined in your code, it returns false and doesn't show up for the llm. I will upload a full documentation for actions next week.

MrAndroPC commented 1 week ago

I see, tnx for clarification. I think it up to ai then to decide if it able to pay (but at least I guess I can check if AI isn't in debt)