Skip to content

Commit

Permalink
Use component_order in entity agent to order components in act context.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 650023069
Change-Id: I59cf0d902fce9025fe5491a07d2ad7f4ff92999a
  • Loading branch information
jzleibo authored and copybara-github committed Jul 7, 2024
1 parent dcca67f commit 1dc30f3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions concordia/factory/agent/temporary_entity_agent__main_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,24 @@ def build_agent(
num_memories_to_retrieve=10,
)

act_component = agent_components.legacy_act_component.ActComponent(
model=model,
clock=clock,
)

components_of_agent = {
'Role playing instructions': instructions,
'Observation': observation,
'Recalled memories and observations': relevant_memories,
}
component_order = list(components_of_agent.keys())
if config.goal:
key = 'Overarching goal'
overarching_goal = agent_components.constant.Constant(
state=config.goal)
components_of_agent['Overarching goal'] = overarching_goal
components_of_agent[key] = overarching_goal
component_order.insert(1, key) # Place the goal after the instructions.

act_component = agent_components.legacy_act_component.ActComponent(
model=model,
clock=clock,
component_order=component_order,
)

agent = entity_agent.EntityAgent(
agent_name=agent_name,
Expand Down

0 comments on commit 1dc30f3

Please sign in to comment.