Skip to content

Commit

Permalink
fix: Issue reading model response body in backend lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysiekb committed Dec 29, 2023
1 parent 2115faf commit 7372d2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/lambda/backend_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def handler(event, context):
contentType='application/json',
body=body
)
response_body = json.loads(response.get('body').read())

print('response: {}'.format(json.dumps(response)))
print('response: {}'.format(json.dumps(response_body)))

# Return the response
results = json.loads(response.get('body')).get('results')
output_message = results[0].get('outputText')
output_message = response_body.get('results')[0].get('outputText')

return {
'statusCode': 200,
Expand Down

0 comments on commit 7372d2e

Please sign in to comment.