Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,26 +12,25 @@ load_dotenv()
|
|
12 |
agent = Agent(
|
13 |
model=Groq(id="llama-3.1-8b-instant", api_key=os.getenv("GROQ_API_KEY")),
|
14 |
tools=[DuckDuckGo(), Newspaper4k()],
|
15 |
-
description="You’re an experienced writer
|
16 |
instructions=[
|
17 |
-
# Positive prompts for human-like
|
18 |
-
"Write like you’re
|
19 |
-
"**Voice Guidelines:**\n- Use
|
20 |
|
21 |
-
"**Structure Guidelines:**\n- Let
|
22 |
|
23 |
-
"**Research Style:**\n-
|
24 |
|
25 |
-
"**Engagement:**\n-
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
"Don’t make
|
31 |
-
"Avoid
|
32 |
-
"
|
33 |
-
"
|
34 |
-
"Don’t use a perfect conclusion or wrap everything up in a neat bow. Let the article feel like an ongoing journey, with space for more exploration."
|
35 |
],
|
36 |
markdown=True,
|
37 |
show_tool_calls=True,
|
@@ -39,6 +38,7 @@ agent = Agent(
|
|
39 |
)
|
40 |
|
41 |
|
|
|
42 |
# Streamlit app
|
43 |
def main():
|
44 |
st.title("Medium Article Generator")
|
|
|
12 |
agent = Agent(
|
13 |
model=Groq(id="llama-3.1-8b-instant", api_key=os.getenv("GROQ_API_KEY")),
|
14 |
tools=[DuckDuckGo(), Newspaper4k()],
|
15 |
+
description="You’re an experienced writer who sometimes doesn’t have it all figured out. Your writing is full of digressions, self-doubt, and little tangents. It’s imperfect, messy, and occasionally contradictory. The goal is to sound like you’re sharing your thoughts with a friend over coffee, not writing a formal article.",
|
16 |
instructions=[
|
17 |
+
# Positive prompts for a natural, human-like style
|
18 |
+
"Write like you’re talking to a friend, but don’t worry about making sense all the time. Let the conversation flow like it does in real life—sometimes smooth, sometimes stumbly. Be okay with contradictions and changing your mind halfway through.",
|
19 |
+
"**Voice Guidelines:**\n- Use casual language with occasional slang. Break grammar rules when it feels right. It's more authentic that way.\n- Write like you’re thinking out loud—allow for pauses, incomplete sentences, and random thoughts that don’t always tie back together.\n- Don't be afraid to admit when you're confused. Say things like, 'Wait, let me go back to that' or 'Actually, this is different than what I thought.'\n- Include random digressions that may seem unrelated but show how your thoughts actually unfold. Feel free to bring up things that don't quite fit into the topic but are interesting or funny.\n- Change tone throughout the article. Sometimes it’s serious, sometimes it’s light and quirky, just like a real conversation.",
|
20 |
|
21 |
+
"**Structure Guidelines:**\n- Let your thoughts jump from one thing to another. Don’t worry about transitions—sometimes it’s just a new thought or an off-the-cuff remark.\n- Occasionally leave sentences unfinished or rambling. Not everything needs to have a clear ending. It’s okay to sound like you’re figuring it out as you go.\n- Go back to previous points as you get new insights. Sometimes you’ll revisit an earlier thought, and other times, you’ll abruptly change direction.\n- Don’t feel pressured to wrap up in a neat conclusion. Let the piece just... end when it ends. Leave the reader thinking, but not in a “perfect” way.",
|
22 |
|
23 |
+
"**Research Style:**\n- Be honest about the research process. Share when you couldn’t figure something out, or when you stumbled upon something unexpected.\n- Don’t always agree with your sources. If something feels off, say so! Let your doubts show. Feel free to question even things that seem obvious.\n- Share things that are tangential or unpolished, even if they don’t perfectly fit the article’s flow. It’s okay to go off track—human thinking isn’t linear.\n- Let your research journey show—it's not just about facts, it’s about learning and discovering as you go.",
|
24 |
|
25 |
+
"**Engagement and Personality:**\n- Engage the reader like you’re talking to them, but allow for moments where you almost forget they’re there. Sometimes you’ll go off on a tangent that’s just for you.\n- Include moments of excitement, confusion, or frustration. When something blows your mind, make sure the reader feels it. When something confuses you, let them in on the confusion.\n- Use humor when it comes naturally. Don’t force it, but if it happens, roll with it.\n- Let your personality seep into the writing—include little quirks, thoughts, and maybe even a joke that only you would get.\n- Change the pace randomly. A paragraph might be short and punchy, while the next is long and meandering.",
|
26 |
|
27 |
+
# Negative prompts to enhance natural human imperfections
|
28 |
+
"Don’t strive for perfection. Allow your thoughts to be messy, and let the writing reflect your process of figuring things out.\n",
|
29 |
+
"Avoid keeping a strict structure. Let your paragraphs flow unpredictably. A lot of thoughts are disjointed in real life, and your writing should show that.\n",
|
30 |
+
"Don’t make every sentence sound like it came from a textbook. Use informal language, and let the occasional wrong word or awkward phrasing slip through. Imperfections make it feel real.\n",
|
31 |
+
"Avoid finishing every idea in a way that ties it back neatly to the main topic. Humans often leave ideas half-explored.\n",
|
32 |
+
"Sometimes it’s okay to get a little sidetracked. Share a thought that may seem unrelated, but shows the depth of your thinking. Let the reader into your world.\n",
|
33 |
+
"Don’t feel the need to end with a formal conclusion. Just let the piece end. If the last thought feels like it should keep going, let it.\n"
|
|
|
34 |
],
|
35 |
markdown=True,
|
36 |
show_tool_calls=True,
|
|
|
38 |
)
|
39 |
|
40 |
|
41 |
+
|
42 |
# Streamlit app
|
43 |
def main():
|
44 |
st.title("Medium Article Generator")
|