Skip to content

Commit f4a3e33

Browse files
author
prima
committed
feat: Improvement to allow AI to see current WI identifiers
1 parent 0a2ff6d commit f4a3e33

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

klite.embd

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25880,7 +25880,7 @@ else
2588025880
},
2588125881
{
2588225882
"name": "overwrite_world_information",
25883-
"description": "Overwrites an entry describing an entity. The information is stored under a unique identifier. This information is included when certain keywords are mentioned.",
25883+
"description": "Overwrites an entry describing an entity. The information is stored under a unique identifier. This information is included when certain keywords are mentioned. Limit this to key information and overwrite unique identifiers if needed.",
2588425884
"args": {
2588525885
"uniqueIdentifier": "<unique identifier (such as a characters name, location etc)>",
2588625886
"text": "<descriptive text which by itself provides all needed information to define the entity>",
@@ -26450,28 +26450,6 @@ json_schema = `RESPOND WITH ONLY VALID JSON CONFORMING TO THE FOLLOWING SCHEMA:
2645026450
}
2645126451
} `;
2645226452

26453-
/**
26454-
* Old action prompt
26455-
let actionPrompt = () => {
26456-
return `${!!localsettings.instruct_sysprompt ? `${localsettings.instruct_sysprompt}\n\n` : ""}You are a decision making action AI that evaluates thoughts and takes concise, purposeful actions which lead to a response to the user.
26457-
26458-
${constraints}
26459-
26460-
${getCommandsAsText()}
26461-
26462-
${agentResources}
26463-
26464-
${agentEvaluation}
26465-
26466-
${json_schema}`
26467-
}**/
26468-
26469-
let actionPrompt = (commands = getEnabledCommands()) => {
26470-
return `${!!localsettings.instruct_sysprompt ? `${localsettings.instruct_sysprompt}` : `You are a decision making action AI that evaluates thoughts and takes concise, purposeful actions which lead to a response to the user.`}
26471-
26472-
${getCommandsAsText(commands)}`
26473-
}
26474-
2647526453
let checkFinalThoughtsPrompt = `Action: {"command":{"name":"thought","args":{"message":"I must make sure that I respond to the user with \"send_message\""}}}`
2647626454
</script>
2647726455
<style>
@@ -26759,6 +26737,10 @@ let checkFinalThoughtsPrompt = `Action: {"command":{"name":"thought","args":{"me
2675926737
let getFinalAgentPrompt = (commands, currentOrderOfActions, objectiveForCurrentAction, initialPrompt) => {
2676026738
let state = getDocumentFromTextDB('State')
2676126739
let prompt = []
26740+
26741+
let sysPrompt = !!localsettings.instruct_sysprompt ? `${localsettings.instruct_sysprompt}` : `You are a decision making action AI that evaluates thoughts and takes concise, purposeful actions which lead to a response to the user.`
26742+
prompt.push(`System prompt: ${sysPrompt}`)
26743+
2676226744
if (!!initialPrompt)
2676326745
{
2676426746
prompt.push(`Last user instruction: ${initialPrompt}`)
@@ -26771,12 +26753,17 @@ let checkFinalThoughtsPrompt = `Action: {"command":{"name":"thought","args":{"me
2677126753
{
2677226754
prompt.push(`Current state: ${state}`)
2677326755
}
26756+
let currentAgentWIs = current_wi.filter(wi => !!wi?.wigroup && wi.wigroup === "Agent").map(wi => wi?.comment)
26757+
if (currentAgentWIs.length > 0)
26758+
{
26759+
prompt.push(`Current unique identifiers for world info: ${currentAgentWIs.join(", ")}`)
26760+
}
2677426761
if (currentOrderOfActions.length > 0)
2677526762
{
2677626763
prompt.push(`Order of actions: ${currentOrderOfActions.join(" -> ")}`)
2677726764
}
2677826765
let basePrompt = prompt.join("\n\n")
26779-
return createSysPrompt(`System prompt:\n\n${actionPrompt(!!commands.find(c => c.name === "plan_actions") ? getEnabledCommands() : commands)}`) + (basePrompt.length > 0 ? createSysPrompt(basePrompt) : "")
26766+
return createSysPrompt(`### Available commands:\n\n${getCommandsAsText(!!commands.find(c => c.name === "plan_actions") ? getEnabledCommands() : commands)}`) + (basePrompt.length > 0 ? createSysPrompt(basePrompt) : "")
2678026767
}
2678126768

2678226769
/**

0 commit comments

Comments
 (0)