(response: string)
| 23 | const DEFAULT_MAX_STEPS = 12; |
| 24 | |
| 25 | function codeBlocks(response: string): string[] { |
| 26 | return [...response.matchAll(/^[ \t]*```[^\r\n`]*\r?\n([\s\S]*?)^[ \t]*```[ \t]*\r?$/gm)].map((match) => |
| 27 | match[1].trim() |
| 28 | ); |
| 29 | } |
| 30 | |
| 31 | function loopPrompt(language: QueryLanguage, includeSummary: boolean, rules: string): string { |
| 32 | return `You are a data analysis agent. Answer the user's question by querying the provided data source. |