Add Customer Support AI Training Environment (OpenEnv-compatible)#1
Merged
vsrupeshkumar merged 1 commit intoMar 31, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot
AI
changed the title
[WIP] Add Customer Support AI training environment for OpenEnv
Add Customer Support AI Training Environment (OpenEnv-compatible)
Mar 31, 2026
Anbu-00001
added a commit
that referenced
this pull request
Apr 4, 2026
- Replaced heuristic StrategicAgent with production-grade LLMAgent.
- Instantiates openai.OpenAI(base_url=API_BASE_URL, api_key=HF_TOKEN).
- Injects full Action JSON schema into system prompt for LLM contract.
- Forces response_format={'type':'json_object'} for guaranteed JSON output.
- Implements 3-retry loop with exponential back-off (1s, 2s, 4s).
- Aborts retries early on 4xx HTTP errors (auth/quota failures).
- Falls back to safe zero-dispatch Action after exhausted retries.
- Emits rich Python logging (DEBUG/INFO/WARNING/ERROR) with token usage and latency.
- System and conversation history preserved across steps per episode.
- History reset between tasks via reset_history().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bootstraps a complete OpenEnv-compatible RL environment simulating a customer support system, built from scratch on an empty repo.
Architecture
environment.py— Core env withreset()/step()/state()interface. 6 deterministic scenarios (payment failure, delayed delivery, refund, account issues). Shaped reward function with partial credit, penalties, and bonuses. Escalation does not auto-terminate episodes — agent must callmark_resolved.tasks.py— ThreeTaskdataclasses (easy / medium / hard) with expected action sequences, max steps, and pass thresholds.grader.py— Per-task deterministic graders returning[0.0, 1.0]; weighted final score (easy=0.2, medium=0.3, hard=0.5).inference.py— Rule-based deterministic baseline agent; runs all tasks and prints scored summary.openenv.yaml— Env metadata, action/task config, resource constraints.Dockerfile—python:3.10-slimcontainer;CMD ["python", "inference.py"].Interface
Reward shaping
classify_issueclassify_issuerespond_with_solutionrespond_with_solutionescalate_to_humanescalate_to_humanmark_resolvedmark_resolvedBaseline scores (rule-based agent, seed=42)
Original prompt