feat: swanlab.html() type#1667
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces HTML support by adding COLUMN_TYPE_HTML and CHART_TYPE_HTML to the protobuf definitions, and updates the generated Go and Python protobuf files. As there are no review comments, I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
3792c15 to
870601b
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for logging HTML data in SwanLab by introducing Html and log_html to the SDK, updating protobuf definitions with HTML column and chart types, and implementing MIME-type detection during media uploads. The feedback focuses on improving the robustness of the HTML parsing logic, specifically handling potential OSError or ValueError exceptions when checking long raw HTML strings as paths, verifying that input paths are files rather than directories, safely handling non-seekable or binary file-like objects, and ensuring atomic list updates during media upload preparation to prevent list length mismatches.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Description
Add
swanlab.Htmlmedia type for logging HTML content during experiments.Changes
New media type:
Htmlswanlab/sdk/internal/run/transforms/html/—HtmlTransformMedia implementationstr/pathlib.Path), file object (TextIO), and nesting (HtmlwrappingHtml)captionparameter (consistent withImage,Audio, etc.){step:03d}-{sha256[:8]}.htmlswanlab/sdk/typings/run/transforms/html.py—HtmlDataType/HtmlDatasTypetype aliasesPublic API
swanlab.Htmlclass exported fromswanlab/sdk/__init__.pyswanlab/__init__.pyi— full type stub with English docstringProto
protos/swanlab/metric/column/v1/column.proto—COLUMN_TYPE_HTMLenum valuemake proto)Usage