Skip to content

Commit

Permalink
fix the way to parse langchain tool's tool_arg['type']
Browse files Browse the repository at this point in the history
  • Loading branch information
Chitius committed Jul 23, 2024
1 parent 92f6eb0 commit 16c4796
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modelscope_agent/tools/langchain_proxy_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def parse_langchain_schema(self):
tool_arg = deepcopy(arg)
tool_arg['name'] = name
tool_arg['required'] = True
tool_arg['type'] = arg['anyOf'][0].get('type', 'string')
if 'type' not in arg:
tool_arg['type'] = arg['anyOf'][0].get('type', 'string')
tool_arg.pop('title')
self.parameters.append(tool_arg)

Expand Down

0 comments on commit 16c4796

Please sign in to comment.