I’ve got this working in a Google Sheet:
Feeding back an NLP analysis of the last Response into the follow up Prompt helps sustain conversation flow. GPT is asked to extract keywords, named entities, context and sentiment from the Response and add them at the head to the follow up interaction. In this way conversation flow appears to be sustained.
Topic, DoNLP, LastResponse and FollowUp are range names.
analyse the Prompt using NLP and return topic, context, named entities, keywords and sentiment and then respond to the Follow Up question :
Who were the main characters
In A10 is the formula ="On the topic of: “&Topic&” "&DoNLP&CHAR(10)&CHAR(10)&LastResponse&CHAR(10)&"Follow up: "&FollowUp
Where the last response was about Bulgakov’s novel the White Guard the next Prompt becomes:
analyse the Prompt using NLP and return topic, context, named entities, keywords and sentiment and then respond to the Follow Up question : The White Guard was written by the Ukrainian writer Mikhail Bulgakov. It is a novel that depicts the events of the Ukrainian Revolution of 1918 and the subsequent civil war in Ukraine. Bulgakov is also known for his famous novel, The Master and Margarita.
(Source gpt-3.5-turbo Temperature 0.7)
and respond to the follow up question : Who were the main characters