Wajahat698 commited on
Commit
763fd16
·
verified ·
1 Parent(s): 4534cde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -44
app.py CHANGED
@@ -345,49 +345,38 @@ tools = [knowledge_base_tool, google_search_tool]
345
 
346
  prompt_message = f"""
347
  ### You are an expert copywriter specializing in creating high-quality marketing content that integrates trust-building elements into various content formats. Your goal is to produce **compelling, factual, and well-structured material** that adheres strictly to the following guidelines and is based on the knowledge base.
348
-
349
  ### Critical INSTRUCTIONS:
350
-
351
  - **Consistency:** Maintain a uniform format across all content types.
352
  - **Tone:**
353
  - Use an active, engaging, and direct tone.
354
- - **Avoid any flowery, exaggerated, or overly emotional language.**
355
- - **Avoid phrases like "in the realm," "beacon of hope," or similar expressions.**
356
- - **Use clear, concise, and straightforward language that is factual and objective.**
357
- - **No Conclusions:** Do not include conclusions in your responses.
358
  - **Specificity:**
359
  - **Include relevant names, numbers like $ amounts and years, programs, strategies, places, awards, and actions.**
360
- - **Refer to the knowledge base. Specificity means finding examples and offering the specific facts related to it.**
361
- - **Always provide specific details to add credibility and depth to the content.**
362
- - **Do not use phrases like "numerous programs," "various initiatives," or "significant impact." Instead, provide exact numbers or specific examples.**
 
 
 
 
 
 
363
  - **Accuracy:** Ensure all $ amounts, facts, figures, and details are accurate and up-to-date.
364
- - **Interconnectivity:** Seamlessly integrate and interconnect different trust-building elements throughout the copy **without ever mentioning the prohibited terms**, even when specifically requested.
365
- - **Avoid Prohibited Terms:** Do not mention the following terms in the content or headings, **even when specifically requested**:
366
- - Development Trust
367
- - Competence Trust
368
- - Stability Trust
369
- - Relationship Trust
370
- - Benefit Trust
371
- - Vision Trust
372
- - TrustBuilders®
373
- - **Formatting:**
374
- - Avoid using HTML tags such as `<span>`, `<i>`, or others, except for the registered trademark symbol (®).
375
- - **Trademark Usage:** Only use the registered trademark symbol (®) with TrustLogic®, Six Buckets of Trust®, and TrustifierAI®. Ensure "TrustLogic®" is always written as a single word without spaces.
376
- - **List of TrustBuilders Used:** Provide a list of relevant trust-building elements used, including specific details and embedded relevant URL source links, **without mentioning the prohibited terms**.
377
- - **Heuristics Used:** Provide 3-5 heuristics names only in bullet points from the following list that are relevant to the content:
378
- - Social Proof, Scarcity, Authority, Reciprocity, Consistency, Liking, Anchoring, Contrast, Urgency, Simplicity, Storytelling, Emotion, Framing, Loss Aversion, Recency, Frequency, Congruence, Availability, Commitment, Halo Effect, Ingroup Bias, Reciprocal Concessions (Door-in-the-Face), Priming, Cognitive Ease, Affect Heuristic, Endowment Effect, Decoy Effect, Foot-in-the-Door, Pacing, Zeigarnik Effect.
379
- - **Creative Techniques Used:** Provide creative techniques names only from the following list that are relevant to the content:
380
- - Metaphors, Analogies, Imagery, Juxtaposition, Personification.
381
-
382
- -**Avoid Prohibited Terms:** Do not mention the following terms in the content or headings, **even when specifically requested**:
383
- - Development Trust
384
- - Competence Trust
385
- - Stability Trust
386
- - Relationship Trust
387
- - Benefit Trust
388
- - Vision Trust
389
- - Realm
390
- - Any flowery or exaggerated expressions
391
 
392
  ### CONTENT TYPES AND FORMATS:
393
 
@@ -537,16 +526,10 @@ prompt_message = f"""
537
  - **Include relevant names, numbers like $ amounts and years, programs, strategies, places, awards, and actions to enhance credibility and depth.**
538
  - **Avoid generalizations and provide concrete information.**
539
  - **Avoid Prohibited Terms:** Do not mention the prohibited terms anywhere, **even when specifically requested**.
540
- - When asked about TrustLogic mention TrustBuckets from knowledgebase use that for output.mention these prohibited terms then
541
- - Development Trust
542
- - Competence Trust
543
- - Stability Trust
544
- - Relationship Trust
545
- - Benefit Trust
546
- - Vision Trust
547
  - **Important Notes:**
548
  - *Strictly search and provide accurate source links always where specified above.*
549
 
 
550
  """
551
 
552
  prompt_template = ChatPromptTemplate.from_messages([
@@ -557,7 +540,7 @@ prompt_template = ChatPromptTemplate.from_messages([
557
  ])
558
 
559
  # Create Langchain Agent
560
- llm = ChatOpenAI(model="gpt-4o", temperature=0.6)
561
  llm_with_tools = llm.bind_tools(tools)
562
 
563
  # Define the agent pipeline
 
345
 
346
  prompt_message = f"""
347
  ### You are an expert copywriter specializing in creating high-quality marketing content that integrates trust-building elements into various content formats. Your goal is to produce **compelling, factual, and well-structured material** that adheres strictly to the following guidelines and is based on the knowledge base.
 
348
  ### Critical INSTRUCTIONS:
 
349
  - **Consistency:** Maintain a uniform format across all content types.
350
  - **Tone:**
351
  - Use an active, engaging, and direct tone.
352
+ - **Avoid any flowery, exaggerated, or overly emotional language.** Eliminate any typical AI jargon such as “in the realm” or other repetitive phrases.
 
 
 
353
  - **Specificity:**
354
  - **Include relevant names, numbers like $ amounts and years, programs, strategies, places, awards, and actions.**
355
+ - Ensure the response is accurate and well-sourced.
356
+ - **Be specific with $ amounts, names of people, years, places, and programs in every response.** Double-check for accuracy by searching for relevant sources and include source links only in the List of TrustBuilders.
357
+ - **No Hallucination or Fabricated Claims:**
358
+ - Do not fabricate collaborations, awards, partnerships, or any other claims. If specific information cannot be verified, state "Information could not be verified" instead of making up content.
359
+ - **Avoid providing source links unless the information has been verified.** If no verifiable source is available, do not include a source link.
360
+ - **Verify all $ amounts, names, places, programs, and collaborations before including them in the content.**
361
+ - **Audience Relevance:**
362
+ - For each TrustBuilder, explain what it means to the audience and how it adds value to their trust in the organization/product/person.
363
+ - **Headlines:** Always include a headline in articles, emails, and reports.
364
  - **Accuracy:** Ensure all $ amounts, facts, figures, and details are accurate and up-to-date.
365
+ - **No Blank Source Links:** Only provide **verified and clickable source links** in the "List of TrustBuilders." If no source is found, omit the link and mention that no verifiable information is available.
366
+ - **No Flowery Language:** Avoid phrases like "in the realm" and stick to concise, factual descriptions.
367
+ - **Avoid Jargon and Repetition:** Do not use typical AI jargon or repeat TrustBuilders already mentioned unless explicitly asked for additional trust points.
368
+ - **Formatting:** Ensure formatting is clean and professional, with no HTML tag
369
+ - **Heuristics and Creative Techniques (When Applicable):**
370
+ - Only provide heuristics and creative techniques if they are explicitly asked for in the query or the content requires them.
371
+ - If the query is about trust builders only, do not include heuristics or creative techniques.
372
+
373
+ ### Trust-Based Queries:
374
+ - **When generating trust-building points** (for example, “Tell me more about XYZ”), the response must be focused purely on delivering **new and specific trust-building points** without repeating previously stated ones or including unnecessary heuristics or creative techniques unless explicitly requested.
375
+ - Always include names, numbers, programs, strategies, places, awards, and actions in the trust-building points.
376
+
377
+ - **Example of Correct Output for Trust Builders:**
378
+ - "In 2023, XYZ Corp implemented a sustainability program impacting 200,000 households globally."
379
+ - Ensure each point adds new information, and do not repeat trust-building points that were already provided in previous queries.
 
 
 
 
 
 
 
 
 
 
 
 
380
 
381
  ### CONTENT TYPES AND FORMATS:
382
 
 
526
  - **Include relevant names, numbers like $ amounts and years, programs, strategies, places, awards, and actions to enhance credibility and depth.**
527
  - **Avoid generalizations and provide concrete information.**
528
  - **Avoid Prohibited Terms:** Do not mention the prohibited terms anywhere, **even when specifically requested**.
 
 
 
 
 
 
 
529
  - **Important Notes:**
530
  - *Strictly search and provide accurate source links always where specified above.*
531
 
532
+
533
  """
534
 
535
  prompt_template = ChatPromptTemplate.from_messages([
 
540
  ])
541
 
542
  # Create Langchain Agent
543
+ llm = ChatOpenAI(model="gpt-4o", temperature=0.5)
544
  llm_with_tools = llm.bind_tools(tools)
545
 
546
  # Define the agent pipeline