Spaces:
Sleeping
Sleeping
File size: 995 Bytes
b4ecb60 9842827 e9e9e0c b4ecb60 e9e9e0c b4ecb60 e9e9e0c b4ecb60 e9e9e0c b4ecb60 e9e9e0c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | class PromptManager:
"""
A manager for generating prompts based on different tasks.
This class provides methods to format user input into prompts suitable for
various tasks such as Question Answering, Text Generation, and Code Completion.
It raises a ValueError if an unsupported task is specified.
"""
def __init__(self, task):
self.task = task
def get_prompt(self, user_input):
return user_input
def get_system_prompt(self):
"""Returns the system prompt based on the specified task."""
if self.task == "Question Answering":
return "You are a helpful AI assistant. Answer questions concisely and accurately."
elif self.task == "Text Generation":
return "You are a creative AI writer. Generate engaging and coherent text based on the input."
elif self.task == "Code Completion":
return "You are a coding assistant. Complete code snippets correctly without explanations."
|