Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Generative AI Features to DartPad (#3135)
* WIP: generate new snippet * WIP: gemini * added Suggest Fix from AI feature * feature: generate code * TODOs * refactoring the generative model instructions and filtering out stray Markdown code blocks * tweaks to the API key management * test and dep tweaks * Fix issues after merge with main branch * Add suggestFix * initial support for streaming response * used fetch_client on the web to enable client-side streaming results in chunks * adding note about why we're using fetch_client * replace NOTEs with TODOs when bug fixes lang * cleanup before refactoring PromptDialog * streaming code - end-to-end * show generated code as it's generated * refactor to make suggestFix streaming * tweak * streaming fix suggestions * show the OK buttons as disabled when it's not time to press them * a little bit of UI cleanup and code refactoring * migrated to http v1.3.0 and removing FetchClient * UI tweak * tweaks * added support for updating existing code * end-to-end support for image attachments * added a max attachment number we can adjust later (started at 3) * updated to show items in true reverse order in the attachment list * image attachment zoom * tweak * add cmd+enter and ctrl+enter to the prompt dialog * run grind build-storage-artifacts * fixed updateCode and other tweaks * gemini menu updates * dialog polish * fixed where the Gemini tagline goes * give the dialogs edges in dark and light mode * disable gzip to enable client to get content as it's available * limiting packages in system instructions; added fix suggestions to the console * system instructions tweak * adding a gzip not * enable auto-run from the generate code dialog * show quick fixes button next to the suggest fix button if analyzer says there's a fix for an issue * remove unneeded editor services method * added diff on update or suggest fix * fixed an async scrolling issue * console crash and dark mode diff view support * another attempt to fix the console scroll crash; fixup ReadOnlyDiffWidget for keyboard shortcuts * tweak * added preset prompt buttons and a means for saving and restoring the user's last prompt * show quick fix action button (lightbulb) next to suggest fix action button (spark) in each error line in the problems area. * WIP: generate/update code based on Flutter | Dart * allow the user to decide between Dart and Flutter when generating and update code * tweak * license header fixes * review feedback updates * updated model to released gemini-2.0-flash * gen-ai build/run-time switch * simplified gen-ai feature enablement * Update .gitignore Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com> * Update pkgs/dart_services/lib/src/common_server.dart Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com> * fix compile error * updated system instructions to prevent spurious output * update stable deps * WIP: applying feedback * workaround for #3148 that shows/hides the Suggest Fix button in the console based on the error state of the app * set appType in Update Code dialog based on current code; add separate prompts for Dart/Flutter. * use appType in suggest fix as well; avoid Dart programs being turned into Flutter programs * fixed focus such that Cmd+Enter/Ctrl+Enter work on Prompt and Generate dialogs * updated cleanCode to assume code inside markdown dart code block * updated based on copilot feedback * fixing conflicts * fixing another conflict * fixing another conflict? --------- Co-authored-by: John Ryan <ryjohn@google.com> Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
- Loading branch information