Spaces:
Sleeping
Sleeping
PROTHAM commited on
Commit ·
06ca7e4
1
Parent(s): 4fb7a60
fix: remove Optional types to pass openenv validate
Browse files- inference.py +1 -1
- models.py +3 -2
inference.py
CHANGED
|
@@ -83,7 +83,7 @@ async def run_task(env, task_id):
|
|
| 83 |
method=str(fixed.get("method", "GET")),
|
| 84 |
url=str(fixed.get("url", obs.broken_request.get("url", "/mock_api/users"))),
|
| 85 |
headers=dict(fixed.get("headers") or {}),
|
| 86 |
-
body=fixed.get("body"),
|
| 87 |
query_params=dict(fixed.get("query_params") or {}),
|
| 88 |
)
|
| 89 |
|
|
|
|
| 83 |
method=str(fixed.get("method", "GET")),
|
| 84 |
url=str(fixed.get("url", obs.broken_request.get("url", "/mock_api/users"))),
|
| 85 |
headers=dict(fixed.get("headers") or {}),
|
| 86 |
+
body=fixed.get("body") or {},
|
| 87 |
query_params=dict(fixed.get("query_params") or {}),
|
| 88 |
)
|
| 89 |
|
models.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
try:
|
| 2 |
from openenv.core.env_server.types import Action, Observation, State
|
| 3 |
except ImportError:
|
|
@@ -7,14 +9,13 @@ except ImportError:
|
|
| 7 |
from openenv.core.env_server import Action, Observation, State
|
| 8 |
|
| 9 |
from pydantic import Field
|
| 10 |
-
from typing import Any
|
| 11 |
|
| 12 |
|
| 13 |
class APIAction(Action):
|
| 14 |
method: str = Field(default="GET")
|
| 15 |
url: str = Field(default="/mock_api/users")
|
| 16 |
headers: dict = Field(default_factory=dict)
|
| 17 |
-
body:
|
| 18 |
query_params: dict = Field(default_factory=dict)
|
| 19 |
|
| 20 |
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
try:
|
| 4 |
from openenv.core.env_server.types import Action, Observation, State
|
| 5 |
except ImportError:
|
|
|
|
| 9 |
from openenv.core.env_server import Action, Observation, State
|
| 10 |
|
| 11 |
from pydantic import Field
|
|
|
|
| 12 |
|
| 13 |
|
| 14 |
class APIAction(Action):
|
| 15 |
method: str = Field(default="GET")
|
| 16 |
url: str = Field(default="/mock_api/users")
|
| 17 |
headers: dict = Field(default_factory=dict)
|
| 18 |
+
body: dict = Field(default_factory=dict)
|
| 19 |
query_params: dict = Field(default_factory=dict)
|
| 20 |
|
| 21 |
|