GENERAL INSTRUCTIONS
-----------------
In our system, the behavior of a conversational AI agent is guided by "guidelines". The agent makes use of these guidelines whenever it interacts with a user (also referred to as the customer).
Each guideline is composed of two parts:
- "condition": This is a natural-language condition that specifies when a guideline should apply.
          We look at each conversation at any particular state, and we test against this
          condition to understand if we should have this guideline participate in generating
          the next reply to the user.
- "action": This is a natural-language instruction that should be followed by the agent
          whenever the "condition" part of the guideline applies to the conversation in its particular state.
          Any instruction described here applies only to the agent, and not to the user.

While an action can only instruct the agent to do something, some guidelines may require something from the customer in order to be completed. These are referred to as "customer dependent" guidelines.
For example, the action "get the customer's ID number" requires the agent to ask the customer what's their account number, but the guideline is not fully completed until the user provides it.

Task Description
----------------

Your task is to evaluate whether a set of "customer dependent" guidelines should be applied to the current state of a conversation between an AI agent and a user.

You will be given guidelines where the agent has already performed their part of the action at least once during the interaction. Now you need to determine if each guideline should be reapplied based on the conversation's current state.

A guideline should be applied if either of the following conditions is true:

   1. Incomplete Action: The original condition still holds, the reason that triggered the agent's initial action remains relevant, AND the customer has not yet fulfilled their part of the action. Example: The agent asked for the user's ID, but the user hasn't responded yet, and the conversation is still about accessing their account.
   2. New Context for Same Condition: The condition arises again in a new context, requiring the action to be repeated by both agent and customer. Example: The user switches to asking about a second account, so the agent needs to ask for another ID.

Key Evaluation Rules:

- Avoid Repeating Static Information Requests: Do not reapply guidelines that request static information (ID, name, date of birth) unless there's a genuinely new context. However, if an action combines static and dynamic components (e.g., "ask for name and preferred appointment time"), reapply the guideline when the dynamic component becomes relevant again.

- Focus on Most Recent Context: Base your evaluation primarily on the last user message. A guideline should only be reapplied if its condition is clearly met in that latest message, not based on earlier parts of the conversation.

- Handle Context Shifts: If a user briefly mentions something that would trigger a guideline but then shifts topics within the same message, do NOT consider the condition active.

- Track Resolution Status: If the most recent instance of a condition has been addressed and resolved, there's no need to reapply the guideline. However, if the user is still engaging with an unresolved issue or a new instance arises, reapplication may be appropriate.





Examples of Guideline Match Evaluations:
-------------------
Example #1: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I'm planning a trip next month. Any ideas on where to go?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That sounds exciting! What kind of activities do you enjoy \u2014 relaxing on the beach, hiking, museums, food tours?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "That's a complicated question. I will think and tell you."
    }
  }
]


- **Guidelines**:
1) The customer wants recommendations for a trip


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer wants recommendations for a trip",
      "action": "Ask for their preferred activities and recommend accordingly",
      "condition_still_met": true,
      "customer_should_reply": true,
      "tldr": "The customer should answer what's their preferred activities.",
      "should_apply": true
    }
  ]
}
```

Example #2: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I'm planning a trip next month. Any ideas on where to go?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That sounds exciting! What kind of activities do you enjoy \u2014 relaxing on the beach, hiking, museums, food tours?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I love hiking and exploring local food scenes."
    }
  }
]


- **Guidelines**:
1) The customer wants recommendations for a trip


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer wants recommendations for a trip",
      "action": "Ask for their preferred activities and recommend accordingly",
      "condition_still_met": true,
      "customer_should_reply": false,
      "condition_met_again": false,
      "tldr": "The customer has already answer what's their preferred activities",
      "should_apply": false
    }
  ]
}
```

Example #3: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I'm planning a trip next month. Any ideas on where to go?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That sounds exciting! What kind of activities do you enjoy\u2014relaxing on the beach, hiking, museums, food tours?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I love hiking and exploring local food scenes."
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Great! You might enjoy a trip to the Pacific Northwest\u2014plenty of trails and great food in Portland and Seattle."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "What about a winter trip in Europe?"
    }
  }
]


- **Guidelines**:
1) The customer wants recommendations for a trip


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer wants recommendations for a trip",
      "action": "Ask for their preferred activities and recommend accordingly",
      "condition_still_met": true,
      "customer_should_reply": false,
      "condition_met_again": true,
      "action_should_reapply": true,
      "action_wasnt_taken": true,
      "tldr": "The customer ask about a new trip plan.",
      "should_apply": true
    }
  ]
}
```

Example #4: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I'm planning a trip next month. Any ideas on where to go?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That sounds exciting! What kind of activities do you enjoy\u2014relaxing on the beach, hiking, museums, food tours?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I love hiking and exploring local food scenes."
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Great! You might enjoy a trip to the Pacific Northwest\u2014plenty of trails and great food in Portland and Seattle."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "What about a winter trip in Europe?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That can be great! What kind of activities would you like to do there?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I will go to France probably"
    }
  }
]


- **Guidelines**:
1) The customer wants recommendations for a trip


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer wants recommendations for a trip",
      "action": "Ask for their preferred activities and recommend accordingly",
      "condition_still_met": true,
      "customer_should_reply": true,
      "tldr": "The customer didn't answer the question.",
      "should_apply": true
    }
  ]
}
```

Example #5: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I'm planning a trip next month. Any ideas on where to go?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That sounds exciting! What kind of activities do you enjoy\u2014relaxing on the beach, hiking, museums, food tours?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "I love hiking and exploring local food scenes."
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Great! You might enjoy a trip to the Pacific Northwest\u2014plenty of trails and great food in Portland and Seattle."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "What about a winter trip in Europe?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "That can be great! What kind of activities would you like to do there?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Actually let's stick to the Plan for next month"
    }
  }
]


- **Guidelines**:
1) The customer wants recommendations for a trip


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer wants recommendations for a trip",
      "action": "Ask for their preferred activities and recommend accordingly",
      "condition_still_met": false,
      "tldr": "The customer regret about the new planning",
      "should_apply": false
    }
  ]
}
```

Example #6: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Hi, I need help changing the email on my account."
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Sure! Could you please provide your account ID so I can verify your identity?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "It\u2019s ACC12345."
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Thanks! I\u2019ve updated your email."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Also, can you check the last payment on my account?"
    }
  }
]


- **Guidelines**:
1) The customer is asking for account-related help


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer is asking for account-related help",
      "action": "Ask for their account ID to verify their identity",
      "condition_still_met": true,
      "customer_should_reply": false,
      "condition_met_again": true,
      "action_should_reapply": false,
      "tldr": "The customer already provided their account Id",
      "should_apply": false
    }
  ]
}
```




You are an AI agent named Pepsi Agent.

The following is a description of your background and personality: ###
An agent that offers Pepsi to thirsty customers
###



The user you're interacting with is called Guest.



The following is a list of events describing the most recent state of the back-and-forth
interaction between you and a user: ###
['{"event_kind": "message", "event_source": "user", "data": {"participant": "Guest", "message": "Hi, I\'m thirsty"}}', '{"event_kind": "message", "event_source": "ai_agent", "data": {"participant": "Pepsi Agent", "message": "Would you like a refreshing Pepsi to quench your thirst?"}}', '{"event_kind": "message", "event_source": "user", "data": {"participant": "Guest", "message": "Hmmm what? What can I get?"}}']
###



- Conditions List: ###
1) Condition: The customer is thirsty. Action: See if they'd like a Pepsi
###



IMPORTANT: Please note there are exactly 1 guidelines in the list for you to check.

OUTPUT FORMAT
-----------------
- Specify the applicability of each guideline by filling in the details in the following list as instructed:
```json
{
    "checks": [
        {
            "guideline_id": "1",
            "condition": "The customer is thirsty",
            "action": "See if they'd like a Pepsi",
            "condition_still_met": "<BOOL, whether the condition that raised the guideline still relevant in the most recent interaction and subject hasn't changed>",
            "customer_should_reply": "<BOOL, include only if condition_still_met=True. whether the customer needs to apply their side of the action>",
            "condition_met_again": "<BOOL, include only if customer_should_reply=False whether the condition is met again in the recent interaction for a new reason and action should be taken again>",
            "action_should_reapply": "<BOOL,  include only if condition_met_again=True. whether the action is not static and should be taken again>",
            "action_wasnt_taken": "<BOOL, include only if action_should_reapply=True, whether the new action wasn't taken yet by the agent or the customer>",
            "tldr": "<str, Explanation for why the guideline should apply in the most recent context>",
            "should_apply": "<BOOL>"
        }
    ]
}
```