bidah / react-native-vercel-ai

🤖 ⚛️ Run Vercel AI package on React Native and Expo universal native apps (Mobile and web)
MIT License
198 stars 12 forks source link

Support for Vercel AI SDK v3 / Generative UI #12

Open allenchuang opened 5 months ago

allenchuang commented 5 months ago

Hi there, wondering if this package would be able to upgrade to SDK v3 to support generative UI with react native?

bidah commented 4 months ago

that's a good one and we are getting behind. will bring an update tops next week.

cureau commented 4 months ago

Fyi, since this is about making compatibility current, I'll mention that this may or may not be compatible with Expo SDK 50.

I get ReferenceError: Property 'document' doesn't exist when I:

  1. add the metro config config.resolver.unstable_enablePackageExports = true; and then npx expo prebuild --clean + npx expo ios
  2. add "browser": { "ai/react": "./node_modules/ai/react" }, to package.json
  3. replace ai/react with react-native-vercel-ai

Reverting these changes resolves the error. But my setup is so convoluted, I'll refrain from filing a bug. Just wanted to post this here since you're updating the library.

versions

(Thanks for this library!)