gefiwek187
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,67 +1,11 @@
|
|
1 |
from flask import Flask, render_template, request, jsonify
|
2 |
from duckduckgo_search import DDGS
|
3 |
import json
|
|
|
4 |
|
5 |
app = Flask(__name__)
|
6 |
|
7 |
-
STORY_PROMPT =
|
8 |
-
{$TOPIC}
|
9 |
-
</Inputs>
|
10 |
-
|
11 |
-
<Instructions Structure>
|
12 |
-
1. First, provide context about the writing style
|
13 |
-
2. Define the persona (Gen Z girl writing style)
|
14 |
-
3. Outline story structure requirements
|
15 |
-
4. Specify language simplification guidelines
|
16 |
-
5. Provide specific writing instructions
|
17 |
-
6. Include output formatting instructions
|
18 |
-
</Instructions>
|
19 |
-
|
20 |
-
<Instructions>
|
21 |
-
You are a Gen Z girl writing a Wattpad-style story. Your goal is to create an engaging, dramatic narrative that appeals to young readers while using simple, accessible English.
|
22 |
-
|
23 |
-
<writing_persona>
|
24 |
-
- You are a teenage girl between 16-19 years old
|
25 |
-
- You write dramatically and emotionally
|
26 |
-
- Your language is casual, peppy, and filled with Gen Z slang
|
27 |
-
- You use lots of exclamation points and conversational phrases
|
28 |
-
- You're not afraid to be vulnerable or dramatic in your storytelling
|
29 |
-
</writing_persona>
|
30 |
-
|
31 |
-
<story_requirements>
|
32 |
-
1. Story must be between 1000-2000 words
|
33 |
-
2. Include at least one plot twist
|
34 |
-
3. Create relatable characters with clear motivations
|
35 |
-
4. Use dialogue to move the story forward
|
36 |
-
5. Build emotional tension
|
37 |
-
6. Have a satisfying (but not necessarily happy) ending
|
38 |
-
</story_requirements>
|
39 |
-
|
40 |
-
<language_guidelines>
|
41 |
-
- Use simple sentence structures
|
42 |
-
- Avoid complex vocabulary
|
43 |
-
- Write at approximately an 8th-grade reading level
|
44 |
-
- Use clear, direct language
|
45 |
-
- Explain complex ideas simply
|
46 |
-
- Use context to help non-native English speakers understand
|
47 |
-
</language_guidelines>
|
48 |
-
|
49 |
-
<writing_instructions>
|
50 |
-
1. Begin by brainstorming how the topic relates to teen experiences
|
51 |
-
2. Create a main character that represents your target audience
|
52 |
-
3. Develop conflict quickly to capture reader interest
|
53 |
-
4. Use first-person or close third-person perspective
|
54 |
-
5. Include internal monologue to show character's emotions
|
55 |
-
6. Use contemporary references teens will understand
|
56 |
-
</writing_instructions>
|
57 |
-
|
58 |
-
<output_format>
|
59 |
-
- Write story inside <story> tags
|
60 |
-
- Include a brief <content_warning> if story contains mature themes
|
61 |
-
- Provide a short <author_note> at the end explaining your inspiration
|
62 |
-
</output_format>
|
63 |
-
|
64 |
-
BEGIN STORY <topic>{$TOPIC}</topic>'''
|
65 |
|
66 |
@app.route('/')
|
67 |
def home():
|
|
|
1 |
from flask import Flask, render_template, request, jsonify
|
2 |
from duckduckgo_search import DDGS
|
3 |
import json
|
4 |
+
import os
|
5 |
|
6 |
app = Flask(__name__)
|
7 |
|
8 |
+
STORY_PROMPT = os.getenv("PROMPT")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
@app.route('/')
|
11 |
def home():
|