chore: add model name in detail

This commit is contained in:
Novice 2026-01-07 15:05:18 +08:00
parent cef7fd484b
commit 1584a78fc9
No known key found for this signature in database
GPG Key ID: EE3F68E3105DAAAB
2 changed files with 4 additions and 0 deletions

View File

@ -123,6 +123,7 @@ class LLMTraceSegment(BaseModel):
# Common metadata for both model and tool segments
provider: str | None = Field(default=None, description="Model or tool provider identifier")
name: str | None = Field(default=None, description="Name of the model or tool")
icon: str | None = Field(default=None, description="Icon for the provider")
icon_dark: str | None = Field(default=None, description="Dark theme icon for the provider")
error: str | None = Field(default=None, description="Error message if segment failed")

View File

@ -1720,6 +1720,7 @@ class LLMNode(Node[LLMNodeData]):
# Generate model provider icon URL
provider = self._node_data.model.provider
model_name = self._node_data.model.name
model_icon = self._generate_model_provider_icon_url(provider)
model_icon_dark = self._generate_model_provider_icon_url(provider, dark=True)
@ -1734,6 +1735,7 @@ class LLMNode(Node[LLMNodeData]):
tool_calls=list(buffers.pending_tool_calls),
),
provider=provider,
name=model_name,
icon=model_icon,
icon_dark=model_icon_dark,
error=error,
@ -1848,6 +1850,7 @@ class LLMNode(Node[LLMNodeData]):
output=result_str,
),
provider=tool_provider,
name=tool_name,
icon=tool_icon,
icon_dark=tool_icon_dark,
error=str(tool_error) if tool_error else None,