vania-janet/multiturn-rag-retrieval-data huggingface dataset:
[Image showing selecting the redistributable MQ C client compatible with an Operating System](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_mqclient2.png)
3. Select to download via HTTPS, this will allow you to download the client directly through your browser as shown below ![Image showing a number of download options with HTTPS being selected](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_mqclient3.png) - Note: if you do not have this option, try in an alternative browser.
4. After clicking on continue. You will be redirected to screen shown below. Click on the symbol as shown by the red circle to begin your download ![Click on the image indicated by the red circle](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_mqclient4.png)
5. Once downloaded, extract the file to a directory of your choice <PATH_TO_MQCLIENT_DIR>



* tar -xvzf <IBM-MQC-Redist>.tar.gz <PATH_TO_MQCLIENT_DIR>



6. Add commands to path



* export PATH=$PATH:<PATH_TO_MQCLIENT_DIR>/bin
* An application has been granted permissions to access queue managers within your IBM MQ service instance. You have obtained the MQ username and API key for this application (for instructions, follow the [configuring access for connecting an application to a queue manager](https://cloud.ibm.com/docs/services/mqcloud?topic=mqcloud-mqoc_configure_app_qm_access) guide).
* If you do not intend to use one of the predefined 'DEV.QUEUE.' queues to put and get messages, follow the [Assigning user/group access to a queue](https://cloud.ibm.com/docs/services/mqcloud?topic=mqcloud-mqoc_configure_auth_record) guide to configure the authorization record required for this queue.
* If you are using a JSON CCDT for your application , you must have a 9.1.2 (or above) installation of the client.
* An existing installation of IBM MQ Client on your own machine.



* Download the client from [here](http://www-01.ibm.com/support/docview.wss?uid=swg240421761).



* Clicking the HTTP link next to the latest available version of the CD Clients will take you to Fix Central. From there you can search for and select the appropriate Redist (redistributable) client bundle for your operating system platform. This will include the sample applications.



* Once downloaded, unpack the bundle into a location of your choosing.
* Make a note of the full path to the directory containing the sample applications. This path will be referenced as <PATH_TO_SAMPLE_BIN_DIR> for the rest of this task.



* For Windows, this will be the bin directory unpacked in the previous step, the location of which will depend upon where you chose to unpack the bundle.
* For Linux, this will be the samp/bin directory unpacked in the previous step, the location of which will depend upon where you chose to unpack the bundle.











 TLS additional setup
Download the Fabric CA client]] to your local file system.
The easiest way to get the Fabric CA client is to download all of the Fabric tool binaries directly. Navigate to a directory where you would like to download the binaries with your command line, and fetch them by running the following cURL]] command.

curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.3 1.4.3 -d -s

This command installs the binaries in a bin/ directory.
2. Set the PATH path to the directory where you downloaded the Fabric tool binaries:
export PATH=$PATH:<full/path/to/fabric-ca-client/bin>

For example, if you installed the binaries in your home directory you would set your PATH as:

export PATH=$PATH:$HOME/bin
3. Create the folder where you will store the certificates of your CA admin.
mkdir -p $HOME/fabric-ca-client/ca-admin
4. Set the value of the $FABRIC_CA_CLIENT_HOME environment variable to be the path where the CA client will store the generated MSP certificates. Ensure that you remove the configuration material that might be created by earlier attempts. If you didn't run the enroll command before, the msp folder and the .yaml file do not exist.
export FABRIC_CA_CLIENT_HOME=$HOME/fabric-ca-client/ca-admin
rm -rf $FABRIC_CA_CLIENT_HOME/fabric-ca-client-config.yaml
rm -rf $FABRIC_CA_CLIENT_HOME/msp
5. Retrieve the TLS certificate of your CA to be used by the Fabric CA client. If you are using the IBM Blockchain Platform console, open the CA and click Settings, and look for the certificate in base64 format in the TLS Certificate field. If your are using the APIs, you can call GET /ak/api/v2/components]GET _components] and find the CA TLS certificate in the "PEM" field.
Click on the symbol as shown by the red circle to begin your download ![Click on the image indicated by the red circle](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_mqclient4.png)
5. Once downloaded, extract the file to a directory of your choice <PATH_TO_MQCLIENT_DIR>



* tar -xvzf <IBM-MQC-Redist>.tar.gz <PATH_TO_MQCLIENT_DIR>



6. Add commands to path



* export PATH=$PATH:<PATH_TO_MQCLIENT_DIR>/bin:<PATH_TO_MQCLIENT_DIR>/samp/bin









 Appendix 4: Sample MQMFTCredentials.xml file 

Files of this type store credential information for agent processes. They can contain user names and passwords which are used to authenticate with the MQ on Cloud Queue Manager. Below is a sample file which can be referred :

<?xml version="1.0" encoding="UTF-8"?>
<!--
@start_non_restricted_prolog@
Version: %Z% %I% %W% %E% %U% [%H% %T%]

Licensed Materials - Property of IBM

5724-H72

Copyright IBM Corp. 2012, 2017 All Rights Reserved.

US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with
IBM Corp.
@end_non_restricted_prolog@
-->
<?xml version="1.0" encoding="UTF-8"?>
* Mac/Linux: export MQCCDTURL=file:////Users/you/definitions/connection_info_ccdt.json
* Windows: set MQCCDTURL=file:///c:/mydefinitions/connection_info_ccdt.json
* Windows (PowerShell): $env:MQCCDTURL=file:///c:/mydefinitions/connection_info_ccdt.json



MQCCDTURL can be replaced by two other environment variables MQCHLLIB (the full path to the directory of your ccdt file) and MQCHLTAB (the filename of the ccdt file)
2. Set the 'MQSAMP_USER_ID' variable:



* Mac/Linux: export MQSAMP_USER_ID="<application MQ username>"
* Windows (Command prompt): set MQSAMP_USER_ID=<application MQ username>
* Windows (PowerShell): $env:MQSAMP_USER_ID="<application MQ username>"



The next steps should be run from this same command shell. { :note}







 Put a message onto the test queue using amqsputc 

**Note: ** Please ensure that you have carried out the prerequisite steps listed above - in particular configuring application access to the queue manager.

In the same shell used in the previous step:



1. Run <PATH_TO_SAMPLE_BIN_DIR>/amqsputc DEV.QUEUE.1 <your QMGR name>



* Where <PATH_TO_SAMPLE_BIN_DIR> is the path to the sample applications bin directory you made note of in the Prerequisites section above.



2. Enter the application API key when prompted for a password.
3. Type in a test message.
4. Press Enter twice to exit the amqsputc sample.







 Get a message using amqsgetc 

In the same shell used in the previous step:



1.
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

//UserInfo dictionary will contain data sent from the server
}







 Notification options 

The following notification options are supported.



 Interactive notifications 



1. To enable interactive push notifications, the notification action parameters must be passed in as part of the notification object. The following is a sample code to enable interactive notifications:



let actionOne = ENPushNotificationAction(identifierName: "FIRST", buttonTitle: "Accept", isAuthenticationRequired: false, defineActivationMode: .foreground)

let actionTwo = ENPushNotificationAction(identifierName: "SECOND", buttonTitle: "Reject", isAuthenticationRequired: false, defineActivationMode: .destructive)

let category = ENPushNotificationActionCategory(identifierName: "category", buttonActions: [actionOne, actionTwo])

let notificationOptions = ENPushClientOptions()
notificationOptions.setInteractiveNotificationCategories(categoryName: [category])
enPush.initialize(instanceGUID, destinationID, apiKey, notificationOptions)



1. Implement the callback method on AppDelegate.swift:

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
switch response.actionIdentifier {
case "Accept":
print("Clicked Accept")
case "Reject":
print("Clicked Reject")
default:
}
completionHandler()
}



This callback method is invoked when user clicks the action button.
* [Step three: Generate certificates for your wallet](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-commercial-paper-step-three-generate-certificates)
* [Step four: Use the connection profile to build a Fabric gateway](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-commercial-paper-step-four-gateway)
* [Step five: Invoke the smart contract](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-commercial-paper-step-five-invoke)
* [Step six: Operate the sample as Digibank](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-commercial-paper-step-six-operate-as-digibank)



* [Connecting to your network by using low-level Fabric SDK APIs](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-low-level-api)
* [Highly available applications](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appconsole-app-ha)
* [Using indexes with CouchDB](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appconsole-app-couchdb)
* [Clock synchronization](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appconsole-app-clock)
* [Additional Resources](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appconsole-app-resources)
* <ENDPOINT> is the API endpoint in the region where you plan to configure or manage a target. For more information, see [Endpoints](https://cloud.ibm.com/docs/atracker?topic=atracker-endpointsendpoints_api).
* TARGET_ID is the ID of the target.



For example, you can use the following cURL request to validate a target in US-South:

curl -X POST https://private.us-south.atracker.cloud.ibm.com/api/v2/targets/<TARGET_ID>/validate -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json"

In the response, you get information in the section cos_write_status, for example:

"write_status": {
"status": "success"
},





 Viewing a target using the API 

You can use the following cURL command to view the configuration details of 1 target:

curl -X GET <ENDPOINT>/api/v2/targets/TARGET_ID -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json"

Where



* <ENDPOINT> is the API endpoint in the region where you plan to configure or manage a target. For more information, see [Endpoints](https://cloud.ibm.com/docs/atracker?topic=atracker-endpointsendpoints_api).
* TARGET_ID is the ID of the target.



For example, you can run the following cURL request to get information about a target with the ID 00000000-0000-0000-0000-000000000000:

curl -X GET https://private.us-south.atracker.cloud.ibm.com/api/v2/targets/00000000-0000-0000-0000-000000000000 -H "Authorization: $ACCESS_TOKEN" -H "content-type: application/json"
[Firebase getting started](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-firebase-get-started.png)

Figure 3. Firebase getting started
* In the Add Firebase to your Android app window, add com.ibm.cloud.eventnotifications.destination.android as the Package Name. The App nickname field is optional.
* Click Register app.

Zoom

![Add Firebase to your Android app](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-add-firebase.png)

Figure 4. Add Firebase to your Android app
* Include the package name of your application. Enter the package name in Add Firebase to your Android app window. The App nickname field is optional.
* Click Register app. See the following example:

Zoom

![Register Android app](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-add-firebase.png)

Figure 5. Register Android app
* The google-services.json file is generated.
* Download the latest config file google-services.json under Your apps.







 Step 4: Add a generic API source 

Take the following steps:



* Go to the Sources section of the Event Notifications dashboard.
* Click Add and select an API Source.
* Type a name and an optional description and click Add.







 Step 5: Create an Event Notifications destination 

Click Destinations in the Event Notifications console and add the following destination details:



* Name: add a name for the Destination.
* Go to the [Firebase Console](https://console.firebase.google.com/?pli=1). A Google user account is required.
* Click Create a project. If you are already having a project, then click Add Project.
* In the Create a project window, enter a project name, and accept the terms and enable or disable Google analytics (optional) by selecting the toggle switch and click Continue.
* If Google analytics is enabled, then in the Configure Google Analytics window, choose the Analytics location, and accept the terms.
* Click Create Project.
* Click Continue when the new project is ready.
* In the navigation panel, select the settings icon next to the Project Overview and select Settings > Project settings.
* Click the Service Accounts tab.

Zoom

![FCM credentials](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-fcm-credentials.png)

Figure 2. FCM credentials
* Click Generate new private key to generate your project credentials. The downloaded file will contain: project_id, private_key, and client_email.







 Step 3: Generate google-services.jsongoogle-services.json 

You also need to generate the google-services.json file. Complete the following steps:



* In the Firebase console Project overview section, under Get started by adding Firebase to your app section click the Android icon.

Zoom

![Firebase getting started](https://cloud.ibm.com/docs-content/v1/content/4c9a07fe500838e5e55e71e73131ef20b44a6c66/event-notifications/images/en-firebase-get-started.png)

Figure 3. Firebase getting started
* In the Add Firebase to your Android app window, add com.ibm.cloud.eventnotifications.destination.android as the Package Name.
Import a peer by calling POST /ak/api/v2/components/peer]POST _ak_api_v2_components_peer] .5. If you plan to use the IBM Blockchain Platform console to operate your blockchain components, you must import your component administrator identities into your console wallet. For more information, see Importing an admin identity into the IBM Blockchain Platform console]] ! .6. After you deploy your network, you can use the Fabric SDKs, the Peer CLI, or the console UI to create channels and deploy smart contracts. If you need to programmatically create a channel, you must provide the consortium name. For IBM® Blockchain Platform, the consortium name must be set to SampleConsortium.<-- </ol> -->The service credential that is used for API authentication must have the Manager role in IAM to be able to create components. See the table on user roles]] ! ! ! ! for more information.<-- </section "id="section-ibp-v2-apis-import-with-apis" "> --><-- <section "id="section-ibp-v2-apis-config-fabric-ca-client" "> --> Operating your CA with the Fabric CA client You can use the Fabric CA client to operate your CAs. Run the following Fabric CA client commands to register your component and administrator identities and generate the necessary certificates.<-- <section "id="section-ibp-v2-apis-setup-fabric-ca-client" "> --> Set up the Fabric CA client <-- <ol> -->1. Download the Fabric CA client]] to your local file system.
The easiest way to get the Fabric CA client is to download all of the Fabric tool binaries directly. Navigate to a directory where you would like to download the binaries with your command line, and fetch them by running the following cURL]] command.

curl -sSL http://bit.ly/2ysbOFE | bash -s 1.4.3 1.4.3 -d -s
[Image showing list of queue managers with Application permissions circled](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_application_select.png)
3. Now click the 3 dots next to the application you will use for the AMS tutorial ![Image showing list of application permissions currently set](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_application_tab.png)
4. Click Add new API key - Note. Existing app API keys will continue to work



![Image showing Add new API key circled for an application](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_app_new_apikey.png) 5. Click Download to download apiKey.json containing an app username and apikey ![Image showing the Download button for the app new API key highlighted](https://cloud.ibm.com/docs-content/v1/content/3a120b16db5fdc3e70d071af8a63ce5515c1b096/mqcloud/images/mqoc_ams_app_download.png)





 Appendix 4: IBM MQ C Client
A sample file for secrets and related instruction are in the [GitHub repository for this tutorial](https://github.com/IBM-Cloud/github-traffic-stats).







 Step 4: App ID and GitHub configuration (browser) 

The following steps are all performed using your Internet browser. First, you configure App ID to use the Cloud Directory and to work with the app. Thereafter, you create a GitHub access token. It is needed by the app to retrieve the traffic data.



1. In the [IBM Cloud® Resource List](https://cloud.ibm.com/resources) open the overview of your services. Locate the instance of the App ID service in the Services section. Click on its entry to open the details.
2. In the service dashboard, click on Manage Authentication in the menu on the left side. It brings a list of the available identity providers, such as Facebook, Google, SAML 2.0 Federation and the Cloud Directory. Switch the Cloud Directory to Enabled, all other providers to Disabled.

You may want to configure [Multi-Factor Authentication (MFA)](https://cloud.ibm.com/docs/appid?topic=appid-cd-mfacd-mfa) and advanced password rules. They are not discussed as part of this tutorial.
3. Click on the Authentication Settings tab in the same dialog. In Add web redirect URLs enter the url of your application + /redirect_uri, for example https://ghstats-app.56ab78cd90ef.us-south.codeengine.appdomain.cloud/redirect_uri.

For testing the app locally, the redirect URL is http://127.0.0.1:5000/redirect_uri. You can configure multiple redirect URLs. In order to test the app locally, copy .env.local.template to .env, adapt it and start the app using python3 ghstats.py.
4.
If Gradle is used in build system, add the following information to the file build.gradle in the dependencies section.

implementation com.ibm.eventstreams:oauth-client:0.1.2

Use the following strings and properties.



* Use the bootstrap_endpoints string as the list of bootstrap servers and pass this string of host and port pairs to your Kafka client.
* Use the api_key string as the API key.
* The IAMOAuthBearerLoginCallbackHandler is provided by the jar package com.ibm.eventstreams:oauth-client:+.
* The IBM Cloud® Identity and Access Management's token endpoint https://iam.cloud.ibm.com/identity/token is configured to generate token from the API key by using specified grant type in jaas config. It is done on client side, thus the API key is never sent to the server side and provides better security than a long-lived API key.
* The Cloud Identity and Access Management's key endpoint https://iam.cloud.ibm.com/identity/keys is configured to validate the token.



For a Java client, the following example shows the minimum set of properties, where ${BOOTSTRAP_ENDPOINTS}, and ${APIKEY} are to be replaced by the values that you retrieved previously.

bootstrap.servers=${BOOTSTRAP_ENDPOINTS}
sasl.mechanism=OAUTHBEARER
sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required grant_type="urn:ibm:params:oauth:grant-type:apikey" apikey="${APIKEY}";
sasl.login.callback.handler.class=com.ibm.eventstreams.oauth.client.IAMOAuthBearerLoginCallbackHandler
sasl.oauthbearer.token.endpoint.url=https://iam.cloud.ibm.com/identity/token
event-notifications.channel-groups.delete DELETE /event-notifications/v1/instances/{instance_id}/destinations/{id}/fcm_channel_groups/{group_id} Manager, Administrator Delete an existing channel group under a push notifications FCM destination 
 event-notifications.integrations.list GET /event-notifications/v1/instances/{instance_id}/integrations Manager, Administrator, Device-Manager List all Key Management Services integrations 
 event-notifications.integrations.read GET /event-notifications/v1/instances/{instance_id}/integrations/{id} Manager, Administrator, Device-Manager Get a single Key Management Services integration 
 event-notifications.integrations.update PUT /event-notifications/v1/instances/{instance_id}/integrations/{id} Manager, Administrator, Device-Manager Update an existing Key Management Services integration 







 Working with API keys 

Upon creating service credentials, you might notice an apiKey is displayed instead of the appSecret.

To use any REST APIs, you must generate the access token by using the following cURL command:



 Parameters 

curl -k -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: application/json" --data-urlencode "grant_type=urn:ibm:params:oauth:grant-type:apikey" --data-urlencode "apikey=G2c7oaUuOjul1RbmbjAeI7YwJSUCW_hmfif3GhLabYPE" "https://iam.cloud.ibm.com/identity/token"





 Response 

{
You can send events to a different destination within the app by using the --path option. For example, if your subscription specifies --path /event, the event is sent to https://<base application URL>/events.
2. After you deploy this app, run the app get command to confirm that the app is in ready status.

ibmcloud ce app get -n kafka-receiver-app
3. Create a Code Engine Kafka event subscription for your Kafka events by using the [ibmcloud ce sub kafka create](https://cloud.ibm.com/docs/codeengine?topic=codeengine-clicli-subscription-kafka-create) command. Use the kafka-subscription-secret secret that you previously created to access the message broker. Specify the broker information based on the service credentials information for your Kafka resource. For this example, you can obtain the broker information from the output of the ibmcloud resource service-key myeventstream-key command. Notice that you must specify a --broker option for each broker for your topic. The --destination option specifies the Code Engine resource that receives the events.