Spaces:
Sleeping
Sleeping
Pranjal Parashar commited on
artifact storage
Browse files- .gitignore +7 -1
- client.py +1 -0
- models.py +5 -0
- runtime.py +18 -22
- server/developer_control_room_environment.py +3 -0
- train.py +20 -23
- training_utils.py +35 -0
.gitignore
CHANGED
|
@@ -8,4 +8,10 @@ __pycache__/
|
|
| 8 |
*.egg-info/
|
| 9 |
outputs/
|
| 10 |
artifacts/
|
| 11 |
-
.github/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
*.egg-info/
|
| 9 |
outputs/
|
| 10 |
artifacts/
|
| 11 |
+
.github/
|
| 12 |
+
artifacts/
|
| 13 |
+
outputs/
|
| 14 |
+
.venv/
|
| 15 |
+
__pycache__/
|
| 16 |
+
*.pyc
|
| 17 |
+
.DS_Store
|
client.py
CHANGED
|
@@ -59,6 +59,7 @@ class DeveloperControlRoomEnv(
|
|
| 59 |
execution_logs=obs.get("execution_logs", []),
|
| 60 |
output_schema=obs.get("output_schema", []),
|
| 61 |
report_preview=obs.get("report_preview", []),
|
|
|
|
| 62 |
cumulative_reward=obs.get("cumulative_reward", 0.0),
|
| 63 |
feedback=obs.get("feedback", ""),
|
| 64 |
last_action_error=obs.get("last_action_error"),
|
|
|
|
| 59 |
execution_logs=obs.get("execution_logs", []),
|
| 60 |
output_schema=obs.get("output_schema", []),
|
| 61 |
report_preview=obs.get("report_preview", []),
|
| 62 |
+
materialized_artifacts=obs.get("materialized_artifacts", {}),
|
| 63 |
cumulative_reward=obs.get("cumulative_reward", 0.0),
|
| 64 |
feedback=obs.get("feedback", ""),
|
| 65 |
last_action_error=obs.get("last_action_error"),
|
models.py
CHANGED
|
@@ -95,6 +95,10 @@ class DeveloperControlRoomObservation(Observation):
|
|
| 95 |
default_factory=list,
|
| 96 |
description="Preview rows from the final report output",
|
| 97 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
cumulative_reward: float = Field(
|
| 99 |
default=0.0,
|
| 100 |
description="Running reward across the episode",
|
|
@@ -128,6 +132,7 @@ class DeveloperControlRoomState(State):
|
|
| 128 |
execution_logs: list[str] = Field(default_factory=list)
|
| 129 |
output_schema: list[str] = Field(default_factory=list)
|
| 130 |
report_preview: list[dict[str, Any]] = Field(default_factory=list)
|
|
|
|
| 131 |
cumulative_reward: float = Field(default=0.0)
|
| 132 |
done: bool = Field(default=False)
|
| 133 |
feedback: str = Field(default="")
|
|
|
|
| 95 |
default_factory=list,
|
| 96 |
description="Preview rows from the final report output",
|
| 97 |
)
|
| 98 |
+
materialized_artifacts: dict[str, str] = Field(
|
| 99 |
+
default_factory=dict,
|
| 100 |
+
description="Generated artifact contents returned by simulation-backed tasks",
|
| 101 |
+
)
|
| 102 |
cumulative_reward: float = Field(
|
| 103 |
default=0.0,
|
| 104 |
description="Running reward across the episode",
|
|
|
|
| 132 |
execution_logs: list[str] = Field(default_factory=list)
|
| 133 |
output_schema: list[str] = Field(default_factory=list)
|
| 134 |
report_preview: list[dict[str, Any]] = Field(default_factory=list)
|
| 135 |
+
materialized_artifacts: dict[str, str] = Field(default_factory=dict)
|
| 136 |
cumulative_reward: float = Field(default=0.0)
|
| 137 |
done: bool = Field(default=False)
|
| 138 |
feedback: str = Field(default="")
|
runtime.py
CHANGED
|
@@ -3,6 +3,8 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
import csv
|
|
|
|
|
|
|
| 6 |
from pathlib import Path
|
| 7 |
from typing import Any
|
| 8 |
|
|
@@ -67,7 +69,7 @@ def execute_csv_report_runtime(scenario: dict[str, Any], state: dict[str, Any])
|
|
| 67 |
"db_path": "",
|
| 68 |
"staged_csv_path": "",
|
| 69 |
"run_dir": "",
|
| 70 |
-
"
|
| 71 |
}
|
| 72 |
|
| 73 |
if duckdb is None:
|
|
@@ -110,14 +112,9 @@ def execute_csv_report_runtime(scenario: dict[str, Any], state: dict[str, Any])
|
|
| 110 |
return result
|
| 111 |
|
| 112 |
episode_id = str(state.get("episode_id") or "unknown-episode")
|
| 113 |
-
workdir = Path.
|
| 114 |
-
staged_root = workdir / "mock_s3"
|
| 115 |
staged_csv = workdir / pipeline["storage_path"]
|
| 116 |
db_path = workdir / "runtime.duckdb"
|
| 117 |
-
pipeline_file = workdir / pipeline_path
|
| 118 |
-
load_sql_file = workdir / load_sql_path
|
| 119 |
-
build_sql_file = workdir / build_sql_path
|
| 120 |
-
report_sql_file = workdir / report_sql_path
|
| 121 |
workdir.mkdir(parents=True, exist_ok=True)
|
| 122 |
result["db_path"] = str(db_path)
|
| 123 |
result["staged_csv_path"] = str(staged_csv)
|
|
@@ -126,23 +123,14 @@ def execute_csv_report_runtime(scenario: dict[str, Any], state: dict[str, Any])
|
|
| 126 |
try:
|
| 127 |
staged_csv.parent.mkdir(parents=True, exist_ok=True)
|
| 128 |
staged_csv.write_text(csv_content, encoding="utf-8")
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
report_sql_file.parent.mkdir(parents=True, exist_ok=True)
|
| 136 |
-
report_sql_file.write_text(report_sql, encoding="utf-8")
|
| 137 |
-
result["materialized_files"] = {
|
| 138 |
-
"pipeline": str(pipeline_file),
|
| 139 |
-
"load_sql": str(load_sql_file),
|
| 140 |
-
"build_sql": str(build_sql_file),
|
| 141 |
-
"report_sql": str(report_sql_file),
|
| 142 |
-
"staged_csv": str(staged_csv),
|
| 143 |
}
|
| 144 |
result["checks"]["storage_stage_check"] = True
|
| 145 |
-
result["logs"].append(f"persisted run artifacts to {workdir}")
|
| 146 |
result["logs"].append(f"staged csv to {staged_csv}")
|
| 147 |
|
| 148 |
con = duckdb.connect(str(db_path))
|
|
@@ -178,7 +166,15 @@ def execute_csv_report_runtime(scenario: dict[str, Any], state: dict[str, Any])
|
|
| 178 |
result["succeeded"] = all(result["checks"].values())
|
| 179 |
result["logs"].append(f"queried {final_view} rows={result['row_count']}")
|
| 180 |
con.close()
|
|
|
|
|
|
|
|
|
|
| 181 |
return result
|
| 182 |
except Exception as exc:
|
| 183 |
result["errors"].append(str(exc))
|
|
|
|
|
|
|
|
|
|
| 184 |
return result
|
|
|
|
|
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
import csv
|
| 6 |
+
import shutil
|
| 7 |
+
import tempfile
|
| 8 |
from pathlib import Path
|
| 9 |
from typing import Any
|
| 10 |
|
|
|
|
| 69 |
"db_path": "",
|
| 70 |
"staged_csv_path": "",
|
| 71 |
"run_dir": "",
|
| 72 |
+
"materialized_artifacts": {},
|
| 73 |
}
|
| 74 |
|
| 75 |
if duckdb is None:
|
|
|
|
| 112 |
return result
|
| 113 |
|
| 114 |
episode_id = str(state.get("episode_id") or "unknown-episode")
|
| 115 |
+
workdir = Path(tempfile.mkdtemp(prefix=f"flowos-runtime-{episode_id}-"))
|
|
|
|
| 116 |
staged_csv = workdir / pipeline["storage_path"]
|
| 117 |
db_path = workdir / "runtime.duckdb"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
workdir.mkdir(parents=True, exist_ok=True)
|
| 119 |
result["db_path"] = str(db_path)
|
| 120 |
result["staged_csv_path"] = str(staged_csv)
|
|
|
|
| 123 |
try:
|
| 124 |
staged_csv.parent.mkdir(parents=True, exist_ok=True)
|
| 125 |
staged_csv.write_text(csv_content, encoding="utf-8")
|
| 126 |
+
result["materialized_artifacts"] = {
|
| 127 |
+
pipeline_path: pipeline_text,
|
| 128 |
+
load_sql_path: load_sql,
|
| 129 |
+
build_sql_path: build_sql,
|
| 130 |
+
report_sql_path: report_sql,
|
| 131 |
+
source_csv: csv_content,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
}
|
| 133 |
result["checks"]["storage_stage_check"] = True
|
|
|
|
| 134 |
result["logs"].append(f"staged csv to {staged_csv}")
|
| 135 |
|
| 136 |
con = duckdb.connect(str(db_path))
|
|
|
|
| 166 |
result["succeeded"] = all(result["checks"].values())
|
| 167 |
result["logs"].append(f"queried {final_view} rows={result['row_count']}")
|
| 168 |
con.close()
|
| 169 |
+
result["db_path"] = ""
|
| 170 |
+
result["staged_csv_path"] = ""
|
| 171 |
+
result["run_dir"] = ""
|
| 172 |
return result
|
| 173 |
except Exception as exc:
|
| 174 |
result["errors"].append(str(exc))
|
| 175 |
+
result["db_path"] = ""
|
| 176 |
+
result["staged_csv_path"] = ""
|
| 177 |
+
result["run_dir"] = ""
|
| 178 |
return result
|
| 179 |
+
finally:
|
| 180 |
+
shutil.rmtree(workdir, ignore_errors=True)
|
server/developer_control_room_environment.py
CHANGED
|
@@ -112,6 +112,7 @@ class DeveloperControlRoomEnvironment(
|
|
| 112 |
execution_logs=[],
|
| 113 |
output_schema=[],
|
| 114 |
report_preview=[],
|
|
|
|
| 115 |
cumulative_reward=0.0,
|
| 116 |
done=False,
|
| 117 |
feedback="Episode started.",
|
|
@@ -295,6 +296,7 @@ class DeveloperControlRoomEnvironment(
|
|
| 295 |
self._state.execution_logs = list(runtime_status.get("logs", [])) + list(runtime_status.get("errors", []))
|
| 296 |
self._state.output_schema = list(runtime_status.get("output_schema", []))
|
| 297 |
self._state.report_preview = list(runtime_status.get("report_preview", []))
|
|
|
|
| 298 |
if runtime_status.get("errors"):
|
| 299 |
self._state.last_action_error = runtime_status["errors"][-1]
|
| 300 |
self._state.active_role = "fixer"
|
|
@@ -402,6 +404,7 @@ class DeveloperControlRoomEnvironment(
|
|
| 402 |
execution_logs=self._state.execution_logs,
|
| 403 |
output_schema=self._state.output_schema,
|
| 404 |
report_preview=self._state.report_preview,
|
|
|
|
| 405 |
cumulative_reward=self._state.cumulative_reward,
|
| 406 |
feedback=feedback or self._state.feedback,
|
| 407 |
last_action_error=self._state.last_action_error,
|
|
|
|
| 112 |
execution_logs=[],
|
| 113 |
output_schema=[],
|
| 114 |
report_preview=[],
|
| 115 |
+
materialized_artifacts={},
|
| 116 |
cumulative_reward=0.0,
|
| 117 |
done=False,
|
| 118 |
feedback="Episode started.",
|
|
|
|
| 296 |
self._state.execution_logs = list(runtime_status.get("logs", [])) + list(runtime_status.get("errors", []))
|
| 297 |
self._state.output_schema = list(runtime_status.get("output_schema", []))
|
| 298 |
self._state.report_preview = list(runtime_status.get("report_preview", []))
|
| 299 |
+
self._state.materialized_artifacts = dict(runtime_status.get("materialized_artifacts", {}))
|
| 300 |
if runtime_status.get("errors"):
|
| 301 |
self._state.last_action_error = runtime_status["errors"][-1]
|
| 302 |
self._state.active_role = "fixer"
|
|
|
|
| 404 |
execution_logs=self._state.execution_logs,
|
| 405 |
output_schema=self._state.output_schema,
|
| 406 |
report_preview=self._state.report_preview,
|
| 407 |
+
materialized_artifacts=self._state.materialized_artifacts,
|
| 408 |
cumulative_reward=self._state.cumulative_reward,
|
| 409 |
feedback=feedback or self._state.feedback,
|
| 410 |
last_action_error=self._state.last_action_error,
|
train.py
CHANGED
|
@@ -21,6 +21,7 @@ try:
|
|
| 21 |
build_turn_prompt,
|
| 22 |
parse_action_json,
|
| 23 |
parse_sample_prompt,
|
|
|
|
| 24 |
run_episode,
|
| 25 |
samples_to_dataset_prompts,
|
| 26 |
)
|
|
@@ -35,6 +36,7 @@ except ImportError:
|
|
| 35 |
build_turn_prompt,
|
| 36 |
parse_action_json,
|
| 37 |
parse_sample_prompt,
|
|
|
|
| 38 |
run_episode,
|
| 39 |
samples_to_dataset_prompts,
|
| 40 |
)
|
|
@@ -199,6 +201,7 @@ def main() -> None:
|
|
| 199 |
output_dir.mkdir(parents=True, exist_ok=True)
|
| 200 |
|
| 201 |
reward_log_path = output_dir / args.reward_log
|
|
|
|
| 202 |
with reward_log_path.open("w", newline="") as handle:
|
| 203 |
writer = csv.writer(handle)
|
| 204 |
writer.writerow(["episode", "task_id", "scenario_id", "total_reward", "score", "solved", "steps"])
|
|
@@ -206,31 +209,34 @@ def main() -> None:
|
|
| 206 |
episode_counter = [0]
|
| 207 |
generation_debug_counter = [0]
|
| 208 |
|
| 209 |
-
def log_episode(metrics:
|
| 210 |
episode_counter[0] += 1
|
| 211 |
with reward_log_path.open("a", newline="") as handle:
|
| 212 |
writer = csv.writer(handle)
|
| 213 |
writer.writerow(
|
| 214 |
[
|
| 215 |
episode_counter[0],
|
| 216 |
-
metrics
|
| 217 |
-
metrics
|
| 218 |
-
f"{metrics
|
| 219 |
-
f"{metrics
|
| 220 |
-
str(bool(metrics
|
| 221 |
-
metrics
|
| 222 |
]
|
| 223 |
)
|
| 224 |
logger.info(
|
| 225 |
"Episode %s task=%s scenario=%s reward=%.3f score=%.3f solved=%s steps=%s",
|
| 226 |
episode_counter[0],
|
| 227 |
-
metrics
|
| 228 |
-
metrics
|
| 229 |
-
metrics
|
| 230 |
-
metrics
|
| 231 |
-
metrics
|
| 232 |
-
metrics
|
| 233 |
)
|
|
|
|
|
|
|
|
|
|
| 234 |
|
| 235 |
def rollout_func(prompts: list[str], trainer: Any) -> dict[str, list]:
|
| 236 |
prompt_batches: list[list[int]] = []
|
|
@@ -297,16 +303,7 @@ def main() -> None:
|
|
| 297 |
total_rewards.append(metrics.total_reward)
|
| 298 |
score_rewards.append(metrics.score)
|
| 299 |
solved_rewards.append(1.0 if metrics.solved else 0.0)
|
| 300 |
-
log_episode(
|
| 301 |
-
{
|
| 302 |
-
"task_id": metrics.task_id,
|
| 303 |
-
"scenario_id": metrics.scenario_id,
|
| 304 |
-
"total_reward": metrics.total_reward,
|
| 305 |
-
"score": metrics.score,
|
| 306 |
-
"solved": metrics.solved,
|
| 307 |
-
"steps": metrics.steps,
|
| 308 |
-
}
|
| 309 |
-
)
|
| 310 |
|
| 311 |
return {
|
| 312 |
"prompt_ids": prompt_batches,
|
|
|
|
| 21 |
build_turn_prompt,
|
| 22 |
parse_action_json,
|
| 23 |
parse_sample_prompt,
|
| 24 |
+
persist_episode_artifacts,
|
| 25 |
run_episode,
|
| 26 |
samples_to_dataset_prompts,
|
| 27 |
)
|
|
|
|
| 36 |
build_turn_prompt,
|
| 37 |
parse_action_json,
|
| 38 |
parse_sample_prompt,
|
| 39 |
+
persist_episode_artifacts,
|
| 40 |
run_episode,
|
| 41 |
samples_to_dataset_prompts,
|
| 42 |
)
|
|
|
|
| 201 |
output_dir.mkdir(parents=True, exist_ok=True)
|
| 202 |
|
| 203 |
reward_log_path = output_dir / args.reward_log
|
| 204 |
+
artifact_output_dir = output_dir / "artifacts" / "sim_runs"
|
| 205 |
with reward_log_path.open("w", newline="") as handle:
|
| 206 |
writer = csv.writer(handle)
|
| 207 |
writer.writerow(["episode", "task_id", "scenario_id", "total_reward", "score", "solved", "steps"])
|
|
|
|
| 209 |
episode_counter = [0]
|
| 210 |
generation_debug_counter = [0]
|
| 211 |
|
| 212 |
+
def log_episode(metrics: Any) -> None:
|
| 213 |
episode_counter[0] += 1
|
| 214 |
with reward_log_path.open("a", newline="") as handle:
|
| 215 |
writer = csv.writer(handle)
|
| 216 |
writer.writerow(
|
| 217 |
[
|
| 218 |
episode_counter[0],
|
| 219 |
+
metrics.task_id,
|
| 220 |
+
metrics.scenario_id,
|
| 221 |
+
f"{metrics.total_reward:.4f}",
|
| 222 |
+
f"{metrics.score:.4f}",
|
| 223 |
+
str(bool(metrics.solved)).lower(),
|
| 224 |
+
metrics.steps,
|
| 225 |
]
|
| 226 |
)
|
| 227 |
logger.info(
|
| 228 |
"Episode %s task=%s scenario=%s reward=%.3f score=%.3f solved=%s steps=%s",
|
| 229 |
episode_counter[0],
|
| 230 |
+
metrics.task_id,
|
| 231 |
+
metrics.scenario_id,
|
| 232 |
+
metrics.total_reward,
|
| 233 |
+
metrics.score,
|
| 234 |
+
metrics.solved,
|
| 235 |
+
metrics.steps,
|
| 236 |
)
|
| 237 |
+
artifact_dir = persist_episode_artifacts(artifact_output_dir, metrics)
|
| 238 |
+
if artifact_dir is not None:
|
| 239 |
+
logger.info("Saved episode artifacts to %s", artifact_dir)
|
| 240 |
|
| 241 |
def rollout_func(prompts: list[str], trainer: Any) -> dict[str, list]:
|
| 242 |
prompt_batches: list[list[int]] = []
|
|
|
|
| 303 |
total_rewards.append(metrics.total_reward)
|
| 304 |
score_rewards.append(metrics.score)
|
| 305 |
solved_rewards.append(1.0 if metrics.solved else 0.0)
|
| 306 |
+
log_episode(metrics)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
|
| 308 |
return {
|
| 309 |
"prompt_ids": prompt_batches,
|
training_utils.py
CHANGED
|
@@ -6,6 +6,7 @@ import asyncio
|
|
| 6 |
import json
|
| 7 |
from dataclasses import dataclass
|
| 8 |
from itertools import cycle, islice
|
|
|
|
| 9 |
from typing import Any, Callable
|
| 10 |
|
| 11 |
import requests
|
|
@@ -66,6 +67,10 @@ class EpisodeMetrics:
|
|
| 66 |
solved: bool
|
| 67 |
steps: int
|
| 68 |
transcript: list[dict[str, Any]]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
prompt_ids: list[int] | None = None
|
| 70 |
completion_ids: list[int] | None = None
|
| 71 |
logprobs: list[float] | None = None
|
|
@@ -228,6 +233,32 @@ def fetch_grader_result(base_url: str) -> dict[str, Any]:
|
|
| 228 |
}
|
| 229 |
|
| 230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
async def run_episode_async(
|
| 232 |
base_url: str,
|
| 233 |
sample: EpisodeSample,
|
|
@@ -284,6 +315,10 @@ async def run_episode_async(
|
|
| 284 |
solved=bool(grader["solved"]),
|
| 285 |
steps=len(rewards),
|
| 286 |
transcript=transcript,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
prompt_ids=prompt_ids,
|
| 288 |
completion_ids=completion_ids,
|
| 289 |
logprobs=logprobs,
|
|
|
|
| 6 |
import json
|
| 7 |
from dataclasses import dataclass
|
| 8 |
from itertools import cycle, islice
|
| 9 |
+
from pathlib import Path
|
| 10 |
from typing import Any, Callable
|
| 11 |
|
| 12 |
import requests
|
|
|
|
| 67 |
solved: bool
|
| 68 |
steps: int
|
| 69 |
transcript: list[dict[str, Any]]
|
| 70 |
+
materialized_artifacts: dict[str, str]
|
| 71 |
+
runtime_status: dict[str, Any]
|
| 72 |
+
output_schema: list[str]
|
| 73 |
+
report_preview: list[dict[str, Any]]
|
| 74 |
prompt_ids: list[int] | None = None
|
| 75 |
completion_ids: list[int] | None = None
|
| 76 |
logprobs: list[float] | None = None
|
|
|
|
| 233 |
}
|
| 234 |
|
| 235 |
|
| 236 |
+
def persist_episode_artifacts(base_dir: str | Path, metrics: EpisodeMetrics) -> Path | None:
|
| 237 |
+
if not metrics.materialized_artifacts and not metrics.runtime_status:
|
| 238 |
+
return None
|
| 239 |
+
run_dir = Path(base_dir) / metrics.scenario_id / f"steps_{metrics.steps}"
|
| 240 |
+
run_dir.mkdir(parents=True, exist_ok=True)
|
| 241 |
+
|
| 242 |
+
for relative_path, content in metrics.materialized_artifacts.items():
|
| 243 |
+
artifact_path = run_dir / relative_path
|
| 244 |
+
artifact_path.parent.mkdir(parents=True, exist_ok=True)
|
| 245 |
+
artifact_path.write_text(content, encoding="utf-8")
|
| 246 |
+
|
| 247 |
+
(run_dir / "runtime_status.json").write_text(
|
| 248 |
+
json.dumps(metrics.runtime_status, indent=2, ensure_ascii=False),
|
| 249 |
+
encoding="utf-8",
|
| 250 |
+
)
|
| 251 |
+
(run_dir / "output_schema.json").write_text(
|
| 252 |
+
json.dumps(metrics.output_schema, indent=2, ensure_ascii=False),
|
| 253 |
+
encoding="utf-8",
|
| 254 |
+
)
|
| 255 |
+
(run_dir / "report_preview.json").write_text(
|
| 256 |
+
json.dumps(metrics.report_preview, indent=2, ensure_ascii=False),
|
| 257 |
+
encoding="utf-8",
|
| 258 |
+
)
|
| 259 |
+
return run_dir
|
| 260 |
+
|
| 261 |
+
|
| 262 |
async def run_episode_async(
|
| 263 |
base_url: str,
|
| 264 |
sample: EpisodeSample,
|
|
|
|
| 315 |
solved=bool(grader["solved"]),
|
| 316 |
steps=len(rewards),
|
| 317 |
transcript=transcript,
|
| 318 |
+
materialized_artifacts=dict(getattr(observation, "materialized_artifacts", {})),
|
| 319 |
+
runtime_status=dict(getattr(observation, "runtime_status", {})),
|
| 320 |
+
output_schema=list(getattr(observation, "output_schema", [])),
|
| 321 |
+
report_preview=list(getattr(observation, "report_preview", [])),
|
| 322 |
prompt_ids=prompt_ids,
|
| 323 |
completion_ids=completion_ids,
|
| 324 |
logprobs=logprobs,
|