| title | Meta OpenEnv Customer Support | |
|---|---|---|
| emoji | 🚀 | |
| colorFrom | blue | |
| colorTo | indigo | |
| sdk | docker | |
| pinned | false | |
| tags |
|
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.
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.
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.
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.
The reward is a float value between 0.0 and 1.0.
Apply the Refund tag to a straightforward refund request and close the ticket.
Reassign the ticket to Escalations and draft a polite holding reply. Closing the ticket without replying is penalized.
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.
Install dependencies:
pip install -r requirements.txtRun the baseline evaluation locally:
python inference.pyThe baseline runner reads the following environment variables:
API_BASE_URLMODEL_NAMEHF_TOKENBENCHMARK
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>
If the OpenEnv CLI is available in your environment, validate the project with:
openenv validateIf 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.
Build the container:
docker build -t customersupportenv .Run the container:
docker run -p 7860:7860 customersupportenvThe Hugging Face Space health check is served by the FastAPI app on port 7860.
The app.py module is intentionally lightweight and serves only the root GET / endpoint for Hugging Face ping checks.
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.