Productionized Internal ToolWorkflow AutomationFile-to-Code Conversion

ASC Merge & C Code Generator

A reusable internal tool that turned manual configuration-file handling into a guided workflow.

AI Application Engineer2026/05PixArt

File-to-Code Tool · Open WebUI Pipeline

Open WebUI ToolRaw-Byte FallbackDownloadable C Export
  1. 01

    Upload ASC

    Single or Multi-File

  2. Tool Call02

    asc_read

    CP950 / Big5 / UTF-8

  3. 03

    Ordered Merge

    Append Init Sequence

  4. 04

    Generate C

    Confirmed Output Format

  5. 05

    asc_export

    .c & Merged .asc

  6. 06

    Nginx Link

    Direct Artifact Delivery

Native Open WebUI tool calling prevents preview garbling and delivers ready-to-download C & ASC artifacts.

6-Encoding Fallback · Nginx Delivery
Workflow overview. Some names and data are anonymized or recreated for confidentiality.

Before

SD users had to manually merge RD-provided ASC files, fix encoding issues, preserve comments, and then turn the result into C initialization code by hand.

After

Packaged the ASC merge and C code conversion process into a reusable internal tool, helping the SD team turn a manual configuration-file workflow into a guided, confirmable, and downloadable standardized process.

Context & Background

  • SD users regularly received one or more ASC configuration files from RD teams and needed to convert them into usable initialization code.
  • The work was repetitive, but it still required careful handling of file order, comments, Chinese annotations, and output format details.

Constraints

  • Open WebUI preview text could not be trusted when files used CP950, Big5, or other legacy encodings.
  • The workflow had to behave differently for single-file versus multi-file cases without forcing users through unnecessary steps.

Problem Solved

  • Manual ASC merging was slow, error-prone, and easy to break when file order or repeated addresses mattered.
  • Chinese comments and RD notes could become garbled or disappear when relying on preview text instead of raw file bytes.
  • Users needed real output files, not a chat response that forced them to copy generated C code manually.

My Role

  • The full interaction flow, supporting Open WebUI skill behavior, and file-processing tool boundaries were defined as one coherent workflow.
  • I implemented the Python tools for raw-byte ASC reading, encoding fallback, and export generation inside the internal environment.

System Design

  • Used Open WebUI native tool calling so the LLM could read uploaded ASC files through asc_read, reason over normalized content, and write outputs through asc_export.
  • Integrated Nginx static hosting with exported files so the final result was delivered as downloadable artifacts instead of long code pasted into chat.

Implementation Highlights

  • Developed asc_read to decode uploaded file bytes with UTF-8, UTF-8-SIG, CP950, Big5, GB18030, and Latin1 fallback handling.
  • Developed asc_export to emit downloadable C files and optional merged ASC files through the internal download service.
  • Added conditional logic for single-file and multi-file workflows, plus append-based merge behavior to preserve initialization sequence.

Outcome & Impact

  • Reduced manual merging and conversion effort for SD users handling RD configuration files.
  • Made the workflow more reliable by preserving annotations, merge order, and downloadable output behavior inside one repeatable tool.

Tech Stack

Open WebUIPythonNative Tool CallingNginxDocker Compose