-
Notifications
You must be signed in to change notification settings - Fork 135
Extensions
Extensions are a way of showing what Program-Y can do, they are domain specific combinations of grammar, configuration and Python code which demonstrate how to extend Program-Y for your own business. They are obviously starting points that get you started, but if you want to contact us about building a professional extension, feel free to email us on the details at the bottom of the page. We can either build the extension in its entirety or work with your development team to get them up to speed on Program-Y, AIML and Extension development.
Program-Y ships with a number of extensions which are additional grammars that provide a specific set of questions and answers. A number of the extensions such as Banking, Energy etc provide a framework to build your own more detailed platform specific to the extension, whereas the more generic ones such as Weather and News provide fully constructed grammars and a range of questions and answers.
Inherit from the abstract base class
programy.extensions.Extension
This class provides a single method to implement, execute, which takes bot, clientid and data as parameters. The data parameter is a space separated set of data that comes directly from the grammar calling the extension
class Extension(object):
__metaclass__ = ABCMeta
@abstractmethod
def execute(self, bot, clientid, data):
raise NotImplemented()
An extension is called from within an 'extension' template tag. All text contained as child elements are passed to the Python method 'execute' as a string of words separated by spaces in the data parameter.
The execute method returns the same, a string of words separated by spaces. This is typically passed through an srai tag the result returned words matched to a suitable pattern.
<category>
<pattern>
BANK BALANCE *
</pattern>
<template>
<srai>
SHOW_BALANCE
<extension path="programy.extensions.banking.balance.BankingBalanceExtension">
<star />
</extension>
</srai>
</template>
</category>
Email: [email protected] | Twitter: @keiffster | Facebook: keith.sterling | LinkedIn: keithsterling | My Blog
- Home
- Background
- Guiding Principles
- Reporting an Issue
- Installation
- You And Your Bot
- Bots
- Clients
- Configuration
- AIML
- Sentence Splitting
- Natural Langauge Processing
- Normalization
- Spelling
- Sentiment Analysis
- Translation
- Security
- Hot Reload
- Logging
- Out of Band
- Multi Language
- RDF Support
- Rich Media
- Asynchronous Events
- Triggers
- External Services
- Dynamic Sets, Maps & Vars
- Extensions
- Pre & Post Processors
- Custom Nodes
- The Brain Tree
- Utilities
- Building It Yourself
- Creating Your Own Bot
- Contributing
- Performance Testing
- FAQ
- History
- Website