mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
fix issue
This commit is contained in:
@@ -94,6 +94,8 @@ class CrewAgentParser:
|
||||
|
||||
elif includes_answer:
|
||||
final_answer = text.split(FINAL_ANSWER_ACTION)[-1].strip()
|
||||
# Remove all backticks (```) from the final answer
|
||||
final_answer = final_answer.replace("```", "").strip()
|
||||
return AgentFinish(thought, final_answer, text)
|
||||
|
||||
if not re.search(r"Action\s*\d*\s*:[\s]*(.*?)", text, re.DOTALL):
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
"task": "\nCurrent Task: {input}\n\nBegin! This is VERY important to you, use the tools available and give your best Final Answer, your job depends on it!\n\nThought:",
|
||||
"memory": "\n\n# Useful context: \n{memory}",
|
||||
"role_playing": "You are {role}. {backstory}\nYour personal goal is: {goal}",
|
||||
"tools": "\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\n{tools}\n\nIMPORTANT: Use the following format in your response WITHOUT any markdown formatting or backticks:\n\nThought: you should always think about what to do\nAction: the action to take, only one name of [{tool_names}], exactly as it is written.\nAction Input: the input to the action as a simple JSON object enclosed in curly braces (use double quotes for keys and values).\nObservation: the result of the action\n\nOnce all necessary information is gathered, return the final answer in this format:\n\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question",
|
||||
"no_tools": "\nTo give my best complete final answer to the task, respond using the exact following format (without any markdown formatting or triple backticks):\n\nThought: I now can give a great answer\nFinal Answer: Your final answer must be the greatest and most complete possible, fully fulfilling the outcome described.\n\nI MUST use this format; my job depends on it!",
|
||||
"format": "I MUST either use a tool (one at a time) OR give my best final answer, but never both in the same message. When responding, I must use the following format (without any markdown formatting or backticks):\n\nThought: you should always think about what to do\nAction: the action to take, which should be one of [{tool_names}]\nAction Input: the input to the action as a dictionary enclosed in curly braces\nObservation: the result of the action\n\nThis Thought/Action/Action Input/Observation process can repeat multiple times. Once I know the final answer, I must return my response using the following format:\n\nThought: I now can give a great answer\nFinal Answer: Your final complete answer, fully meeting the outcome described",
|
||||
"final_answer_format": "If you don't need to use any more tools, you must give your best complete final answer, ensuring it satisfies the expected criteria. Use the EXACT format below (without any markdown formatting or backticks):\n\nThought: I now can give a great answer\nFinal Answer: my best complete final answer to the task.",
|
||||
"format_without_tools": "\nSorry, I didn't use the right format. I MUST either use a tool (among the available ones) OR give my best final answer. Here is the expected format (without any markdown formatting or triple backticks):\n\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, which should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n\nThis Thought/Action/Action Input/Observation process can repeat multiple times. Once I know the final answer, I must return my response using the following format:\n\nThought: I now can give a great answer\nFinal Answer: Your final answer must be the greatest and most complete possible, fully fulfilling the outcome described",
|
||||
"tools": "\nYou ONLY have access to the following tools, and should NEVER make up tools that are not listed here:\n\n{tools}\n\nIMPORTANT: Use the following format in your response:\n\n```\nThought: you should always think about what to do\nAction: the action to take, only one name of [{tool_names}], just the name, exactly as it's written.\nAction Input: the input to the action, just a simple JSON object, enclosed in curly braces, using \" to wrap keys and values.\nObservation: the result of the action\n```\n\nOnce all necessary information is gathered, return the following format:\n\n```\nThought: I now know the final answer\nFinal Answer: the final answer to the original input question\n```",
|
||||
"no_tools": "\nTo give my best complete final answer to the task respond using the exact following format:\n\nThought: I now can give a great answer\nFinal Answer: Your final answer must be the great and the most complete as possible, it must be outcome described.\n\nI MUST use these formats, my job depends on it!",
|
||||
"format": "I MUST either use a tool (use one at time) OR give my best final answer not both at the same time. When responding, I must use the following format:\n\n```\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action, dictionary enclosed in curly braces\nObservation: the result of the action\n```\nThis Thought/Action/Action Input/Result can repeat N times. Once I know the final answer, I must return the following format:\n\n```\nThought: I now can give a great answer\nFinal Answer: Your final answer must be the great and the most complete as possible, it must be outcome described\n\n```",
|
||||
"final_answer_format": "If you don't need to use any more tools, you must give your best complete final answer, make sure it satisfies the expected criteria, use the EXACT format below:\n\n```\nThought: I now can give a great answer\nFinal Answer: my best complete final answer to the task.\n\n```",
|
||||
"format_without_tools": "\nSorry, I didn't use the right format. I MUST either use a tool (among the available ones), OR give my best final answer.\nHere is the expected format I must follow:\n\n```\nQuestion: the input question you must answer\nThought: you should always think about what to do\nAction: the action to take, should be one of [{tool_names}]\nAction Input: the input to the action\nObservation: the result of the action\n```\n This Thought/Action/Action Input/Result process can repeat N times. Once I know the final answer, I must return the following format:\n\n```\nThought: I now can give a great answer\nFinal Answer: Your final answer must be the great and the most complete as possible, it must be outcome described\n\n```",
|
||||
"task_with_context": "{task}\n\nThis is the context you're working with:\n{context}",
|
||||
"expected_output": "\nThis is the expected criteria for your final answer: {expected_output}\nyou MUST return the actual complete content as the final answer, not a summary.",
|
||||
"human_feedback": "You got human feedback on your work, re-evaluate it and give a new Final Answer when ready.\n {human_feedback}",
|
||||
|
||||
Reference in New Issue
Block a user