diff --git a/packages/page-agent/src/utils/normalize.ts b/packages/page-agent/src/utils/autoFixer.ts similarity index 96% rename from packages/page-agent/src/utils/normalize.ts rename to packages/page-agent/src/utils/autoFixer.ts index a8b88ea..e9bf91a 100644 --- a/packages/page-agent/src/utils/normalize.ts +++ b/packages/page-agent/src/utils/autoFixer.ts @@ -1,7 +1,7 @@ import chalk from 'chalk' /** - * Normalize LLM response to fix common format issues. + * Normalize LLM response and fix common format issues. * * Handles: * - No tool_calls but JSON in message.content (fallback) @@ -65,7 +65,7 @@ export function normalizeResponse(response: any): any { resolvedArguments = { action: safeJsonParse(resolvedArguments) } } } else { - throw new Error('No tool_call and message content does not contain valid JSON') + throw new Error('No tool_call and the message content does not contain valid JSON') } } else { throw new Error('No tool_call nor message content is present') diff --git a/packages/page-agent/src/utils/index.ts b/packages/page-agent/src/utils/index.ts index 1c6c0b1..4e90c39 100644 --- a/packages/page-agent/src/utils/index.ts +++ b/packages/page-agent/src/utils/index.ts @@ -1,4 +1,4 @@ -export { normalizeResponse } from './normalize' +export { normalizeResponse } from './autoFixer' /** * Wait until condition becomes true