fix(research): remove template scope constraints and migrate stored templates
Deploy production / deploy (push) Successful in 55s
Deploy production / deploy (push) Successful in 55s
This commit is contained in:
@@ -138,8 +138,6 @@ class Experiments:
|
||||
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 = (
|
||||
parent_snapshots
|
||||
|
||||
@@ -45,7 +45,6 @@ class TemplateSpec(Contract):
|
||||
description: str = Field(default="", max_length=10000)
|
||||
expression: str = Field(min_length=1, max_length=20000)
|
||||
variables: dict[str, Variable] = Field(default_factory=dict, max_length=100)
|
||||
scope: Scope | None = None
|
||||
category: Literal["template", "fragment"] = "template"
|
||||
|
||||
@field_validator("expression")
|
||||
|
||||
Reference in New Issue
Block a user