Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def IBM_chat (messages):
|
|
48 |
"messages": messages,
|
49 |
"max_tokens": 10000,
|
50 |
"temperature": 0.7,
|
51 |
-
"time_limit":
|
52 |
}
|
53 |
headers = {
|
54 |
"Accept": "application/json",
|
@@ -215,7 +215,7 @@ def do_query(query):
|
|
215 |
st.image("banner_policy.jpg", use_container_width=True)
|
216 |
|
217 |
# set up sidebar
|
218 |
-
st.sidebar.title("
|
219 |
st.sidebar.write(
|
220 |
"Synergy Scrolling analyzes policies and finds relevant past projects. "
|
221 |
"This tool helps match your policy or business idea with projects from "
|
@@ -245,7 +245,7 @@ query = ""
|
|
245 |
|
246 |
################ main UI
|
247 |
|
248 |
-
st.title("
|
249 |
st.subheader("AI-Powered Project & Policy Matching")
|
250 |
st.write("Explore the Lab Lab Library to find relevant past projects that align with your policy or new initiative.")
|
251 |
|
@@ -253,21 +253,22 @@ st.write("Explore the Lab Lab Library to find relevant past projects that align
|
|
253 |
|
254 |
policy_input = st.sidebar.text_area("๐ Enter Your Policy or Business Idea:")
|
255 |
|
256 |
-
if st.sidebar.button("๐
|
257 |
if policy_input.strip():
|
258 |
prompt = f"Define search criteria for projects to implement: {policy_input}"
|
259 |
|
260 |
# Get response from IBM
|
261 |
with st.spinner("Analyzing..."):
|
262 |
result = IBM_query(prompt)
|
263 |
-
|
264 |
-
st.session_state["extended_query"] = query
|
265 |
else:
|
266 |
st.sidebar.warning("Please enter a policy or business idea first!")
|
267 |
|
268 |
# Display AI result in another textarea
|
269 |
st.sidebar.text_area("๐ก Extended query:", value=st.session_state.get("extended_query", ""), height=150)
|
270 |
-
|
|
|
|
|
271 |
# Suggested search queries as buttons
|
272 |
col1, col2, col3 = st.columns(3)
|
273 |
|
|
|
48 |
"messages": messages,
|
49 |
"max_tokens": 10000,
|
50 |
"temperature": 0.7,
|
51 |
+
"time_limit": 40000
|
52 |
}
|
53 |
headers = {
|
54 |
"Accept": "application/json",
|
|
|
215 |
st.image("banner_policy.jpg", use_container_width=True)
|
216 |
|
217 |
# set up sidebar
|
218 |
+
st.sidebar.title("๐ง Synergy Scrolling")
|
219 |
st.sidebar.write(
|
220 |
"Synergy Scrolling analyzes policies and finds relevant past projects. "
|
221 |
"This tool helps match your policy or business idea with projects from "
|
|
|
245 |
|
246 |
################ main UI
|
247 |
|
248 |
+
st.title("๐ฎ Policy Scroll")
|
249 |
st.subheader("AI-Powered Project & Policy Matching")
|
250 |
st.write("Explore the Lab Lab Library to find relevant past projects that align with your policy or new initiative.")
|
251 |
|
|
|
253 |
|
254 |
policy_input = st.sidebar.text_area("๐ Enter Your Policy or Business Idea:")
|
255 |
|
256 |
+
if st.sidebar.button("๐ Analyze with IBM Granite"):
|
257 |
if policy_input.strip():
|
258 |
prompt = f"Define search criteria for projects to implement: {policy_input}"
|
259 |
|
260 |
# Get response from IBM
|
261 |
with st.spinner("Analyzing..."):
|
262 |
result = IBM_query(prompt)
|
263 |
+
st.session_state["extended_query"] = "Find 3 projects that best match these criteria: " + result
|
|
|
264 |
else:
|
265 |
st.sidebar.warning("Please enter a policy or business idea first!")
|
266 |
|
267 |
# Display AI result in another textarea
|
268 |
st.sidebar.text_area("๐ก Extended query:", value=st.session_state.get("extended_query", ""), height=150)
|
269 |
+
if st.sidebar.button("๐ Search for synergy"):
|
270 |
+
query = st.session_state.get("extended_query", "")
|
271 |
+
|
272 |
# Suggested search queries as buttons
|
273 |
col1, col2, col3 = st.columns(3)
|
274 |
|