-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support NextJS edge runtime #618
Conversation
🦋 Changeset detectedLatest commit: afc000b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My suggestion would be change "index.edge-ligtht.js" and only export core module.
But no matter how, this would need more effort because need to change many path import
For example, some files would indirectly import vectorStore.js
|
abace24
to
d977285
Compare
d977285
to
fda0dec
Compare
"exports": { | ||
"./readers/SimpleDirectoryReader": { | ||
"import": { | ||
"types": "./dist/type/readers/SimpleDirectoryReader.edge.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could call this EdgeDirectoryReader then we won't need this edge specific export
packages/edge/package.json
Outdated
"license": "MIT", | ||
"type": "module", | ||
"dependencies": { | ||
"@anthropic-ai/sdk": "^0.15.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best we generate this file from core/package.json and copy its dependencies and version
export * from "./objects/index.js"; | ||
export * from "./postprocessors/index.js"; | ||
export * from "./prompts/index.js"; | ||
export * from "./index.edge.js"; | ||
export * from "./readers/index.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here's the trick: edge is neither importing readers nor storage
c81d7b2
to
b113df4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems not working
@@ -0,0 +1,80 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this package empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, idea is to just copy the build from core and then use different exports in this package
@@ -0,0 +1,31 @@ | |||
export * from "./ChatHistory.js"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work, but might need test to make sure won't have regression
working, but some deps seem not correct |
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"llamaindex": "workspace:*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use @llamaindex/edge
package
packages/core/package.json
Outdated
@@ -60,14 +60,12 @@ | |||
".": { | |||
"import": { | |||
"types": "./dist/type/index.d.ts", | |||
"edge-light": "./dist/index.edge.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@himself65 the idea is that @llamaindex/edge
is working with edge, but llamaindex
is not - that's why i removed edge-light
from the core package
9cdff64
to
0c8d7fb
Compare
0c8d7fb
to
20c85f8
Compare
This PR is working with NextJS edge run-time (tested with Chat LlamaIndex (using
pnpm build && pnpm start
-pnpm dev
doesn't work yet))Changes:
Next steps:
Discuss how to deal with non-edge compatible deps - see comments