Closed kurumiflower closed 1 year ago
It's a json answer, indeed. The only difference is the step number on the beginning of string message. Look at the example below,
42["query_answered",{"status":"completed","uuid":"64ffc4fe-41e9-4036-b3fe-341633e9317a","read_write_token":"b7ffdb55-2f48-4259-a582-f29e78501a58","related_queries":["Is there anything specific you would like to ask or talk about"],"backend_uuid":"490544b6-8619-410c-984f-935325833cbc","label":"","search_focus":"internet","step_type":"FINAL","text":"{\"answer\": \"Hello is a common greeting used to express a friendly welcome or to attract someone's attention[6]. It can also be used as an exclamation of surprise, wonder, or elation[6]. Here are some examples of how the term \\\"hello\\\" is used:\\n\\n- **Music**: \\\"Hello\\\" is the title of a song by Adele, released in 2015[4]. There is also a song called \\\"Hello\\\" by Lionel Richie[1].\\n- **Magazine**: \\\"Hello!\\\" is the name of a celebrity and royal news magazine that covers news from the US and around the world[3].\\n- **Products**: \\\"hello\\\" is a brand of naturally friendly products, including toothpaste, that are vegan and never tested on animals[5]. \\n\\nOverall, \\\"hello\\\" is a versatile term that can be used in many different contexts.\", \"web_results\": [{\"name\": \"Lionel Richie - Hello (Official Music Video) - YouTube\", \"url\": \"https://youtube.com/watch?v=mHONNcZbwDY\", \"snippet\": \"76M views 2 years ago #LionelRichie #Remastered ...\", \"meta_data\": null}, {\"name\": \"Adele - Hello (Lyrics) - YouTube\", \"url\": \"https://youtube.com/watch?v=be12BC5pQLE\", \"snippet\": \"Adele - Hello (Lyrics)Follow Adele ...\", \"meta_data\": null}, {\"name\": \"HELLO! US Edition - Latest news and Photos\", \"url\": \"https://www.hellomagazine.com/us/\", \"snippet\": \"HELLO! US edition brings you the latest celebrity & royal news from the US & around the world, magazine exclusives, celeb babies, weddings, pregnancies and ...\", \"meta_data\": null}, {\"name\": \"Hello (Adele song) - Wikipedia\", \"url\": \"https://en.wikipedia.org/wiki/Hello_(Adele_song)\", \"snippet\": \"\\\"Hello\\\" is a song recorded by English singer-songwriter Adele, released on 23 October 2015 by XL Recordings as the lead single from her third studio album, ...\", \"meta_data\": null}, {\"name\": \"hello | naturally friendly products, vegan + never tested on animals\", \"url\": \"https://www.hello-products.com\", \"snippet\": \"naturally friendly products for naturally friendly people. vegan, cruelty free, and thoughtfully formulated for everyone.\", \"meta_data\": null}, {\"name\": \"Hello Definition & Meaning | Dictionary.com\", \"url\": \"https://www.dictionary.com/browse/hello\", \"snippet\": \"(used to express a greeting, answer a telephone, or attract attention.) (an exclamation of surprise, wonder, elation, etc.).\", \"meta_data\": null}], \"chunks\": [\"\", \"Hello is a common\", \" greeting used\", \" to express a\", \" friendly welcome\", \" or to attract\", \" someone's attention\", \"[6]. It can also\", \" be used as an\", \" exclamation of\", \" surprise, wonder\", \", or elation[6]. Here\", \" are some examples\", \" of how the term\", \" \\\"hello\\\" is used\", \":\\n\\n- **Music**: \\\"\", \"Hello\\\" is the\", \" title of a song\", \" by Adele, released\", \" in 2015[4]. There\", \" is also a song\", \" called \\\"Hello\\\" by\", \" Lionel Richie\", \"[1].\\n- **Magazine**: \\\"\", \"Hello!\\\" is the\", \" name of a celebrity\", \" and royal news\", \" magazine that\", \" covers news from\", \" the US and around\", \" the world[3].\\n- **\", \"Products**: \\\"\", \"hello\\\" is a brand\", \" of naturally\", \" friendly products\", \", including tooth\", \"paste, that are\", \" vegan and never\", \" tested on animals\", \"[5]. \\n\\nOverall, \\\"\", \"hello\\\" is a versatile\", \" term that can\", \" be used in many\", \" different contexts\", \".\"], \"extra_web_results\": [], \"deleted_urls\": [], \"image_metadata\": []}","query_str":"hello","personalized":false,"gpt4":false,"mode":"concise","context_uuid":"83603c2e-fd3c-4ea6-bbbf-071c88b802d0","thread_title":"hello","author_username":"lopezjuliusssss2716","author_image":null,"s3_social_preview_url":"https://ppl-ai-public.s3.amazonaws.com/static/img/logo-dot-field.png"}]
You can convert this string to json like how i do here.
hello! do you have any suggestions on how to parse perplexity's answers into readable view? I already tried many ways, but it's not a json answer, also it has problems with converting into a dictionary so, how do you parse it's answers?