Markiian Tsalyk
commited on
Commit
·
8a5e198
1
Parent(s):
6692c96
Modified final answer
Browse files- llama_index_agent.py +1 -1
- tools.py +1 -0
llama_index_agent.py
CHANGED
@@ -130,7 +130,7 @@ class LlamaIndexAgent:
|
|
130 |
[final_answer_tool],
|
131 |
llm=self.llm,
|
132 |
verbose=verbose,
|
133 |
-
max_iterations=
|
134 |
system_prompt="You are approached to prepare answer for the user question in desired format. You always need to use final_answer tool, it will help you.",
|
135 |
)
|
136 |
|
|
|
130 |
[final_answer_tool],
|
131 |
llm=self.llm,
|
132 |
verbose=verbose,
|
133 |
+
max_iterations=5,
|
134 |
system_prompt="You are approached to prepare answer for the user question in desired format. You always need to use final_answer tool, it will help you.",
|
135 |
)
|
136 |
|
tools.py
CHANGED
@@ -296,6 +296,7 @@ def final_answer(query: str, answer: str, **kwargs) -> str:
|
|
296 |
Final answer should be a number or as few words as possible or a comma separated list of numbers and/or strings. 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.
|
297 |
There might be requested exact number, then you need to compress the output so that it was only number without any comments or explanations (float or integer).
|
298 |
And on the other hand, the question might request some exact string value. Don't explain it, just return this value (For example, insted of `In response to the question, desired person is X` return only `X`)
|
|
|
299 |
"""
|
300 |
|
301 |
|
|
|
296 |
Final answer should be a number or as few words as possible or a comma separated list of numbers and/or strings. 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.
|
297 |
There might be requested exact number, then you need to compress the output so that it was only number without any comments or explanations (float or integer).
|
298 |
And on the other hand, the question might request some exact string value. Don't explain it, just return this value (For example, insted of `In response to the question, desired person is X` return only `X`)
|
299 |
+
Again, you don't need to modify or solve answer, you just need to format it properly.
|
300 |
"""
|
301 |
|
302 |
|