Update app.py
Browse files
app.py
CHANGED
|
@@ -173,11 +173,11 @@ def remove_file(n_clicks, existing_files):
|
|
| 173 |
raise PreventUpdate
|
| 174 |
|
| 175 |
triggered_id = ctx.triggered[0]['prop_id']
|
| 176 |
-
removed_file =
|
| 177 |
|
| 178 |
uploaded_files.pop(removed_file, None)
|
| 179 |
return [file for file in existing_files if file['props']['children'][1]['children'] != removed_file]
|
| 180 |
-
|
| 181 |
def generate_matrix_with_gpt(matrix_type, file_contents):
|
| 182 |
prompt = f"""Generate a {matrix_type} based on the following project artifacts:
|
| 183 |
{' '.join(file_contents)}
|
|
|
|
| 173 |
raise PreventUpdate
|
| 174 |
|
| 175 |
triggered_id = ctx.triggered[0]['prop_id']
|
| 176 |
+
removed_file = triggered_id.split('"index":')[1].split('}')[0].strip('"')
|
| 177 |
|
| 178 |
uploaded_files.pop(removed_file, None)
|
| 179 |
return [file for file in existing_files if file['props']['children'][1]['children'] != removed_file]
|
| 180 |
+
|
| 181 |
def generate_matrix_with_gpt(matrix_type, file_contents):
|
| 182 |
prompt = f"""Generate a {matrix_type} based on the following project artifacts:
|
| 183 |
{' '.join(file_contents)}
|