Crackershoot commited on
Commit
7f5f5c3
·
verified ·
1 Parent(s): 13737dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -16
app.py CHANGED
@@ -145,7 +145,7 @@ agent = Agent(
145
  * **Prioritize Knowledge Base**: First, search your internal knowledge base for the answer.
146
  * **Supplement with Web Search**: If the knowledge base information is outdated, insufficient, or the question is better suited for current web information, use the DuckDuckGo tool to perform web searches to fill in gaps or find the most up-to-date data.
147
  * For general technology questions not in your knowledge base, use web search to provide accurate answers.
148
- * If the question is asking for the "latest" or "most recent" of a data-related topic, always use web search and datetime to context.
149
  * If the question is NOT data-related, you MUST respond with: "Please ask relevant data questions only." and terminate.
150
  2. **Response Length Guidelines**:
151
  * For basic questions, keep your answer to a maximum of 300 words.
@@ -403,21 +403,6 @@ with gr.Blocks(
403
  gr.update(value=None, visible=False), # Keep image preview hidden for now.
404
  "" # Keep textbox clear.
405
  )
406
-
407
- def regen_wrapper(chat_history):
408
- if not chat_history or len(chat_history) < 2:
409
- return chat_history, None, None, ""
410
-
411
- last_user_msg = chat_history[-2]["content"]
412
- new_history = chat_history[:-1]
413
-
414
- return chat_ui(last_user_msg, new_history, "Hybrid")
415
-
416
- regen_btn.click(
417
- regen_wrapper,
418
- inputs=chatbot,
419
- outputs=[chatbot, link_state, output_image, question]
420
- )
421
 
422
  # This is a helper function to avoid repeating the event handler chain.
423
  def submit_chain():
 
145
  * **Prioritize Knowledge Base**: First, search your internal knowledge base for the answer.
146
  * **Supplement with Web Search**: If the knowledge base information is outdated, insufficient, or the question is better suited for current web information, use the DuckDuckGo tool to perform web searches to fill in gaps or find the most up-to-date data.
147
  * For general technology questions not in your knowledge base, use web search to provide accurate answers.
148
+ * If the question is asking for the "latest" or "most recent" of a data-related topic, always use the most recent web search and datetime to context.
149
  * If the question is NOT data-related, you MUST respond with: "Please ask relevant data questions only." and terminate.
150
  2. **Response Length Guidelines**:
151
  * For basic questions, keep your answer to a maximum of 300 words.
 
403
  gr.update(value=None, visible=False), # Keep image preview hidden for now.
404
  "" # Keep textbox clear.
405
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
 
407
  # This is a helper function to avoid repeating the event handler chain.
408
  def submit_chain():