vania-janet/multiturn-rag-retrieval-data huggingface dataset:
413 [Payload Too Large](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.11) This code MUST be returned when a request payload size exceeds [the documented limit](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-formatrequest-body-constraints). 
 414 [URI Too Long](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.12) This code MUST be returned when a request's URI length exceeds the [the documented limit](https://cloud.ibm.com/docs/api-handbook?topic=api-handbook-urisconstraints) 
 415 [Unsupported Media Type](https://datatracker.ietf.org/doc/html/rfc7231section-6.5.13) This code MUST be returned when the client sends a payload of a content type the server cannot accept.<br><br>[8] 
 422 [Unprocessable Entity](https://datatracker.ietf.org/doc/html/rfc4918section-11.2) This code SHOULD NOT be used. Instead, 400 should be returned in response to invalid request payloads.<br><br>[9] 
 429 [Too Many Requests](https://datatracker.ietf.org/doc/html/rfc6585section-4) This code MUST be returned when rate-limiting is in use, and the client has sent too many requests for a given time period. 





 Security implications of 401 and 403 

There may be times when returning a 401 or a 403 would reveal the presence of a resource on the server that a client should not be allowed to know exists. In these cases, the server MUST respond with the status code that would be used if the resource did not exist, even for requests that would succeed with proper authentication.

For example, for a GET request for a resource that the client is not allowed to know exists, the server MUST respond with a 404 Not Found.
While you work in IBM Cloud Shell, avoid uploading large files and remove any unused files by using standard Linux™ commands, such as rm.



 Backing up your data 

Your workspace storage is temporary, and it's not intended to be used as the primary storage location for your files. Don't store business-critical or sensitive data in your workspace, and create a backup of your files outside of IBM Cloud Shell. You're responsible for your data, and your backup can help you recover in case an outage or data loss occurs for any reason. For more information about how to transfer files to create a backup, see [Transferring multiple files](https://cloud.ibm.com/docs/cloud-shell?topic=cloud-shell-filestransfer-many-files).







 Uploading files 

You can upload a file to the root level of your home directory. Only a single file can be uploaded at a time.



1. In the IBM Cloud Shell menu bar, click the Upload icon ![Upload icon](https://cloud.ibm.com/docs-content/v1/content/6e73868222d2673c4d974c1cf0452448e1b38054/icons/upload.svg).
2. Select the file that you want to upload, and click Open.



Your file is uploaded in your home directory, for example /home/<user-name>/myFile.txt. You can move or otherwise work with your files by running standard Linux™ commands. For example, you can move a myFile.txt file that you uploaded to a myFolder subdirectory by running the following command.

mv myFile.txt ./myFolder/

Although you can move files, be sure to keep all files in your workspace under your home directory, /home/<user-name>. If you move files outside of this directory, it can cause Cloud Shell to close, which removes your data.





 Downloading files 

You can download a file from your workspace to your local system. Only a single file can be downloaded at a time.
curl -H "Authorization: Bearer $API_BEARER_TOKEN" -X GET "$SERVICE_URL/products/small-appliances:100001/product_details.txt"

import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.GetAttachmentOptions;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.stream.Collectors;

Cloudant service = Cloudant.newInstance();

GetAttachmentOptions attachmentOptions =
new GetAttachmentOptions.Builder()
.db("products")
.docId("small-appliances:100001")
.attachmentName("product_details.txt")
.build();

InputStream streamResult =
service.getAttachment(attachmentOptions).execute()
.getResult();

String response =
new BufferedReader(new InputStreamReader(streamResult))
.lines().collect(Collectors.joining("n"));

System.out.println(response);

from ibmcloudant.cloudant_v1 import CloudantV1

service = CloudantV1.new_instance()

response_attachment = service.get_attachment(
db='products',
doc_id='small-appliances:100001',
attachment_name='product_details.txt'
).get_result().content

print(response_attachment)

getAttachmentOptions := service.NewGetAttachmentOptions(
"products",
"small-appliances:100001",
"product_details.txt",
)

result, response, err := service.GetAttachment(getAttachmentOptions)
if err != nil {
panic(err)
}
<br>.php5, .pht, .phtml, .shtml, .asa, .asax, .swf, .xap, .tfstate, .tfstate.backup, .exe. 
 SANDBOX_IMAGEEXTN From the Git repositories following are the allowed image file extensions. <br>.tif, .tiff, .gif, .png, .bmp, .jpg, .jpeg, .so. 
 SANDBOX_MAX_FILE_SIZE Maximum size of a file that is allowed from the Git repositories is 2 MB. (Yet to be implemented) 



You can customize by following the steps to [edit the default configuration](https://cloud.ibm.com/docs/schematics?topic=schematics-configure-k8s-clusteredit-agent-namespace-confg).





 Agent runtime configuration for Terraform 

The following parameters are the default agent runtime configuration for the Terraform runtime.



Default agent runtime configuration for Terraform

 Parameter Description 

 JOB_WHITELISTEXTN The allowed file extensions from the Git repositories (includes the dependent module repository). <br>.tf, .tfvars, .md, .yaml, .sh, .txt, .yml, .html, .gitignore, .tf.json, license, .js, .pub, .service, _rsa, .py, .json, .tpl, .cfg, .ps1, .j2, .zip, .conf, .crt, .key, .der, .jacl, .properties, .cer, .pem, .tmpl, .netrc. 
 JOB_BLACKLISTEXTN The blocked file extensions from the Git repositories. <br>.php5, .pht, .phtml, .shtml, .asa, .asax, .swf, .xap, .tfstate, .tfstate.backup, .exe.
: Return 405 instead of 500 for invalid path under _index endpoint.

Partitioned database queries
: Fix permissions required for partitioned _find and _explain endpoints.

Runtime environment
: Upgrade to the latest Erlang/OTP 24 release.

View query
: Treat single element keys parameter same as key.







 April 2023 



 03 April 2023 

IBM Cloudant Dashboard
: Update Dashboard to use Carbon 11's color theme.

The following changes were made in build 8382:

Indexing
: Prevent couch_index_server from crashing under load.

Runtime environment
: Upgrade the runtime environment to latest Erlang/OTP 24 point release.







 March 2023 



 14 March 2023 

The following changes were made in build 8373:

_changes endpoint
: Enforce document ids _changes filter optimization limit.

Compaction
: Active database size now decreases when users delete documents.

Indexing
: Enforce partition index count limits for (noninternally) replicated documents.
: Optimize process pool management (fixes CVE-2023-26268).

Query
: Optimize by pushing down field selectors to shards.

Replication
: Replace auto-inserted VDU with BDU.
: Constrain protocol types and socket options.
: Upload design docs individually when you replicate with bulk_get.

Runtime environment
: Upgrade the runtime environment to Erlang/OTP 24 point release patched with alias-cleanup-fix.

Views
: Disable stable and stale parameters in POST requests to partitioned views.







 January 2023 



 11 January 2023 

The following changes were made in build 8349:

IAM trusted profiles
: Fix bug in IAM trusted profiles.

Runtime environment
: Upgrade runtime environment to Erlang/OTP 24.







 November 2022 



 17 November 2022 

The following changes were made in build 8341:

_bulk_get endpoint
: Optimize _bulk_get endpoint.

_changes endpoint
: Fix eventsource formatted feed.
Your Object Storage instances are listed under Storage in the Resource List. The terms resource instance and workspace refer to the same concept, and can be used interchangeably.
5. Choose a unique name. All buckets in all regions across the globe share a single namespace. Ensure that you have the correct permissions to create a bucket.

When you create buckets or add objects, be sure to avoid the use of Personally Identifiable Information (PII). PII is information that can identify any user (natural person) by name, location, or any other means.
6. First, choose a wanted level of resiliency, and then a location where you would like your data to be physically stored. Resiliency refers to the scope and scale of the geographic area across which your data is distributed. Cross Region resiliency spreads your data across several metropolitan areas, while Regional resiliency spreads data across a single metropolitan area. A single data center distributes data across devices within a single site only.
7. Choose the bucket's storage class, which is a reflection of how often you expect to read the stored data and determines billing details. Follow the Create link to create and access your new bucket.

Buckets are a way to organize your data, but they are not the only way. Object names (often referred to as object keys) can use one or more forward slashes for a directory-like organizational system. You then use the portion of the object name before a delimiter to form an object prefix, which is used to list related objects in a single bucket through the API.



Objects are limited to 200 MB when uploaded through the console unless you use the Aspera High-Speed Transfer plug-in. Larger objects (up to 10 TB) can also be split into parts and uploaded in parallel using the API. Object keys can be up to 1024 characters in length, and it's best to avoid any characters that might be problematic in a web address. These special characters (?, =, <, etc.) might cause unwanted behavior if not URL-encoded.
uploader := s3manager.NewUploaderWithClient(client, func(u s3manager.Uploader) {
u.PartSize = 5 * 1024 * 1024 // 64MB per part
})

// make a buffer of 5MB
buffer := make([]byte, 1510241024, 1510241024)
random := rand.New(rand.NewSource(time.Now().Unix()))
random.Read(buffer)

input := &s3manager.UploadInput{
Bucket: aws.String(bucket),
Key: aws.String(key),
Body: io.ReadSeeker(bytes.NewReader(buffer)),
}

// Perform an upload.
d, _ := uploader.Upload(input)
fmt.Println(d)

// Perform upload with options different than the those in the Uploader.
f, _ := uploader.Upload(input, func(u s3manager.Uploader) {
u.PartSize = 10 * 1024 * 1024 // 10MB part size
u.LeavePartsOnError = true // Don't delete the parts if the upload fails.
})
fmt.Println(f)
}
Show more





 Getting an extended listing 

func main() {
// Create client
sess := session.Must(session.NewSession())
client := s3.New(sess, conf)

input := new(s3.ListBucketsExtendedInput).SetMaxKeys(<MAX_KEYS>).SetMarker("<MARKER>").SetPrefix("<PREFIX>")
output, _ := client.ListBucketsExtended(input)

jsonBytes, _ := json.MarshalIndent(output, " ", " ")
fmt.Println(string(jsonBytes))
}
The bucket name is in the format tmp-s3fs-XXXX.
6. Click the tmp-s3fs-XXXX bucket, then click the Configuration tab.
7. On the Configuration page, look for the Quota enforcement section. Note that the bucket was automatically created with a quota equal to the size you specified in the PVC. In this example, the value was 20Gi.







 Step 5: Uploading a file to your bucket 



1. Save the following Pod configuration to a file called pod.yaml.

apiVersion: v1
kind: Pod
metadata:
name: cat-test-file
spec:
containers:
- name: app
image: nginx
volumeMounts:
- name: my-vol
mountPath: "/mnt"
command: ["/bin/sh"]
args: ["-c", "cat mnt/pod.yaml && sleep 5 && exit"]
volumes:
- name: my-vol
persistentVolumeClaim:
claimName: my-cos-pvc
Show more
2. [Navigate to your Object Storage instance in the console](https://cloud.ibm.com/objectstorage) and click the Buckets tab.
3. Click the tmp-s3fs-XXXX bucket, then click Upload.
4. Upload the pod.yaml file that you saved earlier.







 Step 6: Creating an app that mounts the bucket 



1. Copy the following Pod configuration and save it to a file called pod.yaml. This example pod mounts the bucket that was created by the my-cos-pvc PVC and prints the contents of the pod.yaml file you uploaded earlier.

apiVersion: v1
kind: Pod
metadata:
name: cat-test-file
spec:
containers:
- name: app
image: nginx
volumeMounts:
- name: my-vol
mountPath: "/mnt"
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "{{event.data}} "
}
}
]
}]
}
Show more

Here -

ibmendefaultshort is the default short payload that is provided in the incoming payload. attachment_color is the color that is applied to the notification, which was provided during subscription. ibmendefaultlong is the default long payload that is provided in the incoming payload. data is the data JSON provided in the incoming payload and format as JSON in the slack notification.





 Slack retry policy 

When publishing a slack notification, issues such as network errors and application glitches can cause the requests to fail. A retry is used to provide resiliency to external requests. Attempt to retry the requests in such situations by using the following values:



* Limit = 60 seconds: total time that the service retries.
* Step = 5 seconds: after each failure, the service waits 5 seconds before retrying. This delay prevents bombarding of the external services (webhook).



In addition, the following timeout conditions cause the slack call to fail:



* A connection timeout of 10 seconds
* A response timeout of 60 seconds



If a call to the Slack webhook URL fails even after retry attempts, the notification is lost.
An example ACCOUNT is de810d0e-763f-46a6-ae88-50823dc85581-bluemix, and resulting example external endpoint would be de810d0e-763f-46a6-ae88-50823dc85581-bluemix.cloudantnosqldb.appdomain.cloud.

For more information about how to block public network connectivity by using IP allowlisting, see [Secure access control](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-securitysecure-access-control).





 Service credentials 

To generate service credentials for IBM Cloudant by using the IBM Cloud Dashboard, see the [Creating an IBM Cloudant instance on IBM Cloud](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant) tutorial. To generate service credentials from the IBM Cloud CLI, see [Creating an instance with CLI](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-an-ibm-cloudant-instance-on-ibm-cloud-by-using-the-ibm-cloud-clicreating-an-ibm-cloudant-instance-on-ibm-cloud-by-using-the-ibm-cloud-cli).

The following example shows service credentials for an IBM Cloudant instance:

{
"apikey": "MxVp86XHkU82Wc97tdvDF8qM8B0Xdit2RqR1mGfVXPWz",
"host": "76838001-b883-444d-90d0-46f89e942a15-bluemix.cloudant.com",
"iam_apikey_description": "Auto generated apikey during resource-key [...]",
"iam_apikey_name": "auto-generated-apikey-050d21b5-5f[...]",
* [Create a sequence with the read action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_cloudantcloudant_sequence_read)
* [Create a trigger with changes feed](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_cloudantcloudant_trigger_change)
* [Create a rule to associate the trigger with the sequence](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_cloudantcloudant_rule_trigger)
* [Test the sequence](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_cloudantcloudant_test_sequence)
* [Next steps with IBM Cloudant database](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_cloudantcloudant_next)





[Composer](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_composerpkg_composer)



* [Installing the Composer library for JavaScript or Python](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_composerinstall_composer)



* [For JavaScript](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_composerinstall_composer_js)
* [For Python](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_composerinstall_composer_python)



* [Configuring and running compositions in Cloud Functions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_composerrun)
[Deploying quick start templates](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatestemplates)



* [Available quick start templates](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatesavailable-templates)
* [Deploying the IBM Cloudant Events template](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatescloudant-template)



* [Deploying the IBM Cloudant Events template from the console](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatescloudant-template-ui)
* [Deploying the IBM Cloudant Events template from the CLI](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatescloudant-template-cli)
* [Testing your IBM Cloudant Events package](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatescloudant-template_test)



* [Deploying the Get HTTP Resource template](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatesget-http-resource-template)



* [Deploying the Get HTTP Resource template from the console](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatesget-http-resource-template-ui)
* [Deploying the Get HTTP Resource template from the CLI](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatesget-http-resource-template-cli)
* [Invoking the Get HTTP Resource action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-templatesget-http-resource-template-invoke)
For more information about how to block public network connectivity by using IP allowlisting, see [Secure access control](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-securitysecure-access-control).







 Service credentials 

To generate service credentials for IBM Cloudant by using the IBM Cloud Dashboard, see [Creating an IBM Cloudant instance on IBM Cloud](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant). To generate service credentials from the IBM Cloud CLI, see [Creating credentials for your IBM Cloudant service](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-an-ibm-cloudant-instance-on-ibm-cloud-by-using-the-ibm-cloud-clicreating-an-ibm-cloudant-instance-on-ibm-cloud-by-using-the-ibm-cloud-cli).

The following example shows service credentials for an IBM Cloudant instance:

{
"apikey": "MxVp86XHkU82Wc97tdvDF8qM8B0Xdit2RqR1mGfVXPWz",
"host": "76838001-b883-444d-90d0-46f89e942a15-bluemix.cloudant.com",
"iam_apikey_description": "Auto generated apikey during resource-key [...]",
"iam_apikey_name": "auto-generated-apikey-050d21b5-5f[...]",
"iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Manager",
"iam_serviceid_crn": "crn:v1:staging:public:iam-identity::[...]",
url: https://apikey-v2-58B528DF5397465BB6673E1B79482A8C:5811381f6daff7255b288695c3544be63f550e975bcde46799473e69c7d48d61@f6cf0c55-48ea-4908-b441-a962b27d3bb6-bluemix.cloudant.com
username: apikey-v2-58B528DF5397465BB6673E1B79482A8C
port: 443
apikey: XXXXX-XXXXXX_XXXXXXXXXXXXX-XXXXXXXXXXX
host: f6cf0c55-48ea-4908-b441-a962b27d3bb6-bluemix.cloudant.com
iam_apikey_description: Auto generated apikey during resource-k ey operation for Instance - crn:v1:bluemix:public:cloudantnosqldb:us-south:a/b42116849bb7e2abb0841ca25d28ee4c:ee78351d-82bf-4e80-bc22-825c937fafa3::
iam_serviceid_crn: crn:v1:bluemix:public:iam-identity::a/b42116849bb7e2abb0841ca25d28ee4c::serviceid:ServiceId-53f9e2a2-cdfb-4f90-b072-bfffafb68b3e
password: 581138...7d48d61
Show more



Next, you learn how to retrieve your service credentials. You need your service credentials to log in to your IBM Cloudant instance.





 Step 4: Retrieving the service credentials for your IBM Cloudant service 



1.
Getting Started 

This tutorial is a short introduction to using an IBM Cloud® Databases for Redis deployment.



 Before you begin 



* You need to have an [IBM Cloud account](https://ibm.biz/databases-for-redis-signup).
* You also need a Databases for Redis deployment, which can be provisioned from the [IBM Cloud catalog](https://cloud.ibm.com/catalog/databases-for-redis/). Give your deployment a memorable name that appears in your account's Resource List.
* Download and install the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli) and the [Cloud Databases CLI Plugin](https://cloud.ibm.com/docs/databases-cli-plugin?topic=databases-cli-plugin-cdb-reference). Use the IBM Cloud CLI tool to communicate with IBM Cloud from your terminal or command line, and the plugin contains communication commands for your database deployments.
* Before connecting, set your admin password. For more information, see [Setting the Admin Password](https://cloud.ibm.com/docs/databases-for-redis?topic=databases-for-redis-admin-password).



For more information, see [Getting to production](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-best-practices).





 Step 1: Download and Install Redli 

To get a feel for connecting, sending, and retrieving data with Redis, start by connecting with a CLI client. All IBM Cloud Databases use TLS/SSL secured connections, so use a Redis CLI client that supports TLS/SSL, like [Redli](https://github.com/IBM-Cloud/redli).

To install Redli, [download](https://github.com/IBM-Cloud/redli/releases) and install the package for your system.
iam_serviceid_crn: crn:v1:bluemix:public:iam-identity::a/b42116849bb7e2abb0841ca25d28ee4c::serviceid:ServiceId-53f9e2a2-cdfb-4f90-b072-bfffafb68b3e
password: 581138...7d48d61
Show more



Next, you learn how to retrieve your service credentials. You need your service credentials to log in to your IBM Cloudant instance.





 Step 4: Retrieving the service credentials for your IBM Cloudant service 



1. Retrieve credentials for the cs20170517a instance of an IBM Cloudant service. The name for the credentials is creds_for_cs20170517a.

ibmcloud resource service-key creds_for_cs20170517b
2. After you receive the request to retrieve the credentials for the service instance, review the response from IBM Cloud that contains a message similar to the one in the following (abbreviated) example.

Retrieving service key in resource group default of account John Does's Account as john.doe@email.com...
OK
Service key crn:v1:bluemix:public:cloudantnosqldb:us-south:a/b42223455bb7e2abb0841ca25d28ee4c:ee78351d-82bf-4e80-bc22-825c937fafa3:resource-key:621ffde2-ea10-4318-b297-d6d849cec48a was created.

Name: creds_for_cs20170517a
redis_password = "<make_up_a_password>"







 Step 3. Create the infrastructure 



1. Create all the infrastructure that you need by running the Terraform script:

terraform apply --auto-approve

The Terraform folder contains a number of simple scripts, which you can see in the following list:

main.tf
: Tells Terraform to use the IBM Cloud.

variables.tf
: Contains the variable definitions whose values are populated from terraform.tfvars.

redis.tf
: Creates a Databases for Redis instance and some credentials to access it.

cloudant.tf
: Creates an IBM Cloudant free-tier instance and some credentials to access it.

It takes several minutes for the resources to be ready. Now you have an IBM Cloudant instance and a Databases for Redis instance that you can access.

You can have only one free-tier instance per account. If you already have one, you must delete it, or change the plan variable to standard.
2. Check out these instances by visiting the Resources section of your IBM Cloud® account.



The Terraform script outputs several bits of information that you use in the next steps.





 Step 4. Run the service 

In this step, you run a script that creates all the environment variables that your service needs and then runs the service.

In the terminal, type the following command:

./build.sh

When you run this script, it takes the data output from the Terraform script and uses the jq facility to parse the content and create the environment variables needed. It then runs the script (server.js) that initializes the database and populates it with data.





 Step 5. Visit your website 



1. Open a browser and visit https://localhost:8080. See the button for each team in the following screen capture:

Zoom

![{Click the button for each team.]