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

Function getMessages

lib/prompts/chatBot.ts:190–217  ·  view source on GitHub ↗
(
  userCopilotMessages: ChatGPTMessage[],
  actions: Action[],
  userDescription: string | undefined,
  orgInfo: Pick<
    Organization,
    "name" | "description" | "chatbot_instructions" | "enable_data_analysis"
  >,
  language: string | null,
  includeIdLine: boolean,
)

Source from the content-addressed store, hash-verified

188}
189
190export default function getMessages(
191 userCopilotMessages: ChatGPTMessage[],
192 actions: Action[],
193 userDescription: string | undefined,
194 orgInfo: Pick<
195 Organization,
196 "name" | "description" | "chatbot_instructions" | "enable_data_analysis"
197 >,
198 language: string | null,
199 includeIdLine: boolean,
200): ChatGPTMessage[] {
201 const userDescriptionSection = userDescription
202 ? `\nUser description: ${userDescription}\n`
203 : "";
204
205 return [
206 actions.length > 0
207 ? systemPromptWithActions(
208 userDescriptionSection,
209 orgInfo,
210 getActionDescriptions(actions),
211 language,
212 includeIdLine,
213 )
214 : simpleChatPrompt(userDescriptionSection, orgInfo, language),
215 ...userCopilotMessages,
216 ];
217}
218
219export function chatToDocsPrompt(
220 userDescription: string | undefined,

Callers 5

ViewSystemPromptModalFunction · 0.50
PageActionsSectionFunction · 0.50
AngelaFunction · 0.50
preambleFunction · 0.50

Calls 3

simpleChatPromptFunction · 0.85
systemPromptWithActionsFunction · 0.70
getActionDescriptionsFunction · 0.70

Tested by

no test coverage detected