Convo Generator
Convo Generator is a Convo agent and middleware generator using Yeoman.
This generator reads the environment configuration, Convo specification, and OpenAPI specification, which would then be used to generate:
- A Convo agent in the form of Dialogflow export zip which can then be imported or restored into your Dialogflow project
- A Convo middleware in the form of Serverless app with CloudFunctions which can then be deployed to your GCP project.
Please have a look at Convo Thomas, Convo Hacker News, and Convo Jenkins as examples of how Convo Generator can be used.
Installation
Install Yeoman, Serverless, dialogflow-cli:
npm install -g yo serverless dialogflow-cli
Install Convo Generator itself:
npm install -g convo-generator
Configuration
Create the following mandatory configuration files:
And depending on the middleware type specified in your Convo specification, you need to provide these additional configuration files:
Middleware Type | Configuration File |
---|---|
OpenAPI-CloudFunctions | OpenAPI specification |
Usage
DialogFlow agent
Generate DialogFlow agent:
yo convo dialogflow-agent <path/to/env-config.yaml> <path/to/convo-spec.yaml>
Deploy the generated agent:
dialogflow-cli import --credentials <path/to/project-credentials.json> <path/to/generated-agent-dir/>
Alternatively, you can zip up the generated agent, and then import or restore the zip file to Dialogflow.
Freestyle-CloudFunctions middleware:
Generate Freestyle-CloudFunctions middleware:
yo convo freestyle-cloudfunctions-middleware <path/to/env-config.yaml> <path/to/convo-spec.yaml>
Deploy the generated middleware:
serverless deploy
OpenAPI-CloudFunctions middleware:
Generate OpenAPI-CloudFunctions middleware:
yo convo openapi-cloudfunctions-middleware <path/to/env-config.yaml> <path/to/convo-spec.yaml> <path/to/openapi-spec.yaml>
Deploy the generated middleware:
serverless deploy
Colophon
Related Projects:
- Convo - Specification-based voice and text conversation library
- convo-node - node.js utility module for Convo library
- Convo Thomas - Convo agent for Thomas the Tank Engine Facts
- Convo Hacker News - Convo agent and middleware for Hacker News
- Convo Jenkins - Convo agent and middleware for Jenkins