Spaces:
Build error
A newer version of the Gradio SDK is available: 6.26.0
title: Customer_Support_Agent
app_file: app.py
sdk: gradio
sdk_version: 5.23.3
π¬ Customer Support Assistant
An AI-powered voice + text chatbot built with pydantic_ai, powered by Llama 3.3 70B via Cerebras/Groq. It processes customer issues, detects emotional tone, and records support requests into a structured data table. Deployable on Gradio Spaces and usable locally with both text and audio input.
β‘ Features
- π₯ LLM-powered form extraction using
Agentabstraction frompydantic_ai - ποΈ Voice chat with real-time streaming via
fastrtc - π§ Memory-aware responses using
message_history - π Live DataFrame updates for structured customer requests
- πΎ Persistent CSV logging
- π οΈ One-click Gradio UI with tabs for Chat + Customer Data
π Getting Started
1. Clone the Repo
git clone https://github.com/your-username/customer-support-assistant
cd customer-support-assistant
2. Install Dependencies
β οΈ Make sure you use
uvto ensure proper dependency resolution (especially forpydantic_ai).
uv pip install -r requirements.txt
Or use
uvdirectly:
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt
3. Setup .env File
Create a .env file in the root directory.
Refer to settings.py for required fields. At a minimum, you will need:
CEREBRAS_API_KEY=your_api_key
CEREBRAS_BASE_URL=https://api.groq.com/openai/v1
You can optionally set environment variables for your own STT/TTS models as required by fastrtc.
4. Run the App Locally
python app.py
π Deploy on Gradio Spaces
- Add your
CEREBRAS_API_KEYandCEREBRAS_BASE_URLas secrets in the Gradio Space. - Make sure
fastrtcaudio support is configured in the hardware tab. - Gradio Spaces will auto-launch the app via
app.py.
π§ͺ Debug Tips
To simulate extraction alone:
python agents.py
Then type messages in the CLI to test how well the form is filled.
π File Structure
βββ app.py # Main Gradio UI
βββ agents.py # Agent config + LLM interaction logic
βββ settings.py # Handles env/config
βββ form_prompt.txt # System prompt for form extraction
βββ response_prompt.txt # System prompt for response generation
βββ data.csv # Auto-generated CSV storage
βββ requirements.txt
βββ README.md
π§ What the AI Extracts
The form agent will pull out:
customername: Extracted from input or marked as"unknown"requesttype: e.g.,"billing","technical support"issue: 50-line description of the issueemotion:"angry","happy", etc.
π Known Limitations
- Longform audio may require silence-based segmentation tuning.
- This project assumes inputs are customer support related. General queries may misfire.
- Error handling is basic β add guards if scaling for production use.
π Credits
- Built using pydantic_ai
- Voice support via fastrtc
- LLM backend: Llama 3.3 70B via Groq
- UI powered by Gradio