4
4
from prompts import get_release_notes_summary_prompt , get_release_notes_desc_prompt , get_category_prompt
5
5
from html_template import format_output
6
6
7
- #Functions to call the Completions end point for category, summary, and description. The prompts used are imported from the prompts file
7
+ # Functions to call the Completions end point for category, summary, and description. The prompts used are imported from the prompts file
8
8
def _get_category (desc , label ):
9
9
prompt = get_category_prompt (desc , label )
10
10
label = writer .ai .complete (prompt )
@@ -26,16 +26,16 @@ def onchangefile_handler(state, payload):
26
26
27
27
# Store file name and path in case we need to use it later
28
28
name = uploaded_file .get ("name" )
29
- state ["File " ]["Name " ] = name
29
+ state ["file " ]["name " ] = name
30
30
state ["step1" ]["processing-message" ] = f'+File { name } uploaded successfully.'
31
- state ["File " ]["file_path" ] = f"data/{ name } "
31
+ state ["file " ]["file_path" ] = f"data/{ name } "
32
32
file_data = uploaded_file .get ("data" )
33
33
# Save the file to the data folder instead of reading it in memory
34
34
with open (f"data/{ name } " , "wb" ) as file_handle :
35
35
file_handle .write (file_data )
36
36
37
37
# Save raw csv file and mark the upload step as complete
38
- data = pd .read_csv (state ["File " ]["file_path" ])
38
+ data = pd .read_csv (state ["file " ]["file_path" ])
39
39
df = pd .DataFrame (data )
40
40
state ["step1" ]["raw_csv" ] = df
41
41
state ["step1" ]["generate-button-state" ] = "no"
@@ -116,7 +116,7 @@ def _create_df_for_category(df,state):
116
116
117
117
# Function to read in the raw CSV file and return a DataFrame
118
118
def _raw_csv_to_df (state ):
119
- data = pd .read_csv (state ["File " ]["file_path" ])
119
+ data = pd .read_csv (state ["file " ]["file_path" ])
120
120
df = pd .DataFrame (data )
121
121
return df
122
122
@@ -126,8 +126,8 @@ def _raw_csv_to_df(state):
126
126
"title" : "Release Notes Generator"
127
127
},
128
128
"logo_image_path" : 'static/Writer_Logo_black.svg' ,
129
- "File " : {
130
- "Name " : "" ,
129
+ "file " : {
130
+ "name " : "" ,
131
131
"file_path" : ""
132
132
},
133
133
"metrics" :{
0 commit comments