Spaces:
Runtime error
Runtime error
Update prompt templates and regex pattern to use tagged placeholders for better clarity
Browse files
src/gaia_solving_agent/agent.py
CHANGED
|
@@ -77,7 +77,7 @@ class GaiaWorkflow(Workflow):
|
|
| 77 |
async def parse_answer(self, ev: AnswerEvent) -> StopEvent:
|
| 78 |
llm = get_llm()
|
| 79 |
prompt_template = RichPromptTemplate(FORMAT_ANSWER)
|
| 80 |
-
pattern = r"Question :\s*(.*)[\n$]"
|
| 81 |
search = re.search(pattern, ev.plan)
|
| 82 |
question = search.group(1) if search else ""
|
| 83 |
result = llm.complete(prompt_template.format(question=question))
|
|
|
|
| 77 |
async def parse_answer(self, ev: AnswerEvent) -> StopEvent:
|
| 78 |
llm = get_llm()
|
| 79 |
prompt_template = RichPromptTemplate(FORMAT_ANSWER)
|
| 80 |
+
pattern = r"<Question> :\s*(.*)[\n$]"
|
| 81 |
search = re.search(pattern, ev.plan)
|
| 82 |
question = search.group(1) if search else ""
|
| 83 |
result = llm.complete(prompt_template.format(question=question))
|
src/gaia_solving_agent/prompts.py
CHANGED
|
@@ -25,11 +25,11 @@ User query: "{{ user_request }}"
|
|
| 25 |
|
| 26 |
Respond with exactly:
|
| 27 |
'''
|
| 28 |
-
1. Question : xxxxxxx
|
| 29 |
-
2. Known facts:
|
| 30 |
- xxxxxxx
|
| 31 |
- xxxxxxx
|
| 32 |
-
3. Sub-tasks:
|
| 33 |
{% if additional_file_extension|length -%}
|
| 34 |
- There is an additional file to analyse. It's file extension is {{ additional_file_extension }}. You must analyse it to find out
|
| 35 |
{%- endif %}
|
|
|
|
| 25 |
|
| 26 |
Respond with exactly:
|
| 27 |
'''
|
| 28 |
+
1. <Question> : xxxxxxx
|
| 29 |
+
2. <Known facts>:
|
| 30 |
- xxxxxxx
|
| 31 |
- xxxxxxx
|
| 32 |
+
3. <Sub-tasks>:
|
| 33 |
{% if additional_file_extension|length -%}
|
| 34 |
- There is an additional file to analyse. It's file extension is {{ additional_file_extension }}. You must analyse it to find out
|
| 35 |
{%- endif %}
|