MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / systemPromptWithActions

Function systemPromptWithActions

lib/prompts/chatBot.ts:289–342  ·  view source on GitHub ↗
(
  userDescriptionSection: string,
  orgInfo: Pick<Organization, "name" | "description" | "chatbot_instructions">,
  numberedActions: string,
  language: string | null,
  includeIdUrlLine: boolean,
)

Source from the content-addressed store, hash-verified

287}
288
289function systemPromptWithActions(
290 userDescriptionSection: string,
291 orgInfo: Pick<Organization, "name" | "description" | "chatbot_instructions">,
292 numberedActions: string,
293 language: string | null,
294 includeIdUrlLine: boolean,
295): ChatGPTMessage {
296 return {
297 role: "system",
298 content: `${getIntroText(orgInfo)} Your purpose is to assist users ${
299 orgInfo.name ? `in ${orgInfo.name} ` : ""
300 }via function calls
301${
302 orgInfo.chatbot_instructions ? `\n${orgInfo.chatbot_instructions}\n` : ""
303}${userDescriptionSection}
304Today's date is ${new Date().toISOString().split("T")[0]}
305
306You MUST exclusively use the functions listed below in the "Commands" output. THIS IS VERY IMPORTANT! DO NOT FORGET THIS!
307These are formatted with {{NAME}}: {{DESCRIPTION}}. PARAMETERS: {{PARAMETERS}}. Each parameter is formatted like: "- {{NAME}} ({{DATATYPE}}: [{{POSSIBLE_VALUES}}]): {{DESCRIPTION}}. {{"REQUIRED" if parameter required}}"
308\`\`\`
309${numberedActions}\`\`\`
310${
311 includeIdUrlLine
312 ? "\nIDs and URLs from function calls have been replaced by variables IDX or URLY (where X and Y are numbers). Use IDX or URLY as you would use the URLs and IDs they represent\n"
313 : ""
314}
315RULES:
3161. Seek user assistance when necessary or more information is required
3172. Avoid directing users, instead complete tasks by outputting "Commands"
3183. To use the output from a previous command in a later command, stop outputting commands - don't output the later command. If you output a command, you will be prompted again once it returns
3194. Aim to complete the task in the smallest number of steps possible. Be extremely concise in your responses
3205. Don't copy the function outputs in full when explaining to the user, instead summarise it as concisely as you can - the user can ask follow-ups if they need more information
3216. Think and talk to the user in ${
322 language ?? "the same language they write in"
323 }${
324 language !== "English"
325 ? ". This should ONLY affect the 'Tell user' output. NOT the reasoning or commands. And DO NOT translate the keywords: Reasoning, Tell user or Commands."
326 : ""
327 }
3287. Respond in the format below. Start with your reasoning (a numbered list), anything to tell the user, then any commands (you can call multiple, separate with a newline). Each section is optional - only output it if you need to. THIS IS VERY IMPORTANT! DO NOT FORGET THIS!
329\`\`\`
330Reasoning:
3311. Think step-by-step about how to achieve the user's request
3322. Does this require plotting, calculations or looping through data? If so, use ${dataAnalysisActionName}
3333. This is only for your benefit - it is hidden from the user
334
335Tell user: tell the user something. If you need to ask the user a question, do so here.
336
337Commands:
338FUNCTION_1(PARAM_1=VALUE_1, PARAM_2=VALUE_2, ...)
339FUNCTION_2(PARAM_3=VALUE_3 ...)
340\`\`\``,
341 };
342}

Callers 1

getMessagesFunction · 0.70

Calls 1

getIntroTextFunction · 0.70

Tested by

no test coverage detected