-
Notifications
You must be signed in to change notification settings - Fork 375
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
fix(core): add more exports on llm/index
#780
Conversation
|
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.
Add a mock ALL_AVAILABLE_ANTHROPIC_LEGACY_MODELS
ALL_AVAILABLE_ANTHROPIC_MODELS
here https://github.com/run-llama/LlamaIndexTS/blob/main/packages/core/e2e/fixtures/llm/anthropic.ts
It's better to use I'm releasing 0.3.0 and will support Cloudflare and others; not everything can be exported to the root index. #775 |
Thanks, so I'll make that change. The issue of not exporting things to the root (or at least to the root of the folders) is that it's very tough for users to figure out what is being exported from where without reading the code. Even if we autogen the API docs (currently broken) we also change the names of the files pretty regularly and move things around, so those imports will not be stable. I think unless it's absolutely unfeasible, we should do our best to try to have everything importable from "llamaindex" 99% of our users are going to import things that way. (because even if we put it in the docs people won't read them) And for the more advanced users we can guide them to import from "llamaindex/[folder]" I don't think it's a good idea to tell people to import from a specific file. |
Yes, export everything as much as possible, but in my view. it's kind of the fault of our library. We should explicit provider sub-modules like The pitfall for JS here is not all code can be run in all JS runtime(like Edge, Cloudflare...), which would cause extra costs for library maintainers to support multiple platforms. I think putting everything into the top index file could cause other hidden dangers |
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.
small nit: we could create src/llm.ts
so that user don't need import by llamaindex/llm/index
but llamaindex/llm
@marcusschiesser @himself65 why did we move away from just export * from every file in the directory? Is there a benefit to doing so? Clear downside is that we'll often forget to re-export things.