vania-janet/multiturn-rag-retrieval-data huggingface dataset:
* You can use the [COS SDK](https://cloud.ibm.com/docs/cloud-object-storage/libraries?topic=cloud-object-storage-sdk-gs) to perform bucket and object-level tasks. The SDK includes code samples in multiple languages.
* You can create your own [actions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions) or [web actions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_web) to be executed when the trigger is fired.
* You can use the actions in the [IBM Cloud Object Storage package](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_obstoragepkg_obstorage_install) to [read and write objects to a bucket](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_obstoragepkg_obstorage_actions) and other tasks. The actions are executed in either Python or Node.js.







 Reference for Object Storage and Cloud Functions 

Review the following reference material for information on the IBM Cloud Object Storage trigger package.



 IBM Cloud Object Storage trigger entities 

The IBM Cloud Object Storage trigger contains the /whisk.system/cos package and supports the following parameters.



Table 2. cos package parameters

 Entity Type Description 

 /whisk.system/cos Package This package contains the /whisk.system/cos/changes feed. 
 /whisk.system/cos/changes Feed This feed responds to changes to an IBM Cloud Object Storage bucket and fires a Cloud Functions trigger. When you create a trigger using this feed, you can specify [these parameters](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_obstoragepkg_obstorage_ev_ch_ref_trig) using the --param flag. 







 IBM Cloud Object Storage trigger parameters
: See [How do I package my Python app for deployment in Cloud Functions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prephow_to_package_python).





 5 December 2019 

Improved documentation for the quick start templates.
: See [Deploying quick start templates](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templates).

Updated the API endpoints documentation.
: See [Regions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-cloudfunctions_regions).







 November 2019 



 18 November 2019 

New Functions CLI version 1.0.36.
: See [CLI version history](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-cli_versions).







 October 2019 



 31 October 2019 

The IBM Cloud Object Storage trigger is now available in the following regions: us-east, us-south, eu-gb, eu-de, and jp-tok regions.
: See [IBM Cloud Object Storage](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_obstorage).





 28 October 2019 

Updates for binding services to entities.
: See [Binding IBM Cloud services to Cloud Functions entities](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-services).

Updates for memory usage.
: See [Memory usage with Node.js runtime actions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-testmemory_usage)





 14 October 2019 

New Functions CLI version 1.0.35.
: See [CLI version history](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-cli_versions).

Added console tasks to actions.
Watson SDKs 

SDKs abstract much of the complexity associated with application development. By providing programming interfaces in languages that you already know, they can help you get up and running quickly with IBM Watson services.



 Supported SDKs 

The following Watson SDKs are supported by IBM:



* [Java SDK](https://github.com/watson-developer-cloud/java-sdk)
* [Node.js SDK](https://github.com/watson-developer-cloud/node-sdk)
* [Python SDK](https://github.com/watson-developer-cloud/python-sdk)
* [.NET SDK](https://github.com/watson-developer-cloud/dotnet-standard-sdk)



The [API reference](https://cloud.ibm.com/docs?tab=api-docs&category=ai%2Ccloud_pak) for each service includes information and examples for these SDKs.





 Community SDKs 

The following SDKs are available from the Watson community of developers:



* [ABAP SDK for IBM Watson](https://github.com/watson-developer-cloud/abap-sdk-nwas), using SAP NetWeaver
* [Android SDK](https://github.com/watson-developer-cloud/android-sdk)
* [Go SDK](https://github.com/watson-developer-cloud/go-sdk)
* [Ruby SDK](https://github.com/watson-developer-cloud/ruby-sdk)
* [Salesforce SDK](https://github.com/watson-developer-cloud/salesforce-sdk)
* [Swift SDK](https://github.com/watson-developer-cloud/swift-sdk)
* [Unity SDK](https://github.com/watson-developer-cloud/unity-sdk)







 SDK updates and deprecation 

The supported Watson SDKs are updated according to the following guidelines.
* The [Writer or Manager service access role](https://cloud.ibm.com/docs/containers?topic=containers-userschecking-perms)



* [Learn about Docker and Kubernetes terminology](https://cloud.ibm.com/docs/containers?topic=containers-service-arch).







 Step 1: Download app code 

Get your code ready to go. Don't have any code yet? You can download starter code to use in this tutorial.



1. Create a directory that is named cf-py and navigate into it. In this directory, you save all the files that are required to build the Docker image and to run your app.

mkdir cf-py && cd cf-py
2. Copy the app code and all related files into the directory. You can use your own app code or download boilerplate from the catalog. This tutorial uses the Python Flask boilerplate. However, you can use the same basic steps with a Node.js, Java, or [Kitura](https://github.com/IBM-Cloud/Kitura-Starter) app.

To download the Python Flask app code:

a. In the catalog, in Boilerplates, click Python Flask. This boilerplate includes a runtime environment for both Python 2 and Python 3 apps.

b. Enter the app name cf-py-<name> and click CREATE. To access the app code for the boilerplate, you must deploy the CF app to the cloud first. You can use any name for the app. If you use the name from the example, replace <name> with a unique identifier, such as cf-py-msx.

Attention: Do not use personal information in any app, container image, or Kubernetes resource names.

As the app is deployed, instructions for "Download, modify, and redeploy your app with the command line interface" are displayed.

c. From step 1 in the console instructions, click DOWNLOAD STARTER CODE.

d.
Using the Go SDK 

The IBM Analytics Engine Go SDK allows you to interact programmatically with the IBM Analytics Engine service API for serverless instances.

You can get the source code for the SDK from GitHub. See [ ibm-iae-go-sdk](https://github.com/IBM/ibm-iae-go-sdk). The iaesdk library provides complete access to the IBM Analytics Engine API.



 Getting the SDK 

You need to download and install the SDK to use it in your Go applications. You can do this by entering the following command:

go get -u github.com/IBM/ibm-iae-go-sdk

If your application uses Go modules, you can add a suitable import to your Go application, and run:

go mod tidy





 Importing packages 

After you have installed the SDK, you need to import the SDK packages that you want to use in your Go applications.

For example:

import (
"github.com/IBM/go-sdk-core/v3/core"
"github.com/IBM/ibm-iae-go-sdk/ibmanalyticsengineapiv3"
)





 Creating a client and sourcing credentials 

When you connect to IBM Analytics Engine, a client is created and configured using the credential information (API key and service instance ID) that you provide. If you don't provide this information manually, these credentials can be sourced from a credentials file or from environment variables.

You can retrieve the service instance ID when you create service credentials or through the CLI. See [Retrieving service endpoints](https://cloud.ibm.com/docs/AnalyticsEngine?topic=AnalyticsEngine-retrieve-endpoints-serverless).

To use the IBM Analytics Engine Go SDK, you need the following values:



* IAM_API_KEY: The API key generated when creating the service credentials. You can retrieve by viewing the service credentials on the [IBM Cloud dashboard](https://cloud.ibm.com/resources).
: The Java, Python, and Node.js SDKs for Discovery do not provide all of the functionality provided by the default REST (cURL) API. Not all cURL methods have an equivalent method in the non-cURL SDKs, and not all non-cURL methods provide all of the same features that their cURL equivalents have. In other words, the Java, Python, and Node.js SDKs currently provide only a subset of the cURL API's capabilities. : If you use the Word converter, matching on headings by using the style key is much more accurate and efficient than it by using the level key.

Data Crawler : The Data Crawler retries uploads if it encounters an upload failure. : The Data Crawler is unable to retry documents that uploaded successfully but failed to be converted or indexed. : The Data Crawler does not have a function to check downstream status and attempt to re-upload URLs that failed downstream. : There is no easy way to determine which documents are ingested by the Data Crawler. For example, if you run the Data Crawler against a set of 500 documents, the Data Crawler might report failures submitting 65 documents with a total collection of 212 documents. The status of the remaining 223 documents is undetermined. : A workaround is available, but it is complicated and involves invoking the API directly. Contact IBM® support for assistance.
* [Salesforce SDK](https://github.com/watson-developer-cloud/salesforce-sdk)
* [Swift SDK](https://github.com/watson-developer-cloud/swift-sdk)
* [Unity SDK](https://github.com/watson-developer-cloud/unity-sdk)







 SDK updates and deprecation 

The supported Watson SDKs are updated according to the following guidelines.



 Semantic versioning 

Supported Watson SDKs adhere to semantic versioning with releases labeled as {major}.{minor}.{patch}.





 Release frequency 

SDKs are released independently and might not update on the same schedule.



* The current releases of the Watson SDKs are updated on a 2- to 6-week schedule. These releases are either minor updates or patches that do not include breaking changes. You can update to any version of the SDK with the same major version number.
* Major updates that might include breaking changes are released approximately every 6 months.







 Deprecated release 

When a major version is released, support continues on the previous major release for 12 months in a deprecation period. The deprecated release might be updated with bug fixes, but no new features will be added and documentation might not be available.





 Obsolete release 

After the 12-month deprecation period, a release is obsolete. The release might be functional but is unsupported and not updated. Update to the current release.
* [Packaging Python code with a Docker virtual environment in an archive](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_python_virtenv)
* [Packaging large Python dependencies in a custom Docker image](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_python_docker)



* [Preparing apps in Docker images](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_docker)



* [Creating a custom Docker image for your action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_create_custom_docker_action)
* [Deploying an action with a custom Docker image](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_deploy_action_custom_docker_image)



* [Preparing Go Apps](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go)



* [Structuring Go Apps](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go_struct)
* [Creating a simple Golang Action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go_simple)
* [Create a Golang action made up of multiple packages](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go_multi_packages)
* [Create an action by using external libraries with Go modules](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prepprep_go_external_libraries)
Why generate SDKs? 



  Leverage code generation 

The basic service-level elements of the SDK SHOULD be generated from the API definition.

The reasons for using SDK generation include:



*  Faster time to market. Reduce the time it takes to add SDK support for new features in a service.
*  Improved quality. Avoid “copy-and-paste” and typo errors that occur in hand-written SDKs.
*  Enforced compliance. Improve and enforce agreement with the API definition.
*  Enforced consistency. Establish a common style for a particular language SDK across a family of APIs.
*  Increased adoption. Generated SDKs have common style, making them easier for developers to learn.







  Core SDK libraries 

SDKs produced with generation require a common set of capabilities, such as networking operations or authentication mechanisms. Handwritten SDKs are also welcome to leverage these common operations.

Core libraries:



*  [IBM go-sdk-core](https://github.com/IBM/go-sdk-core)
*  [IBM java-sdk-core](https://github.com/IBM/java-sdk-core)
*  [IBM node-sdk-core](https://github.com/IBM/node-sdk-core)
*  [IBM python-sdk-core](https://github.com/IBM/python-sdk-core)
*  [IBM swift-sdk-core](https://github.com/IBM/swift-sdk-core)
print("Unable to retrieve bucket contents: {0}".format(e))

SDK References



* Classes



* [Bucket](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlbucket)
* [ObjectSummary](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlobjectsummary)



* Collections



* [objects](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlS3.Bucket.objects)









 Get file contents of particular item 

def get_item(bucket_name, item_name):
print("Retrieving item from bucket: {0}, key: {1}".format(bucket_name, item_name))
try:
file = cos.Object(bucket_name, item_name).get()
print("File Contents: {0}".format(file["Body"].read()))
except ClientError as be:
print("CLIENT ERROR: {0}n".format(be))
except Exception as e:
print("Unable to retrieve file contents: {0}".format(e))

SDK References



* Classes



* [Object](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlobject)



* Methods



* [get](https://ibm.github.io/ibm-cos-sdk-python/reference/services/s3.htmlS3.Object.get)









 Delete an item from a bucket 

def delete_item(bucket_name, object_name):
try:
cos.delete_object(Bucket=bucket_name, Key=object_name)
print("Item: {0} deleted!n".format(object_name))
except ClientError as be:
Supported APIs 

Object Storage for Satellite supports most S3 APIs.



  Supported S3 APIs 



*  AbortMultipartUpload
*  CompleteMultipartUpload
*  CopyObject
*  CreateBucket
*  CreateMultipartUpload
*  DeleteBucket
*  DeleteBucketCors
*  DeleteBucketLifecycle
*  DeleteBucketWebsite
*  DeleteObject
*  DeleteObjects
*  DeleteObjectTagging
*  DeletePublicAccessBlock
*  GetBucketAcl
*  GetBucketCors
*  GetBucketLifecycle
*  GetBucketLocation
*  GetBucketVersioning
*  GetBucketWebsite
*  GetObject
*  GetObjectAcl
*  GetObjectTagging
*  GetPublicAccessBlock
*  HeadBucket
*  HeadObject
*  ListBuckets
*  ListMultipartUploads
*  ListObjects
*  ListObjectsV2
*  ListObjectVersions
*  ListParts
*  PutBucketAcl
*  PutBucketCors
*  PutBucketLifecycle (expiration rules only)
*  PutBucketVersioning
*  PutBucketWebsite
*  PutObject
*  PutObjectAcl
*  PutObjectTagging
*  PutPublicAccessBlock
*  UploadPart
*  UploadPartCopy







  Unsupported S3 APIs 



*  PutBucketLifecycle (archive rules only)
*  RestoreObject
The following examples are using [softlayer-python](https://github.com/softlayer/softlayer-python) client.

Set an api username and apikey as following for each example in case you don't have a /.softlayer file that is configured in your environment.

client = SoftLayer.Client(username='set me', api_key='set me')



 Creating a load balancer 

The following example retrieves the package ID, subnet ID, and prices for a "Load Balancer As A Service (LBaaS)" package, builds the order data and places the order.

import SoftLayer
from pprint import pprint

class LBaaSExample():
def __init__(self):
self.client = SoftLayer.Client()

def get_package_id(self, pkg_name):
"""Returns the packageId for the LBaaS"""
_filter = {"name":{"operation": pkg_name}}

pkg_list = self.client['Product_Package'].getAllObjects(filter=_filter)

return pkg_list[0]

def get_item_prices(self, pkg_id):
"""Returns the standard prices"""

item_list = self.client['Product_Package'].getItems(id=pkg_id)
prices = []

for item in item_list:
price_id = [p'id'] for p in item'prices']
if not p'locationGroupId']]
prices.append(price_id)

return prices

def get_subnet_id(self, datacenter):
"""Find and returns the first subnet in the datacenter"""

_filter = {"privateSubnets": {
"networkVlan": {
"primaryRouter": {
"datacenter": {
You must specify a Monitoring endpoint, and the Monitoring API token that is associated to the team that you want to manage with the Python client.

Complete the following steps from a terminal:



1. [Get the Monitoring API token](https://cloud.ibm.com/docs/monitoring?topic=monitoring-api_tokenapi_token_get).
2. Get the endpoint for the region where the monitoring instance is available.

To see the list of endpoints that are available, see [Monitoring endpoints](https://cloud.ibm.com/docs/monitoring?topic=monitoring-endpointsendpoints_sysdig).

For example, the endpoint for an instance that is available in us-south is the following: https://us-south.monitoring.cloud.ibm.com
3. Add the following entries to your Python script:

from sdcclient import IbmAuthHelper, SdMonitorClient

URL = <MONITORING_ENDPOINT>
 For example: URL = 'https://us-south.monitoring.cloud.ibm.com'

MONITOR_TOKEN = <MONITOR_TOKEN>
 For example: MONITOR_TOKEN = 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

sdclient = SdMonitorClient(token=MONITOR_TOKEN,sdc_url=URL)

Where

<MONITORING_ENDPOINT> must be replaced with the endpoint where the monitoring instance is available.

<MONITOR_TOKEN> must be replaced with the Monitoring API token.



You can now use the sdclient to perform actions that will be authenticated by using IAM.







 Sample 1. Python script that uses IAM API key 

!/usr/bin/env python3

import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import IbmAuthHelper, SdMonitorClient

 Parse arguments.
Save a dashboard to a file sdclient.save_dashboard_to_file('dashboard_name', 'dashboard_name.json') 





 List dashboards per team 

You can use Python to list the dashboards available to teams.



 List the dashboards that are available in the default team 

The following code shows the structure of a Python script to list the dashboards available in the default team.

!/usr/bin/env python3

import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import IbmAuthHelper, SdMonitorClient

 Parse arguments.
def usage():
print('usage: %s <endpoint-url> <apikey> <instance-guid>' % sys.argv[0])
print('endpoint-url: The endpoint URL that should point to IBM Cloud')
print('apikey: IBM Cloud IAM apikey that will be used to retrieve an access token')
print('instance-guid: GUID of an IBM Cloud Monitoring with monitoring instance')
sys.exit(1)

if len(sys.argv) != 4:
usage()

URL = sys.argv[1]
APIKEY = sys.argv[2]
GUID = sys.argv[3]

 Instantiate the client
ibm_headers = IbmAuthHelper.get_headers(URL, APIKEY, GUID)
sdclient = SdMonitorClient(sdc_url=URL, custom_headers=ibm_headers)

 Show the list of dashboards
ok, res = sdclient.get_dashboards()

if not ok:
print(res)
sys.exit(1)

for db in res['dashboards']:
Getting started with the Data Crawler 

The Data Crawler is no longer supported or available for download beginning [17 April 2019](https://cloud.ibm.com/docs/discovery?topic=discovery-release-notes17apr19). This content is provided for existing installations only. See [Connecting to Data Sources](https://cloud.ibm.com/docs/discovery?topic=discovery-sources) for other available connectivity options.

This topic explains how to use the data crawler to ingest files from your local filesystem, to use with IBM Watson™ Discovery.

Before attempting this task, create an instance of Discovery in IBM Cloud®. To complete this guide, you must use the credentials that are associated with the instance of the service that you created.



 Create an environment 

Use the bash POST /v1/environments method to create an environment. Think of an environment as the warehouse where you are storing all your boxes of documents. The following example creates an environment that is called my-first-environment:

Replace {apikey} with your service credentials.

(For more detailed information about using {apikey} credentials, see [Getting started with the API](https://cloud.ibm.com/docs/discovery?topic=discovery-gs-api).)

curl -X POST -u "apikey:{apikey}" -H "Content-Type: application/json" -d "{ "name":"my-first-environment", "description":"exploring environments"}" "{url}/v1/environments?version=2019-04-30"

The API returns a response that includes information such as your environment ID, environment status, and how much storage your environment is using. Do not go on to the next step until your environment status is ready. When you create the environment, if the status returns status:pending, use the GET /v1/environments/{environment_id} method to check the status until it is ready. In this example, replace {apikey} with your service credentials, and replace {environment_id} with the environment ID that was returned when you created the environment.
For more information about Node.js 10 packages, see [(Details on GitHub)](https://github.com/ibm-functions/runtime-nodejs/blob/master/nodejs10/package.json).







 Python runtimes 

By default, all Python actions are executed in a Python version 3.9 environment.



Table 4. Python versions

 Kind Python version Description Change log 

 python:3.11 [3.11.x](https://github.com/docker-library/python/blob/2bcce464bea3a9c7449a2fe217bf4c24e38e0a47/3.11/buster/Dockerfile) By default, all Python actions are executed in a Python version 3.11.x environment (Debian Buster based) unless you specify the --kind flag when you create or update an action. To explicitly use this runtime, specify the CLI parameter --kind python:3.11 when you create or update an action. The runtime contains SDK packages for IBM Cloud services available for use by Python actions, in addition to the Python 3.11 standard libraries. [CHANGELOG.md](https://github.com/ibm-functions/runtime-python/blob/master/python3.11/CHANGELOG.md). 
 python:3.9 [3.9.x](https://github.com/docker-library/python/blob/6a2c0f48f011aa279a0c9190725fc84a220460bc/3.9/buster/Dockerfile) Python actions are executed in a Python version 3.11.x environment (Debian Buster based) unless you specify the --kind flag when you create or update an action. To explicitly use this runtime, specify the CLI parameter --kind python:3.9 when you create or update an action. The runtime contains SDK packages for IBM Cloud services available for use by Python actions, in addition to the Python 3.9 standard libraries.