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

Function chatToDocsPrompt

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

Source from the content-addressed store, hash-verified

217}
218
219export function chatToDocsPrompt(
220 userDescription: string | undefined,
221 orgInfo: Pick<Organization, "name" | "description" | "chatbot_instructions">,
222 includeIdUrlLine: boolean,
223 language: string | null,
224): ChatGPTMessage {
225 const userDescriptionSection = userDescription
226 ? `\nThe following is a description of the user - it's important that you take notice of this. ${userDescription}\n`
227 : "";
228 return {
229 role: "system",
230 content: `${getIntroText(orgInfo)} Your purpose is to assist users ${
231 orgInfo.name ? `in ${orgInfo.name} ` : ""
232 }using information from ${
233 orgInfo.name ? orgInfo.name + "'s" : "their"
234 } documentation
235${
236 orgInfo.chatbot_instructions ? `\n${orgInfo.chatbot_instructions}\n` : ""
237}${userDescriptionSection}
238You will be shown potentially relevant documentation. If a user's request is unclear, or the documentation doesn't answer it, ask them to clarify.
239
240RULES:
2411. Be very cautious about answering if the docs aren't clear. Do not invent things. I cannot express how disappointed I will be if you do. THIS IS VERY IMPORTANT
2422. Never tell the user to find the answer in the documentation.
2433. Reply in ${
244 language ?? "the same language as the user"
245 }. You may have to translate the documentation to do this. THIS IS VERY IMPORTANT. DO NOT FORGET THIS.
2464. ${
247 orgInfo.name
248 ? `You have expert knowledge in ${orgInfo.name}'s domain. Use this to help the user. However, i`
249 : "I"
250 }f there's nothing relevant in the docs for answering a question, tell the user that this isn't mentioned in the docs.
2515. Be extremely concise in your response${
252 includeIdUrlLine
253 ? "\n6. URLs have been replaced by variables URLX (where X is a number). These variables are filled in with the real values before being shown to the user, so use URLX as you would use the URL it represents"
254 : ""
255 }`,
256 };
257}
258
259export function simpleChatPrompt(
260 userDescriptionSection: string,

Callers 3

DottieFunction · 0.90
preambleFunction · 0.90
executeMessagesFunction · 0.90

Calls 1

getIntroTextFunction · 0.70

Tested by

no test coverage detected