BuilderIO / gpt-assistant

An experiment to give an autonomous GPT agent access to a browser and have it accomplish tasks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML too big, token limit reached

joshbruegger opened this issue · comments

Hi!
First of all, I love this project and think it has great potential!

I played around with it a bit, and it seems like it runs into the token limit quite often due to the length of the HTML DOM it uses in the prompt.

While the current HTML shortening strategy is already not bad, I think it could be improved with further abstraction. Emmet abbreviations come to mind for a possible approach, perhaps without including attributes at all and numbering elements of the same type (like div1, div2, a1, a2...) in order for GPT to select an element by just naming it, like browser.click(a3).

Has anyone already looked into how to tackle the problem? I'd love to hear if something has been tried again before contributing!