JSON is a weak suit of mine.
I have a JSON string:
How do I parse this to extract the message content starting with "Ahoy matey..." and ending with "...me hearty!" ?
If someone can help with this I will be able to show how to interact with ChatGPT - the real deal.
Thanks...
I have a JSON string:
{"id":"chatcmpl-6t2JQdgU1ypn0ayhONAkE6bAEoGkz","object":"chat.completion","created":1678574948,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":25,"completion_tokens":110,"total_tokens":135},"choices":[{"message":{"role":"assistant","content":"Ahoy matey, ye be askin' a great question. The worst investment be ones that promise quick riches without flappin' yer sails too much, like the \"get rich quick\" schemes, ponzi schemes Or pyramid schemes. These scams be all about misuse of trust And deceivin' the inexperienced. They be luring investors with high promised returns, but in the end, they just take yer doubloons and disappear into the horizon. Stay away from such crooks and keep yer treasure safe, me hearty!"},"finish_reason":"stop","index":0}]}
How do I parse this to extract the message content starting with "Ahoy matey..." and ending with "...me hearty!" ?
If someone can help with this I will be able to show how to interact with ChatGPT - the real deal.
Thanks...