Getting started with the skill creation
API endpoint that returns the bank details
Before going to the skill development, we need to find an API that would return the bank details from the IFSC, On browsing through various open source projects. I found an apt endpoint by Razorpay. Razorpay is a payment gateway for India which allows businesses to accept, process and disburse payments with ease. The Github link to the repository is https://github.com/razorpay/ifsc.
API endpoint – https://ifsc.razorpay.com/<:ifsc>
Request type – GET
Response type – JSON
Now, head over to the SUSI Etherpad, which is the current SUSI Skill Development Environment and create a new Pad.
Here, we need to define the skill in the Etherpad. We will now write rules/intents for the skill. An intent represents an action that fulfills a user’s spoken request.
Intents consist of 2 parts –
- User query – It contains different patterns of query that user can ask.
- Answer – It contains the possible answer to the user query.
The main intent that our skill focuses on is, returning the bank name and address from the IFSC code. Here is how it looks –
Part-wise explanation of the intent
- The first line contains the query pattern that the user can use while querying. You can see that a wildcard character (*) is used in the pattern. It contains the IFSC of the bank that we wish to know, and will later on use to fetch the details via the API.
- The second line contains an example query, followed by third line that contains the expected answer.
- Last part of the rule contains the answer that is fetched from an external API – https://ifsc.razorpay.com/<:ifsc> ,via the console service provided by SUSI Skills. Here, <:ifsc> refers to the IFSC that the user wants to know about. We get it from the user query itself, and can access it by the variable name $1$ as it matches with the 1st wildcard present in the query. If there would be 2 wildcards, we could have accessed them by $1$ and $2$ respectively.
- The console service provides us with an option to enter the url of the API that we want to hit and path of the key we want to use.
The sample response of the endpoint looks like this :
- Since, we want to extract the name of the bank, the BANK key contains our desired value and we will use $.BANK in the path of the console service. And it can be accessed by $object$ in the answer. We frame the answer using $object$ and $1$ variables, and it like the one mentioned in the expected answer. eol marks the end of the console service.
- Similarly, the intent that gives us the address of the bank looks like this –
Testing the skill
- Open any SUSI Client and then write dream <your dream name> so that dreaming is enabled for SUSI. We will write down dream ifsc. Once dreaming is enabled, you can now test any skills which you’ve made in your Etherpad.
- We can test the skills by asking queries and matching it with the expected answer. Once the testing is done, write stop dreaming to disable dreaming for SUSI.
- After the testing was successful completely, we will go ahead and add it to the susi_skill_data.
- The general skill format is –
We will add the basic skill details and author details to the etherpad file and make it in the format as mentioned above. The final text file looks like this –
Submitting the skill
The final part is adding the skill to the list of skills for SUSI. We can do it by 2 ways:
1st method (using the web interface)
- Open https://susi.skills.com and login into SUSI account (or sign up, if not done).
- Click on the create skill button.
- Select the appropriate fields like Category, Language, Skill name, Logo.
- Paste the text file that we had created.
- Add comments regarding the skill and click on Save to save the skill.
2nd method (sending a PR)
- Send a Pull Request to susi_skill_data repository providing the dream name. The PR should have the text file containing the skill.
So, this was a short blog on how we can develop a SUSI skill of our choice.
- API Documentation of Razorpay –
- Tutorials for Skill Development –
- Relevant Blogs –