--- 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 ```bash 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) |