Skip to content
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

Better LLM Context for packages and imports #28

Open
janwilmake opened this issue Oct 4, 2024 · 5 comments
Open

Better LLM Context for packages and imports #28

janwilmake opened this issue Oct 4, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@janwilmake
Copy link

Is your feature request related to a problem? Please describe:

Congrats on the launch! Very cool stuff, but one immediate limitation I noticed is you don't have realtime info about packages. like what's inside them...

Describe the solution you'd like:

I'd like the llm to use a tool so it can reason over realtime contents of the package

Describe alternatives you've considered:

The alternative is to just use large packages that it knows, but that's quite a limitation!

Additional context:

I'm building http://swcapi.com and http://npmjz.com let me know if you need help with that!

@Nemikolh Nemikolh added the enhancement New feature or request label Oct 7, 2024
@Nemikolh
Copy link
Member

Nemikolh commented Oct 7, 2024

Hey @CodeFromAnywhere ! 👋

Do you mean to show something like which npm packages are installed in the project? If yes, this is visible in the package.json.

@janwilmake
Copy link
Author

janwilmake commented Oct 7, 2024

no, that's not what I mean.

I mean that your ai hallucinates on the contents of packages. it does not use any context of the actual stuff inside of packages. for bigger packages it's totally fine, but what about smaller ones that aren't represented well in your dataset of the model, or packages owned by the user? you need this additional context to have an ai chatbot that does not hallucinate.

im creating an api for having this context

@Nemikolh
Copy link
Member

Nemikolh commented Oct 7, 2024

I think there's a misunderstanding. Packages are fetched from the npm registry the same way they're fetched on https://stackblitz.com. They are not generated by bolt.

@janwilmake
Copy link
Author

janwilmake commented Oct 7, 2024

I guess the things I say are a bit ambiguous... 😅

The halicunation occurs in the code generation part.

Of course I don't doubt the content of the node_modules folder is sound.

What I mean is that the LLM often hallucinates which functions it should use from packages it installs. Because of that, it generates code that breaks.

Have you thought about this?

As an example, see this prompt with the result:

Screenshot 2024-10-08 at 12 28 32 AM

It hallucinates ^1.0.0 which doesn't exist.

Screenshot 2024-10-08 at 12 30 22 AM

It hallucinates filterArray which doesn't exist. It didn't even check! I also don't see a red line, probably because package installation failed.

Screenshot 2024-10-08 at 12 30 45 AM

Edit: seems it gets stuck here for over 2 minutes now which may be why no red line for edge-util.

Screenshot 2024-10-08 at 12 33 43 AM

@janwilmake janwilmake changed the title Realtime info on packages used ~~Realtime info on packages used~~ Better LLM Context for packages and imports Oct 7, 2024
@janwilmake janwilmake changed the title ~~Realtime info on packages used~~ Better LLM Context for packages and imports Better LLM Context for packages and imports Oct 7, 2024
@Nemikolh
Copy link
Member

Oh thank you so much for the clarification! So sorry, I totally understand what you mean.

I think we could definitely improve on that area to help the AI model so that it generates only known versions. For imports it's a bit more tricky but there's a plenty of ideas we want to experiment.

I'll add this to our internal tracker and we'll keep you posted.

igoraguiar pushed a commit to igoraguiar/bolt.new that referenced this issue Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants