description="The summary of the observation/ img",
)
classSequence(BaseModel):
goal:str=Field(
...,
description="The goal of the mission",
)
observation:List[Observation]=Field(
...,
description="The observations of the agent",
)
action:str=Field(
...,
description="Take an action that leads to the completion of the task.",
)
classGoalDecomposer(BaseModel):
goal:str=Field(
...,
description="The goal of the task",
)
sub_goals:List[str]=Field(
...,
description="The sub goals of the mission",
)
# Given the task t, observation o, the sub-goals
# sequence g1, g2, g3, ..., gn can be formulated as:
classKGP(BaseModel):
task:str=Field(
...,
description="The task to be accomplished",
)
observation:str=Field(
...,
description="The observation of the task",
)
sequence:List[GoalDecomposer]=Field(
...,
description="The sequence of goals to accomplish the task",
)
# Example usage:
# Initialize the function caller
model=OpenAIFunctionCaller(
system_prompt="You're an autonomous agent, you're purpose to accomplish a task through understanding your goal, observing the environment, and taking actions that lead to the completion of the task.",
max_tokens=500,
temperature=0.5,
base_model=KGP,
parallel_tool_calls=False,
)
# The OpenAIFunctionCaller class is used to interact with the OpenAI API and make function calls.