mirror of
https://github.com/collinear-ai/yc-bench.git
synced 2026-05-02 17:45:54 +00:00
Initial commit
This commit is contained in:
commit
3a1c562827
59 changed files with 8418 additions and 0 deletions
22
src/yc_bench/agent/tools/run_command_schema.py
Normal file
22
src/yc_bench/agent/tools/run_command_schema.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class RunCommandResult:
|
||||
ok: bool
|
||||
exit_code: int
|
||||
stdout: str
|
||||
stderr: str
|
||||
sim_time: str | None
|
||||
command: str
|
||||
|
||||
def normalize_result(payload):
|
||||
return RunCommandResult(
|
||||
ok=bool(payload.get("ok", False)),
|
||||
exit_code=int(payload.get("exit_code", 1)),
|
||||
stdout=str(payload.get("stdout", "")),
|
||||
stderr=str(payload.get("stderr", "")),
|
||||
sim_time=payload.get("sim_time"),
|
||||
command=str(payload.get("command", "")),
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue