usersimcrs.simulator.llm.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

Prompt

Initializes the prompt.

Module Contents

usersimcrs.simulator.llm.prompt.DEFAULT_TASK_DEFINITION = 'Complete the conversation as a CUSTOMER discussing with an ASSISTANT. The conversation is about...
class usersimcrs.simulator.llm.prompt.Prompt(requirements: usersimcrs.core.information_need.InformationNeed, item_type: str, task_definition: str = DEFAULT_TASK_DEFINITION, persona: usersimcrs.user_modeling.persona.Persona = None)

Initializes the prompt.

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

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

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

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

property prompt_text: str

Prompt for the user simulator.

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, participant: dialoguekit.participant.DialogueParticipant) None

Updates the context provided in the prompt.

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

  • participant – Participant of the conversation.