Skip to content

Commit

Permalink
add reference_data to agent calls (#57)
Browse files Browse the repository at this point in the history
add reference_data to agent calls'
  • Loading branch information
dillonalaird authored Apr 19, 2024
1 parent 7d72439 commit ec6b653
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ def __call__(
self,
input: Union[List[Dict[str, str]], str],
image: Optional[Union[str, Path]] = None,
reference_data: Optional[Dict[str, str]] = None,
visualize_output: Optional[bool] = False,
) -> str:
"""Invoke the vision agent.
Expand All @@ -459,7 +460,12 @@ def __call__(
"""
if isinstance(input, str):
input = [{"role": "user", "content": input}]
return self.chat(input, image=image, visualize_output=visualize_output)
return self.chat(
input,
image=image,
visualize_output=visualize_output,
reference_data=reference_data,
)

def log_progress(self, description: str) -> None:
_LOGGER.info(description)
Expand Down Expand Up @@ -563,10 +569,14 @@ def chat(
self,
chat: List[Dict[str, str]],
image: Optional[Union[str, Path]] = None,
reference_data: Optional[Dict[str, str]] = None,
visualize_output: Optional[bool] = False,
) -> str:
answer, _ = self.chat_with_workflow(
chat, image=image, visualize_output=visualize_output
chat,
image=image,
visualize_output=visualize_output,
reference_data=reference_data,
)
return answer

Expand Down

0 comments on commit ec6b653

Please sign in to comment.