...
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
In order to Use the following step-by-step guide to create a Botbot AI assist example stream in Usage Engine. See Botbot AI assist for an overview of the Botbot use case.
To process usage using the Botbot AI assist example stream, you must need to create a :
meter
...
types (the product you want to meter)
...
meters (
...
buckets to measure the usage per customer for the product).
...
Here is a step-by-step guide on how you can provision meters and meter types for an example stream - Botbot AI assist.
...
Meters and meter types are usually created using APIs called from an external system. You can automate this step for this example stream by importing the helper streams listed below. See https://infozone.atlassian.net/wiki/spaces/DAZ/pages/7842293/Streams#Importing-an-Existing-Stream.
Helper streams
Provisioning Meter Types - This stream helps to creates a meter type (AI Assist) which is a product definition for measuring the number of resolved cases by botbot’s offeringthe meter types. It uses the aggregation type Increment ‘sum’ and has a monthly reset interval set as Monthly ie, meaning the golden record is records are sent once the every month has ended.
Provisioning Meters - This stream provisions creates the meters for botbot’s customers with the user id being the company’s namethe above meter types. The user ID for each company is the company name. In this example, there are two meters created for each company - one for the L1 support bot and one for the L2 support bot.
Purge Meters - This is an additional stream to clean up the meters post-processing.
Step 1
...
Step 2
Create a new secret in the secrets wallet of type OAuth 2.0 containing your applications application's credentials. Select the authentication type “Client credentials“ and add the client ID and client secret created in the previous step, see Secret Wallets.
...
Update the authentication in all streams with your new secret. This is done in the functions within the streams that have a red error notification on them. Ensure that the audience and access token URL of the OAuth2 OAuth 2.0 authentication is configured to match your Environments API base URL.
Step 5
Run stream 1. Provisioning Meter Types. When the stream has completed you will have a six new meter type named "Pay-per-print" types in the Usage metering view.
Step 6
Navigate to "Usage metering" and copy the ID of the "AI Assist" meter type for later.
Also, open the Open the stream configuration of Botbot AI assist and copy the meter key from the Meter processor Processor for later.
Step 7
Open the stream configuration of 2. Provisioning Meters and open the script named "Prepare Meters". Paste in the meter type ids and meter key that you got from the previous step.
Step 8
Run stream 2. Provisioning Meters. After Once the stream has is completed, you will have 3 meters across your newly created meter type12 meters in total.
Step 9
The meters you created in the previous step is are now associated with the Meter processor in the Botbot AI assist stream.
...
If you want to delete your meters. Navigate to the stream configuration of 3. Purge Meters. Paste the meter type ids and meter key into the script "Prepare Filter". Run the , run the Purge Meters stream. Now all the meters related to Botbot AI assist have been deleted.