CoolFace
Apppublic

prasanna2119/Customer_Support_RL_Environment

sourceHugging Faceupdated 5mo agoView on Hugging Face
0likes
App README

๐ŸŽง Customer Support RL Environment

An OpenEnv-compliant reinforcement learning environment that simulates a real-world customer support desk.

Overview

An AI agent learns to handle customer support workflows across three progressively harder tasks:

TaskDifficultyDescription
classify-ticketEasyAssign a support ticket to the correct category
draft-responseMediumWrite a professional empathetic response
resolve-escalationHardHandle a multi-turn escalation sequence

Action Space

Each action is a JSON object:

json
{
  "action_type": "classify | draft | acknowledge_urgency | escalate_manager | ...",
  "content": "<text content of the action>"
}

Observation Space

Each observation is a JSON object containing:

  • โ€”task โ€” current task name
  • โ€”session_id โ€” unique episode identifier
  • โ€”instruction โ€” what the agent should do
  • โ€”ticket or conversation โ€” the support scenario
  • โ€”action_format โ€” expected format of the action

Reward Function

TaskReward Signal
classify-ticket1.0 correct, 0.5 related category, 0.0 wrong
draft-response0.0โ€“1.0 based on required elements present, forbidden elements absent, response length
resolve-escalation1.0 correct action per step, 0.4 related action, 0.0 wrong

API Endpoints

MethodPathDescription
GET/healthHealth check
GET/tasksList all tasks
POST/resetStart a new episode
POST/stepTake an action
GET/POST/stateQuery current episode state

Example: Reset

bash
curl -X POST http://localhost:7860/reset \
  -H "Content-Type: application/json" \
  -d '{"task": "classify-ticket"}'

Example: Step

bash
curl -X POST http://localhost:7860/step \
  -H "Content-Type: application/json" \
  -d '{"task": "classify-ticket", "action": {"action_type": "classify", "content": "billing"}}'

Setup & Running

Local

bash
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 7860

Docker

bash
docker build -t customer-support-env .
docker run -p 7860:7860 \
  -e HF_TOKEN=your_token \
  -e MODEL_NAME=Qwen/Qwen2.5-72B-Instruct \
  customer-support-env

Run Inference

bash
export HF_TOKEN=your_token
export MODEL_NAME=Qwen/Qwen2.5-72B-Instruct
export API_BASE_URL=https://router.huggingface.co/v1
export ENV_BASE_URL=http://localhost:7860

python inference.py

Environment Variables

VariableDescriptionDefault
HF_TOKENHuggingFace API keyโ€”
MODEL_NAMELLM model identifierQwen/Qwen2.5-72B-Instruct
API_BASE_URLLLM API endpointhttps://router.huggingface.co/v1
ENV_BASE_URLThis environment's URLhttp://localhost:7860
TASKRun a specific task onlyall tasks

Team

AgentForge โ€” OpenEnv Hackathon 2026