Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
19 |
-
"Write like you're sharing an insightful discovery with a friend
|
20 |
-
"**Voice Guidelines:**\n-
|
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 |
-
|
27 |
-
|
28 |
-
"
|
29 |
-
|
30 |
-
"
|
31 |
-
|
32 |
-
"Don’t
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
50 |
response = agent.run(
|
51 |
f"Write an article for Medium about: {topic}\n\n"
|
52 |
"Remember:\n"
|
53 |
-
"-
|
54 |
-
"-
|
55 |
-
"-
|
56 |
-
"-
|
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 |
+
|