Need advice: architecture & team structure for a natural-language AI MicroPython builder (web vs VS Code extension) #19412
leezisheng
started this conversation in
General
Replies: 1 comment 5 replies
-
|
Hi, Below is a simple translation script that might help you and others interested in your work. #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# translate_md_file.py
import os
import re
import sys
import argparse
from googletrans import Translator
parser = argparse.ArgumentParser()
parser.add_argument('inn')
parser.add_argument('out')
args = parser.parse_args()
print(f'File-in: {args.inn}, File-out: {args.out}')
# Initialize translator
translator = Translator()
# Regex to detect any CJK Unified Ideographs (commonly used Chinese characters)
CHINESE_CHAR_RE = re.compile('[\u4e00-\u9fa5]')
def contains_chinese(text):
return bool(CHINESE_CHAR_RE.search(text))
def translate_text(text):
if text is None:
return ''
elif not contains_chinese(text):
return text
try:
# Translate from source language (automatically detected) to English 'en'
result = translator.translate(text, dest='en')
return result.text
except Exception as e:
print(f"Translation error: {e}", file=sys.stderr)
return text
def translate_file():
# Read file with utf-8, ignoring errors for safety
with open(args.inn, "r") as r, open(args.out, "w") as w:
for line in r.readlines():
translated = translate_text(line)
if translated != '' and len(translated) > 1:
w.write(translated + '\n')
translate_file()Simply run the script in a directory. For example: $ python3 translate_md_file.py README.md EN_README.md |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Body:
Hey everyone,
I’m working on an LLM-powered tool that turns plain natural language prompts into complete, flashable MicroPython hardware projects — full pipeline from requirement parsing, component selection, pin mapping, code generation, wiring diagrams to one-click device flashing.
The core Skill pipeline and long-running workflow protocol are already built. We’re currently evaluating two product paths and would really appreciate input from anyone who’s built similar developer tools:
I’m stuck on technical roadmap and team structure, and have a few specific questions:
Repo links for full context:
Any thoughts, hot takes or warnings are all welcome. Thanks a ton!
Beta Was this translation helpful? Give feedback.
All reactions