Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,8 @@ if 'Recap' not in st.session_state:
|
|
24 |
st.session_state['Recap'] = False
|
25 |
if 'Summaries' not in st.session_state:
|
26 |
st.session_state['Summaries'] = []
|
|
|
|
|
27 |
|
28 |
|
29 |
|
@@ -87,6 +89,8 @@ if st.button("sync"):
|
|
87 |
if st.session_state['sync']:
|
88 |
|
89 |
if not st.session_state['Recap']:
|
|
|
|
|
90 |
st.session_state['selected_branches'] = st.session_state['branches_list']
|
91 |
st.session_state['selected_contributor'] = [] # Reset selected contributor
|
92 |
# Branch selection
|
@@ -109,32 +113,29 @@ if st.session_state['sync']:
|
|
109 |
print(st.session_state['commits'])
|
110 |
print(st.session_state['markdown'])
|
111 |
|
|
|
|
|
112 |
st.session_state['Recap'] = True
|
113 |
print(len(st.session_state['commits']))
|
114 |
-
# st.session_state['markdown'] = get_markdown(st.session_state['commits'])
|
115 |
-
# st.session_state['sync'] = False
|
116 |
else:
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
st.text_input("Ask any question about the contributor:", on_change=None, key="chat_prompt")
|
123 |
-
|
124 |
-
if st.button("ask"):
|
125 |
-
st.write("Feature coming soon!")
|
126 |
-
if st.session_state['commits']:
|
127 |
-
st.table(st.session_state['commits'])
|
128 |
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
|
|
|
|
|
|
138 |
|
139 |
|
140 |
# if st.session_state['Recap']:
|
|
|
24 |
st.session_state['Recap'] = False
|
25 |
if 'Summaries' not in st.session_state:
|
26 |
st.session_state['Summaries'] = []
|
27 |
+
if 'Summaries_state' not in st.session_state:
|
28 |
+
st.session_state['Summaries_state'] = False
|
29 |
|
30 |
|
31 |
|
|
|
89 |
if st.session_state['sync']:
|
90 |
|
91 |
if not st.session_state['Recap']:
|
92 |
+
|
93 |
+
st.session_state['Summaries_state'] = False
|
94 |
st.session_state['selected_branches'] = st.session_state['branches_list']
|
95 |
st.session_state['selected_contributor'] = [] # Reset selected contributor
|
96 |
# Branch selection
|
|
|
113 |
print(st.session_state['commits'])
|
114 |
print(st.session_state['markdown'])
|
115 |
|
116 |
+
st.session_state['markdown'] = get_markdown(st.session_state['commits'])
|
117 |
+
# st.session_state['sync'] = False
|
118 |
st.session_state['Recap'] = True
|
119 |
print(len(st.session_state['commits']))
|
|
|
|
|
120 |
else:
|
121 |
+
st.session_state['Summaries_state'] = True
|
122 |
+
|
123 |
+
|
124 |
+
|
125 |
+
if st.session_state['Summaries_state']:
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
+
# rs.slides(markdown, height=500)
|
128 |
+
rs.slides(st.session_state['markdown'], height=500)
|
129 |
+
|
130 |
+
# Chat prompt (future feature)
|
131 |
+
st.text_input("Ask any question about the contributor:", on_change=None, key="chat_prompt")
|
132 |
+
|
133 |
+
st.session_state["question"] = st.text_input("Ask any question about the contributor:", on_change=None, key="chat_prompt")
|
134 |
+
|
135 |
+
if st.button("ask"):
|
136 |
+
st.session_state["response"] = chat_complete(f"given the following summaries of this contributor's commits {str(st.session_state['summaries'])} answer the following question: {str(st.session_state['question'])}")
|
137 |
+
st.write(str(st.session_state["response"]))
|
138 |
+
|
139 |
|
140 |
|
141 |
# if st.session_state['Recap']:
|