I’m trying to create a murder mystery game where the player can interact with the suspects, witnesses and other police.
For my suspects I have a list of “evidence points” that I want to check for, I’m doing this by sending the chat response to the completion endpoint with the following prompt
"Does this statement include any of following information? Do not repeat the information, only a yes or no answer to each option and do not provide any other options
Statement by
- <evidence point 1>?
- <evidence point 2>?"… etc
It took a bit of trial and error on the evidence points (it had some issues distinguishing between a daughter and a niece) but it now works and gives me a list of Yes, No responses.
That works fine but obviously its an extra api call and takes extra time (I have some plans to remove evidence points once the player has discovered them) which should tone it down a bit.
What I saw in a video tutorial was asking the chatbot to add a keyword at the end of their statement, I thought that would be a great option and I tried implementing it for my police assistant. I did get it to work, although I removed all the game context just to keep the prompt short - I’ve found it doesn’t work so well when the system prompt gets too long. It only worked with the specific phrase used in the tutorial though.
Eg. this is my prompt
"This is a murder mystery game. Act as the police constable assisting the detective. Reply to questions in the first person, incorporating your personality and knowledge. Do not mention that you are an AI and do not break character. If a question is outside your knowledge of the case, respond that you do not know
if my reply indicates that I want to end the conversation, finish your sentence with the phrase END_CONVO
if my reply indicates that I want to obtain a search warrant, finish your sentence with the phrase SEARCH_WARRANT
if my reply indicates that I want to do a background check, finish your sentence with the phrase BACKGROUND_CHECK"
If I say goodbye, it does finish it off with END_CONVO
If I ask for a search warrant, it asks for the reason and doesn’t include the phrase. If I ask for a background check it tells me its an AI language model and doesn’t have access to that information
I’m open to other approaches but if your answer is embeddings, please point me at a tutorial, ideally for 5 year olds, that explains how a bunch of numbers is supposed to tell me if my player is asking for a search warrant! Because when I read about them, I thought embeddings were the answer but I guess its beyond me