Skip to content

Commit

Permalink
formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed May 29, 2024
1 parent eb33d08 commit 71bcb89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ class VisionAgent(Agent):
>>> agent = VisionAgent()
>>> code = agent("What percentage of the area of the jar is filled with coffee beans?", media="jar.jpg")
"""

def __init__(
self,
planner: Optional[LLM] = None,
Expand All @@ -283,6 +284,7 @@ def __init__(
VisionAgent instances are running in parallel. This callback ensures
that the progress are not mixed up.
"""

self.planner = (
OpenAILLM(temperature=0.0, json_mode=True) if planner is None else planner
)
Expand Down Expand Up @@ -317,6 +319,7 @@ def __call__(
Returns:
str: The code output by the Vision Agent.
"""

if isinstance(input, str):
input = [{"role": "user", "content": input}]
results = self.chat_with_workflow(input, media)
Expand All @@ -341,6 +344,7 @@ def chat_with_workflow(
Dict[str, Any]: A dictionary containing the code, test, test result, plan,
and working memory of the agent.
"""

if len(chat) == 0:
raise ValueError("Chat cannot be empty.")

Expand Down

0 comments on commit 71bcb89

Please sign in to comment.