Update app.py
Browse files
app.py
CHANGED
@@ -85,15 +85,17 @@ def generate_story(comments, temperature=0.7):
|
|
85 |
completion = client.chat.completions.create(
|
86 |
model="gpt-4o",
|
87 |
messages=[{"role": "system", "content": f"""
|
88 |
-
|
|
|
89 |
Read all the comments, understand the emotions people are feeling and pick the third most common emotion
|
90 |
and create a story in first person (the person can be randomly young or old and the story can be
|
91 |
based in past or future) based on that emotion picking a random character keep the words
|
92 |
simple and a bit profound but overall simple words. Give more weight to the comments that
|
93 |
-
come earlier in sequence. The
|
|
|
94 |
{"role": "assistant", "content": """
|
95 |
-
|
96 |
-
|
97 |
"""}]
|
98 |
,temperature=temperature)
|
99 |
return completion.choices[0].message.content
|
|
|
85 |
completion = client.chat.completions.create(
|
86 |
model="gpt-4o",
|
87 |
messages=[{"role": "system", "content": f"""
|
88 |
+
The comments are given here: {comments_text}. ignore the comment which has lyrics of the song,
|
89 |
+
ignore all comments similar to 'anyone in 2024',
|
90 |
Read all the comments, understand the emotions people are feeling and pick the third most common emotion
|
91 |
and create a story in first person (the person can be randomly young or old and the story can be
|
92 |
based in past or future) based on that emotion picking a random character keep the words
|
93 |
simple and a bit profound but overall simple words. Give more weight to the comments that
|
94 |
+
come earlier in sequence. The comment should similar to how the comments are given. Keep the story randomly between 50-120 words.
|
95 |
+
Don't mention the comments or emotions. just return the story"""},
|
96 |
{"role": "assistant", "content": """
|
97 |
+
toss a coin if head comes, then make the story a bit humorous
|
98 |
+
if tail comes then make the story a little bit sad and nostalgic
|
99 |
"""}]
|
100 |
,temperature=temperature)
|
101 |
return completion.choices[0].message.content
|