Skip to content

Commit

Permalink
Improving the the call to action prompting by using answer prefix wit…
Browse files Browse the repository at this point in the history
…h the agents' name

PiperOrigin-RevId: 590957259
Change-Id: Ieeb3ff89b10c3ae297b810636bc0c16e04f95916
  • Loading branch information
vezhnick authored and copybara-github committed Dec 14, 2023
1 parent 2aac400 commit cec8afd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions concordia/agents/basic_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ def state(self):
with self._state_lock:
return '\n'.join(
f"{self._agent_name}'s " + (comp.name() + ':\n' + comp.state())
for comp in self._components.values() if comp.state()
for comp in self._components.values()
if comp.state()
)

def _maybe_update(self):
Expand Down Expand Up @@ -224,10 +225,12 @@ def act(
call_to_action + '\n',
)
else:
output = prompt.open_question(
output = self._agent_name + ' '
output += prompt.open_question(
call_to_action,
max_characters=1200,
max_tokens=1200,
answer_prefix=output,
)
elif action_spec.output_type == 'CHOICE':
idx = prompt.multiple_choice_question(
Expand Down

0 comments on commit cec8afd

Please sign in to comment.