Skip to content

Commit

Permalink
Fix JSON parsing issue in history.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FloRul committed Mar 21, 2024
1 parent 51585ae commit 7847dcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lambdas/inference/src/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def get(self, limit: int = 10):
InvocationType="RequestResponse",
Payload=json.dumps(payload),
)
body = json.loads(response["Payload"].read().decode("utf-8-sig"))["body"]
body = json.loads(
json.loads(response["Payload"].read().decode("utf-8-sig"))["body"]
)
for x in body:
result.append({"role": "user", "content": x["HumanMessage"]})
result.append({"role": "assistant", "content": x["AssistantMessage"]})
Expand Down

0 comments on commit 7847dcf

Please sign in to comment.