Prof-Reza commited on
Commit
540bee1
·
1 Parent(s): 9e4c6fb

updating CHATBOT_GUIDELINES to include "You are a conversational chatbot." -- changing the max_tokens to 300

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -25,13 +25,13 @@ json_file = json.dumps(data, indent=4)
25
 
26
  def respond(message, chat_history):
27
  global json_file
28
- CHATBOT_GUIDELINES = f"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 non-related topics. 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. Politely inform users that you can only provide assistance and answers concerning the provided file, refraining from engaging in irrelevant or inappropriate topics. Maintain respect and professionalism. Ensure interactions are polite, constructive, and on-topic, maintaining a professional and respectful user experience."
29
- prompt = f"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 non-related topics. 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. Politely inform users that you can only provide assistance and answers concerning the provided file, refraining from engaging in irrelevant or inappropriate topics. Maintain respect and professionalism. Ensure interactions are polite, constructive, and on-topic, maintaining a professional and respectful user experience."#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,
34
- max_tokens=700, # Adjust max_tokens as needed
35
  temperature=0.3, # Adjust temperature as needed
36
  )
37
 
 
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 non-related topics. 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. Politely inform users that you can only provide assistance and answers concerning the provided file, refraining from engaging in irrelevant or inappropriate topics. Maintain respect and professionalism. Ensure interactions are polite, constructive, and on-topic, maintaining a professional and respectful user experience."
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,
34
+ max_tokens=300, # Adjust max_tokens as needed
35
  temperature=0.3, # Adjust temperature as needed
36
  )
37