Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ with st.sidebar:
|
|
33 |
st.subheader("About:")
|
34 |
st.info(
|
35 |
"\n\n 1. This app uses the 'gpt-4o-mini-2024-07-18' model."
|
36 |
-
"\n\n 2. Writing essays may take some time, approximately 2
|
37 |
)
|
38 |
|
39 |
# API Key Retrieval
|
@@ -46,7 +46,7 @@ with st.sidebar:
|
|
46 |
essay_length = st.number_input(
|
47 |
"Select Essay Length (words):",
|
48 |
min_value=150,
|
49 |
-
max_value=
|
50 |
value=250,
|
51 |
step=50
|
52 |
)
|
@@ -74,9 +74,9 @@ def initialize_agents():
|
|
74 |
return st.session_state["app"]
|
75 |
|
76 |
# Initialize the full EssayWriter instance
|
77 |
-
essay_writer = EssayWriter() #
|
78 |
-
st.session_state["app"] = essay_writer #
|
79 |
-
st.session_state["chat_active"] = False #
|
80 |
|
81 |
return essay_writer
|
82 |
except Exception as e:
|
|
|
33 |
st.subheader("About:")
|
34 |
st.info(
|
35 |
"\n\n 1. This app uses the 'gpt-4o-mini-2024-07-18' model."
|
36 |
+
"\n\n 2. Writing essays may take some time, approximately 1-2 minutes."
|
37 |
)
|
38 |
|
39 |
# API Key Retrieval
|
|
|
46 |
essay_length = st.number_input(
|
47 |
"Select Essay Length (words):",
|
48 |
min_value=150,
|
49 |
+
max_value=500,
|
50 |
value=250,
|
51 |
step=50
|
52 |
)
|
|
|
74 |
return st.session_state["app"]
|
75 |
|
76 |
# Initialize the full EssayWriter instance
|
77 |
+
essay_writer = EssayWriter() # Store the full instance
|
78 |
+
st.session_state["app"] = essay_writer # Now contains `graph`
|
79 |
+
st.session_state["chat_active"] = False # Enable chat after successful initialization
|
80 |
|
81 |
return essay_writer
|
82 |
except Exception as e:
|