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

Function stripExampleFunctions

lib/edge-runtime/angelaUtils.ts:172–181  ·  view source on GitHub ↗
(rawOutput: string)

Source from the content-addressed store, hash-verified

170}
171
172export 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
183export function getAssistantFnMessagePairs(
184 responseMessages: (FunctionMessage | AssistantMessage)[],

Callers 2

streamResponseToUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected