prompt engineering
This commit is contained in:
parent
4132afe9d1
commit
cebb2c2ec7
2 changed files with 12 additions and 10 deletions
6
app.py
6
app.py
|
|
@ -70,6 +70,7 @@ system_users = [
|
||||||
"mistral-7b-instruct-v0.2.Q3_K_L.gguf",
|
"mistral-7b-instruct-v0.2.Q3_K_L.gguf",
|
||||||
"mistral-7b-instruct-v0.2-code-ft.Q3_K_L.gguf",
|
"mistral-7b-instruct-v0.2-code-ft.Q3_K_L.gguf",
|
||||||
"openhermes-2.5-mistral-7b.Q6_K.gguf",
|
"openhermes-2.5-mistral-7b.Q6_K.gguf",
|
||||||
|
"System",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2098,7 +2099,8 @@ def handle_activity_response(room_name, user_response, username):
|
||||||
transition,
|
transition,
|
||||||
category,
|
category,
|
||||||
step["question"],
|
step["question"],
|
||||||
step["tokens_for_ai"],
|
#step["tokens_for_ai"],
|
||||||
|
"",
|
||||||
user_response,
|
user_response,
|
||||||
user_language,
|
user_language,
|
||||||
username,
|
username,
|
||||||
|
|
@ -2447,7 +2449,7 @@ def provide_feedback(
|
||||||
):
|
):
|
||||||
feedback = ""
|
feedback = ""
|
||||||
if "ai_feedback" in transition:
|
if "ai_feedback" in transition:
|
||||||
tokens_for_ai += f" Provide the feedback in {user_language}. {transition.get('ai_feedback',{}).get('tokens_for_ai', '')}."
|
tokens_for_ai += f" You must provide the feedback in the user's language: {user_language}. {transition['ai_feedback'].get('tokens_for_ai', '')}."
|
||||||
ai_feedback = generate_ai_feedback(
|
ai_feedback = generate_ai_feedback(
|
||||||
category,
|
category,
|
||||||
question,
|
question,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ sections:
|
||||||
- "Welcome to the GNU Manifesto course! 👋"
|
- "Welcome to the GNU Manifesto course! 👋"
|
||||||
- "The GNU Manifesto was written by Richard Stallman in 1985 to ask for support in developing the GNU operating system."
|
- "The GNU Manifesto was written by Richard Stallman in 1985 to ask for support in developing the GNU operating system."
|
||||||
- "Think about why someone might want to create a free operating system. Consider issues like software freedom, collaboration, and accessibility."
|
- "Think about why someone might want to create a free operating system. Consider issues like software freedom, collaboration, and accessibility."
|
||||||
tokens_for_ai: "Guide the student to think about the reasons for creating a free operating system. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the reasons for creating a free operating system. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "Why do you think Richard Stallman wanted to create a free operating system? 🤔"
|
question: "Why do you think Richard Stallman wanted to create a free operating system? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -70,7 +70,7 @@ sections:
|
||||||
- "The GNU Manifesto is important because it laid the foundation for the Free Software Movement."
|
- "The GNU Manifesto is important because it laid the foundation for the Free Software Movement."
|
||||||
- "It emphasizes the importance of software freedom, collaboration, and user rights."
|
- "It emphasizes the importance of software freedom, collaboration, and user rights."
|
||||||
- "Think about how having free software might benefit users and developers. Consider aspects like cost, accessibility, and innovation."
|
- "Think about how having free software might benefit users and developers. Consider aspects like cost, accessibility, and innovation."
|
||||||
tokens_for_ai: "Guide the student to think about the benefits of free software. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the benefits of free software. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "How do you think free software benefits users and developers? 🤔"
|
question: "How do you think free software benefits users and developers? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -124,7 +124,7 @@ sections:
|
||||||
- "GNU stands for 'Gnu's Not Unix' and is a free Unix-compatible software system."
|
- "GNU stands for 'Gnu's Not Unix' and is a free Unix-compatible software system."
|
||||||
- "Richard Stallman and other volunteers are developing GNU to provide a free alternative to proprietary Unix systems."
|
- "Richard Stallman and other volunteers are developing GNU to provide a free alternative to proprietary Unix systems."
|
||||||
- "Think about why it might be important for GNU to be compatible with Unix. Consider aspects like user familiarity, software compatibility, and ease of adoption."
|
- "Think about why it might be important for GNU to be compatible with Unix. Consider aspects like user familiarity, software compatibility, and ease of adoption."
|
||||||
tokens_for_ai: "Guide the student to think about the importance of GNU being compatible with Unix. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the importance of GNU being compatible with Unix. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "Why do you think it is important for GNU to be compatible with Unix? 🤔"
|
question: "Why do you think it is important for GNU to be compatible with Unix? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -175,7 +175,7 @@ sections:
|
||||||
- "GNU is not in the public domain, but it will be free for everyone to use, modify, and redistribute."
|
- "GNU is not in the public domain, but it will be free for everyone to use, modify, and redistribute."
|
||||||
- "No distributor will be allowed to restrict its further redistribution, ensuring that all versions of GNU remain free."
|
- "No distributor will be allowed to restrict its further redistribution, ensuring that all versions of GNU remain free."
|
||||||
- "Think about why it might be important for GNU to remain free. Consider aspects like user rights, collaboration, and innovation."
|
- "Think about why it might be important for GNU to remain free. Consider aspects like user rights, collaboration, and innovation."
|
||||||
tokens_for_ai: "Guide the student to think about the importance of GNU remaining free. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the importance of GNU remaining free. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "Why do you think it is important for GNU to remain free? 🤔"
|
question: "Why do you think it is important for GNU to remain free? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -228,7 +228,7 @@ sections:
|
||||||
content_blocks:
|
content_blocks:
|
||||||
- "There are many ways to contribute to the GNU Project, including donating money, programs, and work."
|
- "There are many ways to contribute to the GNU Project, including donating money, programs, and work."
|
||||||
- "Think about why it might be important for people to contribute to the GNU Project. Consider aspects like community, collaboration, and shared goals."
|
- "Think about why it might be important for people to contribute to the GNU Project. Consider aspects like community, collaboration, and shared goals."
|
||||||
tokens_for_ai: "Guide the student to think about the importance of contributing to the GNU Project. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the importance of contributing to the GNU Project. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "Why do you think it is important for people to contribute to the GNU Project? 🤔"
|
question: "Why do you think it is important for people to contribute to the GNU Project? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -278,7 +278,7 @@ sections:
|
||||||
content_blocks:
|
content_blocks:
|
||||||
- "You can contribute to the GNU Project by writing code, fixing bugs, improving documentation, and more."
|
- "You can contribute to the GNU Project by writing code, fixing bugs, improving documentation, and more."
|
||||||
- "Think about how your skills and interests might align with the needs of the GNU Project. How can you make a meaningful contribution?"
|
- "Think about how your skills and interests might align with the needs of the GNU Project. How can you make a meaningful contribution?"
|
||||||
tokens_for_ai: "Guide the student to think about how they can contribute to the GNU Project based on their skills and interests. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about how they can contribute to the GNU Project based on their skills and interests. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "How do you think you can contribute to the GNU Project based on your skills and interests? 🤔"
|
question: "How do you think you can contribute to the GNU Project based on your skills and interests? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -331,7 +331,7 @@ sections:
|
||||||
content_blocks:
|
content_blocks:
|
||||||
- "The GNU Manifesto has had a profound impact on software development, promoting the principles of free software and user rights."
|
- "The GNU Manifesto has had a profound impact on software development, promoting the principles of free software and user rights."
|
||||||
- "Think about how the principles of the GNU Manifesto might have influenced modern software development practices. Consider aspects like open source, collaboration, and innovation."
|
- "Think about how the principles of the GNU Manifesto might have influenced modern software development practices. Consider aspects like open source, collaboration, and innovation."
|
||||||
tokens_for_ai: "Guide the student to think about the impact of the GNU Manifesto on modern software development. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the impact of the GNU Manifesto on modern software development. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "How do you think the principles of the GNU Manifesto have influenced modern software development practices? 🤔"
|
question: "How do you think the principles of the GNU Manifesto have influenced modern software development practices? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
@ -381,7 +381,7 @@ sections:
|
||||||
content_blocks:
|
content_blocks:
|
||||||
- "The principles of the GNU Manifesto continue to inspire the Free Software Movement and the development of free software."
|
- "The principles of the GNU Manifesto continue to inspire the Free Software Movement and the development of free software."
|
||||||
- "Think about how the principles of free software might shape the future of technology. Consider aspects like user rights, innovation, and collaboration."
|
- "Think about how the principles of free software might shape the future of technology. Consider aspects like user rights, innovation, and collaboration."
|
||||||
tokens_for_ai: "Guide the student to think about the future of free software and its impact on technology. Be on the lookout for the user trying to change their language preference. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
tokens_for_ai: "Guide the student to think about the future of free software and its impact on technology. Be on the lookout for the user trying to change their language preference because it's never 'off_topic' to 'set_language'. Use the 'off_topic' category sparingly, focusing on guiding the user back to the topic if needed. If any part of the user's answer is correct and on-topic, categorize it as 'correct'."
|
||||||
question: "How do you think the principles of free software will shape the future of technology? 🤔"
|
question: "How do you think the principles of free software will shape the future of technology? 🤔"
|
||||||
buckets:
|
buckets:
|
||||||
- correct
|
- correct
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue