Spaces:
Sleeping
Sleeping
Commit ·
57c1944
1
Parent(s): 546cfce
Add OpenEnv spec_version 1 format, server/app.py, pyproject.toml for validator
Browse files- email_env/openenv.yaml +5 -61
- openenv.yaml +5 -61
- pyproject.toml +13 -0
- server/__init__.py +0 -0
- server/app.py +6 -0
email_env/openenv.yaml
CHANGED
|
@@ -1,62 +1,6 @@
|
|
|
|
|
| 1 |
name: email-triage
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
observation_space:
|
| 8 |
-
type: object
|
| 9 |
-
properties:
|
| 10 |
-
email_text:
|
| 11 |
-
type: string
|
| 12 |
-
description: The full text of the incoming email
|
| 13 |
-
sender_type:
|
| 14 |
-
type: string
|
| 15 |
-
enum: [customer, internal, system]
|
| 16 |
-
description: The type of sender
|
| 17 |
-
|
| 18 |
-
action_space:
|
| 19 |
-
type: object
|
| 20 |
-
properties:
|
| 21 |
-
category:
|
| 22 |
-
type: string
|
| 23 |
-
enum: [billing, technical, general]
|
| 24 |
-
priority:
|
| 25 |
-
type: string
|
| 26 |
-
enum: [low, medium, high]
|
| 27 |
-
response:
|
| 28 |
-
type: string
|
| 29 |
-
description: The reply text to send back to the sender
|
| 30 |
-
required: [category, priority, response]
|
| 31 |
-
|
| 32 |
-
reward:
|
| 33 |
-
type: continuous
|
| 34 |
-
range: [0.0, 1.0]
|
| 35 |
-
description: >
|
| 36 |
-
+0.4 for correct category, +0.3 for correct priority,
|
| 37 |
-
+0.3 for response quality (keyword-based partial credit).
|
| 38 |
-
-0.2 penalty for empty response.
|
| 39 |
-
|
| 40 |
-
tasks:
|
| 41 |
-
- id: task_1
|
| 42 |
-
difficulty: easy
|
| 43 |
-
- id: task_2
|
| 44 |
-
difficulty: medium
|
| 45 |
-
- id: task_3
|
| 46 |
-
difficulty: hard
|
| 47 |
-
- id: task_4
|
| 48 |
-
difficulty: easy
|
| 49 |
-
- id: task_5
|
| 50 |
-
difficulty: hard
|
| 51 |
-
|
| 52 |
-
episode_length: 1
|
| 53 |
-
|
| 54 |
-
server:
|
| 55 |
-
endpoints:
|
| 56 |
-
reset: POST /reset
|
| 57 |
-
step: POST /step
|
| 58 |
-
state: GET /state
|
| 59 |
-
tasks: GET /tasks
|
| 60 |
-
grader: POST /grader
|
| 61 |
-
baseline: GET /baseline
|
| 62 |
-
default_port: 8000
|
|
|
|
| 1 |
+
spec_version: 1
|
| 2 |
name: email-triage
|
| 3 |
+
type: space
|
| 4 |
+
runtime: fastapi
|
| 5 |
+
app: server.app:app
|
| 6 |
+
port: 7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
openenv.yaml
CHANGED
|
@@ -1,62 +1,6 @@
|
|
|
|
|
| 1 |
name: email-triage
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
observation_space:
|
| 8 |
-
type: object
|
| 9 |
-
properties:
|
| 10 |
-
email_text:
|
| 11 |
-
type: string
|
| 12 |
-
description: The full text of the incoming email
|
| 13 |
-
sender_type:
|
| 14 |
-
type: string
|
| 15 |
-
enum: [customer, internal, system]
|
| 16 |
-
description: The type of sender
|
| 17 |
-
|
| 18 |
-
action_space:
|
| 19 |
-
type: object
|
| 20 |
-
properties:
|
| 21 |
-
category:
|
| 22 |
-
type: string
|
| 23 |
-
enum: [billing, technical, general]
|
| 24 |
-
priority:
|
| 25 |
-
type: string
|
| 26 |
-
enum: [low, medium, high]
|
| 27 |
-
response:
|
| 28 |
-
type: string
|
| 29 |
-
description: The reply text to send back to the sender
|
| 30 |
-
required: [category, priority, response]
|
| 31 |
-
|
| 32 |
-
reward:
|
| 33 |
-
type: continuous
|
| 34 |
-
range: [0.0, 1.0]
|
| 35 |
-
description: >
|
| 36 |
-
+0.4 for correct category, +0.3 for correct priority,
|
| 37 |
-
+0.3 for response quality (keyword-based partial credit).
|
| 38 |
-
-0.2 penalty for empty response.
|
| 39 |
-
|
| 40 |
-
tasks:
|
| 41 |
-
- id: task_1
|
| 42 |
-
difficulty: easy
|
| 43 |
-
- id: task_2
|
| 44 |
-
difficulty: medium
|
| 45 |
-
- id: task_3
|
| 46 |
-
difficulty: hard
|
| 47 |
-
- id: task_4
|
| 48 |
-
difficulty: easy
|
| 49 |
-
- id: task_5
|
| 50 |
-
difficulty: hard
|
| 51 |
-
|
| 52 |
-
episode_length: 1
|
| 53 |
-
|
| 54 |
-
server:
|
| 55 |
-
endpoints:
|
| 56 |
-
reset: POST /reset
|
| 57 |
-
step: POST /step
|
| 58 |
-
state: GET /state
|
| 59 |
-
tasks: GET /tasks
|
| 60 |
-
grader: POST /grader
|
| 61 |
-
baseline: GET /baseline
|
| 62 |
-
default_port: 8000
|
|
|
|
| 1 |
+
spec_version: 1
|
| 2 |
name: email-triage
|
| 3 |
+
type: space
|
| 4 |
+
runtime: fastapi
|
| 5 |
+
app: server.app:app
|
| 6 |
+
port: 7860
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pyproject.toml
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "email-triage"
|
| 3 |
+
version = "1.0.0"
|
| 4 |
+
description = "Email Triage and Response OpenEnv Environment"
|
| 5 |
+
requires-python = ">=3.10"
|
| 6 |
+
dependencies = [
|
| 7 |
+
"fastapi>=0.110.0",
|
| 8 |
+
"uvicorn>=0.29.0",
|
| 9 |
+
"pydantic>=2.6.0",
|
| 10 |
+
"requests>=2.31.0",
|
| 11 |
+
"openai>=1.30.0",
|
| 12 |
+
"python-dotenv>=1.0.0",
|
| 13 |
+
]
|
server/__init__.py
ADDED
|
File without changes
|
server/app.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Root-level server/app.py — re-exports the FastAPI app from email_env.
|
| 3 |
+
This file exists to satisfy the OpenEnv validator convention.
|
| 4 |
+
"""
|
| 5 |
+
|
| 6 |
+
from email_env.server.app import app # noqa: F401
|