From 7847dcfedeeecb11c91b8acdc60c61c484640172 Mon Sep 17 00:00:00 2001 From: FloRul Date: Wed, 20 Mar 2024 21:58:33 -0400 Subject: [PATCH] Fix JSON parsing issue in history.py --- lambdas/inference/src/history.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lambdas/inference/src/history.py b/lambdas/inference/src/history.py index 4d209e9..bbd1184 100644 --- a/lambdas/inference/src/history.py +++ b/lambdas/inference/src/history.py @@ -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"]})