Skip to content

Commit 591c3e2

Browse files
author
melihunsal
committed
finalizer prompt modified
1 parent b8f9522 commit 591c3e2

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

CONTRIBUTING.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,26 @@ DemoGPT works through the following steps:
3030
- `task_definitions.py`: Definitions of all available tasks.
3131
- `prompts`: Folder containing task files.
3232

33-
### Task List Folder (`src/plan/chains/prompts`)
33+
### Task List Folder (`demogpt/plan/chains/prompts`)
3434

3535
Contains task files. Only `prompt_chat_template.py`, `ui_input_file.py`, `ui_input_text.py`, `ui_output_text.py` are filled. Others need to be filled according to their needs.
3636

3737
## Adding a New Task
3838

3939
To add a new task, follow these steps:
4040

41-
1. **Fill the Corresponding File:** Fill the corresponding file in `src/plan/chains/prompts` with the implementation of the new task.
42-
2. **Update Task Definitions:** Change the "TASKS" variable in `src/plan/chains/task_definitions.py` to include the new task.
43-
3. **Add the New Task to Task Chains:** Add the new task in `src/plan/chains/task_chains.py`.
44-
4. **Modify `__init__.py`:** Modify `src/plan/chains/prompts/__init__.py` in a way that the new task becomes available.
45-
5. **Update Test Cases:** Update the `TOOL_EXAMPLES` variable in `src/plan/test_cases.py` and add at least one test case to test the new tool.
46-
6. **Add Test Script:** Add the corresponding test script in `src/plan/test.py` like the following:
41+
1. **Fill the Corresponding File:** Fill the corresponding file in `demogpt/plan/chains/prompts` with the implementation of the new task.
42+
2. **Update Task Definitions:** Change the "TASKS" variable in `demogpt/plan/chains/task_definitions.py` to include the new task.
43+
3. **Add the New Task to Task Chains:** Add the new task in `demogpt/plan/chains/task_chains.py`.
44+
4. **Modify `__init__.py`:** Modify `demogpt/plan/chains/prompts/__init__.py` in a way that the new task becomes available.
45+
5. **Add the New Task Call to `demogpt/plan`:** Add new task to getCodeSnippet function like in the following:
46+
```python
47+
elif task_type == $task_name:
48+
code = TaskChains.$task_name(task=task,code_snippets=code_snippets)
49+
```
50+
51+
6. **Update Test Cases:** Update the `TOOL_EXAMPLES` variable in `demogpt/plan/test_cases.py` and add at least one test case to test the new tool.
52+
7. **Add Test Script:** Add the corresponding test script in `demogpt/plan/test.py` like the following:
4753

4854
```python
4955
def test_$new_task_name(self):

demogpt/plan/app.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import logging
22
import os
33
import signal
4-
import webbrowser
5-
from time import sleep
4+
import sys
5+
6+
current_file_path = os.path.abspath(__file__)
7+
current_directory = os.path.dirname(current_file_path)
8+
parent_directory = os.path.dirname(current_directory)
9+
grandparent_directory = os.path.dirname(parent_directory)
10+
sys.path.append(grandparent_directory)
611

712
import streamlit as st
813
from utils import runStreamlit
914
from model import DemoGPT
10-
from time import sleep
1115

1216
# logging.basicConfig(level = logging.DEBUG,format='%(levelname)s-%(message)s')
1317

demogpt/plan/chains/prompts/final.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
1111
Step-1 Write all the import statements from the Draft Code.
1212
13-
Step-2 Write all the function definitions
13+
Step-2 Write all the function definitions from the Draft Code.
1414
15-
Step-3 Get input from the user
15+
Step-3 Get input from the user.
1616
17-
Step-4 Put a submit button with an appropriate title
17+
Step-4 Put a submit button with an appropriate title.
1818
1919
Step-5 Call functions only if all user inputs are taken and the button is clicked.
2020

0 commit comments

Comments
 (0)