eta.discourse.get_prior_words

get_prior_words(turns, agent=None)[source]

Retrieve the prior utterance in the conversation, using a generic utterance if none is found.

Parameters:
  • turns (list[DialogueTurn]) – A list of dialogue turns in the conversation, in chronological order.

  • agent (str, optional) – The agent whose prior words should be found (by default, find the prior turn by any agent).

Returns:

The prior words by the given agent, if one exists, or a generic utterance.

Return type:

str