YUS200619's picture
fix: add server module, pyproject.toml scripts, uv.lock
e12d96c
metadata
title: Invoice Exception Handler
emoji: 🧾
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false

Invoice Exception Handler — OpenEnv

An AI agent learning environment that simulates accounts payable exception handling. The agent acts as an AP analyst: receives flagged invoices, investigates root causes, makes decisions, and closes cases. Built for the OpenEnv hackathon.


Quick Start

pip install -r requirements.txt
python app.py
# Visit http://localhost:7860

Tasks

Task Difficulty Description
task1_price_variance Easy Invoice 3.08% above PO, verbal approval from procurement
task2_duplicate_tax Medium Duplicate invoice with hidden GST error correction
task3_compound_fraud Hard 4 simultaneous fraud signals including BEC attack

API

POST /reset    — Start new episode
POST /step     — Execute action
GET  /state    — Current state
POST /grade    — Grade episode
GET  /health   → {"status": "ok"}

Action Space

Action Params
inspect_field document, field
cross_check field, doc_a, doc_b
run_check check_name
query_supplier question, channel
query_internal department, question
apply_rule rule_id
make_decision decision, reason
route_to team, notes
close_case summary

Environment Variables

Variable Default
API_BASE_URL https://router.huggingface.co/v1
MODEL_NAME Qwen/Qwen2.5-72B-Instruct
HF_TOKEN (required for inference)