Daniel Marques commited on
Commit
5073361
1 Parent(s): f65a4f6

feat: add websocket

Browse files
Files changed (2) hide show
  1. main.py +1 -2
  2. prompt_template_utils.py +1 -1
main.py CHANGED
@@ -55,7 +55,7 @@ QA = RetrievalQA.from_chain_type(
55
  },
56
  )
57
 
58
- def sendPromptChain(QA, user_prompt, isRoom=False):
59
  print(QA)
60
 
61
  res = QA(user_prompt)
@@ -65,7 +65,6 @@ def sendPromptChain(QA, user_prompt, isRoom=False):
65
  prompt_response_dict = {
66
  "Prompt": user_prompt,
67
  "Answer": answer,
68
- "Room": isRoom
69
  }
70
 
71
  prompt_response_dict["Sources"] = []
 
55
  },
56
  )
57
 
58
+ def sendPromptChain(QA, user_prompt):
59
  print(QA)
60
 
61
  res = QA(user_prompt)
 
65
  prompt_response_dict = {
66
  "Prompt": user_prompt,
67
  "Answer": answer,
 
68
  }
69
 
70
  prompt_response_dict["Sources"] = []
prompt_template_utils.py CHANGED
@@ -16,7 +16,7 @@ from langchain.prompts import PromptTemplate
16
  # system_prompt = """You are a helpful assistant, and you will use the context and documents provided in the training to answer users' questions. Please read the context provided carefully before responding to questions and follow a step-by-step thought process. If you cannot answer a user's question based on the provided context, please inform the user. Do not use any other information to answer the user. Provide a detailed response based on the content of locally trained documents."""
17
 
18
  system_prompt = """It's a useful assistant that will use the context and documents provided in the training to answer users' questions.
19
- Read the context provided before answering the questions and think step by step. Your answer cannot be more than 10 sentences long.
20
  If you can't answer, just say "I don't know" and don't try to work out an answer to respond to the user."""
21
 
22
  def get_prompt_template(system_prompt=system_prompt, promptTemplate_type=None, history=False):
 
16
  # system_prompt = """You are a helpful assistant, and you will use the context and documents provided in the training to answer users' questions. Please read the context provided carefully before responding to questions and follow a step-by-step thought process. If you cannot answer a user's question based on the provided context, please inform the user. Do not use any other information to answer the user. Provide a detailed response based on the content of locally trained documents."""
17
 
18
  system_prompt = """It's a useful assistant that will use the context and documents provided in the training to answer users' questions.
19
+ Read the context provided before answering the questions and think step by step. Your answer cannot be more than 2000 words long.
20
  If you can't answer, just say "I don't know" and don't try to work out an answer to respond to the user."""
21
 
22
  def get_prompt_template(system_prompt=system_prompt, promptTemplate_type=None, history=False):