Skip to content

Config_Brain_Services

Keith Sterling edited this page Sep 22, 2017 · 9 revisions

Brain Service Configuration

Programy provides the ability to define a number of services which can then be called from the 'sraix' tag. Each service is expected to be a basic REST API. The original AIML spec required the various configuration parameters to be embedded into the sraix tags, but this made changing them in multiple places difficult and error prone.

The configuration has therefore been extracted into the config file, and all that is required in the 'sraix' tag is to define the service name.

  brain:
    services:
        REST:
            classname: programy.utils.services.rest.GenericRESTService
            method: GET
            host: 0.0.0.0
        Pannous:
            classname: programy.utils.services.pannous.PannousService
            url: http://weannie.pannous.com/api
        Pandora:
            classname: programy.utils.services.pandora.PandoraService
            url: http://www.pandorabots.com/pandora/talk-xml
        Wikipedia:
            classname: programy.utils.services.wikipediaservice.WikipediaService
Name Description Example Default
classname Name of the Python class to dynamically load. See defining your own services for more info on the interface needed. programy.utils.services.rest.GenericRESTService Specific to service
method REST method to use for the call. This is either GET or POST [GET|POST] GET
host FQDN or IP address of the host to call http://www.pandorabots.com/pandora/talk-xml Specific to service
url Additional URL component of the call /API/v1.0/query Specific to service
Clone this wiki locally