Files
langgraph/examples
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
..
2024-02-19 08:39:21 -08:00
r
2024-03-06 17:08:20 -08:00
cr
2024-02-26 11:32:55 -08:00
2024-03-06 17:33:07 -08:00
2024-03-19 08:49:06 -07:00
2024-03-29 16:42:24 -07:00
2024-02-12 15:15:37 -08:00
2024-02-12 15:12:28 -08:00
2024-04-03 21:39:56 -07:00
2024-02-20 17:17:42 -08:00
2024-02-20 20:11:27 -08:00
2024-03-01 12:38:07 +01:00
2024-02-15 23:09:59 -08:00
2024-03-14 10:50:58 -07:00
2024-02-06 06:40:35 -08:00
2024-01-07 09:50:39 -08:00
2024-02-15 23:09:59 -08:00
2024-02-15 23:09:59 -08:00
2024-03-07 09:19:26 -08:00