vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Filtering 

Filtering MAY be implemented for collections where clients need to limit the resources returned by specific criteria.



 Basic filtering 

Basic filtering provides the ability for the client to specify one or more filters where each supported field is required to match a specific value. Any primitive field returned by a collection MAY be supported for filtering.

The query parameter names for a basic filter MUST match the name of a primitive field on a resource in the collection exactly or a nested primitive field where the . character is the hierarchical separator. The only exception to this rule is for [primitive arrays](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-filteringprimitive-arrays).

The resulting collection MUST satisfy all filters. For example, the below filters would return only users whose first name is "John" and last name is "Smith":

GET /v2/users?first_name=John&last_name=Smith



 Matching logic 

Guidance for matching logic varies by field type, and is provided under the accepted formats heading for each type in the [Types](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-types) section.





 Primitive arrays 

Primitive arrays (such as tags) MAY support a singular form of the field (such as tag) as a filter that matches the resource if the array contains the supplied value. For example, the below filter could return the result following:

GET /v2/users?tag=swift

{
"resources": [
{
"email": "john.smith@ibm.com",
"first_name": "John",
"last_name": "Smith",
"tags": "objective-c", "swift", "ruby", "elixir"]
}
]
}







 Extended filtering 

The following types MAY support the below extended filters:



 Numeric fields 

Numeric fields MAY support the following comparisons:



* Not equal, by prefixing a value with not:
* Greater than, by prefixing a value with gt:
* Greater than or equal, by prefixing a value with gte:
For example, within your enterprise you might want to limit a specific account group, and its child accounts, to work with only the products that are Financial Services Validated.

The following example request restricts the products for an account group and child accounts. When you call the API, replace the ID variables with the values that are specific to your target account group or account. The options for {account_filters} are: inculde_all, category_filters, and id_filters.



* Java
* Python
* Go
* Node



String id = "{id}";
Filters accountFilters = {accountFilters};
UpdateCatalogAccountOptions updateOptions = new UpdateCatalogAccountOptions.Builder().id(id).accountFilters(accountFilters).build();
Response<Void> response = service.updateCatalogAccount(updateOptions).execute();
System.out.println(response.getResult());

id="{id}"
accountFilters={accountFilters}
response = self.service.update_catalog_account(id=id, account_filters=accountFilters)
print(response)

id := "{id}"
accountFilters := {accountFilters}
updateOptions := service.NewUpdateCatalogAccountOptions()
updateOptions.SetID(id)
updateOptions.AccountFilters(accountFilters)
response, _ := service.UpdateCatalogAccount(updateOptions)
fmt.Println(response)

id = "{id}";
accountFilters = {accountFilters};
response = await service.updateCatalogAccount({ 'id': id, 'accountFilters': accountFilters });
console.log(response);
This example deals with a few ways of pulling data from SoftLayer_Event_Log. There can be many Logs, so by using a filter, like the recentLogs function, you can limit how far back you search for Events.

This example deals with a few ways of pulling data from [SoftLayer_Event_Log](https://sldn.softlayer.com/reference/services/SoftLayer_Event_Log/). The latest version of the SoftLayer API Client for Java (v0.3.2 at the time of publishing this example) does not support object filters in the SoftLayer API, so programmatic filters are used instead.

This example deals with a few ways of pulling data from SoftLayer_Event_Log. There can be many Logs, so by using a filter, like the getRecentLogs function, you can limit how far back you search for Events. This example uses the maxNumberOfEvents value to limit the number of event logs that that are retrieved.

For more information about the SoftLayer API and virtual server APIs, see the following resources in the SoftLayer® Development Network:



* [SoftLayer API Overview ![External link icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/launch-glyph.svg)](https://sldn.softlayer.com/reference/softlayerapi/)
* [Getting Started with the SoftLayer API ![External link icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/launch-glyph.svg)](https://sldn.softlayer.com/article/getting-started/)



For API usage examples, see the following resources:



* [Understanding and building an order by using the SoftLayer API order CLI](https://softlayer.github.io/article/understanding-ordering/)
Total Outbound Digital messages = (number of email addresses) x (topic events)

In the example, the total outbound digital messages are as follows:

100 x 1000 = 100000 outbound digital messages

You are charged for messages that are successfully sent by the IBM Cloud email service regardless of whether the remote email server successfully delivered the message to the recipient. For example, bounced emails still count as outbound digital messages. So vet your email list carefully to prevent unnecessary charges.

You can monitor your email usage by setting up a monitoring dashboard through the Actions menu of the Event Notifications dashboard. See [Monitor Event Notifications service metrics with IBM Cloud Monitoring](https://cloud.ibm.com/docs/event-notifications?topic=event-notifications-en-monitoringen-monitoring) for details.





 Unsubscribe 

You can subscribe to or unsubscribe from specific Event Notifications email notifications. Also, users can opt out of receiving notifications for any subscription.

The Active tab displays the list of recipients email addresses and the date activated. The Unsubscribed tab displays the list of recipients who don't want to receive any email notification.

To unsubscribe, do the following steps:



* Under email subscription, click the Unsubscribed dialog to modify subscription settings and unsubscribe from mailing lists.
* Select or deselect the Unsubscribed dialog, which automatically reflects in the subscription wizard.



The role of an Admin:



* Only an admin can move or modify an unsubscribed email ID to Active.
* Only an admin can clear unsubscribed email lists.
* An admin cannot manually move or add users to the unsubscribed list.
event-notifications.subscriptions.read GET /event-notifications/v1/instances/{instanceID}/subscriptions/{subscriptionID} Manager, Reader, Writer, Administrator, Channel-Editor Get Subscription for Event Notifications instance 
 event-notifications.subscriptions.update PUT /event-notifications/v1/instances/{instanceID}/subscriptions/{subscriptionID} Manager, Writer, Administrator, Channel-Editor Update Subscription for Event Notifications instance 
 event-notifications.subscriptions.delete DELETE /event-notifications/v1/instances/{instanceID}/subscriptions/{subscriptionID} Manager, Administrator, Channel-Editor Delete Subscription from Event Notifications instance 
 event-notifications.subscriptions.list GET /event-notifications/v1/instances/{instanceID}/subscriptions Manager, Reader, Writer, Administrator, Channel-Editor Get All Subscriptions for Event Notifications instance 
 event-notifications.notifications.post POST /event-notifications/v1/instances/{{instance_id}}/notifications Manager, Writer, Administrator, Event-Source-Manager, Event-Notification-Publisher Send Notification to Event Notifications instance 
 event-notifications.counts.get GET /event-notifications/v1/instances/{instanceID}/counts Manager, Reader, Event-Source-Manager, Channel-Editor, Event-Notification-Publisher Get All Notifications for Event Notifications instance 
 event-notifications.events.create GET /event-notifications/v1/instances/{instanceID}/events/{eventID}?sourceID=* Manager, Administrator, Event-Source-Manager Get Event for Event Notifications instance 
 event-notifications.events.read POST /event-notifications/v1/instances/{instanceID}/sources Manager, Administrator, Event-Source-Manager 
 event-notifications.events.list GET /event-notifications/v1/instances/{instanceID}/events?sourceID=* Manager, Administrator, Event-Source-Manager Get All Events for Event Notifications instance
Get filters GET /v1/{crn}/zones/{domain_id}/filters internet-svcs.security.read internet-svcs.filters.read 
 Create a filter POST /v1/{crn}/zones/{domain_id}/filters internet-svcs.security.manage internet-svcs.filters.create 
 Update a filter PATCH /v1/{crn}/zones/{domain_id}/filters/{filter_id} internet-svcs.security.update internet-svcs.filters.update 
 Delete a filter DELETE /v1/{crn}/zones/{domain_id}/filters/{filter_id} internet-svcs.security.manage internet-svcs.filters.delete 
 Validate the expression of a filter. POST /v1/{crn}/zones/{domain_id}/filters/validate-expr internet-svcs.security.manage internet-svcs.filters-validate-expr.create 







 Security Events 



Table 9. Security Events

 Action Method IAM ACTION AT ACTION 

 Get security events GET /v1/{crn}/zones/{domain_id}/security/events internet-svcs.security.read internet-svcs.security-events.read 
 Get firewall events (Deprecated) GET /v1/{crn}/zones/{domain_id}/analytics/firewall_events [DEPRECATED] internet-svcs.security.read internet-svcs.firewall-events-analytics.read 







 Rate Limiting 



Table 10. Rate Limiting

 Action Method IAM ACTION AT ACTION 

 Get rate limiting rules GET /v1/{crn}/zones/{domain_id}/rate_limits internet-svcs.security.read internet-svcs.rate-limits.read 
 Create a rate limiting rule POST /v1/{crn}/zones/{domain_id}/rate_limits internet-svcs.security.manage internet-svcs.rate-limits.create
Filter out logs that are forwarded by your logging configuration.

ibmcloud ks logging filter create --cluster CLUSTER --type LOG_TYPE [--logging-config CONFIG] [--namespace KUBERNETES_NAMESPACE] [--container CONTAINER_NAME] [--level LOGGING_LEVEL] [--message MESSAGE] [--regex-message MESSAGE] [--force-update] [--output json] [-q]

Minimum required permissions
: Editor platform access role for the cluster in IBM Cloud Kubernetes Service

Command options:

-c, --cluster CLUSTER
: Required: The name or ID of the cluster to create a logging filter for.

--type LOG_TYPE
: The type of logs that you want to apply the filter to. Currently all, container, and host are supported.

-lc, --logging-config CONFIG
: Optional: The logging configuration ID. If not provided, the filter is applied to all the cluster logging configurations that are passed to the filter. You can view log configurations that match the filter by using the --show-matching-configs option with the command. To specify multiple IDs, use multiple options, such as -lc id1 -lc id2.

-n, --namespace KUBERNETES_NAMESPACE
: Optional: The Kubernetes namespace from which you want to filter logs.

--container CONTAINER_NAME
: Optional: The name of the container from which you want to filter out logs. This option applies only when you are using log type container.

--level LOGGING_LEVEL
: Optional: Filters out logs that are at the specified level and less. Acceptable values in their canonical order are fatal, error, warn/warning, info, debug, and trace. As an example, if you filtered logs at the info level, debug, and trace are also filtered. Note: You can use this option only when log messages are in JSON format and contain a level field. Example output {"log": "hello", "level": "info"}

--message MESSAGE
"tags": "objective-c", "swift", "ruby", "elixir"]
}
]
}







 Extended filtering 

The following types MAY support the below extended filters:



 Numeric fields 

Numeric fields MAY support the following comparisons:



* Not equal, by prefixing a value with not:
* Greater than, by prefixing a value with gt:
* Greater than or equal, by prefixing a value with gte:
* Less than, by prefixing a value with lt:
* Less than or equal, by prefixing a value with lte:
* In a set, by providing a comma-separated list of values
* Not in a set, by prefixing a comma-separated list of values with not:



If any integer or float field supports any of the above comparisons, all integer and float fields which the collection can be filtered on MUST support all of the above comparisons.





 Date and date/time fields 

Date and date/time fields MAY support the following comparisons:



* Not equal, by prefixing a value with not:
* Greater than, by prefixing a value with gt:
* Greater than or equal, by prefixing a value with gte:
* Less than, by prefixing a value with lt:
* Less than or equal, by prefixing a value with lte:
* In a set, by providing a comma-separated list of values
* Not in a set, by prefixing a comma-separated list of values with not:



If any date or date/time field supports any of the above comparisons, all date and date/time fields which the collection can be filtered on MUST support all of the above comparisons.





 Identifier and enumeration fields 

Identifier and enumeration fields MAY support the following comparisons:



* Not equal, by prefixing a value with not:
* In a set, by providing a comma-separated list of values
* Not in a set, by prefixing a comma-separated list of values with not:
* If you send logs to the Log Analysis service, you can define [exclusion rules](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-exclusion_rules) to drop logs before they are stored for search.



* You can drop the log lines entirely and not see them at all through the UI.
* You can view the log lines in the UI, but you cannot search on them. However, you can define views and alerts based on the data from these logs.



* You can also configure [usage quotas](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-control_usage_quotas) and define conditional usage quota exclusion rules.
You will configure the rule so that you are not able to see excluded log data through views.

Complete the following steps to define the exclusion rule:

Prereq: You must have a cluster configured to forward logs to a logging instance. [Learn more](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-config_agent_kube_cluster).



1. [Launch the IBM Log Analysis web UI](https://cloud.ibm.com/docs/log-analysis?topic=log-analysis-view_logsview_logs_step2).
2. Click the Settings icon ![Configuration icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/admin.png). Then select Usage > Exclusion Rules.
3. Select Add Rule. The Create Rule section opens.
4. Enter a name for the rule in the section What is this rule for?. For example, enter Exclude log records from the namespace kube-system except error ones.
5. Enter the exclusion criteria. You can select 1 or more sources, 1 or more apps, enter a query, or a combination of sources, apps and query.

In the Query section, enter Namespace:kube-system -level:error to exclude all lines except the ones that report an error.
6. Leave unchecked the option Preserve these lines for live-tail and alerting.
7. Click Save.

Check the query in a custom view by entering the search criteria in the search bar of the Everything view, and validating that the data that is displayed is the data that you want excluded.
case 'text':
// It's a text response, so we just display it.
console.log(response.output.generic[0].text);
break;
case 'option':
// It's an option response, so we'll need to show the user
// a list of choices.
console.log(response.output.generic[0].title);
const options = response.output.generic[0].options;
// List the options by label.
for (let i = 0; i < options.length; i++) {
console.log((i+1).toString() + '. ' + options[i].label);
}
promptOption = true;
break;
}
}
}
}

// If we're not done, prompt for the next round of input.
if (!endConversation) {
let messageInput;
if (promptOption == true) {
// Prompt for a valid selection from the list of options.
let choice;
do {
choice = prompt('? ');
if (isNaN(choice)) {
choice = 0;
}
} while (choice < 1 || choice > response.output.generic[0].options.length);
const value = response.output.generic[0].options[choice-1].value;
// Use message input from the selected option.
messageInput = value.input;
} else {
// We're not showing options, so we just prompt for the next
// round of input.
const newText = prompt('>> ');
messageInput = {
text: newText,
}
}
sendMessage(messageInput);
} else {
// We're done, so we delete the session.
service
.deleteSession({
assistantId,
sessionId,
})
[Image showing the + on the queues widgit](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_webconsole_create_queue.png)
3. Select a queue type of 'Local'.
4. Type in 'DEV.TEST.1'.

The name can contain up to 48 characters. Valid characters are letters, numbers and the period, forward slash, underscore and percent symbols. The queue name needs to be unique within the queue manager.
5. Click Create.



You will see a success message, and your new queue now appears in the list.





 Put a message onto the test queue 



1. Click queue 'DEV.TEST.1'.
2. Click the 'Create +' button.
3. Under 'Application data' enter a message
4. Click Create.



![Image showing the creation of a message on the queue](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_webcli_put.png)

You can see the message is now on the queue.





 Browse a message on the test queue 



1. Click on the message in the table.



You can see the details of the message. Expand 'Application data' to view the message text.





 Delete the test queue 



1. Ensure the 'Queues' tab is selected

!
You probably want either the Found response for all of them or none of them to be returned.

To prevent Found responses from being displayed, you can do one of the following things to each Found response:



* Add a condition to the response that prevents it from being displayed if particular slots are filled. For example, you can add a condition, like !($size && $time), that prevents the response from being displayed if the $size and $time context variables are both provided.
* Add the !all_slots_filled condition to the response. This setting prevents the response from being displayed if all of the slots are filled. Do not use this approach if you are including a confirmation slot. The confirmation slot is also a slot, and you typically want to prevent the Found responses from being displayed before the confirmation slot itself is filled.







 Handling requests to exit a process 

Add at least one slot handler that can recognize it when a user wants to exit the node.

For example, in a node that collects information to schedule a pet grooming appointment, you can add a handler that conditions on the #cancel intent, which recognizes utterances such as, Forget it. I changed my mind.



1. In the JSON editor for the handler, fill all of the slot context variables with dummy values to prevent the node from continuing to ask for any that are missing. And in the handler response, add a message such as, Ok, we'll stop there. No appointment will be scheduled.
2. Choose what action you want your assistant to take next from the following options:



* Prompt again (Default): Displays the prompt for the slot that the user was working with just before asking the off-topic question.
* Skip current slot: Displays the prompt associated with the slot that comes after the slot that the user was working with just before asking the off-topic question. And your assistant makes no further attempts to fill the skipped slot.
* Skip to response: Skips the prompts for all remaining empty slots including the slot the user was working with just before asking the off-topic question.



3. In the node-level response, add a condition that checks for a dummy value in one of the slot context variables.
If you try to set a percentage where an exclusion rule exists, you will be warned that the existing rule will be replaced.
3. Select the source of the logs you want to exclude.
4. Select the apps you want to exclude.
5. Specify a [query](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-views) to select the log lines you want to exclude.
6. Select if your want to discard all matching log lines until the next billing cycle and if you want those log lines preserved for live tail and alerting.

All configured alert recipients will be alerted when the percentage threshold of the monthly quota is reached. This behavior cannot be changed.
7. Click Apply to save the exclusion rule.
8. After you configure an exclusion rule, verify that the exclusion rule behaves as you expect.

Check the query in a custom view by entering the search criteria in the search bar of the Everything view, and validating that the data that is displayed is the data that you want excluded.







 Enable and disabling exclusion rules 

Toggle the selection next to the exclusion rules to enable or disable the rule.

Zoom

![Example switch to enable or disable exclusion rule](https://cloud.ibm.com/docs-content/v1/content/6f3c07c34058f637b1c86044ca4f9b24214330a7/activity-tracker/images/usage_quota_rule_switch.png)

Figure 1. Example switch showing exclusion rule is enabled





 Editing exclusion rules 

To edit an exclusion rule click Edit next to the exclusion rule that you want to change.







 Configuring usage quota alerts 

By default the account owner is configured to receive alert emails. You can configure your systems to send email alerts, Slack notifications, or both.

To configure notifications when a quota threshold is exceeded, do the following:



1. Under Alert recipients select the desired recipient email addresses. There must be at least one email address configured if Slack notifcations are not configured.
[Check mark icon](https://cloud.ibm.com/docs-content/v1/content/f61dbc5d84bf0c89e477a05cab04c72f429e1b7a/log-analysis/images/checkmark-icon.svg) 
 Delete a view and its associated alerts. DELETE 







 query (string) 

Specifies the search query that is applied to the view.

Check the query in the logging web UI to validate that the data that is displayed through the view matches the data entry that you plan to monitor through that view.





 hosts (array of strings) 

Specifies the list of services from which you want to view data.

In the logging web UI, the value that is set for Source in the Line identifiers section corresponds to the hosts value of the service that generates that log.

For example, to enter multiple hosts, you must separate the hosts with a comma:

"hosts": ["is", "event-streams"]





 apps (array of strings) 

Specifies the service instance ID that generates the log.

For example, to enter multiple apps, you must separate the apps with a comma:

"apps": ["apps1", "apps2"]





 channels (array of objects) 

Specifies the notification channels and trigger conditions that are associated with a view.



* You can configure 1 or more channels per view.
* You can configure any of the following channels through the Configuration API: email, webhook, PagerDuty.



"channels": [
{
"integration": "email",
"emails": "LIST OF EMAILS"], // array of strings (emails) that are comma-separated
"triggerlimit": 15,
"triggerinterval": "5m",
"immediate": true,
"terminal": true,
"operator": "presence",
"timezone": "TIMEZONE"
},
{
"integration": "webhook",