Skip to content

Commit

Permalink
Reformat reporting of subcomponents in all components derived from qu…
Browse files Browse the repository at this point in the history
…estion of recent memory. We previously prefixed all subcomponents with "{name}'s\n" since typical names were things like "hunger" or "self identity". But it no longer makes sense given the way usage has evolved. Now we typically use subcomponents with keys like "Question: Is Bob hungry?\nAnswer: ". So the prefix should change.

In practice, this change goes from:

Old version which doesn't make sense:

```
Bob's
Question: Is Bob hungry?
Answer:
Yes
'''

New version after this change:

```
Question: Is Bob hungry?
Answer: Yes
...

If you want to restore the old behavior you can always include the agent name in the component's pre_act_key.

PiperOrigin-RevId: 673449346
Change-Id: Ideca6a212794271becc7f3d1c2fb0cfa8ef3618b
  • Loading branch information
jzleibo authored and copybara-github committed Sep 11, 2024
1 parent 148ab85 commit d4e32c0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions concordia/components/agent/question_of_recent_memories.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ def _make_pre_act_value(self) -> str:
prompt.statement(f'Current time: {self._clock_now()}.\n')

component_states = '\n'.join([
f"{agent_name}'s"
f' {prefix}:\n{self.get_named_component_pre_act_value(key)}'
f' {prefix}: {self.get_named_component_pre_act_value(key)}'
for key, prefix in self._components.items()
])
prompt.statement(component_states)
Expand Down

0 comments on commit d4e32c0

Please sign in to comment.