For example, with browser automation, giving the LLM raw access to the literal DOM generally results in disaster for tasks that need to be stable across more than 5-10 interactions. The better approach is to write an intermediate layer that understands each view and can provide a list of tools that are precisely tailored for each case. E.g.:
https://myapp/Login
-
- Available Tools:
vs https://myapp/login
- We detected that this is the application's login page.
- It has the following visible elements:
+ Username
+ Password
+ Login Button
- Available Tools:
+ PerformLogin
+ Quit
The later case takes a lot more effort, but it also reduces a Turing complete problem space into a binary decision at this particular step.