Skip to content

Commit

Permalink
fixing param name as it overlaps with function call
Browse files Browse the repository at this point in the history
  • Loading branch information
shankar-vision-eng committed Apr 30, 2024
1 parent 5bb6283 commit cf4211a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def __call__(
image: Optional[Union[str, Path]] = None,
reference_data: Optional[Dict[str, str]] = None,
visualize_output: Optional[bool] = False,
self_reflect: Optional[bool] = True,
self_reflection: Optional[bool] = True,
) -> str:
"""Invoke the vision agent.
Expand All @@ -502,7 +502,7 @@ def __call__(
{"image": "image.jpg", "mask": "mask.jpg", "bbox": [0.1, 0.2, 0.1, 0.2]}
where the bounding box coordinates are normalized.
visualize_output: Whether to visualize the output.
self_reflect: boolean to enable and disable self reflection.
self_reflection: boolean to enable and disable self reflection.
Returns:
The result of the vision agent in text.
Expand All @@ -514,7 +514,7 @@ def __call__(
image=image,
visualize_output=visualize_output,
reference_data=reference_data,
self_reflect=self_reflect,
self_reflection=self_reflection,
)

def log_progress(self, description: str) -> None:
Expand All @@ -541,7 +541,7 @@ def chat_with_workflow(
image: Optional[Union[str, Path]] = None,
reference_data: Optional[Dict[str, str]] = None,
visualize_output: Optional[bool] = False,
self_reflect: Optional[bool] = True,
self_reflection: Optional[bool] = True,
) -> Tuple[str, List[Dict]]:
"""Chat with the vision agent and return the final answer and all tool results.
Expand All @@ -554,7 +554,7 @@ def chat_with_workflow(
{"image": "image.jpg", "mask": "mask.jpg", "bbox": [0.1, 0.2, 0.1, 0.2]}
where the bounding box coordinates are normalized.
visualize_output: Whether to visualize the output.
self_reflect: boolean to enable and disable self reflection.
self_reflection: boolean to enable and disable self reflection.
Returns:
A tuple where the first item is the final answer and the second item is a
Expand Down Expand Up @@ -631,7 +631,7 @@ def chat_with_workflow(
else:
reflection_images = None

if self_reflect:
if self_reflection:
reflection = self_reflect(
self.reflect_model,
question,
Expand Down Expand Up @@ -670,14 +670,14 @@ def chat(
image: Optional[Union[str, Path]] = None,
reference_data: Optional[Dict[str, str]] = None,
visualize_output: Optional[bool] = False,
self_reflect: Optional[bool] = True,
self_reflection: Optional[bool] = True,
) -> str:
answer, _ = self.chat_with_workflow(
chat,
image=image,
visualize_output=visualize_output,
reference_data=reference_data,
self_reflect=self_reflect,
self_reflection=self_reflection,
)
return answer

Expand Down

0 comments on commit cf4211a

Please sign in to comment.