File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
import type { ActionResponse } from "./types.ts" ;
2
2
const jsonBlockPattern = / ` ` ` j s o n \n ( [ \s \S ] * ?) \n ` ` ` / ;
3
3
4
- export const messageCompletionFooter = `\nResponse format should be formatted in a JSON block like this:
4
+ export const messageCompletionFooter = `\nResponse format should be formatted in a valid JSON block like this:
5
5
\`\`\`json
6
- { "user": "{{agentName}}", "text": "string", "action": "string" }
7
- \`\`\`` ;
6
+ { "user": "{{agentName}}", "text": "<string>", "action": "<string>" }
7
+ \`\`\`
8
+
9
+ The “action” field should be one of the options in [Available Actions] and the "text" field should be the response you want to send.
10
+ ` ;
8
11
9
12
export const shouldRespondFooter = `The available options are [RESPOND], [IGNORE], or [STOP]. Choose the most appropriate option.
10
13
If {{agentName}} is talking too much, you can choose [IGNORE]
@@ -60,15 +63,15 @@ export const parseBooleanFromText = (text: string) => {
60
63
return null ; // Return null for unrecognized inputs
61
64
} ;
62
65
63
- export const stringArrayFooter = `Respond with a JSON array containing the values in a JSON block formatted for markdown with this structure:
66
+ export const stringArrayFooter = `Respond with a JSON array containing the values in a valid JSON block formatted for markdown with this structure:
64
67
\`\`\`json
65
68
[
66
69
'value',
67
70
'value'
68
71
]
69
72
\`\`\`
70
73
71
- Your response must include the JSON block.` ;
74
+ Your response must include the valid JSON block.` ;
72
75
73
76
/**
74
77
* Parses a JSON array from a given text. The function looks for a JSON block wrapped in triple backticks
You can’t perform that action at this time.
0 commit comments