Manasa1 commited on
Commit
32cd9dd
·
verified ·
1 Parent(s): bc3d95e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -21
app.py CHANGED
@@ -15,21 +15,24 @@ agent = Agent(
15
  tools=[DuckDuckGo(), Newspaper4k()],
16
  description="You are an experienced writer who understands the art of engaging, informative, and clear writing. Your style blends a friendly tone with valuable insights, designed to invite reflection and discussion, perfect for an online magazine like Medium.",
17
  instructions=[
18
- # Positive prompts for Medium
19
- "Write like you're sharing an insightful discovery with a friend but maintain a level of professionalism that suits a Medium audience.",
20
- "**Voice Guidelines:**\n- Be conversational, but ensure clarity and professionalism.\n- Avoid sounding overly casual or too formal—balance is key.\n- Share your personal perspective, but keep it relevant to the reader's interests.\n- Use stories and examples that connect to the broader theme.",
21
- "**Structure Guidelines:**\n- Start with a compelling hook to grab the reader's attention.\n- Use subheadings to break down sections and guide the reader through the article.\n- Create smooth transitions between sections to maintain flow.\n- Include a clear conclusion that ties everything together and leaves the reader with something to reflect on.\n- Use lists or bullet points for clarity when appropriate.",
22
- "**Research Style:**\n- Back up your claims with credible sources, but don't overwhelm the reader with data—focus on the most impactful findings.\n- Share your process and how you came to your conclusions.\n- Include personal reflections or lessons learned to add depth to the topic.",
23
- "**Engagement:**\n- Aim to spark curiosity or offer value that encourages the reader to think or take action.\n- Include questions or statements that invite readers to reflect or engage with the content.\n- Use a tone that makes the reader feel like you're having a conversation, not lecturing them.",
24
- "Most importantly: Keep it clear, engaging, and relevant. Remember that the Medium audience is looking for thought-provoking, valuable content.",
25
 
26
- # Negative prompts for Medium
27
- "Avoid being too casual or informal. Medium readers appreciate clarity and insight, not overly conversational language that could distract from the main point.",
28
- "Do not use excessive slang or make the writing too 'chatty'. While personality is important, it should not overshadow the message.",
29
- "Avoid going on tangents that do not add value or clarity to the main idea. Medium articles should have a clear focus.",
30
- "Don’t be repetitive unless it's for emphasis. Medium readers prefer concise content with meaningful points.",
31
- "Avoid overcomplicating the structure. Medium articles should be easy to follow, with clear sections and a logical flow of ideas.",
32
- "Don’t use overly technical or niche jargon unless it's essential for the topic. Medium's audience is diverse, so keep things accessible.",
 
 
 
 
 
 
 
33
  ],
34
  markdown=True,
35
  show_tool_calls=True,
@@ -46,16 +49,14 @@ def main():
46
 
47
  if st.button("Generate Article"):
48
  if topic:
49
- with st.spinner("Writing your article... (making sure it's clear and engaging for Medium)..."):
50
  response = agent.run(
51
  f"Write an article for Medium about: {topic}\n\n"
52
  "Remember:\n"
53
- "- Start with a strong hook\n"
54
- "- Use clear sections with subheadings\n"
55
- "- Keep your tone conversational, yet informative\n"
56
- "- Avoid being overly casual or too formal\n"
57
- "- Back up your points with insights or personal reflections\n"
58
- "- End with a clear conclusion that invites reflection"
59
  )
60
 
61
  st.markdown("## Your Medium Article")
@@ -73,3 +74,4 @@ def main():
73
 
74
  if __name__ == "__main__":
75
  main()
 
 
15
  tools=[DuckDuckGo(), Newspaper4k()],
16
  description="You are an experienced writer who understands the art of engaging, informative, and clear writing. Your style blends a friendly tone with valuable insights, designed to invite reflection and discussion, perfect for an online magazine like Medium.",
17
  instructions=[
18
+ # Positive prompts for human-like writing
19
+ "Write like you're sharing an insightful discovery with a friend. Add imperfections like self-corrections, digressions, and real-time thoughts.",
20
+ "**Voice Guidelines:**\n- Keep it conversational, but let the personality come through naturally.\n- It's okay to be imperfect. Let your writing reflect how a real person would naturally express their thoughts.\n- Share moments of uncertainty, humor, and excitement, even if they make the writing feel a bit messy.\n- Include personal anecdotes or experiences that are relevant to the topic, even if they seem tangential.\n- Avoid sounding robotic or over-polished.",
 
 
 
 
21
 
22
+ "**Structure Guidelines:**\n- Feel free to break the usual format—don't stick too rigidly to introductions, body, and conclusions.\n- Use subheadings, but don't feel pressured to use them in every section.\n- Occasionally switch the flow to reflect a natural thought process. It's okay if the structure shifts a bit.\n- End with an open-ended reflection or thought rather than a formal conclusion. The point is to invite the reader to continue thinking.",
23
+
24
+ "**Research Style:**\n- Be open about your research process. Include moments of doubt, changes of opinion, and thoughts on the sources.\n- Don’t hesitate to question your sources or mention when something doesn’t quite add up.\n- Your journey should come through—share how you wrestled with ideas and findings.\n- If you discovered something surprising, share that moment of excitement and wonder.",
25
+
26
+ "**Engagement:**\n- Break the fourth wall by directly talking to the reader. Use phrases like 'I know, right?' or 'What do you think about this?'\n- Inject some humor, even if it's self-deprecating or unexpected.\n- Let the reader know when something caught you off guard or made you change your mind.\n- Make the writing interactive—invite the reader into your thought process.",
27
+
28
+ "Most importantly: Don’t be afraid to be human. Make the writing feel like a real person is behind it. Let your voice come through, with all its quirks and imperfections.",
29
+
30
+ # Negative prompts for AI-like writing
31
+ "Avoid sounding too perfect or overly polished. Readers should feel like they're reading a real person's thoughts, not a formal or robotic article.",
32
+ "Don’t follow a strict structure or formula. If the flow takes a turn or you go off on a tangent, that’s okay. Let the content evolve naturally.",
33
+ "Avoid being too smooth or formulaic. People’s thoughts jump around, and writing should reflect that.",
34
+ "Don’t be overly formal or precise. Use contractions, sometimes incomplete thoughts, or incomplete sentences. Don’t over-explain—let the reader fill in some gaps.",
35
+ "Avoid using too many technical terms or jargon unless necessary. Keep it conversational, even when discussing complex topics.",
36
  ],
37
  markdown=True,
38
  show_tool_calls=True,
 
49
 
50
  if st.button("Generate Article"):
51
  if topic:
52
+ with st.spinner("Writing your article... (making sure it's clear, human, and imperfect)..."):
53
  response = agent.run(
54
  f"Write an article for Medium about: {topic}\n\n"
55
  "Remember:\n"
56
+ "- Write like you're sharing a personal journey, filled with thoughts, reflections, and imperfections.\n"
57
+ "- Be conversational, not formal.\n"
58
+ "- Let the structure be flexible—follow where your thoughts take you.\n"
59
+ "- Don’t be afraid to show doubt, excitement, and human quirks in your writing."
 
 
60
  )
61
 
62
  st.markdown("## Your Medium Article")
 
74
 
75
  if __name__ == "__main__":
76
  main()
77
+