Commit Graph
6 Commits
Author SHA1 Message Date
MisraaksandGitHub 217321127f Issue #274: Fix LLMCompiler Bugs (#275)
* Update LLMCompiler.ipynb

The code didn't actually handle when there's more than one dependency listed in an argument. The example of multi-step math used in the code doesn't work because the third step has more than one dependency in its args and the code only handles one:
```
User query: "What's ((3*(4+5)/0.5)+3245) + 8? What's 32/4.23? What's the sum of those two values?"
1. math(problem="((3*(4+5)/0.5)+3245) + 8")
2. math(problem="32/4.23")
3. math(problem="${1}+${2}")
4. join()<END_OFPLAN>
```
Step 3 fails, and does so silently too. It correctly parses strings that are "${1}", but not multi-argument strings like "${1}+${2}"

This fixes it to handle any number of dependencies listed in one arg. It uses the regex pattern already defined in output_parser.py.

* Fix looping function calls because no arg context

Task Fetching Unit, when it inserts the tool_messages, the function args don't get logged with function calls, this causes the replanner to loop and use the same function parameters and never corrects itself.

* Fix tool index count and range

In the planner prompt formatting, the 'num_tools' variable needs to have a +1 added to it because we're appending the join() function, without +1 it says there's one less available tools than there actually is because it only counts the passed in functions and not the join() function. And add +1 for listing otherwise it starts at a 0 offset.

* Fix unhandled empty iterator exception

Task fetching unit: When it calls the tools it doesn't handle when there's no tasks. next() is called and fails. This fixes it by wrapping in a try/except. On exception we set tasks to an empty list since next() failed, there's no tasks.
2024-04-05 10:37:11 -07:00
William Fu-Hinthorn 3226278e22 conclusion 2024-02-12 15:18:48 -08:00
William Fu-Hinthorn 925d015335 Update llmcompiler 2024-02-12 15:05:45 -08:00
William Fu-Hinthorn 92329b3ae8 reword 2024-02-12 14:55:30 -08:00
William Fu-Hinthorn ac131cc954 Add llmcompiler 2024-02-12 14:41:56 -08:00
William Fu-Hinthorn c26a8675c3 rename 2024-02-09 16:05:51 -08:00