Skip to content

Commit

Permalink
update output format
Browse files Browse the repository at this point in the history
  • Loading branch information
leilei-jiang committed Sep 2, 2024
1 parent 39fe99a commit a8a2d19
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@ def _invoke(self,
response = requests.post(url=PERPLEXITY_API_URL, json=payload, headers=headers)
response.raise_for_status()
valuable_res = self._parse_response(response.json())
text_response = json.dumps(valuable_res, ensure_ascii=False, indent=2)
return self.create_text_message(text_response)

return [
self.create_json_message(valuable_res),
self.create_text_message(json.dumps(valuable_res, ensure_ascii=False, indent=2))
]

0 comments on commit a8a2d19

Please sign in to comment.