Spaces:
Sleeping
Sleeping
add auto_save and input limit (#1)
Browse files- add auto save and input limit (507564e2311ab6cf14438a84d7b4e50a65409428)
- fix bugs on auto save (a6f3675b7adf940b88b965a489c11f5393d700b2)
- fix bugs on auto save (7f4fb866dd92fc76859713846c331cce8e7d881c)
- Fix bugs (cf0da09860bba6c99300151c6b1c2233691091c6)
- delete unnecessary code andswitch off local mode (b7dc23fbebcc87f7599d5af409399e56c28b5f75)
- launch app to public (755d8263f5b6b9509a9c6244205713d1af9f9df9)
- minor fix (ec8338e2ff3058ebe2fbac74cc7147ae342e17b2)
- Merge branch 'main' into pr/1 (fef4c918b59c3f58d450d2a49564bdb234e65bba)
- Solve environment conflict and merge with new UI layout (1d1684354c83e9faa97c13ffe8e73e97309e7ff0)
- app.py +70 -14
- save_data.py +45 -11
app.py
CHANGED
|
@@ -2,8 +2,10 @@ import gradio as gr
|
|
| 2 |
from utils import *
|
| 3 |
from save_data import add_new_data, get_sheet_service
|
| 4 |
from instructions import *
|
|
|
|
| 5 |
from constants import SDG_DETAILS, GPT_PROMPT_parallel, GPT_PROMPT_sequential, GPT_PROMPT_reverse_sequential
|
| 6 |
|
|
|
|
| 7 |
class SessionManager:
|
| 8 |
def __init__(self):
|
| 9 |
self.sessions = []
|
|
@@ -58,19 +60,26 @@ def handle_create_sequential(task, human_input, session_manager, api_key, identi
|
|
| 58 |
cooperate_style = "sequential"
|
| 59 |
session_index = session_manager.add_session(task=task, cooperate_style=cooperate_style)
|
| 60 |
session_manager.update(session_index, human_input, 'human_initial_answer')
|
| 61 |
-
output = merge_texts_sequential(task, human_input, api_key)
|
| 62 |
-
session_manager.update(session_index, output, 'ai_modificated_output')
|
| 63 |
session_manager.update(session_index, identification_code, 'user_identification_code')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
return output, session_index
|
| 65 |
|
| 66 |
|
| 67 |
def handle_create_parallel(task, human_input, session_manager, api_key, identification_code):
|
| 68 |
cooperate_style = "parallel"
|
| 69 |
session_index = session_manager.add_session(task=task, cooperate_style=cooperate_style)
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
session_manager.update(session_index, human_input, 'human_initial_answer')
|
| 72 |
session_manager.update(session_index, ai_initial_answer, 'ai_initial_answer')
|
| 73 |
-
final_answer = merge_texts_parallel(task, human_input, ai_initial_answer, api_key)
|
| 74 |
session_manager.update(session_index, final_answer, 'merged_final_answer')
|
| 75 |
session_manager.update(session_index, identification_code, 'user_identification_code')
|
| 76 |
return ai_initial_answer, final_answer, session_index
|
|
@@ -87,7 +96,10 @@ def handle_create_reverse_sequential(task, session_manager, api_key, identificat
|
|
| 87 |
def handle_modify_reverse_sequential(session_index, modification_suggestions, session_manager, api_key):
|
| 88 |
session = session_manager.get_session(session_index)
|
| 89 |
session_manager.update(session_index, modification_suggestions, 'human_modifications')
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
| 91 |
session_manager.update(session_index, final_answer, 'final_answer')
|
| 92 |
return final_answer, session_index
|
| 93 |
|
|
@@ -119,6 +131,14 @@ def login(identification_code):
|
|
| 119 |
else:
|
| 120 |
return update_content(None)
|
| 121 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
if __name__ == "__main__":
|
| 124 |
api_key = get_api_key(local=False)
|
|
@@ -166,7 +186,7 @@ if __name__ == "__main__":
|
|
| 166 |
|
| 167 |
with group_a_content:
|
| 168 |
with gr.Row():
|
| 169 |
-
human_input = gr.Textbox(label="Human Input")
|
| 170 |
with gr.Row():
|
| 171 |
submit_btn = gr.Button("Create")
|
| 172 |
with gr.Row():
|
|
@@ -175,10 +195,15 @@ if __name__ == "__main__":
|
|
| 175 |
|
| 176 |
submit_btn.click(
|
| 177 |
fn=lambda task, human_input, id: handle_create_sequential(task, human_input, session_manager, api_key, id),
|
| 178 |
-
inputs=[
|
| 179 |
outputs=[ai_output, session_index]
|
| 180 |
)
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
# evaluate same for every group
|
| 183 |
evaluate_btn = gr.Button("Evaluate")
|
| 184 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
@@ -189,9 +214,15 @@ if __name__ == "__main__":
|
|
| 189 |
outputs=[evaluation_result]
|
| 190 |
)
|
| 191 |
|
| 192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
save_result = gr.Label()
|
| 194 |
|
|
|
|
| 195 |
save_btn.click(
|
| 196 |
fn=lambda session_index: save_data(session_index, session_manager, service, SHEET_ID1),
|
| 197 |
inputs=[session_index],
|
|
@@ -203,7 +234,7 @@ if __name__ == "__main__":
|
|
| 203 |
|
| 204 |
with group_b_content:
|
| 205 |
with gr.Row():
|
| 206 |
-
human_input = gr.Textbox(label="Human Input")
|
| 207 |
with gr.Row():
|
| 208 |
create_btn = gr.Button("Create")
|
| 209 |
with gr.Row():
|
|
@@ -213,10 +244,15 @@ if __name__ == "__main__":
|
|
| 213 |
|
| 214 |
create_btn.click(
|
| 215 |
fn=lambda task, human_input, id: handle_create_parallel(task, human_input, session_manager, api_key, id),
|
| 216 |
-
inputs=[
|
| 217 |
outputs=[ai_initial_output, final_output, session_index]
|
| 218 |
)
|
| 219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
|
| 221 |
evaluate_btn = gr.Button("Evaluate")
|
| 222 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
@@ -227,7 +263,12 @@ if __name__ == "__main__":
|
|
| 227 |
outputs=[evaluation_result]
|
| 228 |
)
|
| 229 |
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
save_result = gr.Label()
|
| 232 |
|
| 233 |
save_btn.click(
|
|
@@ -244,7 +285,7 @@ if __name__ == "__main__":
|
|
| 244 |
create_initial_btn = gr.Button("Create")
|
| 245 |
with gr.Row():
|
| 246 |
initial_answer = gr.Textbox(label="AI Initial Answer")
|
| 247 |
-
modification_suggestions = gr.Textbox(label="Modification Suggestions")
|
| 248 |
with gr.Row():
|
| 249 |
create_final_btn = gr.Button("Modify")
|
| 250 |
with gr.Row():
|
|
@@ -254,16 +295,26 @@ if __name__ == "__main__":
|
|
| 254 |
|
| 255 |
create_initial_btn.click(
|
| 256 |
fn=lambda task, id: handle_create_reverse_sequential(task, session_manager, api_key, id),
|
| 257 |
-
inputs=[
|
| 258 |
outputs=[initial_answer, session_index]
|
| 259 |
)
|
| 260 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
create_final_btn.click(
|
| 262 |
fn=lambda session_index, modification_suggestions: handle_modify_reverse_sequential(session_index, modification_suggestions, session_manager, api_key),
|
| 263 |
inputs=[session_index, modification_suggestions],
|
| 264 |
outputs=[final_answer, session_index]
|
| 265 |
)
|
| 266 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
evaluate_btn = gr.Button("Evaluate")
|
| 268 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
| 269 |
|
|
@@ -273,7 +324,12 @@ if __name__ == "__main__":
|
|
| 273 |
outputs=[evaluation_result]
|
| 274 |
)
|
| 275 |
|
| 276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
save_result = gr.Label()
|
| 278 |
|
| 279 |
save_btn.click(
|
|
|
|
| 2 |
from utils import *
|
| 3 |
from save_data import add_new_data, get_sheet_service
|
| 4 |
from instructions import *
|
| 5 |
+
from user_groups import user_data
|
| 6 |
from constants import SDG_DETAILS, GPT_PROMPT_parallel, GPT_PROMPT_sequential, GPT_PROMPT_reverse_sequential
|
| 7 |
|
| 8 |
+
|
| 9 |
class SessionManager:
|
| 10 |
def __init__(self):
|
| 11 |
self.sessions = []
|
|
|
|
| 60 |
cooperate_style = "sequential"
|
| 61 |
session_index = session_manager.add_session(task=task, cooperate_style=cooperate_style)
|
| 62 |
session_manager.update(session_index, human_input, 'human_initial_answer')
|
|
|
|
|
|
|
| 63 |
session_manager.update(session_index, identification_code, 'user_identification_code')
|
| 64 |
+
if word_limit_validation(human_input):
|
| 65 |
+
output = word_limit_validation(human_input)
|
| 66 |
+
else:
|
| 67 |
+
output = merge_texts_sequential(task, human_input, api_key)
|
| 68 |
+
session_manager.update(session_index, output, 'ai_modificated_output')
|
| 69 |
return output, session_index
|
| 70 |
|
| 71 |
|
| 72 |
def handle_create_parallel(task, human_input, session_manager, api_key, identification_code):
|
| 73 |
cooperate_style = "parallel"
|
| 74 |
session_index = session_manager.add_session(task=task, cooperate_style=cooperate_style)
|
| 75 |
+
if word_limit_validation(human_input):
|
| 76 |
+
ai_initial_answer = word_limit_validation(human_input)
|
| 77 |
+
final_answer = word_limit_validation(human_input)
|
| 78 |
+
else:
|
| 79 |
+
ai_initial_answer = generate_ai_initial_answer(task, api_key)
|
| 80 |
+
final_answer = merge_texts_parallel(task, human_input, ai_initial_answer, api_key)
|
| 81 |
session_manager.update(session_index, human_input, 'human_initial_answer')
|
| 82 |
session_manager.update(session_index, ai_initial_answer, 'ai_initial_answer')
|
|
|
|
| 83 |
session_manager.update(session_index, final_answer, 'merged_final_answer')
|
| 84 |
session_manager.update(session_index, identification_code, 'user_identification_code')
|
| 85 |
return ai_initial_answer, final_answer, session_index
|
|
|
|
| 96 |
def handle_modify_reverse_sequential(session_index, modification_suggestions, session_manager, api_key):
|
| 97 |
session = session_manager.get_session(session_index)
|
| 98 |
session_manager.update(session_index, modification_suggestions, 'human_modifications')
|
| 99 |
+
if word_limit_validation(modification_suggestions):
|
| 100 |
+
final_answer = word_limit_validation(modification_suggestions)
|
| 101 |
+
else:
|
| 102 |
+
final_answer = modify_with_suggestion(session['task'], modification_suggestions, api_key)
|
| 103 |
session_manager.update(session_index, final_answer, 'final_answer')
|
| 104 |
return final_answer, session_index
|
| 105 |
|
|
|
|
| 131 |
else:
|
| 132 |
return update_content(None)
|
| 133 |
|
| 134 |
+
def word_limit_validation(human_input):
|
| 135 |
+
words = human_input.split()
|
| 136 |
+
if len(words) < 50:
|
| 137 |
+
return f"Error: Your input '{human_input}'is less than 50 words. Please enter at least 50 words."
|
| 138 |
+
return None
|
| 139 |
+
|
| 140 |
+
def on_textbox_change(session_index, session_manager, service, SHEET_ID):
|
| 141 |
+
return save_data(session_index, session_manager, service, SHEET_ID)
|
| 142 |
|
| 143 |
if __name__ == "__main__":
|
| 144 |
api_key = get_api_key(local=False)
|
|
|
|
| 186 |
|
| 187 |
with group_a_content:
|
| 188 |
with gr.Row():
|
| 189 |
+
human_input = gr.Textbox(label="Human Input (At least 50 words)")
|
| 190 |
with gr.Row():
|
| 191 |
submit_btn = gr.Button("Create")
|
| 192 |
with gr.Row():
|
|
|
|
| 195 |
|
| 196 |
submit_btn.click(
|
| 197 |
fn=lambda task, human_input, id: handle_create_sequential(task, human_input, session_manager, api_key, id),
|
| 198 |
+
inputs=[description, human_input, identification_code],
|
| 199 |
outputs=[ai_output, session_index]
|
| 200 |
)
|
| 201 |
|
| 202 |
+
ai_output.change(
|
| 203 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID1),
|
| 204 |
+
inputs = [session_index]
|
| 205 |
+
)
|
| 206 |
+
|
| 207 |
# evaluate same for every group
|
| 208 |
evaluate_btn = gr.Button("Evaluate")
|
| 209 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
|
|
| 214 |
outputs=[evaluation_result]
|
| 215 |
)
|
| 216 |
|
| 217 |
+
evaluation_result.change(
|
| 218 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID1),
|
| 219 |
+
inputs = [session_index]
|
| 220 |
+
)
|
| 221 |
+
|
| 222 |
+
save_btn = gr.Button("Save Data", elem_id="save_btn")
|
| 223 |
save_result = gr.Label()
|
| 224 |
|
| 225 |
+
|
| 226 |
save_btn.click(
|
| 227 |
fn=lambda session_index: save_data(session_index, session_manager, service, SHEET_ID1),
|
| 228 |
inputs=[session_index],
|
|
|
|
| 234 |
|
| 235 |
with group_b_content:
|
| 236 |
with gr.Row():
|
| 237 |
+
human_input = gr.Textbox(label="Human Input(At least 50 words)")
|
| 238 |
with gr.Row():
|
| 239 |
create_btn = gr.Button("Create")
|
| 240 |
with gr.Row():
|
|
|
|
| 244 |
|
| 245 |
create_btn.click(
|
| 246 |
fn=lambda task, human_input, id: handle_create_parallel(task, human_input, session_manager, api_key, id),
|
| 247 |
+
inputs=[description, human_input, identification_code],
|
| 248 |
outputs=[ai_initial_output, final_output, session_index]
|
| 249 |
)
|
| 250 |
|
| 251 |
+
ai_initial_output.change(
|
| 252 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID2),
|
| 253 |
+
inputs = [session_index]
|
| 254 |
+
)
|
| 255 |
+
|
| 256 |
|
| 257 |
evaluate_btn = gr.Button("Evaluate")
|
| 258 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
|
|
|
| 263 |
outputs=[evaluation_result]
|
| 264 |
)
|
| 265 |
|
| 266 |
+
evaluation_result.change(
|
| 267 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID2),
|
| 268 |
+
inputs = [session_index]
|
| 269 |
+
)
|
| 270 |
+
|
| 271 |
+
save_btn = gr.Button("Save Data",elem_id="save_btn")
|
| 272 |
save_result = gr.Label()
|
| 273 |
|
| 274 |
save_btn.click(
|
|
|
|
| 285 |
create_initial_btn = gr.Button("Create")
|
| 286 |
with gr.Row():
|
| 287 |
initial_answer = gr.Textbox(label="AI Initial Answer")
|
| 288 |
+
modification_suggestions = gr.Textbox(label="Modification Suggestions(At least 50 words)")
|
| 289 |
with gr.Row():
|
| 290 |
create_final_btn = gr.Button("Modify")
|
| 291 |
with gr.Row():
|
|
|
|
| 295 |
|
| 296 |
create_initial_btn.click(
|
| 297 |
fn=lambda task, id: handle_create_reverse_sequential(task, session_manager, api_key, id),
|
| 298 |
+
inputs=[description, identification_code],
|
| 299 |
outputs=[initial_answer, session_index]
|
| 300 |
)
|
| 301 |
|
| 302 |
+
initial_answer.change(
|
| 303 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 304 |
+
inputs = [session_index]
|
| 305 |
+
)
|
| 306 |
+
|
| 307 |
create_final_btn.click(
|
| 308 |
fn=lambda session_index, modification_suggestions: handle_modify_reverse_sequential(session_index, modification_suggestions, session_manager, api_key),
|
| 309 |
inputs=[session_index, modification_suggestions],
|
| 310 |
outputs=[final_answer, session_index]
|
| 311 |
)
|
| 312 |
|
| 313 |
+
final_answer.change(
|
| 314 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 315 |
+
inputs = [session_index]
|
| 316 |
+
)
|
| 317 |
+
|
| 318 |
evaluate_btn = gr.Button("Evaluate")
|
| 319 |
evaluation_result = gr.Textbox(label="Evaluation Result")
|
| 320 |
|
|
|
|
| 324 |
outputs=[evaluation_result]
|
| 325 |
)
|
| 326 |
|
| 327 |
+
evaluation_result.change(
|
| 328 |
+
fn = lambda session_index: on_textbox_change(session_index, session_manager, service, SHEET_ID3),
|
| 329 |
+
inputs = [session_index]
|
| 330 |
+
)
|
| 331 |
+
|
| 332 |
+
save_btn = gr.Button("Save Data", elem_id="save_btn")
|
| 333 |
save_result = gr.Label()
|
| 334 |
|
| 335 |
save_btn.click(
|
save_data.py
CHANGED
|
@@ -10,7 +10,7 @@ def load_envs(local=False):
|
|
| 10 |
"""Load the environment variables."""
|
| 11 |
if local:
|
| 12 |
from dotenv import load_dotenv
|
| 13 |
-
load_dotenv()
|
| 14 |
service_account_info = json.loads(os.environ['GOOGLE_APPLICATION_CREDENTIALS_JSON'])
|
| 15 |
SHEET_ID1 = os.environ['SHEET_ID1'] # human-ai-sequential
|
| 16 |
SHEET_ID2 = os.environ['SHEET_ID2'] # human-ai-parallel
|
|
@@ -40,6 +40,14 @@ def col_letter(col_num):
|
|
| 40 |
letter = chr(65 + remainder) + letter
|
| 41 |
return letter
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
def add_new_data(new_row, service, SPREADSHEET_ID, num_of_columns = 5):
|
| 44 |
"""Add new data to the spreadsheet.
|
| 45 |
new_row: list of data to be added. """
|
|
@@ -50,23 +58,49 @@ def add_new_data(new_row, service, SPREADSHEET_ID, num_of_columns = 5):
|
|
| 50 |
spreadsheetId=SPREADSHEET_ID,
|
| 51 |
range=range_to_read
|
| 52 |
).execute()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
values = result.get('values', [])
|
| 54 |
number_of_rows = len(values)
|
| 55 |
new_row = [new_row]
|
| 56 |
-
|
|
|
|
| 57 |
|
| 58 |
request_body = {
|
| 59 |
'values': new_row
|
| 60 |
}
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
|
| 72 |
|
|
|
|
| 10 |
"""Load the environment variables."""
|
| 11 |
if local:
|
| 12 |
from dotenv import load_dotenv
|
| 13 |
+
load_dotenv(override=True)
|
| 14 |
service_account_info = json.loads(os.environ['GOOGLE_APPLICATION_CREDENTIALS_JSON'])
|
| 15 |
SHEET_ID1 = os.environ['SHEET_ID1'] # human-ai-sequential
|
| 16 |
SHEET_ID2 = os.environ['SHEET_ID2'] # human-ai-parallel
|
|
|
|
| 40 |
letter = chr(65 + remainder) + letter
|
| 41 |
return letter
|
| 42 |
|
| 43 |
+
def col_letter(col_num):
|
| 44 |
+
"""Convert a column number to its corresponding Excel-style letter."""
|
| 45 |
+
letter = ''
|
| 46 |
+
while col_num > 0:
|
| 47 |
+
col_num, remainder = divmod(col_num - 1, 26)
|
| 48 |
+
letter = chr(65 + remainder) + letter
|
| 49 |
+
return letter
|
| 50 |
+
|
| 51 |
def add_new_data(new_row, service, SPREADSHEET_ID, num_of_columns = 5):
|
| 52 |
"""Add new data to the spreadsheet.
|
| 53 |
new_row: list of data to be added. """
|
|
|
|
| 58 |
spreadsheetId=SPREADSHEET_ID,
|
| 59 |
range=range_to_read
|
| 60 |
).execute()
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
# search for first columns match
|
| 64 |
+
match_found = False
|
| 65 |
+
update_idx = None
|
| 66 |
+
for idx, row in enumerate(result.get('values', [])):
|
| 67 |
+
if row[0] == new_row[0]:
|
| 68 |
+
match_found = True
|
| 69 |
+
range_to_write = f'Sheet1!A{idx + 1}:{col_letter(num_of_columns)}{idx + 1}'
|
| 70 |
+
update_idx = idx + 1
|
| 71 |
+
break
|
| 72 |
+
|
| 73 |
values = result.get('values', [])
|
| 74 |
number_of_rows = len(values)
|
| 75 |
new_row = [new_row]
|
| 76 |
+
if not match_found:
|
| 77 |
+
range_to_write = f'Sheet1!A{number_of_rows + 1}'
|
| 78 |
|
| 79 |
request_body = {
|
| 80 |
'values': new_row
|
| 81 |
}
|
| 82 |
+
if match_found:
|
| 83 |
+
service.spreadsheets().values().clear(
|
| 84 |
+
spreadsheetId=SPREADSHEET_ID,
|
| 85 |
+
range=range_to_write,
|
| 86 |
+
body={},
|
| 87 |
+
).execute()
|
| 88 |
+
response = service.spreadsheets().values().update(
|
| 89 |
+
spreadsheetId=SPREADSHEET_ID,
|
| 90 |
+
range=range_to_write,
|
| 91 |
+
valueInputOption='RAW',
|
| 92 |
+
body=request_body
|
| 93 |
+
).execute()
|
| 94 |
+
print(f"Updated row at position {update_idx}")
|
| 95 |
+
else:
|
| 96 |
+
response = service.spreadsheets().values().append(
|
| 97 |
+
spreadsheetId=SPREADSHEET_ID,
|
| 98 |
+
range=range_to_write,
|
| 99 |
+
valueInputOption='RAW',
|
| 100 |
+
insertDataOption='INSERT_ROWS',
|
| 101 |
+
body=request_body
|
| 102 |
+
).execute()
|
| 103 |
+
print(f"Added new row at position {number_of_rows + 1}")
|
| 104 |
|
| 105 |
|
| 106 |
|