ArpitxGit / AIChatBotBackend

aichatbotbackend-414059.spheron.app
0 stars 1 forks source link

JSON unexpected token on `JSON.parse(assistantMessagesFiltered[0].content[0].text.value` #2

Open adg29 opened 5 months ago

adg29 commented 5 months ago

See blob link below. Context This occurs the first time requesting /api/assist The second request succeeds

https://github.com/ArpitxGit/AIChatBotBackend/blob/45893734240c9a82dae95327abba6b2bf9baa7ce/index.js#L160

First request response

{"error":"Unexpected token ' in JSON at position 6","currentResponse":{"userMessage":"Time hook: Deadlifting, Place: Coral Gables Gym, Role: Aria Stone, The Protein Guardian, Club: Clean Protein","thread":"thread_fI7pnZP2V5aElTZza2HPkYLP","runStatus":"completed"}}%     

Second request response

{"userMessage":"Time hook: Deadlifting, Place: Coral Gables Gym, Role: Aria Stone, The Protein Guardian, Club: Clean Protein","thread":"thread_fZhrMxfbR7hprAh5RncDXZtd","runStatus":"completed","assistantResponse":{"1":"The Protein Guardian's Quest","2":"Aria Stone, the Protein Guardian, must uncover the secrets of the Clean Protein club to protect the athletes of Coral Gables Gym.","3":"šŸŒŸ Embrace the strength of the Clean Protein club and unlock your potential at Coral Gables Gym! šŸ’Ŗ #ProteinGuardian #FitnessJourney"}
ArpitxGit commented 3 months ago

it happens time to time :)