Update app.py
Browse files
app.py
CHANGED
@@ -160,11 +160,12 @@ def remove_file(n_clicks, existing_files):
|
|
160 |
raise PreventUpdate
|
161 |
|
162 |
triggered_id = ctx.triggered[0]['prop_id']
|
163 |
-
|
|
|
164 |
|
165 |
uploaded_files.pop(removed_file, None)
|
166 |
return [file for file in existing_files if file['props']['children'][1]['props']['children'] != removed_file]
|
167 |
-
|
168 |
def generate_matrix_with_gpt(matrix_type, file_contents):
|
169 |
prompt = f"""Generate a {matrix_type} based on the following project artifacts:
|
170 |
|
|
|
160 |
raise PreventUpdate
|
161 |
|
162 |
triggered_id = ctx.triggered[0]['prop_id']
|
163 |
+
# Extract the file name from the triggered_id string
|
164 |
+
removed_file = triggered_id.split('"index":')[1].split('}')[0].strip('"')
|
165 |
|
166 |
uploaded_files.pop(removed_file, None)
|
167 |
return [file for file in existing_files if file['props']['children'][1]['props']['children'] != removed_file]
|
168 |
+
|
169 |
def generate_matrix_with_gpt(matrix_type, file_contents):
|
170 |
prompt = f"""Generate a {matrix_type} based on the following project artifacts:
|
171 |
|