Skip to content

Prototype LLM Feature in the CircuitPython web editor - #605

Draft
makermelissa wants to merge 2 commits into
circuitpython:betafrom
makermelissa:prototype-ask-ai
Draft

makermelissa wants to merge 2 commits into
circuitpython:betafrom
makermelissa:prototype-ask-ai

Conversation

@makermelissa

@makermelissa makermelissa commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The code in this pull request was generated by OpenAI Codex.

This draft explores an AI Feature panel for the CircuitPython web editor. It relates to #604 and runs in a loopback-only development mode with OpenAI or Claude keys stored locally.

  • Add a responsive AI panel with resizable separators, saved visibility, and a model picker grouped by family. Model and effort choices are remembered.
  • Apply generated Python to the editor, with a stop button, keyboard shortcuts, and an undo action.
  • Use the built-in Python formatter and open the standard Save As dialog with a suggested filename. The user confirms the save through the existing dialog.

Try it locally

Run npm run dev:ai, open the local editor, add a provider key in Settings, and open the AI panel. Applying a request sends the prompt and current Python buffer to the selected provider.

Validation

  • Production-mode Vite build.
  • All 38 Ask AI tests, using synthetic keys and mocked provider responses.
  • Loopback development server smoke test with a simulated board proxy.
  • Chrome prototype checks for phone-width layouts, formatting and undo, and Save As prefill, cancellation, and saving to a simulated board.

@makermelissa makermelissa changed the title Prototype Ask AI in the CircuitPython web editor Prototype LLM Feature in the CircuitPython web editor Dec 3, 2026
@tannewt

tannewt commented Dec 3, 2026

Copy link
Copy Markdown
Member

Got a screenshot of this? I really think we should go AI first and only view code to comment on specific parts of it like crit.md does.

@makermelissa

Copy link
Copy Markdown
Collaborator Author

Got a screenshot of this? I really think we should go AI first and only view code to comment on specific parts of it like crit.md does.

Sure:
Screenshot 2026-12-04 at 12 18 45 PM
Screenshot 2026-12-04 at 12 18 51 PM

@makermelissa

makermelissa commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator Author

I think the editor should also work without AI for folks who don't have it set up and this approach does that. The only downside to this approach is that users would need to add API keys for each device because it's stored on the device itself.

@makermelissa

Copy link
Copy Markdown
Collaborator Author

If you think we should take a different approach, then I'm all for it. I just wanted to start by getting something up that worked.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants