From f6b75bdbec72bcb8f9d9d6bc3a22be2021fec126 Mon Sep 17 00:00:00 2001 From: Dillon Laird Date: Mon, 9 Sep 2024 09:19:02 -0700 Subject: [PATCH] allow debugger to see docs in case the bug was a missing import --- vision_agent/agent/vision_agent_coder_prompts.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vision_agent/agent/vision_agent_coder_prompts.py b/vision_agent/agent/vision_agent_coder_prompts.py index 5c2f6518..8b966de4 100644 --- a/vision_agent/agent/vision_agent_coder_prompts.py +++ b/vision_agent/agent/vision_agent_coder_prompts.py @@ -121,12 +121,11 @@ def remove_arrays(o): if isinstance(o, list): - return [remove_arrays(i) for i in o] + return [remove_arrays(e) for e in o] elif isinstance(o, dict): - for k, v in o.items(): - o[k] = remove_arrays(v) + return {{k: remove_arrays(v) for k, v in o.items()}} elif isinstance(o, np.ndarray): - return str(o.shape) + return "array: " + str(o.shape) else: return o @@ -324,6 +323,11 @@ def find_text(image_path: str, text: str) -> str: FIX_BUG = """ **Role** As a coder, your job is to find the error in the code and fix it. You are running in a notebook setting so you can run !pip install to install missing packages. +**Documentation**: +This is the documentation for the functions you have access to. You may call any of these functions to help you complete the task. They are available through importing `from vision_agent.tools import *`. + +{docstring} + **Instructions**: Please re-complete the code to fix the error message. Here is the previous version: ```python