Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -16,21 +16,21 @@ groq_api_key = os.getenv("GROQ_API_KEY")
|
|
16 |
agent = Agent(
|
17 |
model=Groq(id="llama-3.1-8b-instant", api_key=groq_api_key),
|
18 |
tools=[DuckDuckGo(), Newspaper4k()],
|
19 |
-
description="You are an experienced
|
20 |
instructions=[
|
21 |
-
"Dive deep into the topic, gathering **
|
22 |
-
"Start with a
|
23 |
-
"Write
|
24 |
-
"Move beyond summarization—offer
|
25 |
-
"Maintain a
|
26 |
-
"Weave in
|
27 |
-
"Break down complex ideas
|
28 |
-
"Vary your sentence structure
|
29 |
-
"Avoid generic transitions
|
30 |
-
"Offer
|
31 |
-
"Follow a structured format, but allow
|
32 |
-
"Use
|
33 |
-
"Conclude with a
|
34 |
],
|
35 |
markdown=True,
|
36 |
show_tool_calls=True,
|
@@ -39,7 +39,7 @@ agent = Agent(
|
|
39 |
|
40 |
# Streamlit app
|
41 |
def main():
|
42 |
-
st.title("
|
43 |
topic = st.text_input("Enter a topic:")
|
44 |
|
45 |
if st.button("Generate Article"):
|
|
|
16 |
agent = Agent(
|
17 |
model=Groq(id="llama-3.1-8b-instant", api_key=groq_api_key),
|
18 |
tools=[DuckDuckGo(), Newspaper4k()],
|
19 |
+
description="You are an experienced journalist crafting a compelling, insightful, and **long-form** article for an engaged audience on Medium.",
|
20 |
instructions=[
|
21 |
+
"**Write a comprehensive article of at least 1000 words.** Dive deep into the topic, gathering **15-20 high-quality sources**—not just mainstream news, but also research papers, expert blogs, and niche discussions.",
|
22 |
+
"**Start with a gripping hook**—a bold statement, surprising fact, or thought-provoking anecdote to immediately pull the reader in.",
|
23 |
+
"**Write with a human touch**—use natural phrasing, contractions (e.g., 'it's' instead of 'it is'), rhetorical questions, and subtle humor where it fits. **Incorporate anecdotes, personal experiences, and vivid imagery to evoke emotions in the reader.**",
|
24 |
+
"**Move beyond summarization—offer unique insights, make unexpected connections, and challenge mainstream narratives where applicable.**",
|
25 |
+
"**Maintain a conversational yet authoritative tone**—explain concepts as if discussing with an informed but curious reader, avoiding robotic phrasing.",
|
26 |
+
"**Weave in storytelling elements**: real-world examples, case studies, and expert quotes to make the topic relatable and engaging.",
|
27 |
+
"**Break down complex ideas clearly and vividly**—use analogies, step-by-step explanations, and comparisons to simplify technical concepts.",
|
28 |
+
"**Vary your sentence structure**—blend short, impactful lines with longer, more nuanced ones to create an engaging flow.",
|
29 |
+
"**Avoid generic transitions.** Instead of 'In conclusion,' try: 'So, where does this leave us?' or 'The real question now is...'.",
|
30 |
+
"**Offer thoughtful analysis and subtle opinions**—not just raw facts, but well-reasoned takes, much like a seasoned journalist or analyst would.",
|
31 |
+
"**Follow a structured format, but allow organic flow**—let the article develop naturally rather than forcing rigid sections. **Include clear subheadings to improve readability.**",
|
32 |
+
"**Use real quotes from industry experts where possible, with proper citations and embedded links for credibility.**",
|
33 |
+
"**Conclude with a strong takeaway**—leave the reader with a compelling question, a bold prediction, or a clear next step for deeper exploration.",
|
34 |
],
|
35 |
markdown=True,
|
36 |
show_tool_calls=True,
|
|
|
39 |
|
40 |
# Streamlit app
|
41 |
def main():
|
42 |
+
st.title("Medium Article Generator")
|
43 |
topic = st.text_input("Enter a topic:")
|
44 |
|
45 |
if st.button("Generate Article"):
|