Commit Graph
127 Commits
Author SHA1 Message Date
Nicholas Tindle af572a5caa Allow changes to Spec (#272)
* feat: initial implementation of post endpoints, non working due to circular dependency

* fix: linting

* fix: recursive import

* feat: refactor to support module additions

* feat: fix up add route endpoint, move models to api layer

* feat: add deletes
2024-05-24 07:34:46 -05:00
Aarushi 08d1e5167e update to gpt4o (#273)
* update to gpt4o

* adding prompots dir
2024-05-17 11:59:56 +01:00
Swiftyandcodiumai-pr-agent-pro[bot] dcbfe2dc01 feat: create single function (#269)
* feat: create single function

* update prompts to disable database stuff when no database schema is passed

* added abilty to test function endpoint

* feat: add write_function_sepec endpoint

* del tmp json file

* Updated endpoints

* changed function routes to a functions group

* Update codex/develop/agent.py

Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>

* feat: add FunctionResponse return type to write_function endpoint

* unified endpoints

* fixed pr agents error

---------

Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
2024-05-11 08:49:20 +02:00
Zamil Majdyandmajdyz 803b015f98 [AGPT-714] Implement inter-page linking on front-end page decomposition by prompting (#263)
## **User description**
Changes:
* Hint the UI page generation with its connection to another pages.
* Add validation on the page connection prompting
* Cleaner auto import on missing function and missing object (remove wildcard, import only the missing part). on missing object we try to find the related function and import the file that hosts that function (only support the object type referred by the ApiRouteSpec, it can still be improved).

Out of scope:
* Validation of ui.link and page connection (if LLM hallucinate the page on `ui.link`, we are not failing this yet!)


___

## **Type**
Enhancement, Bug fix


___

## **Description**
- Enhanced code validation to include checks for `ui.link` usage and ensure it references valid functions.
- Improved import handling in `__fix_missing_imports` by adding async fetching of functions related to object types and better error message integration.
- Added a new database function `get_object_type_referred_functions` to fetch functions related to an object type.
- Updated `PageDecompositionEntry` to use a dictionary for `used_functions` to include descriptions, and added `PageConnection` model for describing connections between pages.
- Enhanced validation in `PageDecompositionBlock` to include checks for main function naming, existence of a home page, and valid page connections.
- Updated Jinja2 template example to reflect new features in page decomposition, including detailed function usage and page connections.



___



## **Changes walkthrough**
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement
</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>code_validation.py</strong><dd><code>Enhance Code Validation and Import Handling</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>
      
codex/develop/code_validation.py

<li>Added validation for <code>ui.link</code> usage in function code to ensure it <br>references valid functions.<br> <li> Enhanced the <code>__fix_missing_imports</code> function to handle missing imports <br>more accurately, including async fetching of functions related to <br>object types.<br> <li> Improved error handling by appending problematic lines to error <br>messages.<br>


</details>
    

  </td>
  <td><a href="https://github.com/Significant-Gravitas/codex/pull/263/files#diff-deae541000e158a1fc146c31004d52ed52a858802dd058803d920d97477071d6">+35/-10</a>&nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
      <summary><strong>database.py</strong><dd><code>Add Database Function for Object Type Function Fetching</code>&nbsp; &nbsp; </dd></summary>
<hr>
      
codex/develop/database.py

<li>Added a new function <code>get_object_type_referred_functions</code> to fetch <br>functions related to an object type.<br>


</details>
    

  </td>
  <td><a href="https://github.com/Significant-Gravitas/codex/pull/263/files#diff-61c5f5198f842fcc472b6b31ee2e5a53eac489a88152cbc792895f1f9d60f694">+23/-1</a>&nbsp; &nbsp; </td>

</tr>                    

<tr>
  <td>
    <details>
      <summary><strong>ai_page_decompose.py</strong><dd><code>Enhance Page Decomposition with Detailed Function Usage and Page </code><br><code>Connections</code></dd></summary>
<hr>
      
codex/requirements/blocks/ai_page_decompose.py

<li>Updated <code>PageDecompositionEntry</code> to use a dictionary for <code>used_functions</code> <br>to include descriptions.<br> <li> Added <code>PageConnection</code> model to describe connections between pages.<br> <li> Enhanced validation in <code>PageDecompositionBlock</code> to include checks for <br>main function naming, existence of a home page, and valid page <br>connections.<br>


</details>
    

  </td>
  <td><a href="https://github.com/Significant-Gravitas/codex/pull/263/files#diff-0539cf8ae85457e8d87308e181529144d8f564ad2453eabecc509b4f02c4abe2">+55/-9</a>&nbsp; &nbsp; </td>

</tr>                    
</table></td></tr><tr><td><strong>Documentation
</strong></td><td><table>
<tr>
  <td>
    <details>
      <summary><strong>system.j2</strong><dd><code>Update Example to Demonstrate Enhanced Page Decomposition Features</code></dd></summary>
<hr>
      
codex/prompts/gpt-4-turbo/requirements/page_decompose/system.j2

<li>Modified the example to reflect changes in the <code>PageDecompositionEntry</code> <br>model using a dictionary for <code>used_functions</code>.<br> <li> Added <code>connections</code> field to demonstrate inter-page linking in the <br>example.<br>


</details>
    

  </td>
  <td><a href="https://github.com/Significant-Gravitas/codex/pull/263/files#diff-c081d45d8aa12144bab35cca95d5b45f35e7a380a84e71632b1d425d9a712f6c">+26/-11</a>&nbsp; </td>

</tr>                    
</table></td></tr></tr></tbody></table>

___

> ✨ **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions

---------

Co-authored-by: majdyz <[email protected]>
2024-05-03 16:26:31 +07:00
Aarushi 2a6ec33a30 First iteration of tracing (#267)
* First iteration of tracing

* fixing linting

* add to Dockerfile
2024-05-02 11:24:07 +01:00
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
Swifty c9dd563589 [AGPT-707] Added in failed state and an on failed called (#245)
* Added in failed state and an on failed called

* pr comments

* Refactor logging in DevelopAIBlock class

* Refactor logging in DevelopAIBlock class

* Refactor logging in DevelopAIBlock class
2024-04-25 14:47:23 +02: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
Swifty b472a58422 Req Update Fixes (#225)
* PR Coments

* Fixed db issue

* Add async main function to database.py

* fixed linting errors

* fixed linting errors

* fixed linting errors

* fixed linting errors

* more linting

* formatting
2024-04-22 10:32:40 +02:00
Swifty 7f3a17948d [AGPT-678] Ensure requirements systems creates what user requested (#216)
* Add InterviewBlock class and model definitions

* Updated the interview process

* new interview integrated with the requirements system

* updated prompt

* fix

* tweaking prompt

* delete simple agent

* change from my personal discord id to another

* fix prompts

* Add reference to the prompt in validation error message

* return feature functionality

* fix regerssion

* updated prompt

* Fix default values in InterviewStep table

* Pr comments

* Updating the requirements flow

* progressing the requirements system

* Updated requirements system

* Fix typo in variable name

* Propogating changes to develop

* Add print_interview and print_spec_summary functions***
***Implement explore_database function***
***Update module_routes/user.j2 template***
***Refactor generate_requirements and define_module_routes functions

* Add gpt-4-turbo model and new prompt templates

* Add unique constraint to repo field

* Update debug print statements and remove unnecessary migration files

* Add migrations

* isort

* Add note about allowed_access_roles in user.j2

* [AGPT-691] Clean up old unused requirements code (#218)

* delete old code

* [AGPT-693] Add back access level (#219)

* Added back access level

* Update migrations

* Delete comment

* Updated where access level is defnined.

* Add interactions

* updated migrations
2024-04-18 15:35:33 +02: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
Swifty af7b56d6c5 Change ENV to DEV_ENV (#190)
* Change ENV to DEV_ENV

* Defaults are always prod configuration
2024-04-08 11:12:51 +00: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
Zamil Majdyandmajdyz a9c6c41771 [AGPT-594] Introduce Event Logging (#169)
* Introduce event logging, captured event: All non-Get HTTP operations.
* Refactor routes.py on each API: removed redundant try-catch for unknown exception, use JsonResponse
* Fix broken api_test.py due to DB seeding being removed.

---------

Co-authored-by: majdyz <[email protected]>
2024-04-04 18:11:47 +02:00
Reinier van der Leer 5a70fd60ad fix(compile): Fix server DB schema generation & code fixing mechanism (#171)
Apparently the generated DB schema is duplicated across every `CompiledRoute`.
Combining the schemas of N routes with M tables will result in N-fold duplication and `prisma generate` failure.
In turn, this breaks code fixing for server.py, resulting in broken deployments.

Tempfix, applied in this commit: use the schema from only one of the `CompiledRoutes`.
Long-term fix: clean up Codex' DB structure.
2024-03-29 20:50:23 +07:00
Zamil Majdyandmajdyz 38afbf3d4f [AGPT-566] Improve function signature in prompt by providing arg and return description from the generated function (#151)
Fixing the promised Todo on parsing the description on generated function
---------

Co-authored-by: majdyz <[email protected]>
2024-03-29 15:30:41 +07:00
Reinier van der Leer 0b6a3ef8ed fix(compile): Fix requirements resolution for hardcoded project dependencies (#167)
The hardcoded dependencies `fastapi`, `pydantic`, `uvicorn` and `prisma` need special treatment,
because if they are included in the `packages` of a generated function,
those requirements are not scrutinized during code validation, allowing invalid versions.
2024-03-29 14:45:35 +07: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
Reinier van der Leer 839ae23101 fix(compile): Resolve multiplicate dependencies -> fix static code analysis (#161)
- Move resolution of multiplicate dependencies from deploy to compile
- Rename `generate_requirements_txt` to `requirements_txt_from_packages`
2024-03-28 10:02:58 +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 Majdy bcd91ad2cb fix(compile): Fix propagation of Packages (#152) 2024-03-26 15:53:02 +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
Swifty b19c426946 [AGPT-547] Systematic prompt template perfomance tool (#144)
* Update Interview and LLMCallAttempt models

* Refactor LLMCallAttempt model

* Refactor code and update logging IDs

* Refactor AIBlock class and handle exception in start_interview

* Add template analytics

* Refactor analytics.py to use get_template_performance() instead of load_data()

* Add migration lock file and analytics functionality

* Pr coments

* Add model field to AIBlock and LLMCallTemplate
2024-03-22 10:58:28 +01:00
Swifty 885153d7fe Refactor route_decorator in compile.py (#143) 2024-03-21 11:44:46 -05: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
Zamil Majdyandmajdyz 78222a5f83 [AGPT-522] Fix Object serialization with additional methods (__init__, repr, and helper functions) (#134)
Lookup on the existing database table is already implemented, but this bug sometimes can get in the way.

---------

Co-authored-by: majdyz <[email protected]>
2024-03-19 17:01:01 -05:00
SwiftyOS 90a319667e formatting 2024-03-18 16:54:18 +01:00
Swifty 675c30cc89 [AGPT-550] Issues in prisma schema generation (#128)
* Fix error handling in exec_external_on_contents function

* Add new models and update existing model in database schema

* Delete User-related models and enums

* Update code block delimiter in DatabaseGenerationBlock

* Refactor code for DatabaseEnums and DatabaseTable classes, and exec_external_on_contents function

* fix test

* Fix exec_external_on_contents function calls

* formatting

* Add database schema implementation requirements
2024-03-18 16:50:31 +01:00
Swifty f5034615fe [AGPT-552] fix type hint errors (#127)
* Fix function template and add validation for required fields

* Add pytest hook to .pre-commit-config.yaml

* Update pytest configuration to pass filenames and include only .py files
2024-03-18 14:49:13 +01:00
Zamil Majdyandmajdyz b93f0f6579 [AGPT-533] Auto fix Optional type and missing imports on DB schemas (model & enum), Python types (#124)
* [AGPT-533] Fix Optional type handling, add default None value

* Add auto fix prisma models and enums

* Make test happy

* Make test happy

* Replace typing list with the original typing list

* Revert prevCallId

* Revert prevCallId

* Add more auto imports

* Fix gen_test

---------

Co-authored-by: majdyz <[email protected]>
2024-03-18 15:17:09 +04:00
Swifty cb25c72868 [AGPT-465] update imports to use full paths not just the functionobj (#126)
* Add migration lock file and update compile_test.py and compile.py

* Fix issue with arg type replacement in compile.py

* Remove migration_lock.toml file

* Add full import path to custom types in compile.py

* Change logger.warning to logger.debug in compile.py

* Refactor normalize_type function to support renamed types
2024-03-18 11:33:26 +01:00
Swifty 9ede19b8d1 [AGPT-549] mistake in developcompilepy (#123)
* Remove unnecessary code in get_object_field_deps function

* Refactor get_object_field_deps function to skip processing certain field types

* Change logger.info to logger.debug in get_object_field_deps function
2024-03-18 09:14:37 +01:00
SwiftyOS cf574b739a Fixing code generation errors 2024-03-17 17:57:36 +01:00
27f5e70f91 [AGPT-545] Find & Replace prisma entity with a fully qualified names (#122)
* [AGPT-545] Find & Replace prisma entity with a fully qualified names

* Ruff

* Revert

* Make lint happy

* Fix static code analysis issues and import statements

* Remove unnecessary logger.info statement

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: SwiftyOS <[email protected]>
2024-03-17 16:59:05 +01:00
6995f6c457 Dev -> Master Batch 1 Part 1 (#109)
* Route schema changes

* Delete ruff.config.json

* save current changes

* style fixes by ruff

* Add class parsing capability

* Fix bugs

* Address comments

* Fix benchmarks

* Fix benchmarks

* Fix benchmarks

* Add comments

* fixing types

* Add error handling and status messages for application creation

* Refactor fetch_deliverable function and update application creation status

* Refactor benchmark output formatting

* Remove unnecessary print statement in fetch_deliverable function

* Propagate DB schema changes: Function <-> CompiledRouteSpec (#65)

Propagate DB schema changes: Function <-> CompiledRouteSpec (#65)

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: Swifty <[email protected]>
Co-authored-by: majdyz <[email protected]>

* emoved broken hardcoded requirements

* Add benchmarking functionality

* Update branch restrictions in GitHub workflows

* Add pytest-cov to dependencies

* Update ruff formatter command to include --check option

* Update workflow names

* Refactor code formatting and fix indentation issues

* Update Python dependency caching and installation process

* Add Prisma client generation step to CI workflow

* Refactor test_process_object_type to use async/await

* Add pytest and ValidationError imports, update arg_types assertion, and add test for ValidationError

* Remove unused imports and commented code

* Add logger to OpenAIChatClient class

* Add async context manager for database connection and disconnection

* Add blank line for readability

* Refactor function_def.arg_types assignment in ast_test.py

* mark integration tests

* Update test workflow name

* Add OpenAI API key configuration

* Better Types for Requirements Request/Response (#76)

Better Types for Requirements Request/Response

---------

Co-authored-by: majdyz <[email protected]>

* [AGPT-474] End-to-end Benchmark (#77)

* Remove unnecessary fetch_deliverable calls and update invoice_generator_requirements

* Fix typo in hardcoded.py

* Add missing app IDs and interview IDs for calendar booking, inventory management, and invoicing systems

* Add options to benchmark and example commands

* Refactor benchmarking code and add new functions

* Add task description method to ExampleTask enum

* Added end-to-end running

* Add hardcoded flag to filter examples in benchmark.py

* Refactor run_benchmark_example function to handle exceptions

* Fix error handling in specification routes

* Fix Function generation bug on nested object type (#79)

Co-authored-by: majdyz <[email protected]>

* Speeding up requirements system

---------

Co-authored-by: Zamil Majdy <[email protected]>
Co-authored-by: majdyz <[email protected]>

* Refactor code: Remove unused imports and clean up formatting

* [AGPT-478] Add Support for Composite Type with multiple Pydantic/nont-primitive classes (#78)

* [AGPT-478] Add support for multiple composite Pydantic objects

* Ruff Ruff!

* Fix failing test

* formatting

* fix populate-db command

* fix run all benchmarks

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: Swifty <[email protected]>

* Refactor package handling in packager.py (#81)

* [Fix] User provided app name being replaced (#82)

* Only make databases when required (#83)

* feat: make the name match

* feat: database becomes optional

* Update agent.py

* Integrate related types into the requirements system (#84)

* feat: make the name match

* feat: database becomes optional

* feat: initial model changes

* feat: add prompts

* feat: more prompts

* fix: nits

* fix: wrong type 😢

* feat: improved prompts

* Cleanup for field type (#85)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Improve type composite-type matching & extracting algorithm (#86)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Add Autogeneration of Typing import (#87)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Fix broken class compiling logic (#88)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Fix function fetching to always include RelatedTypes (#89)

[AGPT-489] Fix function fetching to always include RelatedTypes

---------

Co-authored-by: majdyz <[email protected]>

* fix lock file

* feat: endpoint updates (#95)

* feat: endpoint updates

* fix: ambiguous param

* [AGPT-486] Fix codegen generate code with missing pydantic object (#92)

Co-authored-by: majdyz <[email protected]>

* Fix retry prompt (#96)

Co-authored-by: majdyz <[email protected]>

* Allow benchmark on $PORT (#98)

* Ntindle/agpt 506 add a bit of debug tooling for requirements gen (#100)

* [AGPT-485] Fix missing pydantic object during requirement-step; leading to LLM to guess wrong signature (#97)

[AGPT-485] Fix missing pydantic object during requirement-step; leading to LLM to guess wrong signature

---------

Co-authored-by: majdyz <[email protected]>

* [AGPT-157] Add Database Integration Generation (#90)

* Added prisma client to server code

* Add DatabaseSchema to INCLUDE_FUNC

* Update functions to be async and add database schema documentation

* Add DatabaseSchema and DatabaseTables to ApiRouteSpec

* Updated dev prompts for db

* Update profile management descriptions

* Update route function definition to be async

* Remove logging of database schema

* Add Prisma schema file generation

* Refactor benchmark and agent modules

* Refactor code and comment out debug statements

* formatting

* Add available_functions to develop_route

* Update prisma import and method calls

* loading all related tables

* Refactor create_prisma_scheama_file function to handle cases with no database schema

* Fix async function call in packager.py

* Fix database table query in packager.py

* Fix database access and unnecessary imports

* review comments

* [AGPT-508] Enum support for Codex - Generation Logic Layer (#102)

Co-authored-by: majdyz <[email protected]>

* Add Enum Generation to Requriements (#101)

* Added prisma client to server code

* Add DatabaseSchema to INCLUDE_FUNC

* Update functions to be async and add database schema documentation

* Add DatabaseSchema and DatabaseTables to ApiRouteSpec

* Updated dev prompts for db

* Update profile management descriptions

* Update route function definition to be async

* Remove logging of database schema

* Add Prisma schema file generation

* Refactor benchmark and agent modules

* Refactor code and comment out debug statements

* formatting

* Add available_functions to develop_route

* Update prisma import and method calls

* loading all related tables

* Refactor create_prisma_scheama_file function to handle cases with no database schema

* Fix async function call in packager.py

* Fix database table query in packager.py

* Fix database access and unnecessary imports

* feat: add enums to the database gen

* fix: formatting

* Updated to new schema

* update hardcoded requirements

* fix: objectType generation without type bool

* Add database enum import statement

* removed unused var as failing lint check

---------

Co-authored-by: SwiftyOS <[email protected]>

* More Linting Issues Fixes (#99)

* fix: more linting issues

* Remove error log for async functions

* Fix return_type default value in FunctionDef class

* Added another validation check

---------

Co-authored-by: Swifty <[email protected]>

* [AGPT-463] Add code generation validation using Ruff (#103)

---------

Co-authored-by: majdyz <[email protected]>

* feat: extract external command on in memory code to a function with tests

* feat: prisma model parser

* feat: database test updates

now requires prisma to run

* feat: test for prisma accessible

* feat: update to use format and validate

Also saves the formatted and validated models in place

* fix: lint

* fix: remove unused variable

* feat: allow multiple generators

* .gitignore and .env.example (#107)

* feat: .env.example

* feat: gitignore

* fix: replace all bad chars with NOTHING

also fix the format string

* Add Database Docker Compose File (#108)

* feat: .env.example

* feat: gitignore

* fix: replace all bad chars with NOTHING

also fix the format string

* feat: add docker compose with only db

---------

Co-authored-by: Swifty <[email protected]>

* feat: remove vector requirement (#106)

* Fix lifecycle and prisma models and enums missing (#105)

* fix: add prisma model imports fro root level

* fix: reorder start code and add lifecycle

* Validate Database Generation (#104)

* feat: extract external command on in memory code to a function with tests

* feat: prisma model parser

* feat: database test updates

now requires prisma to run

* feat: test for prisma accessible

* feat: update to use format and validate

Also saves the formatted and validated models in place

* fix: lint

* fix: remove unused variable

* feat: allow multiple generators

* formatting

* Change logger.info to logger.debug in exec_external_on_contents function

* Update error logging in exec_external_on_contents function

* Update response model and route annotation in compile.py

* Force

* Ruff

* Fix Api route spec

* formatting

* Dont generate envexample passwords with symbols in them (#117)

* fix: don't use special chars in db password

* fix: linting

* [AGPT-540] Add missing initialization of available object types (#113)

* [AGPT-540] Add missing initialization of available object types

* [AGPT-540] Add missing initialization of available object types

* [AGPT-540] Add missing initialization of available object types

* Ruff

* allow non-annotated type checking

* Include all available function for ruff

* Fix tests

* Make DB work

* Make stubbing work

* Make papa-lint happy

* Ruffs

* Add prisma model validation layer

* Improve prisma querying by avoiding conflict

* Move on during failure formatting

---------

Co-authored-by: majdyz <[email protected]>

* main into dev (#118)

* Update setup guide.

* [AGPT-544] Vague 500 errors in interview stage (#115)

* Add error handling for user not found in database during interview step.

* Add error handling for app not found in database during interview step.

* Add error handling for interview not found in database during interview step.

* Add error handling for nonexistent questions in interview step.

* Add error handling for non-"ask" tool in user answers in interview step.

* Clarify comment describing interview next_step.

---------

Co-authored-by: Toran Bruce Richards <[email protected]>

* [AGPT-511] Resume running from any point (#114)

* Refactor populate_db function and add get_resume_points command

* Fix app ID reference in benchmark.py

* Add ResumePoint model

* Added runner funcitons to running codex from the cli

* Add application description field to ApplicationBase model and update create_app method in CodexClient

* Refactor code to run tasks concurrently

* Add include parameter to find_many() method in get_resume_points()

* Add disconnect calls to asyncio event loop

* Update resume_point name to display only the first 30 characters

* Remove commented out code and unused imports

* Remove unused code

* formatting

* Fix validation error handling in develop.py

* formatting

* fixes

* Add validation error for unimplemented main function

* Validate and try-fix generated endpoint db and model usage (#116)

* feat: log status

* feat: trivial implementation of copy

works for request -> response and response-> request for unfilled object but not list[unfilled_object]

* fix: i cant rememember

* feat: more complex

* feat: mostly working

* fix: fixes from tests

* feat: tests

* fix: linting problems and test name

* feat: add more supported types

* fix: remove unused data

* fix: stop using print

* fix: arrays of arrays

* fix: lint

* fix: reduce mess

* feat: more complex type that I hope we never actually use

* fix: lint

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: majdyz <[email protected]>
Co-authored-by: Zamil Majdy <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>
Co-authored-by: Toran Bruce Richards <[email protected]>
2024-03-15 17:16:53 +01:00
e79d563fd4 Dev -> Master (#73)
* Route schema changes

* Delete ruff.config.json

* save current changes

* style fixes by ruff

* Add class parsing capability

* Fix bugs

* Address comments

* Fix benchmarks

* Fix benchmarks

* Fix benchmarks

* Add comments

* fixing types

* Add error handling and status messages for application creation

* Refactor fetch_deliverable function and update application creation status

* Refactor benchmark output formatting

* Remove unnecessary print statement in fetch_deliverable function

* Propagate DB schema changes: Function <-> CompiledRouteSpec (#65)

Propagate DB schema changes: Function <-> CompiledRouteSpec (#65)

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: Swifty <[email protected]>
Co-authored-by: majdyz <[email protected]>

* emoved broken hardcoded requirements

* Add benchmarking functionality

* Update branch restrictions in GitHub workflows

* Add pytest-cov to dependencies

* Update ruff formatter command to include --check option

* Update workflow names

* Refactor code formatting and fix indentation issues

* Update Python dependency caching and installation process

* Add Prisma client generation step to CI workflow

* Refactor test_process_object_type to use async/await

* Add pytest and ValidationError imports, update arg_types assertion, and add test for ValidationError

* Remove unused imports and commented code

* Add logger to OpenAIChatClient class

* Add async context manager for database connection and disconnection

* Add blank line for readability

* Refactor function_def.arg_types assignment in ast_test.py

* mark integration tests

* Update test workflow name

* Add OpenAI API key configuration

* Better Types for Requirements Request/Response (#76)

Better Types for Requirements Request/Response

---------

Co-authored-by: majdyz <[email protected]>

* [AGPT-474] End-to-end Benchmark (#77)

* Remove unnecessary fetch_deliverable calls and update invoice_generator_requirements

* Fix typo in hardcoded.py

* Add missing app IDs and interview IDs for calendar booking, inventory management, and invoicing systems

* Add options to benchmark and example commands

* Refactor benchmarking code and add new functions

* Add task description method to ExampleTask enum

* Added end-to-end running

* Add hardcoded flag to filter examples in benchmark.py

* Refactor run_benchmark_example function to handle exceptions

* Fix error handling in specification routes

* Fix Function generation bug on nested object type (#79)

Co-authored-by: majdyz <[email protected]>

* Speeding up requirements system

---------

Co-authored-by: Zamil Majdy <[email protected]>
Co-authored-by: majdyz <[email protected]>

* Refactor code: Remove unused imports and clean up formatting

* [AGPT-478] Add Support for Composite Type with multiple Pydantic/nont-primitive classes (#78)

* [AGPT-478] Add support for multiple composite Pydantic objects

* Ruff Ruff!

* Fix failing test

* formatting

* fix populate-db command

* fix run all benchmarks

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: Swifty <[email protected]>

* Refactor package handling in packager.py (#81)

* [Fix] User provided app name being replaced (#82)

* Only make databases when required (#83)

* feat: make the name match

* feat: database becomes optional

* Update agent.py

* Integrate related types into the requirements system (#84)

* feat: make the name match

* feat: database becomes optional

* feat: initial model changes

* feat: add prompts

* feat: more prompts

* fix: nits

* fix: wrong type 😢

* feat: improved prompts

* Cleanup for field type (#85)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Improve type composite-type matching & extracting algorithm (#86)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Add Autogeneration of Typing import (#87)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Fix broken class compiling logic (#88)

Co-authored-by: majdyz <[email protected]>

* [AGPT-489] Fix function fetching to always include RelatedTypes (#89)

[AGPT-489] Fix function fetching to always include RelatedTypes

---------

Co-authored-by: majdyz <[email protected]>

* fix lock file

* feat: endpoint updates (#95)

* feat: endpoint updates

* fix: ambiguous param

* [AGPT-486] Fix codegen generate code with missing pydantic object (#92)

Co-authored-by: majdyz <[email protected]>

* Fix retry prompt (#96)

Co-authored-by: majdyz <[email protected]>

* Allow benchmark on $PORT (#98)

* Ntindle/agpt 506 add a bit of debug tooling for requirements gen (#100)

* [AGPT-485] Fix missing pydantic object during requirement-step; leading to LLM to guess wrong signature (#97)

[AGPT-485] Fix missing pydantic object during requirement-step; leading to LLM to guess wrong signature

---------

Co-authored-by: majdyz <[email protected]>

* [AGPT-157] Add Database Integration Generation (#90)

* Added prisma client to server code

* Add DatabaseSchema to INCLUDE_FUNC

* Update functions to be async and add database schema documentation

* Add DatabaseSchema and DatabaseTables to ApiRouteSpec

* Updated dev prompts for db

* Update profile management descriptions

* Update route function definition to be async

* Remove logging of database schema

* Add Prisma schema file generation

* Refactor benchmark and agent modules

* Refactor code and comment out debug statements

* formatting

* Add available_functions to develop_route

* Update prisma import and method calls

* loading all related tables

* Refactor create_prisma_scheama_file function to handle cases with no database schema

* Fix async function call in packager.py

* Fix database table query in packager.py

* Fix database access and unnecessary imports

* review comments

* [AGPT-508] Enum support for Codex - Generation Logic Layer (#102)

Co-authored-by: majdyz <[email protected]>

* Add Enum Generation to Requriements (#101)

* Added prisma client to server code

* Add DatabaseSchema to INCLUDE_FUNC

* Update functions to be async and add database schema documentation

* Add DatabaseSchema and DatabaseTables to ApiRouteSpec

* Updated dev prompts for db

* Update profile management descriptions

* Update route function definition to be async

* Remove logging of database schema

* Add Prisma schema file generation

* Refactor benchmark and agent modules

* Refactor code and comment out debug statements

* formatting

* Add available_functions to develop_route

* Update prisma import and method calls

* loading all related tables

* Refactor create_prisma_scheama_file function to handle cases with no database schema

* Fix async function call in packager.py

* Fix database table query in packager.py

* Fix database access and unnecessary imports

* feat: add enums to the database gen

* fix: formatting

* Updated to new schema

* update hardcoded requirements

* fix: objectType generation without type bool

* Add database enum import statement

* removed unused var as failing lint check

---------

Co-authored-by: SwiftyOS <[email protected]>

* More Linting Issues Fixes (#99)

* fix: more linting issues

* Remove error log for async functions

* Fix return_type default value in FunctionDef class

* Added another validation check

---------

Co-authored-by: Swifty <[email protected]>

* [AGPT-463] Add code generation validation using Ruff (#103)

---------

Co-authored-by: majdyz <[email protected]>

---------

Co-authored-by: majdyz <[email protected]>
Co-authored-by: majdyz <[email protected]>
Co-authored-by: Zamil Majdy <[email protected]>
Co-authored-by: Nicholas Tindle <[email protected]>
2024-03-13 15:55:04 +01:00
SwiftyOS 4efade2fd7 Fix all linting issues 2024-03-04 14:23:42 +01:00
SwiftyOS 4a662d6125 Update ruff config 2024-03-04 14:14:03 +01:00
Swifty 76e69d298e Merge pull request #68 from Significant-Gravitas/zamilmajdy/unwrap-nested-request-api
Unwrap the API RequestObject for the function validation if it's a nested pydantic class
2024-03-04 14:06:47 +01:00