Skip to content

Commit

Permalink
fixing type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed May 23, 2024
1 parent 700c0a5 commit e0c52e2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions vision_agent/agent/vision_agent_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def reflect(


def write_and_test_code(
input: Union[str, Path],
task: str,
tool_info: str,
tool_utils: str,
Expand All @@ -118,6 +117,7 @@ def write_and_test_code(
log_progress: Callable[[Dict[str, Any]], None],
verbosity: int = 0,
max_retries: int = 3,
input_media: Optional[Union[str, Path]] = None,
) -> Dict[str, Any]:
code = extract_code(
coder(CODE.format(docstring=tool_info, question=task, feedback=working_memory))
Expand All @@ -129,7 +129,7 @@ def write_and_test_code(
question=task,
code=code,
feedback=working_memory,
media=input,
media=input_media,
)
)
)
Expand Down Expand Up @@ -277,13 +277,12 @@ def __call__(
self,
input: Union[List[Dict[str, str]], str],
image: Optional[Union[str, Path]] = None,
self_reflection: bool = False,
) -> Dict[str, Any]:
if isinstance(input, str):
input = [{"role": "user", "content": input}]
results = self.chat_with_workflow(input, image, self_reflection)
results = self.chat_with_workflow(input, image)
results.pop("working_memory")
return results # type: ignore
return results

def chat_with_workflow(
self,
Expand Down Expand Up @@ -332,7 +331,6 @@ def chat_with_workflow(
self.verbosity,
)
results = write_and_test_code(
image,
plan_i_str,
tool_info,
UTILITIES_DOCSTRING,
Expand All @@ -342,6 +340,7 @@ def chat_with_workflow(
self.debugger,
self.log_progress,
verbosity=self.verbosity,
input_media=image,
)
success = cast(bool, results["success"])
code = cast(str, results["code"])
Expand Down

0 comments on commit e0c52e2

Please sign in to comment.