Commit Graph
19 Commits
Author SHA1 Message Date
Zamil Majdyandmajdyz 2eb25f909d [AGPT-688] NiceGUI Prototype (#220)
This is a very early prototype of the front-end code generation.

The current implementation is still super basic, but the idea is to evaluate early if this is possible. The hypothesis is if we can build a small fully working UI component, we can utilize more sophisticated agentic prompting.

I created a video of the quick run-through of the code and how to test it https://www.loom.com/share/b331582fa2694ece8594c00ae78c71e5?sid=59b6baa6-ca9b-4f46-bb7e-76a82b1fce98

These are the possible next steps:
https://www.notion.so/auto-gpt/Front-end-Codex-Plan-abf6c1d990104d23b758960cbaea26f9

---------

Co-authored-by: majdyz <[email protected]>
2024-04-26 22:37:36 +07:00
Nicholas Tindle dfa0f3a820 Raise Enhancements up to the level of the prompts (#226)
* feat: raise the validations up

* feat: add error enhancements to the AI Block

* fix: extract the TODO_COMMENT to the constants

* fix: move ErrorEnhancements

* fix: move TODO_COMMENT

* feat: add interview ID to the log

* feat: enhancement is used in system prompt

* fix: imports in the gen_test

* feat: add decimal support

* fix(develop): don't error when the only issue is llm errors
2024-04-23 13:21:57 +01:00
Nicholas Tindle bb6a39cea4 feat(code_validation): improve debug logging (#217) 2024-04-16 15:11:31 -05:00
Nicholas Tindle ab1b79a520 fix: less verbose logging and disable context (#214)
* fix: less vrebose logging and disable context

* fix: comment

* fix: inteview

* fix: interview pt 2

* fix: formatting
2024-04-15 18:16:45 -05:00
Nicholas Tindle 4c7c7c8864 Add Introspection to errors from importing libraries by pulling the file and providing it as context (#194)
* fix: regex

* feat: naive fuzzy match

* feat: naive fuzzy match

* feat(prompts): add context to the prompt

* fix(prompt): improve language

* fix(error_enhancements): copy paste typos and small missed logic bugs
2024-04-15 21:10:55 +01:00
Toran Bruce Richards ee66794d05 Add case for "reportPrivateImportUsage" "X is not exported from module Y" to enhanced error messages (#208)
* Add handling of "reportPrivateImportUsage" error to error enhancements

* refactor(error_enhancements): Improve code structure and readability

- Extract common error enhancement logic into separate functions

* Fix error in error_message extraction
I had previously extracted non-generally applicable functionality to a function. This undoes that.

* Run ruff linter

* Remove typo in enhance_error function declaration.

* Fix type hint in enhance_error function declaration to allow return dictionary values to be None.

* Fix type hint in enhance_error function declaration to allow return dictionary values to be None.

* Formats code_validation.py with Ruff
2024-04-15 17:45:09 +01:00
c1ff29e810 Add DoccumentationExtractor AIBlock (#205)
* Add DoccumentationExtractor AIBlock

* Move prompt files to correct folder.

* Update message referencing "Metadata" to "doccumentation"

* Runs automatic formatter

* feat(doc_block): in progress error grabbing

* fix: missed await

* fix: notation

* fix: linting

* Fix missing function_id error handling in code_validation.py

* Update `error` variable name in code_validation.py and related templates to `full_error_message`

---------

Co-authored-by: Nicholas Tindle <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>
2024-04-15 15:57:16 +01:00
Nicholas Tindle ca85e40a48 Allow fastapi.UploadFile as a type plus minor bug fixes (#197)
* feat: first go of UploadFile

* fix: fixes to main and quietly publishing to gh for now
* fix(deploy): add note to create the repos on dev env in private
(because people were contacting us about the publicly created agpt-coder repos)

* fix(deploy): Do not log created GitHub repo URL with token

* feat(requirements, develop): Add fastapi.UploadFile as available built-in type

* fix(requirements): Allow list for authorization_roles while refining requirements
2024-04-10 10:58:43 -05:00
Zamil Majdyandmajdyz 93c538c5d0 Avoid using corrupted env files by moving the parent dependency folder for linting out of TMP (#196)
Changes:
* Avoid using corrupted env files by moving the parent dependency folder for linting out of TMP.
* Add stricter env existence check (check all the required executables: pyright prisma virtualenv-clone).
* Fix execution bug due to migrating from str -> Path.
* Fix unrelated error on code-validation.
* Add `-I` on pip install for installing linting deps to fix corrupted installations.
---------

Co-authored-by: majdyz <[email protected]>
2024-04-09 09:01:43 +07:00
Reinier van der Leer 38f8686adf Use pathlib to simplify code (#172)
* refactor(common, develop/validate): Use `pathlib` to clean up file writing & path processing

* refactor(deploy): Use `pathlib` to clean up file operations
2024-04-08 11:21:37 +02:00
Zamil Majdyandmajdyz 4f18df891d [AGPT-621] Moving on with code generation with a buggy code (Ruff - PyRight failure) -- Improve TODO comments (#187)
---------

Co-authored-by: majdyz <[email protected]>
2024-04-05 12:33:11 +02:00
Zamil Majdyandmajdyz dc3afe62a6 [AGPT-621] Moving on with code generation with a buggy code (Ruff - PyRight failure) (#181)
To prevent frustrated tester, we should let buggy code to be generated instead of failing the project generation (if it failed on the linter) by appending a # TODO line on the code.

---------

Co-authored-by: majdyz <[email protected]>
2024-04-04 18:11:47 +02:00
Nicholas Tindle 666e28a3f4 Add support for enhancing errors with context aware details (#180)
* fix: minor annoyance

* feat: v1 of error enhancement

* feat: refactor the initial implementation

* fix: linting 🙄

* feat: more loggin

* nit: typehinting
2024-04-04 18:11:47 +02:00
Reinier van der Leer 228eb2b892 fix(develop/validation): Raise log level for failed validation during code reformatting 2024-03-29 06:57:24 +01:00
Zamil Majdyandmajdyz 7f2732bb6b Add json validation error on pyright (#158)
Add json validation error on pyright

---------

Co-authored-by: majdyz <[email protected]>
2024-03-27 16:02:01 +01:00
Zamil Majdyandmajdyz 0df3d5dd22 Add some stability patches (#148)
Changes:

prisma format
Suppress linting error on reformat_code command.
Update exception error messages
Add code validator test
Make reformat_code maintain code line ordering 

---------

Co-authored-by: majdyz <[email protected]>
2024-03-25 22:53:15 +07:00
Zamil Majdyandmajdyz fa72f11b22 [AGPT-580] Support async subprocess execution (#145)
Subprocess execution implementation (for Ruff & PyRight) is currently a blocking call. This doesn't work well with the event-loop used by the fastapi.

Scope:

Make AiBlock.validate async
Make subprocess execution async.

---------

Co-authored-by: majdyz <[email protected]>
2024-03-25 18:22:18 +04:00
d379a0c363 [AGPT-571] Integrate PyRight (#141)
Integrating PyRight project-based code-linting. This will allow us to detect:
* Misuse of async functions.
* Misuse of optional type and other annotated types (currently disabled)
* Wrong usage of pydantic and prisma model.
* Wrong usage of third-party library.
* Use of undeclared field
* Use of uninstalled third-party library (which will prompt LLM to add the requirement list)

Known trade-off:

Setting-up PyRight requires building a full-project (generate the Prisma model code, installing 3rd-party library, compiling the function with the object dependency) this slows down the code-validation during the code-validation step.

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: SwiftyOS <[email protected]>
2024-03-22 16:51:47 +04:00
Zamil Majdyandmajdyz 92416fadac [AGPT-556] Overhaul code-validation design + Add PyRight in commented mode (#139)
This is a large but a much needed change to allow more sophisticated static code analysis to be added.

PyRight (used by pylance) will allow us to detect:

Misuse of async functions.
Misuse of optional type and other annotated types.
Wrong usage of pydantic and prisma model.
Wrong usage of third-party library.
The overhaul is required to allow us retrying while fixing the code as a project (not only as a function) and allow us to keep adding non-LLM fixes to it so that we can avoid wasting the retry.

The scope of this PR is still a refactoring and the adding of the PyRight linter, so this PR try to keep the existing behaviour.
The enablement and more tuning on the linter will be done in the followup PR.

---------

Co-authored-by: majdyz <[email protected]>
2024-03-21 13:28:17 +04:00