Skip to content

Commit

Permalink
fixing a bug on retries and adding prompt for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed May 24, 2024
1 parent 6dc5c68 commit 0629b4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions vision_agent/agent/vision_agent_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ def chat_with_workflow(
success = cast(bool, reflection["success"])
working_memory.append({"code": f"{code}\n{test}", "feedback": feedback})

retries += 1

self.log_progress(
{
"log": f"The Vision Agent V3 has concluded this chat.\nSuccess: {success}",
Expand Down
7 changes: 5 additions & 2 deletions vision_agent/agent/vision_agent_v3_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
2. **Algorithm/Method Selection**: Decide on the most efficient way.
3. **Pseudocode Creation**: Write down the steps you will follow in pseudocode.
4. **Code Generation**: Translate your pseudocode into executable Python code.
5. **Logging**: Log the output of the custom functions that were provided to you from `from vision_agent.tools.tools_v2 import *`. Use a debug flag in the function parameters to toggle logging on and off.
"""

TEST = """
Expand Down Expand Up @@ -161,8 +162,10 @@ def find_text(image_path: str, text: str) -> str:
2. Ensure each test case is well-documented with comments explaining the scenario it covers.
3. Your test case MUST run only on the given image which is {media}
4. DO NOT use any non-existent or dummy image or video files that are not provided by the user's instructions.
4. DO NOT mock any functions, you must test their functionality as is.
5. DO NOT assert the output value, run the code and verify it runs without any errors and assert only the output format or data structure.
5. DO NOT mock any functions, you must test their functionality as is.
6. DO NOT assert the output value, run the code and verify it runs without any errors and assert only the output format or data structure.
7. DO NOT import the testing function as it will available in the testing environment.
8. Print the output of the function that is being tested.
"""


Expand Down

0 comments on commit 0629b4c

Please sign in to comment.