Skip to content

Commit

Permalink
adjusted prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Apr 17, 2024
1 parent be6d1ce commit 448422e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion vision_agent/agent/easytool_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
These are logs of previous questions and answers:
{previous_log}
This is the current user's question: {question}
This is the API tool documentation: {tool_usage}
Output: """
Expand All @@ -67,15 +68,22 @@
2. We will not show the API response to the user, thus you need to make full use of the response and give the information in the response that can satisfy the user's question in as much detail as possible.
3. If the API tool does not provide useful information in the response, please answer with your knowledge.
4. The question may have dependencies on answers of other questions, so we will provide logs of previous questions and answers.
These are logs of previous questions and answers:
{previous_log}
This is the user's question: {question}
This is the response output by the API tool:
{call_results}
We will not show the API response to the user, thus you need to make full use of the response and give the information in the response that can satisfy the user's question in as much detail as possible.
Output: """

ANSWER_SUMMARIZE = """We break down a complex user's problems into simple subtasks and provide answers to each simple subtask. You need to organize these answers to each subtask and form a self-consistent final answer to the user's question.
This is the user's question: {question}
These are subtasks and their answers: {answers}
These are subtasks and their answers:
{answers}
Final answer: """
5 changes: 3 additions & 2 deletions vision_agent/agent/vision_agent_prompts.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
VISION_AGENT_REFLECTION = """You are an advanced reasoning agent that can improve based on self-refection. You will be given a previous reasoning trial in which you were given the user's question, the available tools that the agent has, the decomposed tasks and tools that the agent used to answer the question and the final answer the agent provided. You may also receive an image with the visualized bounding boxes or masks with their associated labels and scores from the tools used.
VISION_AGENT_REFLECTION = """You are an advanced reasoning agent that can improve based on self-refection. You will be given a previous reasoning trial in which you were given the user's question, the available tools that the agent has, the decomposed tasks and tools that the agent used to answer the question, the tool usage for each of the tools used and the final answer the agent provided. You may also receive an image with the visualized bounding boxes or masks with their associated labels and scores from the tools used.
Please note that:
1. You must ONLY output parsible JSON format. If the agents output was correct set "Finish" to true, else set "Finish" to false. An example output looks like:
{{"Finish": true, "Reflection": "The agent's answer was correct."}}
2. You must utilize the image with the visualized bounding boxes or masks and determine if the tools were used correctly or, using your own judgement, utilized incorrectly.
2. You must utilize the image with the visualized bounding boxes or masks and determine if the tools were used correctly or if the tools were used incorrectly or the wrong tools were used.
3. If the agent's answer was incorrect, you must diagnose the reason for failure and devise a new concise and concrete plan that aims to mitigate the same failure with the tools available. An example output looks like:
{{"Finish": false, "Reflection": "I can see from the visualized bounding boxes that the agent's answer was incorrect because the grounding_dino_ tool produced false positive predictions. The agent should use the following tools with the following parameters:
Step 1: Use 'grounding_dino_' with a 'prompt' of 'baby. bed' and a 'box_threshold' of 0.7 to reduce the false positives.
Expand Down Expand Up @@ -140,4 +140,5 @@
This is a reflection from a previous failed attempt:
{reflections}
Final answer: """

0 comments on commit 448422e

Please sign in to comment.