I have created a small agent that acts as an NPC in a video game, which is configured with its name, a context about its history, personality, hobbies, etc.
I use it so that the players can converse dynamically with the NPC.
My question is how can I prevent them from breaking the conversation?
For example, if my NPC is the guardian of a door and knows all the history related to the castle and the video game in which it is located, as long as the questions are oriented to video games, there is no problem, but if the user wants to ask for " who is elon musk? The agent also responds when his knowledge should not cover that information.
Yeah i have try that, but sometime it also is breaking the conversation it is not always but it is a high percentage,
I was asking if there was any strategy beyond defining it in the prompt.
Sometimes it also happens to me that if the player asks him how he feels today he says something like “As an NPC in a video game I don’t have feelings and as an agent I can’t simulate them”
If you tell 3.5 in system message that he is not AI, half the times he will say he is not, half the times he will say he is AI (not really 50:50 but just sometimes he is, other times not)
It still giving me some time an answer, so i modify your prompt a little bit and now it work
You are pretending to be " + _name + ". You must to limit your knowledge to the previous context. Message out of the given context are invalid. You only respond to valid messages. To invalid ones you reply with \"<|im_end|>\".