Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Apr 12, 2024
1 parent 7feab08 commit 737413b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ the individual steps and tools to get the answer:
}
]],
"answer": "The jar is located at [0.58, 0.2, 0.72, 0.45].",
}]
},
{"visualize_output": "final_output.png"}]
```

### Tools
Expand Down
8 changes: 4 additions & 4 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def __call__(
"""
if isinstance(input, str):
input = [{"role": "user", "content": input}]
return self.chat(input, image=image)
return self.chat(input, image=image, visualize_output=visualize_output)

def log_progress(self, description: str) -> None:
_LOGGER.info(description)
Expand Down Expand Up @@ -480,9 +480,9 @@ def chat_with_workflow(
)

if visualize_output:
visualized_output = all_tool_results[-1]["visualized_images"]
visualized_output = all_tool_results[-1]["visualized_output"]
for image in visualized_output:
Image.open(image).show()
Image.open(image).show() # type: ignore

return final_answer, all_tool_results

Expand All @@ -492,7 +492,7 @@ def chat(
image: Optional[Union[str, Path]] = None,
visualize_output: Optional[bool] = False,
) -> str:
answer, _ = self.chat_with_workflow(chat, image=image)
answer, _ = self.chat_with_workflow(chat, image=image, visualize_output=visualize_output)
return answer

def retrieval(
Expand Down

0 comments on commit 737413b

Please sign in to comment.