Skip to content

avpa11/dialogflow-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dialogflow CX Flask Chat Application

A Flask web application that provides a chat interface to interact with your Google Cloud Dialogflow CX agent

Prerequisites

  • Python 3.9 or higher
  • Google Cloud Project with Dialogflow CX and AI Application enabled
  • Dialogflow CX agent created

Installation

  1. Clone or download this project

  2. Install dependencies

    pip install -r requirements.txt
  3. Set up Google Cloud authentication

    Option A: Using gcloud CLI

    gcloud auth application-default login

    Option B: Using service account key

    • Download your service account key from Google Cloud Console
    • Set the GOOGLE_APPLICATION_CREDENTIALS environment variable
  4. Configure your Dialogflow CX settings

    Create a .env file in the project root:

    # Flask Configuration
    SECRET_KEY=your-secret-key-change-this-in-production
    
    # Google Cloud Dialogflow CX Configuration
    PROJECT_ID=your-google-cloud-project-id
    LOCATION_ID=us-central1
    AGENT_ID=your-dialogflow-cx-agent-id
    LANGUAGE_CODE=en-us
    
    # Google Cloud Authentication
    GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service-account-key.json

## Usage

1. **Start the application**

```bash
python app.py
  1. Open your browser Navigate to http://localhost:5000

  2. Start chatting Type your messages and interact with your Dialogflow CX agent

API Endpoints

  • GET /: Main chat interface
  • POST /chat: Send a message to Dialogflow CX
  • GET /config: View current configuration (for debugging)
  • POST /reset_session: Reset the current conversation session

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published