Automático: draw-only option; end-to-end test covers biopsies, treatments and deaths

This commit is contained in:
Roberto Treviño
2026-12-03 15:22:15 -06:00
parent 70c88c54dd
commit 05d0e4c278
2 changed files with 9 additions and 6 deletions
+4 -4
View File
@@ -156,11 +156,11 @@ def language_model() -> LanguageModel:
@router.post("/pipelines/{pipeline_id}/draft")
def start_draft(
pipeline_id: PipelineId, client: DagsterGraphQLClient = Depends(dagster)
pipeline_id: PipelineId, run: bool = True, client: DagsterGraphQLClient = Depends(dagster)
) -> dict[str, str]:
"""Automático: starts the `draft` job, which draws the whole pipeline from its saved
sources (the only nodes it may hold), saves it as a new version and runs it; follow it
at /runs/{run_id}."""
sources (the only nodes it may hold), saves it as a new version and runs it (`run`
false: drawn and saved only); follow it at /runs/{run_id}."""
if not config_log.latest_version(pipeline_id):
raise HTTPException(404, detail=f"no pipeline {pipeline_id}")
_, saved = config_log.get(pipeline_id)
@@ -169,7 +169,7 @@ def start_draft(
"fuentes: guárdela solo con ellas.") # fmt: skip
if not (found := llm.status())["available"]:
raise HTTPException(503, detail=f"El modelo de lenguaje no responde: {found['reason']}")
config = {"ops": {"draft_pipeline": {"config": {"pipeline": pipeline_id}}}}
config = {"ops": {"draft_pipeline": {"config": {"pipeline": pipeline_id, "run": run}}}}
try:
return {"run_id": client.submit_job_execution("draft", run_config=config)}
except DagsterGraphQLClientError as e: