You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/blazickjp/GPT-CodeApp/actions/workflows/pytest_ubuntu.yml)
5
5
6
-
Welcome to GPT-CodeApp, the coding companion you didn't know you needed! 🎉 This project is a clone of Chat-GPT, but with all the features we wish were available. Tired of constantly copying and pasting from VS Code into the UI? Losing context in the conversation memory? Having little visibility into what's going on under the hood? We've got you covered!
6
+
Embark on a coding adventure with GPT-CodeApp, your new AI-powered coding companion! 🎉 This isn't just another Chat-GPT clone; it's your gateway to a smoother coding experience, packed with features you've always wished for.
7
7
8
-
GPT-CodeApp started as a tool to better manage the model's conversational memory and context, but we didn't stop there. We're giving the models access to read, write, and edit files, all under your control! We're offloading all the tedious work to the models, so you can focus on what matters.
9
8
10
-
We're continuously improving and setting new goals. So, come join us on this exciting journey! 🚀
11
-
12
-
13
-

9
+

14
10
15
11
## 📚 Table of Contents
16
12
@@ -21,65 +17,40 @@ We're continuously improving and setting new goals. So, come join us on this exc
21
17
-[License](#license)
22
18
-[Questions](#questions)
23
19
24
-
## 🔥 Recent Updates 🔥
25
-
26
-
-**Bedrock Support:** We've added support for Bedrock, specifically the ClaudEv2 model, allowing you to leverage their AI models in addition to OpenAI's GPT-3.5 and GPT-4 models. 🧠
27
-
-**Sagemaker Endpoint Support:** We're working on adding support for any Sagemaker endpoint. This will allow you to sause any model hosted on Amazon Sagemaker.
28
-
-**Prompt Management:** We've added backend support for prompt management, giving you more control over the prompts that are sent to the AI models.
29
-
-**SQLite Database:** We've moved from Postgres to SQLite for our database needs. This makes setup easier and reduces the resources required to run the application.
30
-
-**UI-Controlled Project Configuration:** You can now control the project configuration directly from the user interface, making it easier to customize the application to your needs.
31
-
32
-
33
20
## 🛠️ Installation and Setup
34
21
35
-
Setting up GPT-CodeApp is as easy as 1, 2, 3! Our application consists of a frontend and a backend, both of which need to be set up separately. Follow the steps below to get started:
22
+
Setting up GPT-CodeApp is as easy as 1, 2, 3! Our application consists of a frontend and a backend, both of which need to be set up separately.
36
23
37
-
### Backend Setup
24
+
Jump straight into action with these simple setup steps for both the frontend and backend. Let's get the engines running!
38
25
39
-
The backend is a Python application that uses FastAPI. Here's how to set it up:
40
-
41
-
42
-
1. Navigate to the backend directory:
26
+
### Backend: The Brain 🧠
43
27
28
+
1.**Enter the Backend Lair:**
44
29
```bash
45
30
cd backend
46
31
```
47
-
48
-
2. Install the necessary Python dependencies. We recommend doing this in a virtual environment:
49
-
50
-
32
+
2. **Summon the Python Dependencies:**
51
33
```bash
52
34
python3 -m venv env
53
35
source env/bin/activate
54
36
pip install -r requirements.txt
55
37
```
56
-
57
-
3. Start the backend server:
58
-
38
+
3. **Awaken the Backend Beast:**
59
39
```bash
60
40
uvicorn main:app --reload
61
41
```
62
42
63
-
The backend server will start running at `http://localhost:8000`.
64
-
65
-
### Frontend Setup
66
-
67
-
The frontend is a React application that uses Next.js. To set it up, follow these steps:
68
-
69
-
1. Navigate to the frontend directory:
43
+
### Frontend: The Face 😎
70
44
45
+
1. **Dive into the Frontend Fortress:**
71
46
```bash
72
47
cd frontend
73
48
```
74
-
75
-
2. Install the necessary JavaScript dependencies:
76
-
49
+
2. **Gather the JavaScript Warriors:**
77
50
```bash
78
51
npm install
79
52
```
80
-
81
-
3. Start the frontend server:
82
-
53
+
3. **Launch the Visual Vanguard:**
83
54
```bash
84
55
npm run dev
85
56
```
@@ -121,82 +92,15 @@ OpenAI uses environment variables for authentication. Follow these steps to set
121
92
Now you're ready to start using the GPT-CodeApp with Anthropic and OpenAI models!
122
93
123
94
## 🎮 Usage
95
+
Dive into the GPT-CodeApp experience with these simple steps:
124
96
125
-
Now that you've set everything up, you're ready to start using GPT-CodeApp! Open `http://localhost:3000` in your web browser and start exploring.
126
-
127
-
Using GPT-CodeApp is as simple as chatting with an AI. Here's how to get started:
128
-
129
-
* Open http://localhost:3000 in your web browser to access the GPT-CodeApp interface.
130
-
* Open the sidebar on the left side of the interface. This is where you'll input the directory of your coding project.
131
-
* Enter the directory of your coding project in the sidebar. This will allow the GPT-CodeApp to access your project files.
132
-
133
-
Start interacting with the GPT-CodeApp just like you would with ChatGPT. You can ask questions, request code snippets, and more. One of the biggest advantages of GPT-CodeApp is the ability to use the search functionality to locate and add files directly to the system prompt. This is a powerful feature that allows you to quickly and easily reference specific parts of your codebase.
134
-
135
-
136
-
Recently, we've also began experiemnting with some cool features like On-Demand Agent Functions that can be called on demand from the user interface (OpenAI Only). They perform specific tasks based on your input and can greatly enhance the functionality and interactivity of the application. To call an On-Demand Agent function, simply prepend the command with a "/".
137
-
138
-
### On-Demand Agent Function (OpenAI Only)
139
-
This feature is currently being revamped. Stay tuned for exciting updates!
140
-
141
-
On-Demand Agent functions are special functions that can be called on demand from the user interface differing from typical OpenAI functions in that we're forcing the function call instead of relying on the LLM to recognize when to call the function. They are designed to perform specific tasks based on user input and can greatly enhance the functionality and interactivity of the application. To call an On-Demand Agent function, you simply prepend the command with a "/".
142
-
143
-
Current On-Demand Agent Functions
97
+
- **Step 1:** Launch your browser and head over to `http://localhost:3000` to greet your new AI coding companion.
144
98
145
-
- Changes
146
-
- Edits a file from the repository given a set of instructions. The memory of the conversation is included so you do not need
147
-
to be overly specific in your instructions. See example below.
148
-
- CommandPlanner
149
-
- Allows the agent to run a sequence of bash operations in a plan and execute paradigm.
150
-
151
-
#### Example
152
-
153
-
Call Agent Function - changes.py needs to be loaded into context
154
-
155
-
```
156
-
/Changes add docstring to the match_partial function
157
-
```
158
-
159
-
Function Call response are streamed back into the UI
"thought": "The user wants to add a docstring to the match_partial function. Docstrings are important for code readability and maintainability, as they explain the purpose of a function, its arguments, and its return value.",
"updated": "def match_partial(\n self, original_lines: List[str], partial_lines: List[str]\n ) -> Tuple[Optional[int], Optional[int], Optional[int]]:\n \"\"\"\n This function matches a part of the original code with a given part.\n\n Args:\n original_lines (List[str]): The original lines of code.\n partial_lines (List[str]): The lines of code that need to be matched.\n\n Returns:\n Tuple[Optional[int], Optional[int], Optional[int]]: The start and end indices of the match in the original code and the number of leading spaces in the matched part.\n \"\"\""
169
-
}
170
-
]
171
-
}
172
-
```
173
-
174
-
Then the Agent also responds in the UI with the final diff of changes that were made
+ This function matches a part of the original code with a given part.
189
-
+
190
-
+ Args:
191
-
+ original_lines (List[str]): The original lines of code.
192
-
+ partial_lines (List[str]): The lines of code that need to be matched.
193
-
+
194
-
+ Returns:
195
-
+ Tuple[Optional[int], Optional[int], Optional[int]]: The start and end indices of the match in the original code and the number of leading spaces in the matched part.
196
-
+ """
197
-
```
99
+
- **Step 3:** Ensure you've setup authentication with either OpenAI (API KEY) or Bedrock (for Anthropic models). With authentication out of the way, you're ready to roll! Look for the sidebar on the main interface. Here, you'll find a spot to input the **full path** to the directory of your project. This is crucial for GPT-CodeApp to understand the context of your work and provide tailored assistance.
100
+
- **Step 4:** Now, it's time to ask away! Load *focus* files into the search bar at the top. Make sure to send them to the backend with the send button. Type your coding queries or dilemmas into the text box and hit submit. GPT-CodeApp will churn through its AI brain to bring you crisp, accurate coding advice or solutions.
101
+
- **Step 5:** Explore the responses, refine your questions for deeper insights, or kick off a new query. The AI is here to assist you through thick and thin code.
102
+
- **Step 6:** Base prompts can be found in the backend/agent/agent_prompts.py file and set to load in the app_setup.py. You can also add your own prompts to the file anytime.
198
103
199
-
The changes were automatically saved and can always be un-done with `cntrl + z`
0 commit comments