Open
Description
What?
Create a new ingest function that returns a single selectable output, that's one of summary
, tree
, or content
.
For example:
summary = selective_ingest("/some/path", output="summary")
tree = selective_ingest("/some/path", output="tree")
content= selective_ingest("/some/path", output="content")
Why?
This optimizes performance, especially if you are calling the ingest
function over and over.
One use case I have in mind is configuring gitingest
as an LLM tool for an AI agent that parses source code. If the agent wants to optimize for its context window, it can decide what sections of the code to grab based on fetching the summary and tree multiple times on the parent directory and sub-directories to explore the code. It can then finally fetch content selectively.
With the current ingest
function, all three outputs are always computed and returned in the Tuple, which could affect performance for large code bases.