Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-debug-code-test-log
Browse files Browse the repository at this point in the history
  • Loading branch information
wuyiqunLu committed May 29, 2024
2 parents 6ff57ed + c7f0e7b commit 2f4ad1e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "vision-agent"
version = "0.2.29"
version = "0.2.30"
description = "Toolset for Vision Agent"
authors = ["Landing AI <[email protected]>"]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion vision_agent/agent/agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict, List, Optional, Union, Any
from typing import Any, Dict, List, Optional, Union


class Agent(ABC):
Expand Down
2 changes: 1 addition & 1 deletion vision_agent/agent/agent_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import sys
from pathlib import Path
from typing import Dict, List, Optional, Union, Any
from typing import Any, Dict, List, Optional, Union

from rich.console import Console
from rich.syntax import Syntax
Expand Down
14 changes: 11 additions & 3 deletions vision_agent/agent/vision_agent_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional, Union, cast, Callable, no_type_check
from typing import Any, Callable, Dict, List, Optional, Union, cast, no_type_check

from rich.console import Console
from rich.syntax import Syntax
Expand All @@ -14,6 +14,7 @@
CODE,
FEEDBACK,
FIX_BUG,
FULL_TASK,
PLAN,
REFLECT,
SIMPLE_TEST,
Expand Down Expand Up @@ -370,7 +371,7 @@ def chat_with_workflow(
self.verbosity,
)
results = write_and_test_code(
plan_i_str,
FULL_TASK.format(user_request=chat[0]["content"], subtasks=plan_i_str),
tool_info,
UTILITIES_DOCSTRING,
format_memory(working_memory),
Expand All @@ -388,7 +389,14 @@ def chat_with_workflow(
plan.append({"code": code, "test": test, "plan": plan_i})

if self_reflection:
reflection = reflect(chat, plan_i_str, code, self.planner)
reflection = reflect(
chat,
FULL_TASK.format(
user_request=chat[0]["content"], subtasks=plan_i_str
),
code,
self.planner,
)
if self.verbosity > 0:
self.log_progress(
{
Expand Down
10 changes: 9 additions & 1 deletion vision_agent/agent/vision_agent_v3_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
{user_request}
"""

FULL_TASK = """
## User Request
{user_request}
## Subtasks
{subtasks}
"""

FEEDBACK = """
## This contains code and feedback from previous runs and is used for providing context so you do not make the same mistake again.
Expand Down Expand Up @@ -170,7 +178,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 feel free to 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 so you can run !pip install to install missing packages.
**Instructions**:
Please re-complete the code to fix the error message. Here is the previous version:
Expand Down

0 comments on commit 2f4ad1e

Please sign in to comment.