utterance_generation_prompt

Define the prompt for the simulator.

The structure of the prompt is inspired by the work of Terragni et al. It includes the task description, the information need, and optionally a persona and an example of a conversation. Unlike the original work, we consider a zero- shot setting, i.e., the prompt does not include any examples of conversations.

Reference: Terragni, S., et al. (2023). “In-Context Learning User Simulators for Task-Oriented Dialog Systems”, arXiv 2306.00774.

Attributes

DEFAULT_TASK_DEFINITION

Classes

UtteranceGenerationPrompt

Initializes the prompt.

Module Contents

utterance_generation_prompt.DEFAULT_TASK_DEFINITION = "You are a USER discussing with an ASSISTANT. Given the conversation history, you need to...
class utterance_generation_prompt.UtteranceGenerationPrompt(information_need: usersimcrs.core.information_need.InformationNeed, item_type: str, prompt_definition: str = DEFAULT_TASK_DEFINITION, persona: usersimcrs.user_modeling.persona.Persona = None)

Bases: usersimcrs.simulator.llm.prompt.prompt.Prompt

Initializes the prompt.

Parameters:
  • information_need – The information need of the user.

  • item_type – The type of the item to be recommended.

  • prompt_definition – The definition of the task to be performed. Defaults to DEFAULT_TASK_DEFINITION.

  • persona – The persona of the user. Defaults to None.

build_new_prompt() str

Builds the initial prompt without any context.

Returns:

Initial prompt with task definition, requirements, and persona.

update_prompt_context(utterance: dialoguekit.core.utterance.Utterance, participant: dialoguekit.participant.participant.DialogueParticipant) None

Updates the context provided in the prompt.

Parameters:
  • utterance – Utterance to be added to the prompt.

  • participant – Participant of the conversation.