(rawOutput: string)
| 170 | } |
| 171 | |
| 172 | export function stripExampleFunctions(rawOutput: string): string { |
| 173 | /** |
| 174 | * Often if the LLM doesn't output any useful commands, it will output |
| 175 | * the functions given as examples in the prompt (e.g. FUNCTION_1 and FUNCTION_2) |
| 176 | * manually strip this out of the response. |
| 177 | */ |
| 178 | |
| 179 | const functionPattern = /(FUNCTION_1\([^)]*\)|FUNCTION_2\([^)]*\))/g; |
| 180 | return rawOutput.replace(functionPattern, ""); |
| 181 | } |
| 182 | |
| 183 | export function getAssistantFnMessagePairs( |
| 184 | responseMessages: (FunctionMessage | AssistantMessage)[], |
no outgoing calls
no test coverage detected