Skip to content

Commit b19cabf

Browse files
committed
Correction to release notes generator
1 parent a6d4dcd commit b19cabf

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

release-notes-generator/end/main.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from prompts import get_release_notes_summary_prompt, get_release_notes_desc_prompt, get_category_prompt
55
from html_template import format_output
66

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
88
def _get_category(desc, label):
99
prompt = get_category_prompt(desc, label)
1010
label = writer.ai.complete(prompt)
@@ -26,16 +26,16 @@ def onchangefile_handler(state, payload):
2626

2727
# Store file name and path in case we need to use it later
2828
name = uploaded_file.get("name")
29-
state["File"]["Name"] = name
29+
state["file"]["name"] = name
3030
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}"
3232
file_data = uploaded_file.get("data")
3333
# Save the file to the data folder instead of reading it in memory
3434
with open(f"data/{name}", "wb") as file_handle:
3535
file_handle.write(file_data)
3636

3737
# 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"])
3939
df = pd.DataFrame(data)
4040
state["step1"]["raw_csv"] = df
4141
state["step1"]["generate-button-state"] = "no"
@@ -116,7 +116,7 @@ def _create_df_for_category(df,state):
116116

117117
# Function to read in the raw CSV file and return a DataFrame
118118
def _raw_csv_to_df(state):
119-
data = pd.read_csv(state["File"]["file_path"])
119+
data = pd.read_csv(state["file"]["file_path"])
120120
df = pd.DataFrame(data)
121121
return df
122122

@@ -126,8 +126,8 @@ def _raw_csv_to_df(state):
126126
"title": "Release Notes Generator"
127127
},
128128
"logo_image_path" : 'static/Writer_Logo_black.svg',
129-
"File": {
130-
"Name" : "",
129+
"file": {
130+
"name" : "",
131131
"file_path" : ""
132132
},
133133
"metrics":{

0 commit comments

Comments
 (0)