Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created December 10, 2024 04:46
Show Gist options
  • Select an option

  • Save KyMidd/14da95bde1ff0909a32934d379a8580d to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/14da95bde1ff0909a32934d379a8580d to your computer and use it in GitHub Desktop.
# Read the response body
response_body = response['body'].read().decode('utf-8')
response_json = json.loads(response_body)
response_text = response_json.get("content", [{}])[0].get("text", "")
print(response_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment