(
userCopilotMessages: ChatGPTMessage[],
actions: Action[],
userDescription: string | undefined,
orgInfo: Pick<
Organization,
"name" | "description" | "chatbot_instructions" | "enable_data_analysis"
>,
language: string | null,
includeIdLine: boolean,
)
| 188 | } |
| 189 | |
| 190 | export 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 | |
| 219 | export function chatToDocsPrompt( |
| 220 | userDescription: string | undefined, |
no test coverage detected