Skip to content

Commit

Permalink
Strip !pip installs (#350)
Browse files Browse the repository at this point in the history
strip installs and do not pip install
  • Loading branch information
dillonalaird authored Jan 29, 2025
1 parent ca1c53f commit e624fa7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vision_agent/agent/vision_agent_coder_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ 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.
**Role** As a coder, your job is to find the error in the code and fix it. You are running in a notebook setting but do not run !pip install to install new 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 *`.
Expand Down
2 changes: 1 addition & 1 deletion vision_agent/agent/vision_agent_coder_prompts_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@


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.
**Role** As a coder, your job is to find the error in the code and fix it. You are running in a notebook setting but do not run !pip install to install new packages.
**Task**: A previous agent has written some code and some testing code according to a plan given to it. It has introduced a bug into it's code while trying to implement the plan. You are given the plan, code, test code and error. Your job is to fix the error in the code or test code.
Expand Down
2 changes: 1 addition & 1 deletion vision_agent/agent/vision_agent_planner_prompts_v2.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PLAN = """
**Role**: You are an expert planning agent that can understand the user request and search for a plan to accomplish it.
**Task**: As a planning agent you are required to understand the user's request and search for a plan to accomplish it. Use Chain-of-Thought approach to break down the problem, create a plan, and then provide a response. Esnure your response is clear, concise, and helpful. You can use an interactive Pyton (Jupyter Notebok) environment, executing code with <execute_python>, each execution is a new cell so old code and outputs are saved.
**Task**: As a planning agent you are required to understand the user's request and search for a plan to accomplish it. Use Chain-of-Thought approach to break down the problem, create a plan, and then provide a response. Esnure your response is clear, concise, and helpful. You can use an interactive Pyton (Jupyter Notebok) environment but do not !pip install packages, execute code with <execute_python>, each execution is a new cell so old code and outputs are saved.
**Documentation**: this is the documentation for the functions you can use to accomplish the task:
{tool_desc}
Expand Down
2 changes: 2 additions & 0 deletions vision_agent/agent/vision_agent_planner_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
extract_tag,
print_code,
print_table,
remove_installs_from_code,
)
from vision_agent.agent.types import AgentMessage, InteractionContext, PlanContext
from vision_agent.agent.vision_agent_planner_prompts_v2 import (
Expand Down Expand Up @@ -180,6 +181,7 @@ def run_critic(


def code_safeguards(code: str) -> str:
code = remove_installs_from_code(code)
if "get_tool_for_task" in code:
lines = code.split("\n")
new_lines = []
Expand Down

0 comments on commit e624fa7

Please sign in to comment.