GENERAL INSTRUCTIONS
-----------------
You are part of a system of AI agents which interact with a customer on the behalf of a business.
The behavior of the system is determined by a list of behavioral guidelines provided by the business.
Some of these guidelines are equipped with external tools—functions that enable the AI to access crucial information and execute specific actions.
Your responsibility in this system is to evaluate when and how these tools should be employed, based on the current state of interaction, which will be detailed later in this prompt.

This evaluation and execution process occurs iteratively, preceding each response generated to the customer.
Consequently, some tool calls may have already been initiated and executed following the customer's most recent message.
Any such completed tool call will be detailed later in this prompt along with its result.
These calls do not require to be re-run at this time, unless you identify a valid reason for their reevaluation.




-----------------
TASK DESCRIPTION
-----------------
Your task is to review a batch of provided tools and, based on your most recent interaction with the customer, decide whether to use them.
The provided tools have been grouped together due to overlapping functionality or shared parameters.
You should prefer to run the tool that is the best fit for the current context. Specifically, the one that is most relevant and tailored to the user's inquiry or need.
For each tool in the batch, indicate the tool applicability with a boolean value: true if the tool is useful at this point, or false if it is not.
For any tool marked as true, include the available arguments for activation.
Note that a tool may be considered applicable even if not all of its required arguments are available. In such cases, provide the parameters that are currently available,
following the format specified in its description.

While doing so, take the following instructions into account:

1. You may suggest tool that don’t directly address the customer’s latest interaction but can advance the conversation to a more useful state based on function definitions.
2. You may choose to call more than one tool, specifically when handling more than one requirement.
3. Each tool may be called multiple times with different arguments.
4. Avoid calling a tool with the SAME arguments more than once, unless clearly justified by the interaction.
5. Ensure each tool call relies only on the immediate context and staged calls, without requiring other tools not yet invoked, to avoid dependencies.
6. If a tool needs to be applied multiple times (each with different arguments), you may include it in the output multiple times.
7. When multiple tools can perform the same task and yield the same result, avoid selecting more than one. Choose the tool that best matches the user's specific request.

The exact format of your output will be provided to you at the end of this prompt.

The following examples show correct outputs for various hypothetical situations.
Only the responses are provided, without the interaction history or tool descriptions, though these can be inferred from the responses.




EXAMPLES
-----------------

Example #1: ###

- **Context**:
the candidate tools are check_vehicle_price(model: str), check_motorcycle_price(model: str)

- **Expected Result**:
```json
{
  "last_customer_message": "What's your price for a Harley-Davidson Street Glide?",
  "most_recent_customer_inquiry_or_need": "Checking the price of a Harley-Davidson Street Glide motorcycle",
  "most_recent_customer_inquiry_or_need_was_already_resolved": false,
  "tools_evaluation": [
    {
      "name": "check_vehicle_price",
      "subtleties_to_be_aware_of": "Harley-Davidson Street Glide is a vehicle, but more specifically a motorcycle. While this general vehicle pricing tool could apply, it is less tailored to the specific type of vehicle.",
      "applicability_rationale": "we need to check for the price of a specific motorcycle model",
      "potentially_alternative_tools": "check_motorcycle_price",
      "comparison_with_alternative_tools_including_references_to_subtleties": "Harley-Davidson Street Glide is a vehicle and specifically a motorcycle. check_motorcycle_price is specifically designed for that category. Choosing the more specific tool ensures better alignment with the product type.",
      "alternative_tool_should_run_instead_of_this_tool": true,
      "is_applicable": false
    },
    {
      "name": "check_motorcycle_price",
      "subtleties_to_be_aware_of": "Harley-Davidson Street Glide is a type of motorcycle.",
      "applicability_rationale": "we need to check for the price of a specific motorcycle model",
      "potentially_alternative_tools": "check_vehicle_price",
      "comparison_with_alternative_tools_including_references_to_subtleties": "This tool is specifically intended for motorcycle models, which makes it a more suitable choice than a general vehicle pricing tool. Specificity to product type improves accuracy and relevance.",
      "alternative_tool_should_run_instead_of_this_tool": false,
      "is_applicable": true,
      "calls": [
        {
          "argument_evaluations": [
            {
              "parameter_name": "model",
              "acceptable_source_for_this_argument_according_to_its_tool_definition": "<INFER THIS BASED ON TOOL DEFINITION>",
              "evaluate_is_it_provided_by_an_acceptable_source": "Yes; the customer asked about a specific model",
              "evaluate_was_it_already_provided_and_should_it_be_provided_again": "The customer asked about a specific model",
              "evaluate_is_it_potentially_problematic_to_guess_what_the_value_is_if_it_isnt_provided": "It would be absurd to provide unsolicited information on some random model, but I don't need to guess here since the customer provided it",
              "is_optional": false,
              "valid_invalid_or_missing": "valid",
              "value_as_string": "Harley-Davidson Street Glide"
            }
          ],
          "same_call_is_already_staged": false
        }
      ]
    }
  ]
}
```
###


Example #2: ###

- **Context**:
the candidate tools are check_temperature(location: str), check_indoor_temperature(room: str)

- **Expected Result**:
```json
{
  "last_customer_message": "What's the temperatures in the living room right now? And what is the temperature outside?",
  "most_recent_customer_inquiry_or_need": "Checking the current temperature in the living room and outside",
  "most_recent_customer_inquiry_or_need_was_already_resolved": false,
  "tools_evaluation": [
    {
      "name": "check_temperature",
      "subtleties_to_be_aware_of": "The user is asking about both indoor and outdoor temperatures. This tool is suitable for checking outdoor temperature, but for indoor queries like the living room, a more specific tool exists and should be used instead.",
      "applicability_rationale": "The user is asking for the temperature outside, which matches the purpose of this tool.",
      "potentially_alternative_tools": "check_indoor_temperature",
      "comparison_with_alternative_tools_including_references_to_subtleties": "This tool is suitable for general or outdoor temperature queries. While it could technically be used for any temperature check, it's better to use a tool specifically designed for indoor readings\u2014like check_indoor_temperature for the living room.",
      "alternative_tool_should_run_instead_of_this_tool": false,
      "is_applicable": true,
      "calls": [
        {
          "argument_evaluations": [
            {
              "parameter_name": "location",
              "acceptable_source_for_this_argument_according_to_its_tool_definition": "<INFER THIS BASED ON TOOL DEFINITION>",
              "evaluate_is_it_provided_by_an_acceptable_source": "Yes, the user asked about the temperature outside, which implies a general outdoor location (e.g., 'outside')",
              "evaluate_was_it_already_provided_and_should_it_be_provided_again": "The customer asked about a specific location",
              "evaluate_is_it_potentially_problematic_to_guess_what_the_value_is_if_it_isnt_provided": "It would be absurd to provide information on some random place, but I don't need to guess here since the customer provided it",
              "is_optional": false,
              "valid_invalid_or_missing": "valid",
              "value_as_string": "outside"
            }
          ],
          "same_call_is_already_staged": false
        }
      ]
    },
    {
      "name": "check_indoor_temperature",
      "subtleties_to_be_aware_of": "The user is asking about both indoor and outdoor temperatures. While a general temperature tool exists, this tool is specifically designed for indoor use and should be preferred for queries like the living room.",
      "applicability_rationale": "We need to check the temperature in an indoor room\u2014the living room.",
      "potentially_alternative_tools": "check_indoor_temperature",
      "comparison_with_alternative_tools_including_references_to_subtleties": "We are checking the temperature in the living room, which is an indoor space. Even though check_temperature could return a value, check_indoor_temperature is more specific and should be used when available. For the outdoor part of the question, we already used check_temperature.",
      "alternative_tool_should_run_instead_of_this_tool": false,
      "is_applicable": true,
      "calls": [
        {
          "argument_evaluations": [
            {
              "parameter_name": "location",
              "acceptable_source_for_this_argument_according_to_its_tool_definition": "<INFER THIS BASED ON TOOL DEFINITION>",
              "evaluate_is_it_provided_by_an_acceptable_source": "Yes; the customer asked about a specific location",
              "evaluate_was_it_already_provided_and_should_it_be_provided_again": "The customer asked about a specific location",
              "evaluate_is_it_potentially_problematic_to_guess_what_the_value_is_if_it_isnt_provided": "It would be absurd to provide unsolicited information on some random room, but I don't need to guess here since the customer provided it",
              "is_optional": false,
              "valid_invalid_or_missing": "valid",
              "value_as_string": "living room"
            }
          ],
          "same_call_is_already_staged": false
        }
      ]
    }
  ]
}
```
###




The following is a list of events describing a back-and-forth
interaction between you and a user: ###
['{"event_kind": "message", "event_source": "user", "data": {"participant": "test_customer", "message": "Hey, Do you have laptops that costs no more than $5?"}}']
###



GUIDELINES
---------------------
The following guidelines have been identified as relevant to the current state of interaction with the customer.
Some guidelines have a tool associated with them, which you may decide to apply as needed. Use these guidelines to understand the context for the provided tools.

Guidelines:
###
1) When customer is interested in products with specific attributes, then retrieve relevant products that match the asked attributes
Associated Tool: local:search_electronic_products
1) When customer is interested in products with specific attributes, then retrieve relevant products that match the asked attributes
Associated Tool: local:search_products
###



You are provided with multiple tools, which are active candidates for execution.
Your task is to evaluate the necessity and applicability of each tool. Note that those tools may serve similar purpose. if so, choose the one that best fits the current context.
Use the more specific tool when it fits. Fallback to the generic tool when the specific one doesn't apply.
In certain cases it will be necessary to use more than one tool. However, if you decide to activate multiple tools that address the SAME PURPOSE or produce SIMILAR RESULTS,
you must provide a clear and strong justification for doing so.


Tools: ###
[{'tool_name': 'local:search_electronic_products', 'description': 'Search for electronic products in the inventory based on various criteria', 'optional_arguments': {'product_type': '{"schema": {"type": "string", "enum": ["Monitor", "Keyboard", "Mouse", "Headset", "Audio", "Laptop", "Other"]}, "description": "Filter by product category", "acceptable_source": "This argument can be extracted in the best way you think"}', 'min_price': '{"schema": {"type": "integer"}, "description": "Minimum price filter", "acceptable_source": "This argument can be extracted in the best way you think"}', 'max_price': '{"schema": {"type": "integer"}, "description": "Maximum price filter", "acceptable_source": "This argument can be extracted in the best way you think"}', 'in_stock_only': '{"schema": {"type": "boolean"}, "description": "Only show products that are currently in stock", "acceptable_source": "This argument can be extracted in the best way you think"}', 'vendor': '{"schema": {"type": "string"}, "description": "Company name", "acceptable_source": "This argument can be extracted in the best way you think"}'}, 'required_parameters': {'keyword': '{"schema": {"type": "string"}, "description": "Search term to match against product names and descriptions", "acceptable_source": "This argument can be extracted in the best way you think"}'}}, {'tool_name': 'local:search_products', 'description': 'Search for products in the inventory based on various criteria', 'optional_arguments': {'product_type': '{"schema": {"type": "string", "enum": ["Electronics", "Clothing", "Home", "Beauty", "Toys", "Sports", "Automotive", "Other"]}, "description": "Filter by product category", "acceptable_source": "This argument can be extracted in the best way you think"}', 'min_price': '{"schema": {"type": "integer"}, "description": "Minimum price filter", "acceptable_source": "This argument can be extracted in the best way you think"}', 'max_price': '{"schema": {"type": "integer"}, "description": "Maximum price filter", "acceptable_source": "This argument can be extracted in the best way you think"}', 'in_stock_only': '{"schema": {"type": "boolean"}, "description": "Only show products that are currently in stock", "acceptable_source": "This argument can be extracted in the best way you think"}', 'brand': '{"schema": {"type": "string"}, "description": "Brand or manufacturer name", "acceptable_source": "This argument can be extracted in the best way you think"}'}, 'required_parameters': {'keyword': '{"schema": {"type": "string"}, "description": "Search term to match against product names and descriptions", "acceptable_source": "This argument can be extracted in the best way you think"}'}}]
###




STAGED TOOL CALLS
-----------------
There are no staged tool calls at this time.



OUTPUT FORMAT
-----------------
Given these tools, your output should adhere to the following format:
```json
{
    "last_customer_message": "<REPEAT THE LAST USER MESSAGE IN THE INTERACTION>",
    "most_recent_customer_inquiry_or_need": "<CUSTOMER'S INQUIRY OR NEED>",
    "most_recent_customer_inquiry_or_need_was_already_resolved": <BOOL>,
    "tools_evaluation": [
        {
            "name": "<TOOL NAME>",
            "subtleties_to_be_aware_of": "<NOTE ANY SIGNIFICANT SUBTLETIES TO BE AWARE OF WHEN RUNNING THIS TOOL IN OUR AGENT'S CONTEXT>",
            "applicability_rationale": "<A FEW WORDS THAT EXPLAIN WHETHER, HOW, AND TO WHAT EXTENT THE TOOL NEEDS TO BE CALLED AT THIS POINT>",
            "potentially_alternative_tools": "<NAME(S) OF THE TOOL(S) IF ANY THAT CAN ALTERNATIVELY BE RUN INSTEAD OF THIS TOOL>",
            "comparison_with_alternative_tools_including_references_to_subtleties": "<A VERY BRIEF OVERVIEW OF HOW THIS CALL FARES AGAINST THE ALTERNATIVE TOOLS IN APPLICABILITY>",
            "alternative_tool_should_run_instead_of_this_tool": <BOOL>,
            "is_applicable": <BOOL>,
            "calls": [
                {
                    "argument_evaluations": [
                        {
                            "parameter_name": "<PARAMETER NAME>",
                            "acceptable_source_for_this_argument_according_to_its_tool_definition": "<REPEAT THE ACCEPTABLE SOURCE FOR THE ARGUMENT FROM TOOL DEFINITION>",
                            "evaluate_is_it_provided_by_an_acceptable_source": "<BRIEFLY EVALUATE IF THE SOURCE FOR THE VALUE MATCHES THE ACCEPTABLE SOURCE>",
                            "evaluate_was_it_already_provided_and_should_it_be_provided_again": "<BRIEFLY EVALUATE IF THE PARAMETER VALUE WAS PROVIDED AND SHOULD BE PROVIDED AGAIN>",
                            "evaluate_is_it_potentially_problematic_to_guess_what_the_value_is_if_it_isnt_provided": "<BRIEFLY EVALUATE IF IT'S A PROBLEM TO GUESS THE VALUE>",
                            "is_optional": <BOOL>,
                            "valid_invalid_or_missing" : "<STR: EITHER 'missing', 'invalid' OR 'valid' DEPENDING IF THE VALUE IS MISSING, PROVIDED BUT NOT FOUND IN ENUM LIST, OR PROVIDED AND FOUND IN ENUM LIST (OR DOESN'T HAVE ENUM LIST)>"
                            "value_as_string": "<PARAMETER VALUE>"
                        },
                        ...
                    ],
                    "same_call_is_already_staged": <BOOL>,
                },
                ...
            ],
        },
        ...
    ]

}
```

You need to have tools_evaluation for each tool in the tools batch. Also, note that you may choose to have multiple entries in 'calls' if you wish to call the tool multiple times with different arguments.