vania-janet/multiturn-rag-retrieval-data huggingface dataset:
The activation ID (44794bd6aab74415b4e42a308d880e5b) which can be used to retrieve the logs or the result of the invocation.









 Testing triggers 

Triggers can be fired, or activated, by using a dictionary of key-value pairs. Sometimes this dictionary is referred to as the event. Triggers can be explicitly fired by a user or fired on behalf of a user by an external event source. As with actions, each firing of a trigger that is associated with a rule results in an activation ID.



1. Fire the trigger.

ibmcloud fn trigger fire TRIGGER_NAME --param PARAM_NAME PARAM_VALUE --param PARAM_NAME PARAM_VALUE

A trigger that isn't associated with a rule has no visible effect when it is fired. Because no rule associated with this trigger, the passed parameters are not used as input by any action.

The following example shows possible output from the previous trigger fire.

ok: triggered TRIGGER_NAME with id fa495d1223a2408b999c3e0ca73b2677
2. Verify that the action was invoked by checking the most recent activation record.

ibmcloud fn activation list --limit 1 ACTION_NAME

The following example shows possible output from the previous command.

activations
fa495d1223a2408b999c3e0ca73b2677 ACTION_NAME
3. Get more information about the activation ID from the previous command output.

ibmcloud fn activation result ACTIVATION_ID

The following example shows possible output from the previous command.

{
"payload": "Hello, Human from Earth"
}







 Testing duration of activations 

Check how long an activation took to complete by getting the activation log. If the duration is too long or you need to adjust the default timeout to allow the function to run longer, you can update your action with a timeout.



1. Get the activation ID.

ibmcloud fn activation list --limit 1 ACTION_NAME

The following example shows possible output from the previous command.
)
options.SetIamID(exampleUserID)
options.SetFormat("include_last_permit")

policyList, response, err := iamPolicyManagementService.ListPolicies(options)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(policyList, "", " ")
fmt.Println(string(b))

const params = {
accountId: exampleAccountId,
iamId: exampleUserId,
format: 'include_last_permit',
};

iamPolicyManagementService.listPolicies(params)
.then(res => {
console.log('listPolicies() result:n' + JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err)
});



* format=include_last_permit: Include the last permit information for each policy.
* sort=last_permit_at: Sort by date in ascending order. The policies that have not been used for any permits and the oldest permits are listed first.



The format of the response is represented in JSON.

{
"policies": [
{
"id": "45b226ac-490d-47f3-a785-990e0c729d93",
"type": "access",
"subjects": ...],
"roles": ...],
"resources": ...],
...
"last_modified_at": "2021-04-09T14:36:30.505Z",
"last_modified_by_id": "IBMid-310000JVN5",
"last_permit_at": null, <-- IAM has no record of this policy ever granting a permit decision
For a user agent to successfully fetch an authenticated resource, they’ll need to provide the correct path, expiration timestamp, and HMAC using query parameters — if any of those three are tampered with, the request fails.

Note that the authenticity of the expiration timestamp is covered by the HMAC, so we can rely on the user-provided timestamp being correct if the HMAC is correct, and thus know when the URL expires. Moreover, you can also determine whether a URL in their possession has expired or not.



 Verifying signed requests 

This example verifies the HMAC for any request URL whose pathname starts with /verify/.

For debugging convenience, this Edge function returns 403 if the URL or HMAC is invalid, or if the URL has expired. You might want to return 404 in an actual implementation.

addEventListener('fetch', event => {
event.respondWith(verifyAndFetch(event.request))
})

async function verifyAndFetch(request) {
const url = new URL(request.url)

// If the path doesn't begin with our protected prefix, just pass the request
// through.
if (!url.pathname.startsWith("/verify/")) {
return fetch(request)
}

// Make sure we have the minimum necessary query parameters.
if (!url.searchParams.has("mac") || !url.searchParams.has("expiry")) {
return new Response("Missing query parameter", { status: 403 })
}

// We'll need some super-secret data to use as a symmetric key.
const encoder = new TextEncoder()
const secretKeyData = encoder.encode("my secret symmetric key")
const key = await crypto.subtle.importKey(
"raw", secretKeyData,
{ name: "HMAC", hash: "SHA-256" },
false, [ "verify" ]
)
`has_skipped_slots` I look forward to helping you with your next reservation. Have a good day. 



The has_skipped_slots condition checks the properties of the slots node to see if any of the slots were skipped. The exit handler skips all remaining slots to go directly to the node response. So, when the has_skipped_slots property is present, you know the exit intent was triggered, and the dialog can display an alternate response.

If you configure more than one slot to skip other slots, or configure another node-level event handler to skip slots, then you must use a different approach to check whether the #exit intent was triggered. See [Handling requests to exit a process](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-slotsdialog-slots-node-level-handler) for an alternate way to do so.
9. You want your assistant to check for the has_skipped_slots property before it displays the standard node-level response. Move the has_skipped_slots conditional response up so it gets processed before the original conditional response or it will never be triggered. To do so, click the response you just added, use the up arrow to move it up, and then click Save.
10. Test this change by using the following script in the "Try it out" pane.



Script details

 Speaker Utterance 

 You i want to make a reservation 
 Watson I can make a reservation for you. Just tell me the day and time of the reservation, and how many people it is for. 
 You it's for 5 people 
 Watson Ok. The reservation is for 5 guests. What day would you like to come in? 
 You Nevermind 
 Watson Ok, we'll stop there. No reservation will be made. I look forward to helping you with your next reservation. Have a good day. 









 Step 8: Apply a valid value if the user fails to provide one after several attempts 

In some cases, a user might not understand what you are asking for. They might respond again and again with the wrong types of values.
The service does this to improve usability by avoiding the 30-second HTTP REST inactivity timeout. To keep the connection alive while recognition is ongoing, the service continues to send this space character until it completes its transcription. The space character has no effect on JSON-encoded response data.

This HTTP inactivity timeout is different from the service's inactivity timeout. The WebSocket interface is not subject to this HTTP timeout.



 Inactivity timeout 

An inactivity timeout (HTTP status code 400) occurs when the service is receiving audio but detects only continuous silence or non-speech activity (no speech) for 30 seconds. The service sends the error message No speech detected for 30s. The inactivity timeout is useful, for example, for terminating a session when a user simply walks away from a live microphone.

The default inactivity timeout is 30 seconds. You can override this value by using the inactivity_timeout parameter. Specify a larger value to increase the inactivity timeout. Specify a value of -1 to set the inactivity timeout to infinity. You are charged for all audio that you send to the service, including silence, so increasing the inactivity timeout can incur additional charges for a streaming session that sends only silence.





 Inactivity timeout example 

The following example request sets the inactivity timeout to 60 seconds. The request sends an initial file to begin the streaming session.

IBM Cloud

curl -X POST -u "apikey:{apikey}" --header "Transfer-Encoding: chunked" --header "Content-Type: audio/flac" --data-binary @{path}audio-file1.flac "{url}/v1/recognize?inactivity_timeout=60"

IBM Cloud Pak for Data

curl -X POST --header "Authorization: Bearer {token}" --header "Transfer-Encoding: chunked" --header "Content-Type: audio/flac" --data-binary @{path}audio-file1.flac "{url}/v1/recognize?inactivity_timeout=60"





 Session timeout
Troubleshooting for Continuous Delivery 

General problems with using IBM Cloud® Continuous Delivery might include user access issues. In many cases, you can recover from these problems by following a few easy steps.



 I removed a user from the authorized user list. Why does this user keep getting added to the list again? 

Users or their accesses were not removed from all locations.

 What’s happening 

A user that you removed from the authorized user list was added to the list again.

 Why it’s happening 

You didn't remove the user or their access from all of the Continuous Delivery service instances, toolchains, or the Git Repos and Issue Tracking repos that are attached to all of the toolchains in the resource group.

 How to fix it 

To remove authorized users from the Continuous Delivery service and prevent them from being added again:



* Remove the user's access in IAM to all toolchains in the resource group.
* Remove the user from the authorized user list in the Continuous Delivery service instance.
* Remove Developer access from all Git Repos and Issue Tracking repos that are attached to all of the toolchains in the resource group.



You can maintain an activity log related to authorized users. For more information about viewing, managing, and auditing service-initiated and user-initiated activities in your IBM Cloud® Continuous Delivery instances, see [IBM Cloud Activity Tracker events](https://cloud.ibm.com/docs/services/ContinuousDelivery?topic=ContinuousDelivery-cd-at-events). For more information about managing authorized users, see [Authorized users](https://cloud.ibm.com/docs/services/ContinuousDelivery?topic=ContinuousDelivery-limitations_usageauthorized_users).





 I tried to run a pipeline, why am I getting an error about Lite plan limits? 

The pipeline that you started failed with an error message.

 What’s happening 

You exceeded the 500-step and job run limit that includes both pipeline steps for Tekton pipelines and pipeline job runs for Classic pipelines. If your pipeline has many steps within a single run, such as with the DevSecOps pipelines, you might reach this limit quickly.
If your instance of App ID is configured to use multiple identity providers, enabling SSO has no effect on the sign-in flow. Users are prompted to enter their Cloud Directory credentials or choose one of the other providers at every sign-in.





 Configuring SSO 

You can configure single sign-on by using the App ID dashboard or by using the APIs.



 With the GUI 

You can configure the SSO through the GUI.



1. Navigate to the Cloud Directory > Single Sign-on tab of the App ID dashboard.
2. Toggle Enable single sign-on to Enabled.
3. Set the amount of time that a user can be inactive before the SSO session expires. When it expires, they must sign in again. The time is specified in minutes and the maximum allowed time for inactivity is 10,080 minutes (7 days). The default time is 1440 minutes, which is the equivalent of 1 day.
4. Add your redirect URIs to the Logout redirect URI box and click the + sign. Be sure to register only applications that you trust. By registering the URI, you're authorizing App ID to include it in the authorization workflow.
5. Click Save.







 With the API 

By using the SSO Configuration Admin API to define three settings, you can turn on the feature.

An example call:

{
"isActive": true,
"inactivityTimeoutSeconds": 86400,
"logoutRedirectUris": [
"http://my-first-app.com/after_logout",
"http://my-second-app.com/after_logout"
]
}



Table 1. SSO configuration settings

 Setting Definition 

 isActive To enable SSO, set this value to true. The default setting is false. 
 inactivityTimeoutSeconds The longest length of time that can pass without any user activity before the user is required to reenter their credentials.
This credit card hold is reversed within 24 to 72 hours. In many cases, a credit card isn't accepted because your credit card issuer didn't authorize it. For more information about issues with credit card authorization, see [Credit Card error messages](https://cloud.ibm.com/docs/billing-usage?topic=billing-usage-cc-error-messages).
* How do I get help with issues with creating an account?

If you are able to log in to an IBM Cloud account, go to the [Support Center](https://cloud.ibm.com/unifiedsupport/supportcenter) and choose one of the following options.



* If you have advanced or premium support, click Chat with IBM to talk to an IBM Cloud support representative.
* Create a support case by clicking Create a case from the Need more help? section.

After you open the case, an email notification is sent to you. Follow the instructions for further communication.



If you can't log in to an IBM Cloud account, [create an account request](https://watson.service-now.com/x_ibmwc_open_case_app.do!/create).
* Why is a VAT ID required when I create an account?

A tax identification number, such as a VAT ID, GST number, or TIN, is required to create a new personal use account with an address in specific countries or regions. For information about these requirements or where personal use accounts are not permitted, see [Personal use availability](https://cloud.ibm.com/docs/account?topic=account-account-getting-startedsignup-personalaccts). A tax identification number is also required for company accounts depending on your location. Some countries where the local government requires it, taxes are charged directly instead.
* How do I update my credit card?

If you have a Pay-As-You-Go account type that is billed in US Dollars, complete the following steps:



1. Go to the [Payments](https://cloud.ibm.com/billing/payments) page.
2. Click Update card, enter the new credit card information, and click Save.
[Navigation Menu icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/icon_hamburger.svg) > Observability > Activity Tracker.
2. Click Open dashboard on the dashboard that you use to monitor context-based restrictions.
3. Use the search field to narrow the results to report-only context-based restrictions events.



1. To view potentially blocked access requests, search for action:context-based-restrictions.policy.eval responseData.isEnforced:==false responseData.decision:Deny.



* isEnforced:==false indicates that the rule is in report-only mode.
* responseData.decision:Deny indicates that, if you enable the rule, this access request is blocked.



Evaluate whether this access flow is supposed to be denied, or whether you need to update your rule to allow access so that your workflows don't break.
2. To view potentially allowed access requests, search for action:context-based-restrictions.policy.eval responseData.isEnforced:==false responseData.decision:Permit.



* isEnforced:==false indicates that the rule is in report-only mode.
* responseData.decision:Permit indicates that, if you enable the rule, this access request is allowed.



Evaluate whether this access flow is supposed to be allowed, or whether you need to update your rule to deny access so that your resources are protected.









 Determining how enabled rules affect access 

When you enable a rule, some users, applications, and workflows might be affected. If your users or applications can't access something that they previously had access to, you can search in Activity Tracker and view what rules are denying the requests. You can further refine the search by filtering on the subject or resource to identify the implicated rule, which is represented by the target id. Then, you can update the rule to allow access so that your workflows don't break.
The [time out](https://cloud.ibm.com/docs/schematics?topic=schematics-job-queue-processjob-queue-timeout) is set for local-exec and remote-exec users by using IBM Cloud Schematics Workspace. You need to ensure the execution completes within 30 minutes. Otherwise, execution times out automatically and the apply state fails.







 What is the use of refresh token header? 

If the destroyresource flag is set to true, refresh token header configuration is required to delete all the IBM Cloud resources, and the Schematics Workspace. Following are the uses of refresh token header:



* If the token is expired, you can use refresh token to get a new IAM access token, see [IAM access token](https://cloud.ibm.com/docs/schematics?topic=schematics-general-faqcreateworkspace-generate-tokens).
* The refresh_token parameter cannot be used to retrieve a new IAM access token.
* When the IAM access token is about to expire, use the [API key](https://cloud.ibm.com/apidocs/iam-identity-token-apicreate-api-key) to create a new access token.
Cleaning up incomplete multipart uploads 

This lifecycle rule stops any multipart uploads if the uploads are not completed within a defined number of days after initiation.

You can set lifecycle rules for objects by using the web console, REST API, and third-party tools that are integrated with IBM Cloud Object Storage.



* A new rule can be added to a new or existing bucket at any time.
* An existing rule can be modified or disabled.



These incomplete uploads do not appear in the console, but the uploaded parts continue to accrue usage and billing charges. Setting up lifecycle rules to automatically delete incomplete uploads is the user's responsibility.



 Attributes of expiration rules 

Each expiration rule has the following attributes:



 ID 

A rule's ID must be unique within the bucket's lifecycle configuration.





 AbortIncompleteMultipartUpload 

The AbortIncompleteMultipartUpload block contains the details that govern the automatic cancellation of uploads. The block contains a single field: DaysAfterInitiation.





 Prefix 

An optional string that will be matched to the prefix of the object name in the bucket. A rule with a prefix will only apply to the objects that match. You can use multiple rules for different actions for different prefixes within the same bucket.





 Status 

A rule can either be enabled or disabled. A rule is active only when enabled.







 Sample lifecycle configurations 

This configuration expires any uploads that haven't completed after 3 days.

<LifecycleConfiguration>
<Rule>
<ID>delete-after-3-days</ID>
<Filter />
<Status>Enabled</Status>
<AbortIncompleteMultipartUpload>
<DaysAfterInitiation>3</DaysAfterInitiation>
</AbortIncompleteMultipartUpload>
</Rule>
</LifecycleConfiguration>

You can also combine rules.
`has_skipped_slots` I look forward to helping you with your next reservation. Have a good day. 



The has_skipped_slots condition checks the properties of the slots node to see if any of the slots were skipped. The exit handler skips all remaining slots to go directly to the node response. So, when the has_skipped_slots property is present, you know the exit intent was triggered, and the dialog can display an alternate response.

If you configure more than one slot to skip other slots, or configure another node-level event handler to skip slots, then you must use a different approach to check whether the #exit intent was triggered. See [Handling requests to exit a process](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-slotsdialog-slots-node-level-handler) for an alternate way to do so.
9. You want your assistant to check for the has_skipped_slots property before it displays the standard node-level response. Move the has_skipped_slots conditional response up so it gets processed before the original conditional response or it will never be triggered. To do so, click the response you just added, use the up arrow to move it up, and then click Save.
10. Test this change by using the following script in the Try it out pane.



Script details

 Speaker Utterance 

 You i want to make a reservation 
 Watson I can make a reservation for you. Just tell me the day and time of the reservation, and how many people it is for. 
 You it's for 5 people 
 Watson Ok. The reservation is for 5 guests. What day would you like to come in? 
 You Nevermind 
 Watson Ok, we'll stop there. No reservation will be made. I look forward to helping you with your next reservation. Have a good day. 









 Step 8: Apply a valid value if the user fails to provide one after several attempts 

In some cases, a user might not understand what you are asking for. They might respond again and again with the wrong types of values.
-H 'bluemix-instance: <instance_ID>' 
-H 'content-type: application/json' 
-d '{
"expiration": <expiration_time>, 
"maxAllowedRetrievals": <use_count> 
}'

Replace the variables in the example request according to the following table.



Table 1. Describes the variables needed to create an import token with the API

 Variable Description 

 region Required. The region abbreviation, such as us-south or au-syd, that represents the geographic area where your Hyper Protect Crypto Services service instance resides. For more information, see [Regional service endpoints](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-regionsservice-endpoints). 
 port Required. The port number of the API endpoint. 
 IAM_token Required. Your IBM Cloud access token. Include the full contents of the IAM token, including the Bearer value, in the cURL request. For more information, see [Retrieving an access token](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-retrieve-access-token). 
 instance_ID Required. The unique identifier that is assigned to your Hyper Protect Crypto Services service instance. For more information, see [Retrieving an instance ID](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-retrieve-access-token). 
 expiration_time The time in seconds from the creation of an import token that determines how long it remains valid. The minimum value is 300 seconds (5 minutes), and the maximum value is 86400 (24 hours). The default value is 600 (10 minutes). 
 use_count The number of times that an import token can be retrieved within the expiration time before it is no longer accessible. The default value is 1. 



A successful POST api/v2/import_token request creates an import token for your service instance.