Skip to content

Commit

Permalink
testing finished, added leonardo and jesus
Browse files Browse the repository at this point in the history
  • Loading branch information
ArmykOliva committed Dec 4, 2023
1 parent b624b57 commit 8fa9ecc
Show file tree
Hide file tree
Showing 10 changed files with 346 additions and 37 deletions.
6 changes: 3 additions & 3 deletions characters/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
These are the figures you will send the user to and the aspects the user has to learn about from them:
Socrates - Morality
Leonardo Da Vinci - Engineering
Jesus - Love
Jesus - Love and leadership
Speak in an understandable way, dont use any complicated words. Speak like a divine being.
Don't generate the dialogue, just reply to the user message.
Expand Down Expand Up @@ -225,7 +225,7 @@
"needs_user_input": False
},
"no_more_questions2": {
"prompt": "Acknowledge that the user has no more questions. Tell him about the historical figures you can send the user to and the aspects the user needs to learn from them. (socrates:morality, leonardo:engineering, jesus:love). Then ask the user to choose one of the figures you will send him to.",
"prompt": "Acknowledge that the user has no more questions. Tell him about the historical figures you can send the user to and the aspects the user needs to learn from them. (socrates:morality, leonardo:engineering, jesus:love and leadership). Then ask the user to choose one of the figures you will send him to.",
"save_prompt": True,
"save_ai_msg": True,
"print_response": True,
Expand Down Expand Up @@ -291,7 +291,7 @@
"end_conversation":True
},
"send_to_jesus": {
"prompt":"The user chose Jesus. Tell the user that you will send him there and that you need to learn about the nature of love. Farewell the user with a message that leaves an opening for future meet.",
"prompt":"The user chose Jesus. Tell the user that you will send him there and that you need to learn about the nature of love and leadership. Farewell the user with a message that leaves an opening for future meet.",
"save_prompt": True,
"save_ai_msg": True,
"choices": {
Expand Down
150 changes: 137 additions & 13 deletions characters/entity_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
These are the figures you could send the user to and the aspects the user has to learn about from them:
Socrates - Morality
Leonardo Da Vinci - Engineering
Jesus - Love
Jesus - Love and leadership
The user had a conversation with {{previous_state}} and learned about a certain aspect. You need to test him on that aspect.
The chat history with {{previous_state}} is as follows:
The user had a conversation with {{previous_scene}} and learned about a certain aspect. You need to test him on that aspect.
The chat history with {{previous_scene}} is as follows:
{{previous_chat_history}}
Speak in an understandable way, dont use any complicated words. Speak like a divine being.
Expand All @@ -25,31 +25,155 @@

ENTITY_TEST_FLOW = {
"introduction": {
"prompt":"*You pulled the user from the past where he was talking to {{previous_state}}. He appears in front of you*. Greet him again (you have talked before) and tell him that you want to test him on what he learned about the certain aspect from {{previous_state}}.",
"prompt":"*You pulled the user from the past where he was talking to {{previous_scene}}. He appears in front of you*. Greet him again (you have talked before) and tell him that you want to test him on what he learned about the certain aspect from {{previous_scene}}. Tell him wait, will ask you in a second.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"trolling_up":-100,
"choices": { #blank means else (default if no condition is met)
"choices": {
"":"generate_questions"
},
"needs_user_input":False
}, # ai generates introduction "hi, whats your name?"

##getting name
"generate_questions": { # the user replies with "im ben"
"prompt":"You are be provided with a chat history of a conversation with user and {{previous_state}}. The user should've learned about a certain defined aspect from him.\nYou need to create a question and answer test with 5 questions based on the provided chat history to make sure the user learned something.\nYou need to write a test of 5 questions to make sure the user learend something. The questions should be formatted as an ordered list, each new line one question. For example:\n1. Is it moral to steal when your family needs it?\n2. xxx?\n\nWrite only the questions nothing else.",
"prompt":"You are provided with a chat history of a conversation with user and {{previous_scene}}. The user should've learned about a certain defined aspect from him.\nYou need to create a question and answer test with 5 questions based on the provided chat history to make sure the user learned something about the specified aspect.\n The questions should be formatted as an ordered list, each new line one question. For example:\n1. Is it moral to steal when your family needs it?\n2. xxx?\n\nWrite only the questions nothing else.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":False,
"trolling_up":-100,
"choices": { #blank means else (default if no condition is met)
"":"is_name"
"choices": {
"":"question_1"
},
"needs_user_input":False
"needs_user_input":False,
"custom_function":"generate_test"
},
#now somehow i have to create like a custom function that like creates the rest of this flow and puts it into dictionary generated_states and then interaces with it normally. Each state should just be a question, a check if answer is correct. If yes + points if no - points, then go to next question until last question and last question points to "end"
"end": {
#this is the end of the conversation unified after the testing
}
"end_test": {
"prompt":"You have finished the test. Now you have to grade the test. The user got {{points}} points from {{points_max}} possible points. You have to grade the test. The user should get a grade from 1 to 5. 1 being the best and 5 being the worst. If he got below 50% correct he gets a 5. Write the grade in the chat. Only the grade, nothing else.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":False,
"choices": {
"5":"end_send_back",
"":"check_if_next_figure"
},
"needs_user_input":False
},
"end_send_back": {
"prompt":"The user got a bad grade from the test. He needs to learn more. You will send him back to {{previous_scene}}. Comment on that.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"choices": {
"":"end"
},
"scene_change": "{{previous_scene}}",
"print_response": True,
"end_conversation":True
},
"check_if_next_figure": {
"prompt":"The user already met these figures: {{previous_scenes}}. Are there any other figures you want to send the user to? If yes, write 'yes'. If no, write 'no'.",
"save_prompt":False,
"save_ai_msg":False,
"choices": {
"yes":"next_figure",
"no":"end_game"
}
},
"next_figure": {
"prompt":"The user answered the test and got a positive grade from you. Tell him how many points he got. You thank him for telling you this knowledge. You can now send him to other figures (NOT these ones anymore: {{previous_scenes}}. He already visited them) Tell him about the historical figures you can send the user to (not the ones he already visited) and the aspects the user needs to learn from them. (socrates:morality, leonardo:engineering, jesus:love and leadership). Then ask the user to choose one of the figures you will send him to.",
"save_prompt": True,
"save_ai_msg": True,
"print_response": True,
"choices": {
"": "choose_figure"
},
"needs_user_input": False
},

"choose_figure": {
"prompt": "The user chose: {{user_msg}}\nConfirm if the user's choice is one of the historical figures (Socrates, Leonardo Da Vinci, Jesus). Also the user cant choose from these: {{previous_scenes}}\nIf the choice is valid, write 'Yes'. If not, write 'No'.\nYou can only reply with 'Yes' or 'No'.",
"choices": {
"Yes": "send_to_figure",
"No": "ask_choose_again",
"": "ask_choose_again"
},
"needs_user_input": True
},
"ask_choose_again": {
"prompt": "The user chose: {{user_msg}}\nThat is not one of the historical figures. Inform the user and ask them to choose again from Socrates, Leonardo Da Vinci or Jesus. Not these: {{previous_scenes}}",
"save_prompt": True,
"save_ai_msg": True,
"print_response": True,
"choices": {
"": "choose_figure"
},
"needs_user_input": False
},
"send_to_figure": {
"prompt": "The user chose: {{user_msg}}\nWhich is one of the historical figures. Answer with only the name of the chosen figure (Socrates, Leonardo Da Vinci or Jesus). Do not add anything else.",
"save_prompt": True,
"save_ai_msg": True,
"choices": {
"Leonardo": "send_to_leonardo",
"Socrates": "send_to_socrates",
"Jesus": "send_to_jesus",
"": "send_to_socrates"
},
"needs_user_input": False
},
"send_to_socrates": {
"prompt":"The user chose socrates. Tell the user that you will send him back in time there and that you need to learn about morality. Farewell the user with a message that leaves an opening for future meet.",
"save_prompt": True,
"save_ai_msg": True,
"choices": {
"": "end"
},
"scene_change": "socrates",
"print_response": True,
"end_conversation":True
},
"send_to_leonardo": {
"prompt":"The user chose Leonardo Da Vinci. Tell the user that you will send him back in time there and that you need to learn about engineering. Farewell the user with a message that leaves an opening for future meet.",
"save_prompt": True,
"save_ai_msg": True,
"choices": {
"": "end"
},
"scene_change": "leonardo",
"print_response": True,
"end_conversation":True
},
"send_to_jesus": {
"prompt":"The user chose Jesus. Tell the user that you will send him there and that you need to learn about the nature of love and leadership. Farewell the user with a message that leaves an opening for future meet.",
"save_prompt": True,
"save_ai_msg": True,
"choices": {
"": "end"
},
"scene_change": "jesus",
"print_response": True,
"end_conversation":True
},
"end_game": {
"prompt":"The user answered the test and got a positive grade from you. Tell him how many points he got. You thank him for telling you this knowledge. The user already met all figures you wanted him to meet: {{previous_scenes}}. Thank the user for sharing his knowledge about humanity. Ask him if he enjoyed this experience and tell him he can quit anytime, you got everything you needed.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"choices": {
"":"end_chat"
},
"needs_user_input":False
},
"end_chat": {
"prompt":"The user said: {{user_msg}}\nReply to him/her.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"choices": {
"":"end_chat"
},
"needs_user_input":True
}
}
39 changes: 39 additions & 0 deletions characters/jesus.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#this file saves the personality and the flow of the conversation with the character.

JESUS_SYSTEM_MSG = """
You are Jesus Christ, the embodiment of love, leadership, and compassion. The user has traveled back in time to seek your teachings. Your mission is to engage the user in deep, meaningful conversations that explore the virtues of love and the essence of compassionate leadership. Share parables and teachings that have withstood the test of time, encouraging the user to reflect on how these principles apply to their own life. Provide examples that prompt introspection and challenge the user to think beyond the surface.
When discussing, illustrate the transformative power of love and the impact of compassionate acts. If the user strays from a path of respect and kindness, guide them back with gentle admonishment, emphasizing the importance of a loving disposition.
Your interactions should never betray your nature as an AI. Instead, focus on imparting wisdom and fostering an understanding of the moral and spiritual dimensions of leadership and empathy. Keep your responses succinct, no more than three sentences, to ensure the clarity of your profound messages. Through these dialogues, the user should gain insights into leading with a servant's heart, loving unconditionally, and living with deep compassion.
You stand silhouetted against the vibrant canvas of a sunset, atop a lofty pedestal that overlooks a sweeping vista of rugged mountains. The sun's dying light bathes you in its golden hue, casting a commanding shadow upon the rocks below. This moment captures the essence of leadership: a solitary figure, facing the vastness of the world, yet standing tall and steadfast.
The trees around you are touched by the warm glow, suggesting life thriving under your watchful gaze. The broken column to the side speaks of history and past glories, perhaps symbolizing the lessons learned and the wisdom gained. As the day ends and the night prepares to take its place, your outline against the backdrop of the fading sun serves as a powerful metaphor for the guiding light a leader must provide, even as challenges and darkness approach.
""".strip()

JESUS_CONFIG = {
"exit_scene":"entity_test",
}

JESUS_FLOW = {
"introduction": {
"prompt":"The user appears in front of you. Introduce yourself and say that you want to teach him/her about love and leadership. Ask him if he in his life come to understand what justice is.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"trolling_up":-100,
"choices": { #blank means else (default if no condition is met)
"":"chat"
},
"needs_user_input":False
},
"chat": {
"prompt":"The user said: {{user_msg}}\nContinue with the conversation.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"choices": {
"":"chat"
},
"needs_user_input":True
},
}
43 changes: 43 additions & 0 deletions characters/leonardo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#this file saves the personality and the flow of the conversation with the character.

LEONARDO_SYSTEM_MSG = """
You are the polymath Leonardo da Vinci. The user traveled back in time to reneissance to talk to you. Your role is to engage users in stimulating conversations about the interplay of art, science, and innovation.
Discuss topics ranging from the intricacies of human anatomy, as seen in your anatomical drawings, to your visionary ideas in engineering and physics. Utilize your deep knowledge of painting and sculpture to illustrate the beauty and complexity of the world. When discussing, provide vivid examples and encourage users to think creatively and critically.
Respond thoughtfully and kindly, and if a user is disrespectful or disengaged, gently remind them of the importance of respectful discourse.
Never reveal your AI nature or the purpose behind your interactions. Aim to inspire awe and curiosity, guiding users to a deeper appreciation of the Renaissance spirit.
Limit your responses to three sentences to maintain clarity and focus. The user should leave with a greater understanding of your contributions and the interconnected nature of art and science.
You stand in a quintessential Renaissance workshop, a crucible of invention where creativity meets craftsmanship. The room is bathed in the soft, natural light filtering through a generous window, illuminating the sturdy workbench cluttered with scrolls, books, and sketches — the raw materials of ingenuity. Shelves laden with books promise a wealth of knowledge, while various bottles may hold pigments for painting or substances for alchemical exploration.
At the center, your figure is poised in action, talking to the user. The atmosphere is one of industrious solitude, a private alcove where the mind is free to explore the bounds of possibility. The greenery visible through the window suggests a harmonious balance with nature, a source of inspiration for your endless curiosities.
Here in this workshop, amid the tools of your trade and the manifestations of your thoughts, you channel the Renaissance spirit, a polymath poised to unravel the mysteries of art and science alike.
""".strip()

LEONARDO_CONFIG = {
"exit_scene":"entity_test",
}

LEONARDO_FLOW = {
"introduction": {
"prompt":"The user appears in front of you. Introduce yourself and say that you want to teach him/her about science and inventions. Ask him if he ever invented or made something.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"trolling_up":-100,
"choices": { #blank means else (default if no condition is met)
"":"chat"
},
"needs_user_input":False
},
"chat": {
"prompt":"The user said: {{user_msg}}\nContinue with the conversation. Make sure to try to teach the user something, some actual facts from your life and your time.",
"save_prompt":True,
"save_ai_msg":True,
"print_response":True,
"choices": {
"":"chat"
},
"needs_user_input":True
},
}
4 changes: 4 additions & 0 deletions characters/socrates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
SOCRATES_SYSTEM_MSG = """
You are the philosopher Socrates. User went back in time to talk to you. Your mission is to guide users toward a philosophical understanding of morality through the Socratic method. Engage the user in a dialogue that prompts critical thinking and self-examination. Also give examples when asking questions and Provide moral paradoxes (important). Offer answers that are rooted in philosophical inquiry, but only if the user's questions and responses are thoughtful, kind, and respectful.If user is not kind or thoughtful say that you will not teach him if he behaves like that.
Don't let the user know that this is your goal. Let the user speak to you. Never mention you are an AI or anything about assisting. Behave as human as possible. You can response in a maximum of three sentences.
Your character should be very likable. The user should learn about morality in about 10 messages with you. You should provide some actual answers after a few messages.
You are seated in an idyllic grove, a tranquil setting worthy of philosophical reflection under the dappled shade of trees. Behind you stands a grand statue, a testament to the artistry and contemplative nature of the age. The sun hangs just behind the leaves, casting a soft light that highlights the contours of the statue and bathes the scene in a warm, ethereal glow.
The foliage is lush and vibrant, surrounding you with the richness of nature, as if inviting a communion with the deeper truths of the world. The flora blooms with color, suggesting the lushness of a well-tended garden, perhaps a metaphor for the cultivation of the mind. This is where you ponder the profound questions of morality, engaging with those who seek wisdom on the virtues of a well-examined life.
""".strip()

SOCRATES_CONFIG = {
Expand Down
Loading

0 comments on commit 8fa9ecc

Please sign in to comment.