Skip to content

Commit

Permalink
remove object creation in args
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Mar 16, 2024
1 parent 1e18ceb commit 2436284
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vision_agent/agent/reflexion.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def __init__(
agent_prompt: str = COT_AGENT_REFLECT_INSTRUCTION,
reflect_prompt: str = COT_REFLECT_INSTRUCTION,
finsh_prompt: str = CHECK_FINSH,
self_reflect_llm: LLM = OpenAILLM(),
action_agent: Union[Agent, LLM] = OpenAILLM(),
self_reflect_llm: Optional[LLM] = None,
action_agent: Optional[Union[Agent, LLM]] = None,
):
self.agent_prompt = agent_prompt
self.reflect_prompt = reflect_prompt
Expand All @@ -66,6 +66,11 @@ def __init__(
self.action_agent = action_agent
self.reflections: List[str] = []

if self_reflect_llm is None:
self.self_reflect_llm = OpenAILLM()
if action_agent is None:
self.action_agent = OpenAILLM()

def __call__(self, input: Union[List[Dict[str, str]], str]) -> str:
if isinstance(input, str):
input = [{"role": "user", "content": input}]
Expand Down

0 comments on commit 2436284

Please sign in to comment.