3 ms·
How do you manage token limits when sending large amounts of code structure to OpenAI?
by NikhilVerma 3y ago
How do you manage token limits when sending large amounts of code structure to OpenAI?
- anotherpaulg 3y agoAider has a "token budget" for the repository map (--map-tokens, default of 1k). It analyzes the AST of all the code in the repo, the call graph, etc... and uses a graph optimization algorithm to select the most relevant parts of the repo map that will fit in the budget. There's some more detail in the recent writeup about the new tree-sitter based repo map that was linked in my comment above.
- ukuina 3y agoAny plans to open support up for other languages that tree-sitter supports?
- anotherpaulg 3y agoAider supports the repo map for bunch of languages already, see below. Is there one in particular you need that is missing? https://github.com/paul-gauthier/aider/tree/main/aider/queries https://github.com/paul-gauthier/aider/tree/main/aider/queri...
- ukuina 3y agoPerl5, please!