Hello.
I am attempting to implement ChatGPT's new API into my app. I have successfully been able to make a post request, and that works like this
(do feel free to use it if you wish)
Where my problem lies is converting the response and I get an error Can someone help me with that? Here's what an API response from ChatGPT looks like:
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [{
"index": 0,
"message": {
"role": "assistant",
**"content": "\n\nHello there, how may I assist you today?",**
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 9,
"completion_tokens": 12,
"total_tokens": 21
}
}
I need help with getting the content of the message
That is where I'm at.