Skip to content

Commit

Permalink
Fix action results (#127)
Browse files Browse the repository at this point in the history
fix action results

Co-authored-by: wangzy <[email protected]>
  • Loading branch information
braisedpork1964 and wangzy committed Jan 31, 2024
1 parent ca1ab4b commit 3d99921
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lagent/actions/google_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def run(self, query: str, k: int = 10) -> ActionReturn:
tool_return.state = ActionStatusCode.HTTP_ERROR
elif status_code == 200:
parsed_res = self._parse_results(response)
tool_return.result = dict(text=str(parsed_res))
tool_return.result = [dict(type='text', content=str(parsed_res))]
tool_return.state = ActionStatusCode.SUCCESS
else:
tool_return.errmsg = str(status_code)
Expand Down
2 changes: 1 addition & 1 deletion lagent/actions/python_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _call(self, command: str) -> ActionReturn:
tool_return.state = ActionStatusCode.API_ERROR
return tool_return
try:
tool_return.result = dict(text=str(res))
tool_return.result = [dict(type='text', content=str(res))]
tool_return.state = ActionStatusCode.SUCCESS
except Exception as e:
tool_return.errmsg = repr(e)
Expand Down

0 comments on commit 3d99921

Please sign in to comment.