The static import of 'ai' package in convertToolsToVercel.ts was still
loading the package early, interfering with @google/genai SDK's stream
handling and causing 'getReader is not a function' errors.
Changes:
- Made convertToolsToVercelFormat async with dynamic import of 'ai'
- Updated all call sites in OpenAI.ts and Anthropic.ts to await the function
- Updated convertToolsToVercel.test.ts to handle async function
This completes the dynamic import strategy across the entire import chain.