Skip to content

Commit

Permalink
Add input args for tool kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Oct 5, 2023
1 parent 8d06c19 commit 6036346
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public Object takeNextStep(Map<String, BaseTool> nameToToolMap, Map<String, Obje
var tool = nameToToolMap.get(agentAction.getTool());
boolean returnDirect = tool.isReturnDirect();
var toolRunKwargs = agent.toolRunLoggingKwargs();
// add input args for tools
toolRunKwargs.putAll(inputs);
if (returnDirect) {
toolRunKwargs.put("llm_prefix", "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public Object run(Object toolInput, Map<String, Object> kwargs) {
LOG.debug("kwargs: {}", kwargs);
Pair<Object[], Map<String, Object>> pair = toArgsAndKwargs(toolInput);
String args = pair.getKey()[0].toString();
return innerRun(args, pair.getValue());

kwargs.putAll(pair.getValue());
return innerRun(args, kwargs);
}
}

0 comments on commit 6036346

Please sign in to comment.