refactor: rename mention node to nested_node for generic sub-graph support

This commit is contained in:
Novice
2026-01-22 13:15:13 +08:00
parent c7d106cfa4
commit 5cb8d4cc11
35 changed files with 319 additions and 289 deletions

View File

@ -165,27 +165,27 @@ class WorkflowScheduleCFSPlanEntity(BaseModel):
granularity: int = Field(default=-1) # -1 means infinite
# ========== Mention Graph Entities ==========
# ========== Nested Node Graph Entities ==========
class MentionParameterSchema(BaseModel):
"""Schema for the parameter to be extracted from mention context."""
class NestedNodeParameterSchema(BaseModel):
"""Schema for the parameter to be extracted from nested node context."""
name: str = Field(description="Parameter name (e.g., 'query')")
type: str = Field(default="string", description="Parameter type (e.g., 'string', 'number')")
description: str = Field(default="", description="Parameter description for LLM")
class MentionGraphRequest(BaseModel):
"""Request payload for generating mention graph."""
class NestedNodeGraphRequest(BaseModel):
"""Request payload for generating nested node graph."""
parent_node_id: str = Field(description="ID of the parent node that uses the extracted value")
parameter_key: str = Field(description="Key of the parameter being extracted")
context_source: list[str] = Field(description="Variable selector for the context source")
parameter_schema: MentionParameterSchema = Field(description="Schema of the parameter to extract")
parameter_schema: NestedNodeParameterSchema = Field(description="Schema of the parameter to extract")
class MentionGraphResponse(BaseModel):
"""Response containing the generated mention graph."""
class NestedNodeGraphResponse(BaseModel):
"""Response containing the generated nested node graph."""
graph: Mapping[str, Any] = Field(description="Complete graph structure with nodes, edges, viewport")