Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def convert_simplified_to_full(
"from_name": "label",
"to_name": "image",
"type": "choices",
"value": {
"values": {
"choices": ["cat", "dog"]
}
}
Expand Down Expand Up @@ -144,7 +144,7 @@ def convert_simplified_to_full(
"from_name": from_name,
"to_name": to_name,
"type": control_type,
"value": {
"values": {
control_type: values
}
}
Expand All @@ -167,7 +167,7 @@ def is_simplified_format(self, tag: Dict[str, Any]) -> bool:
# Simplified format has 'values' at top level and no 'type' field
has_values = 'values' in tag
has_type = 'type' in tag
has_value = 'value' in tag
has_value = 'values' in tag

# If it has 'values' but no 'type', it's simplified
# If it has 'type' and nested 'value', it's already full format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ async def update_file_tags_partial(

如果提供了 template_id,会自动将简化格式的标签转换为完整格式。
简化格式: {"from_name": "x", "to_name": "y", "values": [...]}
完整格式: {"id": "...", "from_name": "x", "to_name": "y", "type": "...", "value": {"type": [...]}}
完整格式: {"id": "...", "from_name": "x", "to_name": "y", "type": "...", "values": {"type": [...]}}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docstring example for the full tag format uses "values": {"type": [...]}; in the actual converter the nested dict key is the control type value (e.g., "choices", "rectanglelabels"). Consider updating the example to something like "values": {"<type>": [...]} to avoid misleading callers.

Suggested change
完整格式: {"id": "...", "from_name": "x", "to_name": "y", "type": "...", "values": {"type": [...]}}
完整格式: {"id": "...", "from_name": "x", "to_name": "y", "type": "...", "values": {"<type>": [...]}}

Copilot uses AI. Check for mistakes.

Args:
file_id: 文件ID
Expand Down
Loading