Wajahat698 commited on
Commit
610c2e7
·
verified ·
1 Parent(s): a9e00d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -13
app.py CHANGED
@@ -220,7 +220,7 @@ def load_knowledge_base():
220
  try:
221
  loader = TextLoader("./data_source/time_to_rethink_trust_book.md")
222
  documents = loader.load()
223
- text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=250)
224
  docs = text_splitter.split_documents(documents)
225
  return docs
226
  except Exception as e:
@@ -292,7 +292,7 @@ prompt_message = f""" You are a expert copywriter capable of generating respons
292
  *Strictly do not mention name of any trust bucket [ stability, development , relationship , competence , benefit , vision] in your response .
293
 
294
  If user input is Trust-Based or proof points or compelling copy Query :
295
- If the query is related to particular trust buckets or proof points in that case only refer to knowledge base :[knowledge_base] and strictly follow the steps below:
296
  **Instructions :**
297
  *Identify Trust Bucket: Determine the relevant trust bucket from the user's query. Do not explicitly mention the trust bucket in your response.
298
  *Response Length: Generate a detailed, compelling copy between 1000-2000 words focused exclusively on the identified trust bucket.
@@ -323,7 +323,6 @@ prompt_message = f""" You are a expert copywriter capable of generating respons
323
  Bucket Brigades: Use short phrases or questions to maintain momentum and encourage continued reading.
324
  AIDA Framework: Structure content to grab Attention, generate Interest, create Desire, and prompt Action.
325
  [Always consider which of these techniques would be most appropriate and effective for the specific query and context when crafting your response]
326
-
327
  """
328
 
329
 
@@ -379,20 +378,17 @@ if not st.session_state.get("chat_started", False):
379
  });
380
  });
381
  </script>
382
-
383
  <style>
384
  /* Hide all <a> elements inside elements with block-container and st-emotion-cache-1eo1tir ea3mdgi5 classes */
385
  .block-container.st-emotion-cache-1eo1tir.ea3mdgi5 a {
386
  display: none !important;
387
  }
388
-
389
  /* Ensure links in the sidebar are visible and underlined */
390
  .stSidebar a {
391
  display: inline !important;
392
  text-decoration: underline !important;
393
  color: inherit !important;
394
  }
395
-
396
  /* Additional styles */
397
  .section-container {
398
  display: flex;
@@ -418,7 +414,6 @@ if not st.session_state.get("chat_started", False):
418
  font-size: 12px;
419
  transition: background-color 0.3s ease;
420
  }
421
-
422
  .section h2 {
423
  color: #afafaf;
424
  font-size: 14px;
@@ -426,16 +421,13 @@ if not st.session_state.get("chat_started", False):
426
  border-bottom: 1px solid #afafaf;
427
  padding-bottom: 4px;
428
  text-align: center; /* Center headings */
429
-
430
  }
431
-
432
  .section p {
433
  color: #afafaf;
434
  font-size: 11px;
435
  margin: 5px 0;
436
  line-height: 1.4;
437
  }
438
-
439
  @media (max-width: 100px) {
440
  .section {
441
  min-width: 90%;
@@ -445,7 +437,6 @@ if not st.session_state.get("chat_started", False):
445
  </style>
446
 
447
  <h1 style="text-align: center; background: #528186; -webkit-background-clip: text; color: transparent;">How can I help you today?</h1>
448
-
449
  <div class="section-container">
450
  <div class="section">
451
  <h2>Find</h2>
@@ -461,14 +452,13 @@ if not st.session_state.get("chat_started", False):
461
  </div>
462
  </div>
463
  <div style="height: 50px;"></div> <!-- Adds a gap of 50px after the section containers -->
464
-
465
  """, unsafe_allow_html=True)
466
 
467
 
468
 
469
 
470
 
471
- prompt = st.chat_input(placeholder="Type your prompt here")
472
  if prompt :
473
 
474
  st.session_state["chat_started"] = True
 
220
  try:
221
  loader = TextLoader("./data_source/time_to_rethink_trust_book.md")
222
  documents = loader.load()
223
+ text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
224
  docs = text_splitter.split_documents(documents)
225
  return docs
226
  except Exception as e:
 
292
  *Strictly do not mention name of any trust bucket [ stability, development , relationship , competence , benefit , vision] in your response .
293
 
294
  If user input is Trust-Based or proof points or compelling copy Query :
295
+ If the query is related to particular trust buckets or proof points in that case only refer to knowledge base :[knowledge base] and strictly follow the steps below:
296
  **Instructions :**
297
  *Identify Trust Bucket: Determine the relevant trust bucket from the user's query. Do not explicitly mention the trust bucket in your response.
298
  *Response Length: Generate a detailed, compelling copy between 1000-2000 words focused exclusively on the identified trust bucket.
 
323
  Bucket Brigades: Use short phrases or questions to maintain momentum and encourage continued reading.
324
  AIDA Framework: Structure content to grab Attention, generate Interest, create Desire, and prompt Action.
325
  [Always consider which of these techniques would be most appropriate and effective for the specific query and context when crafting your response]
 
326
  """
327
 
328
 
 
378
  });
379
  });
380
  </script>
 
381
  <style>
382
  /* Hide all <a> elements inside elements with block-container and st-emotion-cache-1eo1tir ea3mdgi5 classes */
383
  .block-container.st-emotion-cache-1eo1tir.ea3mdgi5 a {
384
  display: none !important;
385
  }
 
386
  /* Ensure links in the sidebar are visible and underlined */
387
  .stSidebar a {
388
  display: inline !important;
389
  text-decoration: underline !important;
390
  color: inherit !important;
391
  }
 
392
  /* Additional styles */
393
  .section-container {
394
  display: flex;
 
414
  font-size: 12px;
415
  transition: background-color 0.3s ease;
416
  }
 
417
  .section h2 {
418
  color: #afafaf;
419
  font-size: 14px;
 
421
  border-bottom: 1px solid #afafaf;
422
  padding-bottom: 4px;
423
  text-align: center; /* Center headings */
 
424
  }
 
425
  .section p {
426
  color: #afafaf;
427
  font-size: 11px;
428
  margin: 5px 0;
429
  line-height: 1.4;
430
  }
 
431
  @media (max-width: 100px) {
432
  .section {
433
  min-width: 90%;
 
437
  </style>
438
 
439
  <h1 style="text-align: center; background: #528186; -webkit-background-clip: text; color: transparent;">How can I help you today?</h1>
 
440
  <div class="section-container">
441
  <div class="section">
442
  <h2>Find</h2>
 
452
  </div>
453
  </div>
454
  <div style="height: 50px;"></div> <!-- Adds a gap of 50px after the section containers -->
 
455
  """, unsafe_allow_html=True)
456
 
457
 
458
 
459
 
460
 
461
+ prompt = st.chat_input("")
462
  if prompt :
463
 
464
  st.session_state["chat_started"] = True