Skip to content

Repository files navigation

title Meta OpenEnv Customer Support
emoji 🚀
colorFrom blue
colorTo indigo
sdk docker
pinned false
tags
openenv

CustomerSupportEnv

CustomerSupportEnv is a deterministic, headless OpenEnv project for a customer support triage and resolution workflow. It is designed for Hugging Face Spaces deployment with Docker and keeps the inference loop local in Python so the model runner never depends on HTTP requests to the environment.

Environment Overview

The environment models three customer support tickets with different difficulty levels:

  • Easy: Tag a simple refund request and close the ticket.
  • Medium: Triage an angry email by moving it to Escalations and drafting a polite holding reply.
  • Hard: Inspect a mocked internal policy dictionary, deny a refund that falls outside the 30-day window, draft a strict but polite reply, tag the ticket as Policy_Denied, and close it.

The environment is deterministic. Reward is scored from 0.0 to 1.0 and increases as the agent makes correct state transitions.

Pydantic Spaces

Observation

An observation contains the live ticket view that the agent receives at each step:

  • ticket_id: The ticket identifier.
  • customer_message: The customer-facing message that defines the case.
  • current_queue: The queue currently assigned to the ticket.
  • history: A running history of state changes and actions.

Action

An action can contain any combination of the following fields:

  • reply: Draft a customer reply.
  • reassign_queue: Move the ticket to another queue.
  • add_tag: Add a routing or decision tag.
  • close_ticket: Close the ticket when the resolution is complete.

Reward

The reward is a float value between 0.0 and 1.0.

Task Descriptions

Task 1 (Easy): Tagging

Apply the Refund tag to a straightforward refund request and close the ticket.

Task 2 (Medium): Triage

Reassign the ticket to Escalations and draft a polite holding reply. Closing the ticket without replying is penalized.

Task 3 (Hard): Multi-step Resolution

Use the mocked policy dictionary to confirm the refund request is outside the 30-day window, draft a strict but polite denial, add the Policy_Denied tag, and close the ticket. Reward is incremental for each correct state change.

Setup

Local Python Run

Install dependencies:

pip install -r requirements.txt

Run the baseline evaluation locally:

python inference.py

The baseline runner reads the following environment variables:

  • API_BASE_URL
  • MODEL_NAME
  • HF_TOKEN
  • BENCHMARK

It uses the OpenAI Python client with a hard timeout of 15 seconds and runs the environment loop directly in Python.

If you plan to run openenv validate locally, install the OpenEnv CLI package you use in your environment first, such as openenv-core if that is the distribution available in your setup.

The inference script emits exactly these stdout line types:

  • [START] task=<task_name> env=<benchmark> model=<model_name>
  • [STEP] step=<n> action=<action_str> reward=<0.00> done=<true|false> error=<msg|null>
  • [END] success=<true|false> steps=<n> score=<score> rewards=<r1,r2,...,rn>

OpenEnv Validation

If the OpenEnv CLI is available in your environment, validate the project with:

openenv validate

If you want a pre-submission smoke test, use the validator script at scripts/validate-submission.sh. It checks a live Hugging Face Space endpoint, a Docker build, and openenv validate.

Docker

Build the container:

docker build -t customersupportenv .

Run the container:

docker run -p 7860:7860 customersupportenv

The Hugging Face Space health check is served by the FastAPI app on port 7860.

FastAPI Ping

The app.py module is intentionally lightweight and serves only the root GET / endpoint for Hugging Face ping checks.

Project Files

  • openenv.yaml: Environment metadata and task declarations.
  • models.py: Pydantic v2 models for observation, action, and reward.
  • env.py: Deterministic environment and graders.
  • app.py: FastAPI ping service.
  • inference.py: Local baseline evaluation script.
  • Dockerfile: Container entrypoint.
  • requirements.txt: Python dependencies.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages