Open KrishnaCodez opened 3 weeks ago
Can you please share your typescript version as well? Updating it may resolve this
my ts version is "typescript": "^5.1.6"
and
tsconfig.json file :- { "compilerOptions": { "module": "NodeNext", "moduleResolution": "NodeNext", "target": "ES2022", "sourceMap": true, "outDir": "dist", "allowSyntheticDefaultImports": true }, "include": ["src/*/.ts", "src/index.ts"] }
Can you share a github repository with a minimal reproduction? I can't reproduce the issue
good to see response from you... here is my repo i have used turbo monorepo i have been trying to implement ai in backend.... for security reason i have removed my frontend folder
also i switch to goggle provider but same error
/../node_modules/@ai-sdk/provider-utils/dist/index.d.ts(134,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation. [0] ../../node_modules/@ai-sdk/provider-utils/dist/index.d.ts(149,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation. [0] ../../node_modules/ai/dist/index.d.ts(8,33): error TS2307: Cannot find module 'openai/lib/AssistantStream' or its corresponding type declarations. [0] ../../node_modules/ai/dist/index.d.ts(9,21): error TS2307: Cannot find module 'openai/resources/beta/threads/runs/runs' or its corresponding type declarations. [0]
@KrishnaCodez i tried your example, but i can't run yarn or another package manager successfully bc it fails to find @repo/eslint-config
@lgrammel i republished repo here is the link i am using ai function in src/controller/chat-controller
Description
Hi Vercel,
I'm trying to implement AI in my Node.js application, i copy paste the code that is available doc but I'm encountering an error. I'd appreciate some assistance in troubleshooting.
The error message I'm getting is:-
Code example
node_modules/@ai-sdk/ui-utils/node_modules/@ai-sdk/provider-utils/dist/index.d.ts(134,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation. [0] node_modules/@ai-sdk/ui-utils/node_modules/@ai-sdk/provider-utils/dist/index.d.ts(149,5): error TS2502: 'fetch' is referenced directly or indirectly in its own type annotation.
[0] node_modules/ai/dist/index.d.ts(8,33): error TS2307: Cannot find module 'openai/lib/AssistantStream' or its corresponding type declarations. [0] node_modules/ai/dist/index.d.ts(9,21): error TS2307: Cannot find module 'openai/resources/beta/threads/runs/runs' or its corresponding type declarations.
Additional context
node version v20.14.0