BaRiDo commited on
Commit
45ab87d
ยท
verified ยท
1 Parent(s): 05ec8aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
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": 30000
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("๐Ÿ” 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,7 +245,7 @@ query = ""
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,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("๐Ÿ”— Connect with IBM Chat"):
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
- query = "Find 3 projects that best match these criteria: " + result
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