Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Load exist project in local file system that not in database. #952

Closed
wants to merge 2 commits into from

Conversation

zkewind
Copy link

@zkewind zkewind commented May 24, 2024

Load exist project in local file system that not in database.
usage:

  • cd to gpt-pilot VS Code Extension xxx/gpt-pilot
  • copy /my_project to xxx/gpt-pilot/workspace
  • cd xxx/gpt-pilot/pilot
  • python ./load_exist.py name=my_project
  • open VS Code Extension
  • Click 'Load App' button, and select 'my_project', then click 'Load' button,choice 'Yes' twice
  • It will directly goto the develpment step finsh status,and ask you to input the next feature,
  • then you can input your new feature requirements to continue the development.

@zkewind zkewind marked this pull request as draft May 27, 2024 06:17
@zkewind zkewind marked this pull request as ready for review May 28, 2024 09:35
@5eqn
Copy link

5eqn commented May 29, 2024

Thank you for the great work! After slight adjust on prompt, I managed to load a Rust project with GPT-Pilot (backed by deepseek-chat model) and added some features. Your PR enabled a wide range of possibilities of utilizing LLM in existing projects, and generalizes well even for external project templates! (as long as it's provided in the PROJECT_TEMPLATES field)

When experimenting with the prompt, I noticed that the summary_codebase.prompt in your PR would confuse deepseek-chat, resulting it to output the example. Using "----start_of_examples----" and "----end_of_examples----" as in implement_changes.prompt can fix this. I haven't tested if this applies for other models, so correct me if I got this wrong.

The edited summary_codebase.prompt is:

You are working on a {{ app_type }} called "{{ name }}" and you need to create a detailed description for current state of project by analyzing the codebase. Your first task is to create a description text.

{{ files_list }}

Now, based on the project details provided, think step by step and create description text for this project. The file should have the following format:
-----------------------format----------------------------
Short description (a few sentences) of the project based on the project details.

Features:
Description of what the app can do and how it can be used.

Functional Specification:
Description of what operations the app will perform and how it is expected to behave. It should include the app's behavior, the app's interactions with the user, and the app's responses to inputs. Also include any other necessary elements to ensure it comprehensively describes the functionality of the application.

Technical Specification:
Description of the architecture and technologies used in the project, and the project structure.
------------------------end_of_format---------------------------

Here is an example:
-----------------------start_of_examples----------------------------
The application is a simple TaskManage app built using React. Its primary function is to allow users to manage a list of tasks (todos). Each task has a description and a state (open or completed, with the default state being open). The application is frontend-only, with no user sign-up or authentication process. The goal is to provide a straightforward and user-friendly interface for task management.

Features:
1. Display of Todos: A list that displays all task items. Each item shows its description and a checkbox to indicate its state (open or completed).
2. Add New task: A button to add a new task item. Clicking this button will prompt the user to enter a description for the new task.
3. Toggle State: Each task item includes a checkbox. Checking/unchecking this box toggles the task's state between open and completed.
4. Local Storage: The application will use the browser's local storage to persist todos between sessions, ensuring that users do not lose their data upon reloading the application.

Functional Specification:
- Upon loading the application, it fetches existing todos from the local storage and displays them in a list.
- Each task item in the list displays a checkbox and a description. The checkbox reflects the task's current state (checked for completed, unchecked for open).
- When the user checks or unchecks a checkbox, the application updates the state of the corresponding task item and saves the updated list to local storage.
- Clicking the "Add New task" button prompts the user to enter a description for the new task. Upon confirmation, the application adds the new task (with the default state of open) to the list and updates local storage.
- The application does not support deleting or editing task items to keep the interface and interactions simple.
- Todos persist between sessions using the browser's local storage. The application saves any changes to the task list (additions or state changes) in local storage and retrieves this data when the application is reloaded.

Technical Specification:
- Platform/Technologies: The application is a web application developed using React. No backend technologies are required.
- Styling: Use Bootstrap 5 for a simple and functional interface. Load Boostrap from the CDN (don't install it locally):
    - https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css
    - https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js
- State Management: Directly in the React component
    - make sure to initialize the state from the local storage as default (... = useState(JSON.parse(localStorage.getItem('todos')) || []) to avoid race conditions
- Data Persistence: The application uses the browser's local storage to persist todos between sessions. It stores the array of todos as a JSON string and parses this data on application load.
-----------------------end_of_examples----------------------------

@zkewind
Copy link
Author

zkewind commented May 29, 2024

@5eqn I noticed that the new PR #976(#976) is implementing this requirement and is integrated into the vs code text, so I will wait and see. If the new PR is okay, I will close this PR.

…tting examples instead of summarizing the code correctly.
@zkewind
Copy link
Author

zkewind commented May 29, 2024

@5eqn You are right, I believe that combining START_OF_XXX (uppercase) with triple quotes marks can solve most LLM recognition errors.

https://github.com/zkewind/gpt-pilot-cn/blob/load_exits_project/pilot/prompts/documentation/summary_codebase.prompt

@zkewind zkewind closed this Jun 10, 2024
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.

None yet

2 participants