mominah commited on
Commit
21a1db4
·
verified ·
1 Parent(s): dfce207

Update routes.py

Browse files
Files changed (1) hide show
  1. routes.py +3 -1
routes.py CHANGED
@@ -101,6 +101,8 @@ def send_query(query_request: QueryRequest):
101
  """
102
  Processes a query and returns the bot's response along with any web sources.
103
  """
 
 
104
  prompt_type = query_request.prompt_type
105
  try:
106
  # Assign the prompt template based on the prompt type.
@@ -127,7 +129,7 @@ def send_query(query_request: QueryRequest):
127
  else:
128
  # Default prompt template if prompt_type is not recognized.
129
  prompt_template = PromptTemplates.get_quiz_solving_prompt()
130
- trainer.set_custom_prompt_template(bot_id, prompt_template)
131
  response, web_sources = trainer.get_response(
132
  query_request.query, query_request.bot_id, query_request.chat_id
133
  )
 
101
  """
102
  Processes a query and returns the bot's response along with any web sources.
103
  """
104
+ # trainer = get_trainer()
105
+ # trainer.load_bot(query_request.bot_id)
106
  prompt_type = query_request.prompt_type
107
  try:
108
  # Assign the prompt template based on the prompt type.
 
129
  else:
130
  # Default prompt template if prompt_type is not recognized.
131
  prompt_template = PromptTemplates.get_quiz_solving_prompt()
132
+ trainer.set_custom_prompt_template(query_request.bot_id, prompt_template)
133
  response, web_sources = trainer.get_response(
134
  query_request.query, query_request.bot_id, query_request.chat_id
135
  )