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

You can watch the videos to learn more about App Configuration service.



* Video transcript

What are Feature Flags?

Before you begin playing the video: In this video, the narrator draws representational images on the display board to explain the concept. [Draw] is used to represent when the narrator draws the representational image. [Writing] is used to represent when the narrator writes some text.

What if you could release a feature to different groups of users without deployment? Is there a way to effectively test features in production, and immediately roll them back if needed?

Hi, my name is Dilan Orrino with IBM Cloud. I'll be answering those questions by discussing feature flags, or sometimes referred to as feature toggle, or switches.

Feature flags are conditions that encompass feature code that allow you to flip them on and off at will. Okay, let's use an example. [Draw] Let's say we've got an ice cream shop franchise that's looking to expand to a new city and we've got a [Draw] banner that we want to display on our website. We'll call this open banner. We only want to display this banner to users that are [Draw] nearby our new ice cream shop we can do this by using feature flags.

There's a couple benefits to using feature flags. [Writing] Number one is we can actually turn these on or off without deployment. [Writing] Number two is we can actually test directly in production. [Writing] And number three we can segment our users based on different attributes.

Okay, there's a couple ways you can do this one way is by using properties in JSON files or config maps. There's a better way however by using a feature flag service.

[Writing] There's a couple benefits to using a feature flag service. Number one is you can have essentially managed place for your features, or excuse me your feature flags. [Writing] Number two is you can turn these on and off without modifying your properties in your future, in your apps or web pages. [Writing] And number three is you get audit and usage data. It's harder to get the audit and usage data by using JSON files.
If the training request fails with a status code of 400, the service sets the custom model's status to failed. Take one of the following actions:



* Use methods of the customization interface to examine the model's resources and fix any errors that you find:



* For an invalid corpus, you can correct the corpus text file and use the allow_overwrite parameter of the POST /v1/customizations/{customization_id}/corpora/{corpus_name} method to add the corrected file to the model. For more information, see [Add a corpus to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreateaddCorpus).
* For an invalid grammar, you can correct the grammar file and use the allow_overwrite parameter of the POST /v1/customizations/{customization_id}/grammars/{grammar_name} method to add the corrected file to the model. For more information, see [Add a grammar to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammarAddaddGrammar).
* For an invalid custom word, you can use the POST /v1/customizations/{customization_id}/words or PUT /v1/customizations/{customization_id}/words/{word_name} method to modify the word directly in the model's words resource. For more information, see [Modifying words in a custom model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatemodifyWord).



For more information about validating the words in a custom language model, see



* [Validating a words resource for previous-generation models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWordsvalidateModel)
Feature flags 

As an app owner, create, and manage feature flags, add them to collections and use them in your app by using SDKs. You can also control the applicability of a feature by enabling or disabling it at run time.

You can add an approval process flow for any configuration changes initiated through an App Configuration environment by using the ServiceNow integration. The approval process flow is applicable to an App Configuration environment like dev, stage, and production. For more information, see [Manage workflow](https://cloud.ibm.com/docs/app-configuration?topic=app-configuration-ac-manage-workflow).

A feature can be enabled or disabled to all the collection users or to a specific set of users and devices or to a certain percentage of specific set of users and devices.

Feature roll outs can be coordinated by defining a start and end time and date. Also, choose a specific day on which a defined feature can be enabled or disabled.

By default, the Feature flags page displays the list of feature flags that are created in the current environment of the App Configuration service instance along with details of the record. Flag types are categorized as Boolean, Numeric, or String.



* A Boolean flag has two values and you can set the default value as 'true' or 'false'.
* A String type flag supports data in the form of text, and JSON or YAML files.
* A Numeric flag supports integers.



Zoom

![List of feature flags](https://cloud.ibm.com/docs-content/v1/content/f3dada89f147af3b88388a2218ddbf64b3c41e5f/app-configuration/images/ac-list-feature-flag.png)

Figure 1. List of feature flags



 Create a feature flag 

To create a feature flag, complete these steps:



1. In the App Configuration console, click Features flags.
2. Select the Current Environment to display the list of feature flags in that environment.
3. Click Create. The side panel opens with fields for creating a new feature flag.

Zoom

!
* A compilation error is introduced when an import view statement introduces a naming conflict with any create view or other import statement within the same module (not just within the current file). This restriction applies to the import of other AQL objects in addition to views.
* A compilation error is introduced when an AQL file inside a module tries to reference another exported view of a module without using the import view statement. The same applies to dictionaries, tables, or functions.
* If two AQL files inside a module import the same view X from another module under two different aliases, for example, A and B, then the two aliases are treated synonymously. This rule applies also to tables, dictionaries, and functions.







 Examples 

In this example, the import statement imports the qualified name of both the exported views, personName.FirstName and personName.NotFirstName. Any view that is not exported by the module personName is not imported as a part of the import statement



* Example 1: Import both FirstName and NotFirstName views

This example shows all of the exported views from module personName. The views FirstName and NotFirstName were created in the example section of the export statement.

module personOther;

-- The following statement would import both views FirstName and NotFirstName.
import module personName;









 The set default dictionary language statement 

The set default dictionary language statement allows an extractor developer to customize the default set of dictionary-matching languages for the containing module.



 Syntax 

set default dictionary language as '<language codes>';





 Description 



* <language codes>

Specifies the language for compilation and matching for dictionaries of the module that are declared without an explicit with language as specification. The <language codes> set must be a comma-separated list, with no white spaces around each language code. Failure to observe this requirement can result in a compilation error.

This statement affects the following dictionaries:



* Dictionaries that are explicitly declared in the current module by using the create dictionary or create external dictionary statement, and that statement does not have a with language as clause.
* Dictionaries from external files.
val features: HashMap<String, Feature>? = appConfiguration.getFeatures();
* Feature evaluation

You can use the feature.getCurrentValue() method to evaluate the value of the feature flag. Pass a unique entityId as the parameter to perform the feature flag evaluation. If the feature flag is configured with segments in the App Configuration service, you can set the attributes values as a JSONObject.

JSONObject entityAttributes = new JSONObject();
try {
entityAttributes.put("city", "Bangalore");
entityAttributes.put("country", "India");
} catch (JSONException e) {
e.printStackTrace();
}

val appConfiguration = AppConfiguration.getInstance()
val feature: Feature? = appConfiguration.getFeature("featureId")

if (feature?.getFeatureDataType() === Feature.FeatureType.NUMERIC) {
val value = feature.getCurrentValue("entityId", entityAttributes)
} else if (feature?.getFeatureDataType() === Feature.FeatureType.BOOLEAN) {
val value = feature.getCurrentValue("entityId", entityAttributes)
} else if (feature?.getFeatureDataType() === Feature.FeatureType.STRING) {
val value = feature.getCurrentValue("entityId", entityAttributes)
}
Show more
* Get single property

val property: Property? = appConfiguration.getProperty("propertyId")
* Get all properties

val properties: HashMap<String, Property>? = appConfiguration.getProperties();
* Property evaluation

You can use the property.getCurrentValue() method to evaluate the value of the property.
See [create a secret](https://cloud.ibm.com/docs/codeengine?topic=codeengine-secretsecret-create-ui) or [create a configmap](https://cloud.ibm.com/docs/codeengine?topic=codeengine-configmapconfigmap-create-ui) to define your secret or configmap before proceeding.





1. To open the dialog to define your environment variable on the Add environment variable page, complete one of the following choices.



* If you are [creating an app](https://cloud.ibm.com/docs/codeengine?topic=codeengine-deploy-appdeploy-app-console), from the Create application page, expand the Environment variables (optional) section. You can add one or more environment variables to the app that you are creating. Click Add to open the Add environment variable page.
* If you are [creating a job](https://cloud.ibm.com/docs/codeengine?topic=codeengine-create-jobcreate-job-ui), from the Create job page, expand the Environment variables (optional) section. Click Add to open the Add environment variable page.
* If you are updating an existing app or job to add environment variables, go to the existing app or job. From the Configuration tab, click Environment variables. For apps, you'll need to click Edit and create a new revision, and then click Add environment variable. For jobs, click Add environment variable to open the Add environment variable page.



2. From the Add environment variable page, create an environment variable in one of the following ways,



* To create a literal environment variable, choose Literal value, specify the name for the literal environment variable, and provide a value. Notice that the Resulting definition section displays the name of the environment variable and its value.
* To create an environment variable that fully references a configmap, choose Reference full configmap, and then select the existing configmap. For this case, all keys of the selected configmap are referenced as part of the environment variable.
print("Unable to update the Layer 7 policy: %s, %s" % (e.faultCode, e.faultString))
Show more





 Add rules to a Layer 7 policy 

import SoftLayer
from pprint import pprint

 UUID of the Layer 7 policy
policyUuid = "set me"

 New rules to add
rules = [
{
"type": "FILE_TYPE",
"comparisonType": "CONTAINS",
"value": "some_value",
"invert": 1
},
{
"type": "PATH",
"comparisonType": "EQUAL_TO",
"value": "some_value",
"invert": 0
}
]

client = SoftLayer.Client()
networkLBaaSL7RuleService = client['SoftLayer_Network_LBaaS_L7Rule']

try:
result = networkLBaaSL7RuleService.addL7Rules(policyUuid, rules)
pprint(result)
except SoftLayer.SoftLayerAPIError as e:
print("Unable to add rules to a Layer 7 policy: %s, %s " % (e.faultCode, e.faultString))
Show more





 Update multiple Layer 7 rules that are attached to the same Layer 7 policy 

 For nice debug output:
import SoftLayer
from pprint import pprint

 UUID of the Layer 7 policy
policyUuid = "set me"

 New rules to add
rules = [
{
'uuid': '<UUID of the L7 Rule being updated>',
'type': 'FILE_TYPE',
'comparisonType': 'CONTAINS',
'value': 'some_newvalue',
'invert': 1
},
{
'uuid': '<UUID of the L7 Rule being updated>',
'type': 'PATH',
Why can't I deploy my changes to a configuration? 

If you're unable to deploy changes to a configuration, you might need an Editor to approve your changes.

  What’s happening 

You can edit and save changes to a configuration, but you can't deploy them.

  Why it’s happening 

After you save changes to a configuration, they must be validated. Then, a user who is assigned to the Editor role for projects must approve the changes before they can be deployed.

  How to fix it 

Contact an Editor on your team to approve the changes to the configuration. Contact your account administrator if you need Editor access to the IBM Cloud Projects service. For more information, see [Assigning users access to projects](https://cloud.ibm.com/docs/secure-enterprise?topic=secure-enterprise-access-project).
console.log(result.details.valueType); // a string value. Example: DISABLED_VALUE
console.log(result.details.reason); // a string value. Example: Disabled value of the feature flag since the feature flag is disabled.
console.log(result.details.segmentName); // (only if applicable, else it is undefined) a string value containing the segment name for which the feature flag was evaluated.
console.log(result.details.rolloutPercentageApplied); // (only if applicable, else it is undefined) a boolean value. True if the entityId was part of the rollout percentage evaluation, false otherwise.
console.log(result.details.errorType); // (only if applicable, else it is undefined) contains the error.message if any error was occured during the evaluation.
Show more



* entityId: Id of the entity. This is a string identifier related to the entity against which the feature is evaluated. For example, an entity might be an instance of an app that runs on a mobile device, a microservice that runs on the cloud, or a component of infrastructure that runs that microservice. For any entity to interact with App Configuration, it must provide a unique entity ID.
* entityAttributes: A JSON object consisting of the attribute name and their values that define the specified entity. This is an optional parameter if the feature flag is not configured with any targeting definition. If the targeting is configured, then entityAttributes should be provided for the rule evaluation. An attribute is a parameter that is used to define a segment. The SDK uses the attribute values to determine whether the specified entity satisfies the targeting rules, and returns the appropriate feature flag value.







 Get single property 

const property = appConfigClient.getProperty('property_id'); // property can be null incase of an invalid property id

if (property != null) {
console.log(Property Name ${property.getPropertyName()} );
Why can't I toggle a newly created feature flag? 

  What’s happening 

Feature flag is disabled and cannot be toggled.

  Why it’s happening 

A Feature flag is linked to a collection and the flag is toggled per environment.

If a feature flag is not linked to any collection, it is disabled by default.

  How to fix it 

Link the feature flag with an existing collection. This allows you to toggle between ON or OFF state.
console.log(Feature Id ${feature.getFeatureId()});
console.log(Feature Type ${feature.getFeatureDataType()});
console.log(Feature is enabled ${feature.isEnabled()});
}





 Evaluate a feature 

You can use the feature.getCurrentValue(entityId, entityAttributes) method to evaluate the value of the feature flag. This method returns one of the Enabled/Disabled/Overridden value based on the evaluation. The data type of returned value matches that of feature flag. Pass a unique entityId as the parameter to perform the feature flag evaluation.

const entityId = 'john_doe';
const entityAttributes = {
city: 'Bangalore',
country: 'India',
};

const featureValue = feature.getCurrentValue(entityId, entityAttributes);

Where:



* entityId: Id of the Entity. This will be a string identifier related to the Entity against which the feature is evaluated. For any entity to interact with App Configuration, it must provide a unique entity ID.
* entityAttributes: A JSON object consisting of the attribute name and their values that defines the specified entity. This is an optional parameter if the feature flag is not configured with any targeting definition. If the targeting is configured, then entityAttributes should be provided for the rule evaluation. An attribute is a parameter that is used to define a segment. The SDK uses the attribute values to determine if the specified entity satisfies the targeting rules, and returns the appropriate feature flag value.







 Get single property 

import { useProperty } from 'ibm-appconfiguration-react-client-sdk';

const property = useProperty('check-in-charges');

if(property) {
console.log(Property Name ${property.getPropertyName()});
console.log(Property Id ${property.getPropertyId()});
[Writing] There's a couple benefits to using a feature flag service. Number one is you can have essentially managed place for your features, or excuse me your feature flags. [Writing] Number two is you can turn these on and off without modifying your properties in your future, in your apps or web pages. [Writing] And number three is you get audit and usage data. It's harder to get the audit and usage data by using JSON files.

Okay, so now let's go back to our example we've got our open banner feature and now let's wrap it with some feature flag code.

And so here's an example, kind of pseudo code, that you can use if store open is enabled.

[Writing] if (storeopen is Enabled()){ Then we're going to show open banner [Writing] show Open Banner();}

so this pseudocode represents our feature code and the flag that potentially could encompass it.

Now let's actually put this in production and [Draw] make it show showcase to some users.

So now that we've got our feature in production it's not usable to any users right now this is an idea typically displayed with feature flags called dark launch. Dark launch is when a feature is in production but not visible to any or all users or any or some users, excuse me.

Now we want to introduce the idea of [Writing] segments.

So we've already said that we only want a certain number of people to view this, people who are nearby our new shop. This will be our segment A, and a segment is simply users or groups of users that have attributes tied to them.

So this first one might have [Writing] current location, and [Writing] zip code.

Attributes, this allows users who are either currently in the location or have already stipulated that they live nearby to view this feature, but before we do that we want to test the feature out on our own employees. [Writing] So we would have segment Bof our testers because we want them to be our employees the attribute might be [Writing] email ID.

Now we can effectively test our feature in production by {Draw] flipping this toggle on.
apprapp.features.update Updated feature or failed to update 
 apprapp.features.updatevalues Updated feature details or failed to update details 
 apprapp.features.delete Deleted feature or failed to delete 
 apprapp.features.list Called the list of features or failed to list 
 apprapp.features.read Retrieved feature details or failed to retrieve the details 
 apprapp.features.evaluate Evaluated feature at the SDK or failed to evaluate 
 apprapp.features.toggle Toggled feature or failed to toggle 
 apprapp.properties.create Created a property or failed to create 
 apprapp.properties.update Updated property or failed to update 
 apprapp.properties.updatevalues Updated property details or failed to update 
 apprapp.properties.delete Deleted property or failed to delete 
 apprapp.properties.list Called the list of properties or failed to list 
 apprapp.properties.read Retrieved details of property or failed to retrieve property details 
 apprapp.properties.evaluate Evaluated property at the SDK or failed to evaluate 
 apprapp.collections.create Created a collection or failed to create 
 apprapp.collections.update Updated a collection or failed to update 
 apprapp.collections.delete Deleted a collection or failed to update 
 apprapp.collections.list Called the list of collections or failed to list 
 apprapp.collections.read Retrieved collection details or failed to retrieve collection details 
 apprapp.snapshots.create Created a snapshot configuration or failed to create 
 apprapp.snapshots.update Updated a snapshot configuration or failed to update 
 apprapp.snapshots.delete Deleted a snapshot configuration or failed to update 
 apprapp.snapshots.list Called the list of snapshot configuration or failed to list 
 apprapp.snapshots.read Retrieved snapshot configuration details or failed to retrieve snapshot configuration details 
 apprapp.snapshots.promote Created or updated the chosen configuration to GitHub based on the snapshots configuration. 
 apprapp.snapshots.restore Writes or updates the chosen snapshot configuration from the GitHub to App Configuration instance.
For more information about the steps to use apply command, see [deploying agent](https://cloud.ibm.com/docs/schematics?topic=schematics-deploy-agent-overview&interface=cli).

Syntax

ibmcloud schematics agent update --id AGENT_ID [--description DESCRIPTION] [--user-state USER_STATE] [--tags TAGS] [--file FILE] [--output OUTPUT] [--no-prompt]

Command options



Schematics agent update flags

 Flag Required / Optional Description 

 --id or -i Required The ID of an agent. 
 --tags or -t Optional Agent tags. This flag can be used multiple times, and search the agent related resources faster. 
 --description or -d Optional Short description of an agent. 
 --user-state or -s Optional User defined status of an agent. Valid values are enable, disable. 
 --file or -f Optional Path to the JSON file that contains the definition of the agent. 
 --output or -o Optional Specify output format, only 'JSON' is supported. 
 --no-prompt Optional Set this flag to update an inventory without an interactive command-line session. 



Example

ibmcloud schematics agent update --id <AGENT_ID>







 Blueprint commands 

Schematics Blueprints is a [beta feature](https://cloud.ibm.com/docs/schematics?topic=schematics-bp-beta-limitations) that are available for evaluation and testing purposes. It is not intended for production usage. Refer to the list of [limitations](https://cloud.ibm.com/docs/schematics?topic=schematics-bp-beta-limitationssc-bp-beta-limitation) for the beta release.



 ibmcloud schematics blueprint create 

Create a blueprint config from the command line using the ibmcloud schematics blueprint create command. Creating a blueprint config is the first step to deploy a blueprint environment.