Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -439,7 +439,9 @@ Example responses:
|
|
| 439 |
"""
|
| 440 |
context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
|
| 441 |
|
| 442 |
-
answer_prompt = f"""You are a general AI assistant. I will ask you a question.
|
|
|
|
|
|
|
| 443 |
|
| 444 |
{context_section}
|
| 445 |
|
|
@@ -491,8 +493,15 @@ Answer:"""
|
|
| 491 |
# Generate answer using search context and attachment context
|
| 492 |
context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
|
| 493 |
|
| 494 |
-
answer_prompt = f"""You are a general AI assistant. I will ask you a question.
|
| 495 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 496 |
|
| 497 |
Question: {question}
|
| 498 |
|
|
@@ -907,7 +916,6 @@ with gr.Blocks(title="Intelligent Agent with Media Processing") as demo:
|
|
| 907 |
gr.Markdown("### Fetch Questions from API")
|
| 908 |
fetch_btn = gr.Button("Fetch Questions", variant="primary")
|
| 909 |
fetch_status = gr.Textbox(label="Fetch Status", lines=2, interactive=False)
|
| 910 |
-
questions_table = gr.DataFrame(label="Available Questions", wrap=True)
|
| 911 |
|
| 912 |
fetch_btn.click(
|
| 913 |
fn=fetch_questions,
|
|
|
|
| 439 |
"""
|
| 440 |
context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
|
| 441 |
|
| 442 |
+
answer_prompt = f"""You are a general AI assistant. I will ask you a question.
|
| 443 |
+
YOUR ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
| 444 |
+
If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string. Do not add a dot after the numbers.
|
| 445 |
|
| 446 |
{context_section}
|
| 447 |
|
|
|
|
| 493 |
# Generate answer using search context and attachment context
|
| 494 |
context_section = f"\n\nAttachment Context:\n{attachment_context}" if attachment_context else ""
|
| 495 |
|
| 496 |
+
answer_prompt = f"""You are a general AI assistant. I will ask you a question.
|
| 497 |
+
Based on the search results and the context section below, provide an answer to the question.
|
| 498 |
+
If the search results don't fully answer the question, you can supplement with your general knowledge.
|
| 499 |
+
Your ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings.
|
| 500 |
+
Do not add dot if your answer is a number.
|
| 501 |
+
If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise.
|
| 502 |
+
If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
| 503 |
+
If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
|
| 504 |
+
Do nor report on your thoughts.
|
| 505 |
|
| 506 |
Question: {question}
|
| 507 |
|
|
|
|
| 916 |
gr.Markdown("### Fetch Questions from API")
|
| 917 |
fetch_btn = gr.Button("Fetch Questions", variant="primary")
|
| 918 |
fetch_status = gr.Textbox(label="Fetch Status", lines=2, interactive=False)
|
|
|
|
| 919 |
|
| 920 |
fetch_btn.click(
|
| 921 |
fn=fetch_questions,
|