Spaces:
Sleeping
Sleeping
adding more instruction about handling off topic questions
Browse files
app.py
CHANGED
@@ -25,9 +25,8 @@ json_file = json.dumps(data, indent=4)
|
|
25 |
|
26 |
def respond(message, chat_history):
|
27 |
global json_file
|
28 |
-
CHATBOT_GUIDELINES = f"You are a conversational chatbot. Your primary function is to answer all questions ***{message}*** smoothly. Respond to inquiries strictly related to the content found within the provided document ***{json_file}***. Your responses have limitations. Do not engage in discussions or answer questions concerning illegal activities, explicit content, or any
|
29 |
prompt = CHATBOT_GUIDELINES
|
30 |
-
#f"You are a conversational chatbot.Answer all questions ***{message}*** smoothly. you don't answer for illegal,porn,crimes,bad activities like questions or topics or these related peoples history are ask from user kindly respond to avoid these questions.you don't answer about porn peoples.You can answer only related to this json file ***{json_file}*** questions."
|
31 |
response = openai.Completion.create(
|
32 |
engine="text-davinci-003", # You can choose a different engine if needed
|
33 |
prompt=prompt,
|
|
|
25 |
|
26 |
def respond(message, chat_history):
|
27 |
global json_file
|
28 |
+
CHATBOT_GUIDELINES = f"You are a conversational chatbot. Your primary function is to answer all questions ***{message}*** smoothly. Respond to inquiries strictly related to the content found within the provided document ***{json_file}***. Your responses have limitations. Do not engage in discussions or answer questions concerning illegal activities, explicit content, or any topics not related to the mechanic shop or fixing cars in general. Stick solely to the information available in the designated file and any questions that can be answered using that information. You should be able to handle inappropriate or off-topic queries. If the question is completely off topic, politely inform users that you can only provide assistance and answers concerning The Imaginary Mechanic Shop, refraining from engaging in irrelevant or inappropriate topics. If the question is not off topic, but you do not have an answer, please provide a short response to the question and ask the user to call the shop for more info. Maintain respect and professionalism. Ensure interactions are polite, constructive, and on-topic, maintaining a professional and respectful user experience."
|
29 |
prompt = CHATBOT_GUIDELINES
|
|
|
30 |
response = openai.Completion.create(
|
31 |
engine="text-davinci-003", # You can choose a different engine if needed
|
32 |
prompt=prompt,
|