Dialogflow Essential Extension for LiveHelperChat
April 30, 2025 ยท View on GitHub
This extension enables LiveHelperChat to authenticate and communicate with Google's Dialogflow ES (Essential) service, allowing chatbot integration with natural language processing capabilities.
Overview
The Dialogflow Essential extension provides an authentication mechanism for LiveHelperChat to securely connect with Google's Dialogflow ES API. This allows you to:
- Generate and manage OAuth bearer tokens for Dialogflow API authentication
- Set up service credentials for Google Cloud Platform
- Use Dialogflow's natural language understanding in your chat workflows
- Integrate AI-powered conversation capabilities into your LiveHelperChat installation
Installation
- Upload the extension to your LiveHelperChat installation's
extensionfolder - Activate the extension in your LiveHelperChat settings
settings/settings.ini.php
'extensions' => array ('dialogflowes')
Setup Instructions
Step 1: Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Dialogflow API for your project
Step 2: Create Service Account Credentials
- In your Google Cloud project, navigate to "IAM & Admin" > "Service Accounts"
- Create a new service account with appropriate permissions (Dialogflow API access)
- Generate and download a JSON key file for this service account
Step 3: Configure the Extension
- Log in to your LiveHelperChat admin panel
- Navigate to "Dialogflow" in the left menu under modules
- Click on "Options"
- Paste the entire content of your service account JSON file into the "Service Credentials Content" field
- Save the settings
Step 4: Create dialogflow agent
- I just used Banking (Banking operations) prebuild agent for testing purposes.
Step 5: Import Rest API and Bot
- Import doc/bot/rest-api.json file as Rest API
- Import doc/bot/bot.json as bot while choosing just imported Rest API
- Modify in back office Rest API and change
PROJECT_IDto yours.
Usage
Once configured, the extension will handle OAuth authentication automatically. To use Dialogflow in your LiveHelperChat environment:
- In REST API calls or webhooks, use the placeholder
{{dialogflowes_bearer_token}}where bearer token authentication is needed - The extension will automatically replace this placeholder with a valid, fresh bearer token
- Tokens are cached until expiration and automatically renewed when needed
Manual testing
See doc folder content.
Permissions
To access and configure this extension, the LiveHelperChat user needs the lhdialogflowes > use_options permission.
Troubleshooting
- If authentication fails, try resetting the bearer token in the Options page
- Ensure your service account has the proper permissions in Google Cloud
- Check that the service credentials JSON is properly formatted and complete
- Verify that your Google Cloud project has Dialogflow API enabled
Demo chat
