feat: run fixed research pipelines within durable budgets
This commit is contained in:
@@ -121,14 +121,18 @@ class Experiments:
|
||||
validation["status"] = "needs_review"
|
||||
return validation
|
||||
|
||||
async def create(self, body, kind="template", extra_evidence=None):
|
||||
async def create(self, body, kind="template", extra_evidence=None, *, parent_snapshots=None):
|
||||
asset = await self.assets.get(body.asset_id, body.version, "template") if body.asset_id else None
|
||||
template = TemplateSpec.model_validate(asset["content"]) if asset else body.template
|
||||
scope = scope_of(body.settings)
|
||||
if template.scope and template.scope.model_dump() != scope:
|
||||
raise HTTPException(422, "模板适用范围与候选设置不同")
|
||||
snapshots, fields = await self.inputs(body.input_ids, scope)
|
||||
parents = await self.parents(body.parent_alpha_ids, body.parent_experiment_ids)
|
||||
parents = (
|
||||
parent_snapshots
|
||||
if parent_snapshots is not None
|
||||
else await self.parents(body.parent_alpha_ids, body.parent_experiment_ids)
|
||||
)
|
||||
variables = {}
|
||||
for name, variable in template.variables.items():
|
||||
if variable.kind == "field":
|
||||
|
||||
Reference in New Issue
Block a user