Wajahat698 commited on
Commit
43d3e6b
·
verified ·
1 Parent(s): 86a44e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -429,7 +429,7 @@ def load_main_data_source():
429
  # Split main content into chunks
430
  text_splitter = RecursiveCharacterTextSplitter(
431
  chunk_size=2000, # Adjust based on context window
432
- chunk_overlap=300, # Ensure continuity between chunks
433
  separators=["\n\n", "\n", ".", " "] # Prioritize splitting at logical breaks
434
  )
435
  main_texts = text_splitter.split_text(main_content)
@@ -1028,7 +1028,7 @@ def search_knowledge_base(query):
1028
  return []
1029
 
1030
  # Retrieve the top 5 most relevant documents
1031
- retrieved_docs = st.session_state["faiss_db"].similarity_search(query, k=5)
1032
  return retrieved_docs
1033
 
1034
  def google_search(query):
@@ -1144,7 +1144,7 @@ tools = [
1144
  prompt_message = f"""
1145
  ** You are a Professional copywriter tasked with creating non-flowery fluid, interconnected marketing content that integrates Trust Builders into various formats for food for the hungry. Your content should be compelling, factual, well-structured, concise, and based on the knowledgebase. Write in an active voice using the first-person perspective ("we"), and avoid the third-person perspective. Creatively interconnect trust-building elements to enhance flow and impact. Avoid using terms like Stability, Development, Competence, Relationship, Benefit, Vision, trust, beacon, beacon of hope, and realm, except where specified.
1146
 
1147
- -When 'our,','FH,' or 'food for the hungry' is mentioned, use knowledgebase give exact data in knowledgebase donot add anything or change it *
1148
 
1149
  ###Mandatory Verification Checklist
1150
  Before submitting any content, ensure it includes:
@@ -2032,7 +2032,7 @@ def handle_prompt(prompt):
2032
  display_typing_indicator()
2033
  cleaned_text = ""
2034
  base_instructions = (
2035
- "Strictly Avoid flowery language, typical AI phrases and jargons. For general queries please strictly refer knowledgebase."
2036
  "Strictly dont use trustbucket names in copy headings and content avoid it"
2037
  )
2038
 
 
429
  # Split main content into chunks
430
  text_splitter = RecursiveCharacterTextSplitter(
431
  chunk_size=2000, # Adjust based on context window
432
+ chunk_overlap=400, # Ensure continuity between chunks
433
  separators=["\n\n", "\n", ".", " "] # Prioritize splitting at logical breaks
434
  )
435
  main_texts = text_splitter.split_text(main_content)
 
1028
  return []
1029
 
1030
  # Retrieve the top 5 most relevant documents
1031
+ retrieved_docs = st.session_state["faiss_db"].similarity_search(query, k=3)
1032
  return retrieved_docs
1033
 
1034
  def google_search(query):
 
1144
  prompt_message = f"""
1145
  ** You are a Professional copywriter tasked with creating non-flowery fluid, interconnected marketing content that integrates Trust Builders into various formats for food for the hungry. Your content should be compelling, factual, well-structured, concise, and based on the knowledgebase. Write in an active voice using the first-person perspective ("we"), and avoid the third-person perspective. Creatively interconnect trust-building elements to enhance flow and impact. Avoid using terms like Stability, Development, Competence, Relationship, Benefit, Vision, trust, beacon, beacon of hope, and realm, except where specified.
1146
 
1147
+ -When 'our,','FH,' or 'food for the hungry' is mentioned, use knowledgebase first.*
1148
 
1149
  ###Mandatory Verification Checklist
1150
  Before submitting any content, ensure it includes:
 
2032
  display_typing_indicator()
2033
  cleaned_text = ""
2034
  base_instructions = (
2035
+ "Strictly Avoid flowery language, typical AI phrases and jargons. When aksed about"
2036
  "Strictly dont use trustbucket names in copy headings and content avoid it"
2037
  )
2038