AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Add language model base and work out interactions with planning manager

Open collijk opened this issue 1 year ago • 3 comments

This PR adds the base abstraction for the language model and adjusts some of the interface of the Planning model to create their communication contract.

collijk avatar May 05 '23 15:05 collijk

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) May 5, 2023 3:32pm

vercel[bot] avatar May 05 '23 15:05 vercel[bot]

Some thoughts on how this will work:

# This may happen "client" application side before we create the Agent, I'm thinking

planner = Planner(...)
language_model = LanguageModel(...)

initial_user_input = ... # Application logic for this
objective_prompt = planner.construct_objective_prompt_from_user_input(initial_user_input)
model_response = language_model.determine_agent_objective(objective_prompt)

agent_objective = model_response.content  # This should be parsed into a standard format already

# This may happen on the "server" side (across the message broker interface)
# ...Update API budget, etc. ...



agent = Agent(
    agent_objective, 
    planner,
    language_model, 
    ...,
)
agent.run()
class Agent:

    def __init__(self, agent_objective, planner, language_model, ...):
        self.objective = agent_objective
        self.planner = planner
        self.language_model = language_model
        ...

    def run():
        while True:
            # Logic to construct the context (checking budget, looking for memories, getting user input)
            planning_prompt_context = PlanningPromptContext(...)
            planning_prompt = self.planner.construct_planning_prompt_from_context(planning_prompt_context)
            action_plan_response = self.language_model.plan_next_axtion(planning_prompt)

            action_plan = action_plan_response.content
            
            # ...Update API budget, check for user confirmation, update memory, etc.
            
            # Logic to construct the context ...
            self_feedback_prompt_context = SelfFeedbackPromptContext(...)
            self_feedback_prompt = self.planner.get_self_feedback_prompt(self_feedback_prompt_context)
            self_feedback_response = self.language_model.get_self_feedback(self_feedback_prompt)
            
            self_feedback = self_feedback_response.content

            # ...Update API budget, resolve action plan with self feedback, update memory, do next action, etc.

collijk avatar May 05 '23 17:05 collijk

People interested in learning more about ongoing talks about the planning manager, refer to: #3593

Boostrix avatar May 06 '23 08:05 Boostrix