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.


Task Description
----------------
You will be given a set of guidelines, each associated with an action that has already been applied one or more times during the conversation.

In general, a guideline should be reapplied if:
1. The condition is met again for a new reason in the most recent user message, and
2. The associated action has not yet been taken in response to this new occurrence, but still needs to be.

Your task is to determine whether reapplying the action is appropriate, based on whether the guideline’s condition is met again in a way that justifies repeating the action. We will want to repeat the action if the current application refers
 to a new or subtly different context or information
For example, a guideline with the condition “the customer is asking a question” should be reapplied each time the customer asks a new question.
In contrast, guidelines involving one-time behaviors (e.g., “send the user our address”) should be reapplied more conservatively: only if the condition ceased to be true for a while and is now clearly true again in the current context.
For instance, if the customer previously complained about an issue and you already offered compensation, then mentions the same issue again, it is usually not necessary to repeat the compensation offer. However, if the customer raises a new
 issue or clearly indicates a different concern, it may warrant reapplying the guideline.

-- Focusing on the most recent context --
When evaluating whether a guideline should be reapplied, the most recent part of the conversation, specifically the last user message, is what matters. A guideline should only be reapplied if its condition is clearly met again in that latest message.
Always base your decision on the current context to avoid unnecessary repetition and to keep the response aligned with the user’s present needs.
Context May Shift:
    Sometimes, the user may briefly raise an issue that would normally trigger a guideline, but then shift the topic within the same message or shortly after. In such cases, the condition should NOT be considered active, and the guideline should
    not be reapplied.
Conditions Can Arise and Resolve Multiple Times:
    A condition may be met more than once over the course of a conversation and may also be resolved multiple times (the action was taken). If the most recent instance of the condition has already been addressed and resolved, there is no need to
    reapply the guideline. However, if the user is still clearly engaging with the same unresolved issue, or if a new instance of the condition arises, reapplying the guideline may be appropriate.


The conversation and guidelines will follow. Instructions on how to format your response will be provided after that.




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

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Can I purchase a subscription to your software?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Absolutely, I can assist you with that right now."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Cool, let's go with the subscription for the Pro plan."
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Your subscription has been successfully activated. Is there anything else I can help you with?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Will my son be able to see that I'm subscribed? Or is my data protected?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "If your son is not a member of your same household account, he won't be able to see your subscription. Please refer to our privacy policy page for additional up-to-date information."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Gotcha, and I imagine that if he does try to add me to the household account he won't be able to see that there already is an account, right?"
    }
  }
]


- **Guidelines**:
1) the customer initiates a purchase.
2) the customer asks about data security


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "the customer initiates a purchase.",
      "action": "Open a new cart for the customer",
      "condition_met_again": false,
      "should_reapply": false
    },
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "the customer asks about data security",
      "action": "Refer the customer to our privacy policy page",
      "condition_met_again": true,
      "action_wasnt_taken": true,
      "should_reapply": true
    }
  ]
}
```

Example #2: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Hi there, what is the S&P500 trading at right now?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Hello! It's currently priced at just about 6,000$."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Better than I hoped. And what's the weather looking like today?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "It's 5 degrees Celsius in London today"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Bummer. Does S&P500 still trade at 6,000$ by the way?"
    }
  }
]


- **Guidelines**:
1) the customer asks about the value of a stock.
2) the weather at a certain location is discussed.


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "the customer asks about the value of a stock.",
      "action": "provide the price using the 'check_stock_price' tool",
      "condition_met_again": true,
      "action_wasnt_taken": true,
      "should_reapply": true
    },
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "the weather at a certain location is discussed.",
      "action": "check the weather at that location using the 'check_weather' tool",
      "condition_met_again": false,
      "should_reapply": false
    }
  ]
}
```

Example #3: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Can you tell me my current account balance?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Your current account balance is $75.20. Would you like to hear about your recent payments?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "What\u2019s the amount due on my latest bill?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Your latest bill is $45.60, due on June 15th"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Have I made any payments this month?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Yes, you made a payment of $30 on May 5th. Can I help with anything else?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Yes can you provide me your contact details?"
    }
  }
]


- **Guidelines**:
1) The customer asks about their account balance, billing amount, or payment status.


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "The customer asks about their account balance, billing amount, or payment status.",
      "action": "Provide the current account balance or billing information clearly.",
      "condition_met_again": false,
      "should_reapply": false
    }
  ]
}
```

Example #4: ###

- **Interaction Events**:
[
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Hi there, what is the S&P500 trading at right now?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "Hello! It's currently priced at just about 6,000$."
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Better than I hoped. And what's the weather looking like today?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "It's 5 degrees Celsius in London today"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Bummer. Does S&P500 still trade at 6,000$ by the way?"
    }
  },
  {
    "event_kind": "message",
    "event_source": "ai_agent",
    "data": {
      "message": "I checked that for you and it's still on 6000$!"
    }
  },
  {
    "event_kind": "message",
    "event_source": "user",
    "data": {
      "message": "Cool thanks"
    }
  }
]


- **Guidelines**:
1) the customer asks about the value of a stock.
2) the weather at a certain location is discussed.


- **Expected Result**:
```json
{
  "checks": [
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "the customer asks about the value of a stock.",
      "action": "provide the price using the 'check_stock_price' tool",
      "condition_met_again": true,
      "action_wasnt_taken": false,
      "should_reapply": false
    },
    {
      "guideline_id": "<example-id-for-few-shots--do-not-use-this-in-output>",
      "condition": "the weather at a certain location is discussed.",
      "action": "check the weather at that location using the 'check_weather' tool",
      "condition_met_again": false,
      "should_reapply": false
    }
  ]
}
```




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 want a drink please..."}}', '{"event_kind": "message", "event_source": "ai_agent", "data": {"participant": "Test Agent", "message": "If you\'re looking for a drink, I have to say my favorite is definitely Pepsi!"}}', '{"event_kind": "message", "event_source": "user", "data": {"participant": "Guest", "message": "Hmmm... What do you have?"}}']
###



- Conditions List: ###
1) Condition: The customer wants something to drink. Action: Insist that your favorite drink is 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 wants something to drink",
            "action": "Insist that your favorite drink is Pepsi",
            "condition_met_again": "<BOOL. Whether the condition met again in a new or subtly different context or information>",
            "action_wasnt_taken": "<BOOL. include only condition_met_again is True if The action wasn't already taken for this new reason>",
            "should_reapply": "<BOOL>"
        }
    ]
}
```