Get relevant context from function/object child references or 3rd party libs using AST/CST #751
kikwho
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A big issue with LLM's is that info regarding latest versions of libraries is not up-to-date. It will hallucinate functions, configs, or different stuff just bcz the lib u used is a new version.
An elegant solution might be to use the AST (Abstract Syntax Tree) or CST (Concrete Syntax Tree) to fetch relevant context. For python you could use the ast package or LibCST. For TypeScript you could choose something else. I suggest prioritizing Python, then Typescript (let's focus on these 2 for now).
I was thinking about a "Collect context from scope" (e.g. function or a class (lets focus on function for now, later we can use that for classes)) where every reference inside this function is being crawled until we hit 3d party libs (or maybe we can even go 1-2 levels deep inside a 3d party lib). Maybe we should set a "depth" parameter which defines how deep you should crawl for each reference.
So imagine you have a function with lots of references to other functions/objects. It would be nice if the user had the option to fetch context about this function, whilst having also some context about the other functions/objects or 3rd party libs that are being used inside that function.
Beta Was this translation helpful? Give feedback.
All reactions