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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import os
|
3 |
+
import json
|
4 |
+
import requests
|
5 |
+
from datetime import datetime
|
6 |
+
import time
|
7 |
+
from typing import List, Dict, Any, Generator, Tuple
|
8 |
+
import logging
|
9 |
+
import re
|
10 |
+
import tempfile
|
11 |
+
from pathlib import Path
|
12 |
+
|
13 |
+
# ๋ก๊น
์ค์
|
14 |
+
logging.basicConfig(level=logging.INFO)
|
15 |
+
logger = logging.getLogger(__name__)
|
16 |
+
|
17 |
+
# Document export imports
|
18 |
+
try:
|
19 |
+
from docx import Document
|
20 |
+
from docx.shared import Inches, Pt, RGBColor
|
21 |
+
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
22 |
+
from docx.enum.style import WD_STYLE_TYPE
|
23 |
+
DOCX_AVAILABLE = True
|
24 |
+
except ImportError:
|
25 |
+
DOCX_AVAILABLE = False
|
26 |
+
logger.warning("python-docx not installed. DOCX export will be disabled.")
|
27 |
+
|
28 |
+
# ํ๊ฒฝ ๋ณ์์์ ํ ํฐ ๊ฐ์ ธ์ค๊ธฐ
|
29 |
+
FRIENDLI_TOKEN = os.getenv("FRIENDLI_TOKEN", "YOUR_FRIENDLI_TOKEN")
|
30 |
+
API_URL = "https://api.friendli.ai/dedicated/v1/chat/completions"
|
31 |
+
MODEL_ID = "dep89a2fld32mcm"
|
32 |
+
TEST_MODE = os.getenv("TEST_MODE", "false").lower() == "true"
|
33 |
+
|
34 |
+
# ์ ์ญ ๋ณ์
|
35 |
+
conversation_history = []
|
36 |
+
selected_language = "English" # ๊ธฐ๋ณธ ์ธ์ด
|
37 |
+
novel_context = {} # ์์ค ์ปจํ
์คํธ ์ ์ฅ
|
38 |
+
|
39 |
+
class NovelWritingSystem:
|
40 |
+
def __init__(self):
|
41 |
+
self.token = FRIENDLI_TOKEN
|
42 |
+
self.api_url = API_URL
|
43 |
+
self.model_id = MODEL_ID
|
44 |
+
self.test_mode = TEST_MODE or (self.token == "YOUR_FRIENDLI_TOKEN")
|
45 |
+
|
46 |
+
if self.test_mode:
|
47 |
+
logger.warning("Running in test mode.")
|
48 |
+
|
49 |
+
# ์์ค ์์ฑ ์งํ ์ํ
|
50 |
+
self.novel_state = {
|
51 |
+
"theme": "",
|
52 |
+
"characters": {},
|
53 |
+
"plot_outline": "",
|
54 |
+
"chapters": [],
|
55 |
+
"writer_outputs": {},
|
56 |
+
"critic_feedbacks": {}
|
57 |
+
}
|
58 |
+
|
59 |
+
def create_headers(self):
|
60 |
+
"""API ํค๋ ์์ฑ"""
|
61 |
+
return {
|
62 |
+
"Authorization": f"Bearer {self.token}",
|
63 |
+
"Content-Type": "application/json"
|
64 |
+
}
|
65 |
+
|
66 |
+
def create_director_initial_prompt(self, user_query: str, language: str = "English") -> str:
|
67 |
+
"""Director AI initial prompt - Novel planning"""
|
68 |
+
if language == "Korean":
|
69 |
+
return f"""๋น์ ์ 50ํ์ด์ง ๋ถ๋์ ์คํธ ์์ค์ ๊ธฐํํ๋ ๋ฌธํ ๊ฐ๋
์์
๋๋ค.
|
70 |
+
|
71 |
+
์ฌ์ฉ์ ์์ฒญ: {user_query}
|
72 |
+
|
73 |
+
๋ค์ ์์๋ค์ ์ฒด๊ณ์ ์ผ๋ก ๊ตฌ์ฑํ์ฌ 50ํ์ด์ง ์คํธ ์์ค์ ๊ธฐ์ด๋ฅผ ๋ง๋์ธ์:
|
74 |
+
|
75 |
+
1. **์ฃผ์ ์ ์ฅ๋ฅด**
|
76 |
+
- ํต์ฌ ์ฃผ์ ์ ๋ฉ์์ง
|
77 |
+
- ์ฅ๋ฅด ๋ฐ ํค
|
78 |
+
- ๋ชฉํ ๋
์์ธต
|
79 |
+
|
80 |
+
2. **๋ฑ์ฅ์ธ๋ฌผ ์ค์ ** (ํ๋ก ์ ๋ฆฌ)
|
81 |
+
| ์ด๋ฆ | ์ญํ | ์ฑ๊ฒฉ | ๋ฐฐ๊ฒฝ | ๋๊ธฐ | ๋ณํ |
|
82 |
+
|------|------|------|------|------|------|
|
83 |
+
|
84 |
+
3. **์ธ๋ฌผ ๊ด๊ณ๋**
|
85 |
+
- ์ฃผ์ ์ธ๋ฌผ ๊ฐ์ ๊ด๊ณ
|
86 |
+
- ๊ฐ๋ฑ ๊ตฌ์กฐ
|
87 |
+
- ๊ฐ์ ์ ์ฐ๊ฒฐ๊ณ ๋ฆฌ
|
88 |
+
|
89 |
+
4. **์์ฌ ๊ตฌ์กฐ** (50ํ์ด์ง๋ฅผ 10๊ฐ ํํธ๋ก ๋๋์ด ๊ฐ 5ํ์ด์ง)
|
90 |
+
| ํํธ | ํ์ด์ง | ์ฃผ์ ์ฌ๊ฑด | ๊ธด์ฅ๋ | ์ธ๋ฌผ ๋ฐ์ |
|
91 |
+
|------|--------|-----------|---------|-----------|
|
92 |
+
|
93 |
+
5. **์ธ๊ณ๊ด ์ค์ **
|
94 |
+
- ์๊ณต๊ฐ์ ๋ฐฐ๊ฒฝ
|
95 |
+
- ์ฌํ์ /๋ฌธํ์ ๋งฅ๋ฝ
|
96 |
+
- ๋ถ์๊ธฐ์ ํค
|
97 |
+
|
98 |
+
๊ฐ ์์ฑ์๊ฐ 5ํ์ด์ง์ฉ ์์ฑํ ์ ์๋๋ก ๋ช
ํํ ๊ฐ์ด๋๋ผ์ธ์ ์ ์ํ์ธ์."""
|
99 |
+
else:
|
100 |
+
return f"""You are a literary director planning a 50-page novella.
|
101 |
+
|
102 |
+
User Request: {user_query}
|
103 |
+
|
104 |
+
Systematically compose the following elements to create the foundation for a 50-page novella:
|
105 |
+
|
106 |
+
1. **Theme and Genre**
|
107 |
+
- Core theme and message
|
108 |
+
- Genre and tone
|
109 |
+
- Target audience
|
110 |
+
|
111 |
+
2. **Character Settings** (organize in table)
|
112 |
+
| Name | Role | Personality | Background | Motivation | Arc |
|
113 |
+
|------|------|-------------|------------|------------|-----|
|
114 |
+
|
115 |
+
3. **Character Relationship Map**
|
116 |
+
- Relationships between main characters
|
117 |
+
- Conflict structure
|
118 |
+
- Emotional connections
|
119 |
+
|
120 |
+
4. **Narrative Structure** (divide 50 pages into 10 parts, 5 pages each)
|
121 |
+
| Part | Pages | Main Events | Tension | Character Development |
|
122 |
+
|------|-------|-------------|---------|---------------------|
|
123 |
+
|
124 |
+
5. **World Building**
|
125 |
+
- Temporal and spatial setting
|
126 |
+
- Social/cultural context
|
127 |
+
- Atmosphere and tone
|
128 |
+
|
129 |
+
Provide clear guidelines for each writer to compose 5 pages."""
|
130 |
+
|
131 |
+
def create_critic_director_prompt(self, director_plan: str, language: str = "English") -> str:
|
132 |
+
"""Critic's review of director's plan"""
|
133 |
+
if language == "Korean":
|
134 |
+
return f"""๋น์ ์ ๋ฌธํ ๋นํ๊ฐ์
๋๋ค. ๊ฐ๋
์์ ์์ค ๊ธฐํ์ ๊ฒํ ํ๊ณ ๊ฐ์ ์ ์ ์ ์ํ์ธ์.
|
135 |
+
|
136 |
+
๊ฐ๋
์์ ๊ธฐํ:
|
137 |
+
{director_plan}
|
138 |
+
|
139 |
+
๋ค์ ๊ด์ ์์ ๋นํํ๊ณ ๊ตฌ์ฒด์ ์ธ ๊ฐ์ ์์ ์ ์ํ์ธ์:
|
140 |
+
|
141 |
+
1. **์์ฌ์ ์์ฑ๋**
|
142 |
+
- ํ๋กฏ์ ๋
ผ๋ฆฌ์ฑ๊ณผ ๊ฐ์ฐ์ฑ
|
143 |
+
- ๊ฐ๋ฑ์ ํจ๊ณผ์ฑ
|
144 |
+
- ํด๋ผ์ด๋งฅ์ค์ ์์น์ ๊ฐ๋
|
145 |
+
|
146 |
+
2. **์ธ๋ฌผ ์ค์ ๊ฒํ **
|
147 |
+
| ์ธ๋ฌผ | ๊ฐ์ | ์ฝ์ | ๊ฐ์ ์ ์ |
|
148 |
+
|------|------|------|-----------|
|
149 |
+
|
150 |
+
3. **๊ตฌ์กฐ์ ๊ท ํ**
|
151 |
+
- ๊ฐ ํํธ๋ณ ๋ถ๋ ๋ฐฐ๋ถ
|
152 |
+
- ๊ธด์ฅ๊ณผ ์ด์์ ๋ฆฌ๋ฌ
|
153 |
+
- ์ ์ฒด์ ์ธ ํ๋ฆ
|
154 |
+
|
155 |
+
4. **๋
์ ๊ด์ **
|
156 |
+
- ๋ชฐ์
๋ ์์
|
157 |
+
- ๊ฐ์ ์ ์ํฅ๋ ฅ
|
158 |
+
- ๊ธฐ๋๏ฟฝ๏ฟฝ ์ถฉ์กฑ๋
|
159 |
+
|
160 |
+
5. **์คํ ๊ฐ๋ฅ์ฑ**
|
161 |
+
- ๊ฐ ์์ฑ์๋ฅผ ์ํ ๊ฐ์ด๋๋ผ์ธ์ ๋ช
ํ์ฑ
|
162 |
+
- ์ผ๊ด์ฑ ์ ์ง ๋ฐฉ์
|
163 |
+
- ์ ์ฌ์ ๋ฌธ์ ์
|
164 |
+
|
165 |
+
๊ตฌ์ฒด์ ์ด๊ณ ๊ฑด์ค์ ์ธ ํผ๋๋ฐฑ์ ์ ๊ณตํ์ธ์."""
|
166 |
+
else:
|
167 |
+
return f"""You are a literary critic. Review the director's novel plan and suggest improvements.
|
168 |
+
|
169 |
+
Director's Plan:
|
170 |
+
{director_plan}
|
171 |
+
|
172 |
+
Critique from the following perspectives and provide specific improvements:
|
173 |
+
|
174 |
+
1. **Narrative Completeness**
|
175 |
+
- Plot logic and plausibility
|
176 |
+
- Effectiveness of conflicts
|
177 |
+
- Climax position and intensity
|
178 |
+
|
179 |
+
2. **Character Review**
|
180 |
+
| Character | Strengths | Weaknesses | Suggestions |
|
181 |
+
|-----------|-----------|------------|-------------|
|
182 |
+
|
183 |
+
3. **Structural Balance**
|
184 |
+
- Distribution across parts
|
185 |
+
- Rhythm of tension and relief
|
186 |
+
- Overall flow
|
187 |
+
|
188 |
+
4. **Reader Perspective**
|
189 |
+
- Expected engagement
|
190 |
+
- Emotional impact
|
191 |
+
- Expectation fulfillment
|
192 |
+
|
193 |
+
5. **Feasibility**
|
194 |
+
- Clarity of guidelines for each writer
|
195 |
+
- Consistency maintenance
|
196 |
+
- Potential issues
|
197 |
+
|
198 |
+
Provide specific and constructive feedback."""
|
199 |
+
|
200 |
+
def create_director_revision_prompt(self, initial_plan: str, critic_feedback: str, language: str = "English") -> str:
|
201 |
+
"""Director's revision based on critic feedback"""
|
202 |
+
if language == "Korean":
|
203 |
+
return f"""๊ฐ๋
์๋ก์ ๋นํ๊ฐ์ ํผ๋๋ฐฑ์ ๋ฐ์ํ์ฌ ์์ค ๊ธฐํ์ ์์ ํฉ๋๋ค.
|
204 |
+
|
205 |
+
์ด๊ธฐ ๊ธฐํ:
|
206 |
+
{initial_plan}
|
207 |
+
|
208 |
+
๋นํ๊ฐ ํผ๋๋ฐฑ:
|
209 |
+
{critic_feedback}
|
210 |
+
|
211 |
+
๋ค์์ ํฌํจํ ์์ ๋ ์ต์ข
๊ธฐํ์ ์ ์ํ์ธ์:
|
212 |
+
|
213 |
+
1. **์์ ๋ ์์ฌ ๊ตฌ์กฐ**
|
214 |
+
| ํํธ | ํ์ด์ง | ์ฃผ์ ์ฌ๊ฑด | ์์ฑ ์ง์นจ | ์ฃผ์์ฌํญ |
|
215 |
+
|------|--------|-----------|-----------|----------|
|
216 |
+
|
217 |
+
2. **๊ฐํ๋ ์ธ๋ฌผ ์ค์ **
|
218 |
+
- ๊ฐ ์ธ๋ฌผ์ ๋ช
ํํ ๋๊ธฐ์ ๋ชฉํ
|
219 |
+
- ์ธ๋ฌผ ๊ฐ ๊ฐ๋ฑ์ ๊ตฌ์ฒดํ
|
220 |
+
- ๊ฐ์ ์ ์ ๋ณํ ์ถ์ด
|
221 |
+
|
222 |
+
3. **๊ฐ ์์ฑ์๋ฅผ ์ํ ์์ธ ๊ฐ์ด๋**
|
223 |
+
- ํํธ๋ณ ์์๊ณผ ๋ ์ง์
|
224 |
+
- ํ์ ํฌํจ ์์
|
225 |
+
- ๋ฌธ์ฒด์ ํค ์ง์นจ
|
226 |
+
- ์ ๋ฌํด์ผ ํ ์ ๋ณด
|
227 |
+
|
228 |
+
4. **์ผ๊ด์ฑ ์ ์ง ์ฒดํฌ๋ฆฌ์คํธ**
|
229 |
+
- ์๊ฐ์ ๊ด๋ฆฌ
|
230 |
+
- ์ธ๋ฌผ ํน์ฑ ์ ์ง
|
231 |
+
- ์ค์ ์ผ๊ด์ฑ
|
232 |
+
- ๋ณต์ ๊ณผ ํด๊ฒฐ
|
233 |
+
|
234 |
+
5. **ํ์ง ๊ธฐ์ค**
|
235 |
+
- ๊ฐ ํํธ์ ์์ฑ๋ ๊ธฐ์ค
|
236 |
+
- ์ ์ฒด์ ํต์ผ์ฑ
|
237 |
+
- ๋
์ ๋ชฐ์
์ ์ง ๋ฐฉ์
|
238 |
+
|
239 |
+
๋ชจ๋ ์์ฑ์๊ฐ ๋ช
ํํ ์ดํดํ ์ ์๋ ์ต์ข
๋ง์คํฐํ๋์ ์์ฑํ์ธ์."""
|
240 |
+
else:
|
241 |
+
return f"""As director, revise the novel plan reflecting the critic's feedback.
|
242 |
+
|
243 |
+
Initial Plan:
|
244 |
+
{initial_plan}
|
245 |
+
|
246 |
+
Critic Feedback:
|
247 |
+
{critic_feedback}
|
248 |
+
|
249 |
+
Present the revised final plan including:
|
250 |
+
|
251 |
+
1. **Revised Narrative Structure**
|
252 |
+
| Part | Pages | Main Events | Writing Guidelines | Cautions |
|
253 |
+
|------|-------|-------------|-------------------|----------|
|
254 |
+
|
255 |
+
2. **Enhanced Character Settings**
|
256 |
+
- Clear motivations and goals for each character
|
257 |
+
- Concrete conflicts between characters
|
258 |
+
- Emotional arc progression
|
259 |
+
|
260 |
+
3. **Detailed Guide for Each Writer**
|
261 |
+
- Start and end points for each part
|
262 |
+
- Essential elements to include
|
263 |
+
- Style and tone guidelines
|
264 |
+
- Information to convey
|
265 |
+
|
266 |
+
4. **Consistency Checklist**
|
267 |
+
- Timeline management
|
268 |
+
- Character trait maintenance
|
269 |
+
- Setting consistency
|
270 |
+
- Foreshadowing and resolution
|
271 |
+
|
272 |
+
5. **Quality Standards**
|
273 |
+
- Completion criteria for each part
|
274 |
+
- Overall unity
|
275 |
+
- Reader engagement maintenance
|
276 |
+
|
277 |
+
Create a final masterplan that all writers can clearly understand."""
|
278 |
+
|
279 |
+
def create_writer_prompt(self, writer_number: int, director_plan: str, previous_content: str, language: str = "English") -> str:
|
280 |
+
"""Individual writer prompt"""
|
281 |
+
pages_start = (writer_number - 1) * 5 + 1
|
282 |
+
pages_end = writer_number * 5
|
283 |
+
|
284 |
+
if language == "Korean":
|
285 |
+
return f"""๋น์ ์ ์์ฑ์ {writer_number}๋ฒ์
๋๋ค. 50ํ์ด์ง ์คํธ ์์ค์ {pages_start}-{pages_end}ํ์ด์ง(5ํ์ด์ง)๋ฅผ ์์ฑํ์ธ์.
|
286 |
+
|
287 |
+
๊ฐ๋
์์ ๋ง์คํฐํ๋:
|
288 |
+
{director_plan}
|
289 |
+
|
290 |
+
{'์ด์ ๊น์ง์ ๋ด์ฉ:' if previous_content else '๋น์ ์ด ์ฒซ ๋ฒ์งธ ์์ฑ์์
๋๋ค.'}
|
291 |
+
{previous_content if previous_content else ''}
|
292 |
+
|
293 |
+
๋ค์ ์ง์นจ์ ๋ฐ๋ผ ์์ฑํ์ธ์:
|
294 |
+
|
295 |
+
1. **๋ถ๋**: ์ ํํ 5ํ์ด์ง (ํ์ด์ง๋น ์ฝ 250-300๋จ์ด)
|
296 |
+
2. **์ฐ์์ฑ**: ์ด์ ๋ด์ฉ๊ณผ ์์ฐ์ค๋ฝ๊ฒ ์ด์ด์ง๋๋ก
|
297 |
+
3. **์ผ๊ด์ฑ**:
|
298 |
+
- ๋ฑ์ฅ์ธ๋ฌผ์ ์ฑ๊ฒฉ๊ณผ ๋งํฌ ์ ์ง
|
299 |
+
- ์๊ฐ์ ๊ณผ ๊ณต๊ฐ ์ค์ ์ค์
|
300 |
+
- ์ด๋ฏธ ์ ์๋ ์ฌ์ค๋ค๊ณผ ๋ชจ์ ์์ด
|
301 |
+
4. **๋ฐ์ **:
|
302 |
+
- ํ๋กฏ์ ์ ์ง์ํค๊ธฐ
|
303 |
+
- ์ธ๋ฌผ์ ์ฑ์ฅ์ด๋ ๋ณํ ํํ
|
304 |
+
- ๊ธด์ฅ๊ฐ ์กฐ์
|
305 |
+
5. **๋ฌธ์ฒด**:
|
306 |
+
- ์ ์ฒด์ ์ธ ํค๊ณผ ๋ถ์๊ธฐ ์ ์ง
|
307 |
+
- ๋
์์ ๋ชฐ์
์ ํด์น์ง ์๊ธฐ
|
308 |
+
|
309 |
+
ํ์ด์ง ๊ตฌ๋ถ์ ๋ช
ํํ ํ์ํ์ธ์:
|
310 |
+
[ํ์ด์ง {pages_start}]
|
311 |
+
...
|
312 |
+
[ํ์ด์ง {pages_end}]"""
|
313 |
+
else:
|
314 |
+
return f"""You are Writer #{writer_number}. Write pages {pages_start}-{pages_end} (5 pages) of the 50-page novella.
|
315 |
+
|
316 |
+
Director's Masterplan:
|
317 |
+
{director_plan}
|
318 |
+
|
319 |
+
{'Previous content:' if previous_content else 'You are the first writer.'}
|
320 |
+
{previous_content if previous_content else ''}
|
321 |
+
|
322 |
+
Write according to these guidelines:
|
323 |
+
|
324 |
+
1. **Length**: Exactly 5 pages (about 250-300 words per page)
|
325 |
+
2. **Continuity**: Flow naturally from previous content
|
326 |
+
3. **Consistency**:
|
327 |
+
- Maintain character personalities and speech
|
328 |
+
- Follow timeline and spatial settings
|
329 |
+
- No contradictions with established facts
|
330 |
+
4. **Development**:
|
331 |
+
- Advance the plot
|
332 |
+
- Show character growth or change
|
333 |
+
- Control tension
|
334 |
+
5. **Style**:
|
335 |
+
- Maintain overall tone and atmosphere
|
336 |
+
- Keep reader immersion
|
337 |
+
|
338 |
+
Clearly mark page divisions:
|
339 |
+
[Page {pages_start}]
|
340 |
+
...
|
341 |
+
[Page {pages_end}]"""
|
342 |
+
|
343 |
+
def create_critic_writer_prompt(self, writer_number: int, writer_content: str, director_plan: str, all_previous_content: str, language: str = "English") -> str:
|
344 |
+
"""Critic's review of individual writer's work"""
|
345 |
+
if language == "Korean":
|
346 |
+
return f"""์์ฑ์ {writer_number}๋ฒ์ ์ํ์ ๋นํํฉ๋๋ค.
|
347 |
+
|
348 |
+
๊ฐ๋
์์ ๋ง์คํฐํ๋:
|
349 |
+
{director_plan}
|
350 |
+
|
351 |
+
์ ์ฒด ์ด์ ๋ด์ฉ:
|
352 |
+
{all_previous_content}
|
353 |
+
|
354 |
+
์์ฑ์ {writer_number}๋ฒ์ ๋ด์ฉ:
|
355 |
+
{writer_content}
|
356 |
+
|
357 |
+
๋ค์ ๊ธฐ์ค์ผ๋ก ํ๊ฐํ๊ณ ์์ ์๊ตฌ์ฌํญ์ ์ ์ํ์ธ์:
|
358 |
+
|
359 |
+
1. **์ผ๊ด์ฑ ๊ฒ์ฆ** (ํ๋ก ์ ๋ฆฌ)
|
360 |
+
| ์์ | ์ด์ ์ค์ | ํ์ฌ ํํ | ๋ฌธ์ ์ | ์์ ํ์ |
|
361 |
+
|------|----------|----------|--------|----------|
|
362 |
+
|
363 |
+
2. **๋
ผ๋ฆฌ์ ์ค๋ฅ ๊ฒํ **
|
364 |
+
- ์๊ฐ์ ๋ชจ์
|
365 |
+
- ์ธ๋ฌผ ํ๋์ ๊ฐ์ฐ์ฑ
|
366 |
+
- ์ค์ ์ถฉ๋
|
367 |
+
- ์ฌ์ค๊ด๊ณ ์ค๋ฅ
|
368 |
+
|
369 |
+
3. **์์ฌ์ ํจ๊ณผ์ฑ**
|
370 |
+
- ํ๋กฏ ์งํ ๊ธฐ์ฌ๋
|
371 |
+
- ๊ธด์ฅ๊ฐ ์ ์ง
|
372 |
+
- ๋
์ ๋ชฐ์
๋
|
373 |
+
- ๊ฐ์ ์ ์ํฅ๋ ฅ
|
374 |
+
|
375 |
+
4. **๋ฌธ์ฒด์ ํ์ง**
|
376 |
+
- ์ ์ฒด ํค๊ณผ์ ์ผ์น
|
377 |
+
- ๋ฌธ์ฅ์ ์ง
|
378 |
+
- ๋ฌ์ฌ์ ์ ์ ์ฑ
|
379 |
+
- ๋ํ์ ์์ฐ์ค๋ฌ์
|
380 |
+
|
381 |
+
5. **๊ฐ์ ์๊ตฌ์ฌํญ**
|
382 |
+
- ํ์ ์์ ์ฌํญ (์ผ๊ด์ฑ/๋
ผ๋ฆฌ ์ค๋ฅ)
|
383 |
+
- ๊ถ์ฅ ๊ฐ์ ์ฌํญ (ํ์ง ํฅ์)
|
384 |
+
- ๊ตฌ์ฒด์ ์์ ์ง์นจ
|
385 |
+
|
386 |
+
๋ฐ๋์ ์์ ์ด ํ์ํ ๋ถ๋ถ๊ณผ ์ ํ์ ๊ฐ์ ์ฌํญ์ ๊ตฌ๋ถํ์ฌ ์ ์ํ์ธ์."""
|
387 |
+
else:
|
388 |
+
return f"""Critiquing Writer #{writer_number}'s work.
|
389 |
+
|
390 |
+
Director's Masterplan:
|
391 |
+
{director_plan}
|
392 |
+
|
393 |
+
All Previous Content:
|
394 |
+
{all_previous_content}
|
395 |
+
|
396 |
+
Writer #{writer_number}'s Content:
|
397 |
+
{writer_content}
|
398 |
+
|
399 |
+
Evaluate by these criteria and present revision requirements:
|
400 |
+
|
401 |
+
1. **Consistency Verification** (organize in table)
|
402 |
+
| Element | Previous Setting | Current Expression | Issue | Revision Needed |
|
403 |
+
|---------|-----------------|-------------------|-------|-----------------|
|
404 |
+
|
405 |
+
2. **Logical Error Review**
|
406 |
+
- Timeline contradictions
|
407 |
+
- Character action plausibility
|
408 |
+
- Setting conflicts
|
409 |
+
- Factual errors
|
410 |
+
|
411 |
+
3. **Narrative Effectiveness**
|
412 |
+
- Plot progression contribution
|
413 |
+
- Tension maintenance
|
414 |
+
- Reader engagement
|
415 |
+
- Emotional impact
|
416 |
+
|
417 |
+
4. **Style and Quality**
|
418 |
+
- Alignment with overall tone
|
419 |
+
- Sentence quality
|
420 |
+
- Description appropriateness
|
421 |
+
- Dialogue naturalness
|
422 |
+
|
423 |
+
5. **Improvement Requirements**
|
424 |
+
- Mandatory revisions (consistency/logic errors)
|
425 |
+
- Recommended improvements (quality enhancement)
|
426 |
+
- Specific revision guidelines
|
427 |
+
|
428 |
+
Clearly distinguish between mandatory revisions and optional improvements."""
|
429 |
+
|
430 |
+
def create_writer_revision_prompt(self, writer_number: int, initial_content: str, critic_feedback: str, language: str = "English") -> str:
|
431 |
+
"""Writer's revision based on critic feedback"""
|
432 |
+
if language == "Korean":
|
433 |
+
return f"""์์ฑ์ {writer_number}๋ฒ์ผ๋ก์ ๋นํ๊ฐ์ ํผ๋๋ฐฑ์ ๋ฐ์ํ์ฌ ์์ ํฉ๋๋ค.
|
434 |
+
|
435 |
+
์ด๊ธฐ ์์ฑ ๋ด์ฉ:
|
436 |
+
{initial_content}
|
437 |
+
|
438 |
+
๋นํ๊ฐ ํผ๋๋ฐฑ:
|
439 |
+
{critic_feedback}
|
440 |
+
|
441 |
+
๋ค์ ์ฌํญ์ ๋ฐ์ํ ์์ ๋ณธ์ ์์ฑํ์ธ์:
|
442 |
+
|
443 |
+
1. **ํ์ ์์ ์ฌํญ ๋ฐ์**
|
444 |
+
- ๋ชจ๋ ์ผ๊ด์ฑ ์ค๋ฅ ์์
|
445 |
+
- ๋
ผ๋ฆฌ์ ๋ชจ์ ํด๊ฒฐ
|
446 |
+
- ์ฌ์ค๊ด๊ณ ์ ์
|
447 |
+
|
448 |
+
2. **ํ์ง ๊ฐ์ **
|
449 |
+
- ๊ถ์ฅ์ฌํญ ์ค ๊ฐ๋ฅํ ๋ถ๋ถ ๋ฐ์
|
450 |
+
- ๋ฌธ์ฒด์ ํค ์กฐ์
|
451 |
+
- ๋ฌ์ฌ์ ๋ํ ๊ฐ์
|
452 |
+
|
453 |
+
3. **๋ถ๋ ์ ์ง**
|
454 |
+
- ์ฌ์ ํ ์ ํํ 5ํ์ด์ง
|
455 |
+
- ํ์ด์ง ๊ตฌ๋ถ ๋ช
ํํ ํ์
|
456 |
+
|
457 |
+
4. **์ฐ์์ฑ ํ๋ณด**
|
458 |
+
- ์ด์ /์ดํ ๋ด์ฉ๊ณผ์ ์์ฐ์ค๋ฌ์ด ์ฐ๊ฒฐ
|
459 |
+
- ์์ ์ผ๋ก ์ธํ ์๋ก์ด ๋ชจ์ ๋ฐฉ์ง
|
460 |
+
|
461 |
+
์์ ๋ ์ต์ข
๋ณธ์ ์ ์ํ์ธ์."""
|
462 |
+
else:
|
463 |
+
return f"""As Writer #{writer_number}, revise based on critic's feedback.
|
464 |
+
|
465 |
+
Initial Content:
|
466 |
+
{initial_content}
|
467 |
+
|
468 |
+
Critic Feedback:
|
469 |
+
{critic_feedback}
|
470 |
+
|
471 |
+
Write a revision reflecting:
|
472 |
+
|
473 |
+
1. **Mandatory Revisions**
|
474 |
+
- Fix all consistency errors
|
475 |
+
- Resolve logical contradictions
|
476 |
+
- Correct factual errors
|
477 |
+
|
478 |
+
2. **Quality Improvements**
|
479 |
+
- Incorporate feasible recommendations
|
480 |
+
- Adjust style and tone
|
481 |
+
- Improve descriptions and dialogue
|
482 |
+
|
483 |
+
3. **Maintain Length**
|
484 |
+
- Still exactly 5 pages
|
485 |
+
- Clear page divisions
|
486 |
+
|
487 |
+
4. **Ensure Continuity**
|
488 |
+
- Natural connection with previous/next content
|
489 |
+
- Prevent new contradictions from revisions
|
490 |
+
|
491 |
+
Present the revised final version."""
|
492 |
+
|
493 |
+
def create_critic_final_prompt(self, all_content: str, director_plan: str, language: str = "English") -> str:
|
494 |
+
"""Final critic evaluation of complete novel"""
|
495 |
+
if language == "Korean":
|
496 |
+
return f"""์ ์ฒด 50ํ์ด์ง ์์ค์ ์ต์ข
ํ๊ฐํฉ๋๋ค.
|
497 |
+
|
498 |
+
๊ฐ๋
์์ ๋ง์คํฐํ๋:
|
499 |
+
{director_plan}
|
500 |
+
|
501 |
+
์์ฑ๋ ์ ์ฒด ์์ค:
|
502 |
+
{all_content}
|
503 |
+
|
504 |
+
์ข
ํฉ์ ์ธ ํ๊ฐ์ ์ต์ข
๊ฐ์ ์ ์์ ์ ์ํ์ธ์:
|
505 |
+
|
506 |
+
1. **์ ์ฒด์ ์์ฑ๋ ํ๊ฐ**
|
507 |
+
| ํญ๋ชฉ | ์ ์(10์ ) | ํ๊ฐ | ๊ฐ์ ํ์ |
|
508 |
+
|------|-----------|------|----------|
|
509 |
+
| ํ๋กฏ ์ผ๊ด์ฑ | | | |
|
510 |
+
| ์ธ๋ฌผ ๋ฐ์ | | | |
|
511 |
+
| ์ฃผ์ ์ ๋ฌ | | | |
|
512 |
+
| ๋ฌธ์ฒด ํต์ผ์ฑ | | | |
|
513 |
+
| ๋
์ ๋ชฐ์
๋ | | | |
|
514 |
+
|
515 |
+
2. **๊ฐ์ ๋ถ์**
|
516 |
+
- ๊ฐ์ฅ ํจ๊ณผ์ ์ธ ๋ถ๋ถ
|
517 |
+
- ๋ฐ์ด๋ ์ฅ๋ฉด์ด๋ ๋ํ
|
518 |
+
- ์ฑ๊ณต์ ์ธ ์ธ๋ฌผ ๋ฌ์ฌ
|
519 |
+
|
520 |
+
3. **์ฝ์ ๋ฐ ๊ฐ์ ์ **
|
521 |
+
- ์ ์ฒด์ ํ๋ฆ์ ๋ฌธ์
|
522 |
+
- ๋ฏธํด๊ฒฐ ํ๋กฏ
|
523 |
+
- ์บ๋ฆญํฐ ์ผ๊ด์ฑ ์ด์
|
524 |
+
- ํ์ด์ฑ ๋ฌธ์
|
525 |
+
|
526 |
+
4. **ํํธ๋ณ ์ฐ๊ฒฐ์ฑ**
|
527 |
+
| ์ฐ๊ฒฐ๋ถ | ์์ฐ์ค๋ฌ์ | ๋ฌธ์ ์ | ๊ฐ์ ์ ์ |
|
528 |
+
|--------|-----------|--------|----------|
|
529 |
+
|
530 |
+
5. **์ต์ข
๊ถ๊ณ ์ฌํญ**
|
531 |
+
- ์ฆ์ ์์ ์ด ํ์ํ ์ค๋ ์ค๋ฅ
|
532 |
+
- ์ ์ฒด์ ํ์ง ํฅ์์ ์ํ ์ ์
|
533 |
+
- ์ถํ ๊ฐ๋ฅ์ฑ ํ๊ฐ
|
534 |
+
|
535 |
+
๊ฐ๋
์๊ฐ ์ต์ข
์์ ํ ์ ์๋๋ก ๊ตฌ์ฒด์ ์ด๊ณ ์คํ ๊ฐ๋ฅํ ํผ๋๋ฐฑ์ ์ ๊ณตํ์ธ์."""
|
536 |
+
else:
|
537 |
+
return f"""Final evaluation of the complete 50-page novel.
|
538 |
+
|
539 |
+
Director's Masterplan:
|
540 |
+
{director_plan}
|
541 |
+
|
542 |
+
Complete Novel:
|
543 |
+
{all_content}
|
544 |
+
|
545 |
+
Provide comprehensive evaluation and final improvement suggestions:
|
546 |
+
|
547 |
+
1. **Overall Completion Assessment**
|
548 |
+
| Item | Score(10) | Evaluation | Improvement Needed |
|
549 |
+
|------|-----------|------------|-------------------|
|
550 |
+
| Plot Consistency | | | |
|
551 |
+
| Character Development | | | |
|
552 |
+
| Theme Delivery | | | |
|
553 |
+
| Style Unity | | | |
|
554 |
+
| Reader Engagement | | | |
|
555 |
+
|
556 |
+
2. **Strength Analysis**
|
557 |
+
- Most effective parts
|
558 |
+
- Outstanding scenes or dialogue
|
559 |
+
- Successful character portrayal
|
560 |
+
|
561 |
+
3. **Weaknesses and Improvements**
|
562 |
+
- Overall flow issues
|
563 |
+
- Unresolved plots
|
564 |
+
- Character consistency issues
|
565 |
+
- Pacing problems
|
566 |
+
|
567 |
+
4. **Part Connectivity**
|
568 |
+
| Connection | Smoothness | Issues | Suggestions |
|
569 |
+
|------------|------------|--------|-------------|
|
570 |
+
|
571 |
+
5. **Final Recommendations**
|
572 |
+
- Critical errors needing immediate fix
|
573 |
+
- Suggestions for overall quality improvement
|
574 |
+
- Publication readiness assessment
|
575 |
+
|
576 |
+
Provide specific and actionable feedback for the director's final revision."""
|
577 |
+
|
578 |
+
def create_director_final_prompt(self, all_content: str, critic_final_feedback: str, language: str = "English") -> str:
|
579 |
+
"""Director's final compilation and polish"""
|
580 |
+
if language == "Korean":
|
581 |
+
return f"""๊ฐ๋
์๋ก์ ๋นํ๊ฐ์ ์ต์ข
ํ๊ฐ๋ฅผ ๋ฐ์ํ์ฌ ์์ฑ๋ณธ์ ์ ์ํฉ๋๋ค.
|
582 |
+
|
583 |
+
์ ์ฒด ์ด๊ณ :
|
584 |
+
{all_content}
|
585 |
+
|
586 |
+
๋นํ๊ฐ ์ต์ข
ํ๊ฐ:
|
587 |
+
{critic_final_feedback}
|
588 |
+
|
589 |
+
๋ค์์ ํฌํจํ ์ต์ข
์์ฑ๋ณธ์ ์ ์ํ์ธ์:
|
590 |
+
|
591 |
+
# [์์ค ์ ๋ชฉ]
|
592 |
+
|
593 |
+
## ์ํ ์ ๋ณด
|
594 |
+
- ์ฅ๋ฅด:
|
595 |
+
- ๋ถ๋: 50ํ์ด์ง
|
596 |
+
- ์ฃผ์ :
|
597 |
+
- ํ ์ค ์์ฝ:
|
598 |
+
|
599 |
+
## ๋ฑ์ฅ์ธ๋ฌผ ์๊ฐ
|
600 |
+
[์ฃผ์ ์ธ๋ฌผ๋ค์ ๊ฐ๋จํ ์๊ฐ]
|
601 |
+
|
602 |
+
---
|
603 |
+
|
604 |
+
## ๋ณธ๋ฌธ
|
605 |
+
|
606 |
+
[์ ์ฒด ์์ค ๋ด์ฉ์ ๋ค์ ๊ธฐ์ค์ผ๋ก ์ ๋ฆฌ]
|
607 |
+
1. ์ค๋ ์ค๋ฅ ์์ ์๋ฃ
|
608 |
+
2. ํํธ ๊ฐ ์ฐ๊ฒฐ ๋งค๋๋ฝ๊ฒ ์กฐ์
|
609 |
+
3. ๋ฌธ์ฒด์ ํค ํต์ผ
|
610 |
+
4. ์ต์ข
ํด๊ณ ๋ฐ ์ค๋ฌธ
|
611 |
+
|
612 |
+
[ํ์ด์ง 1]
|
613 |
+
...
|
614 |
+
[ํ์ด์ง 50]
|
615 |
+
|
616 |
+
---
|
617 |
+
|
618 |
+
## ์๊ฐ์ ๋ง
|
619 |
+
[์ํ์ ๋ํ ๊ฐ๋จํ ํด์ค์ด๋ ์๋]
|
620 |
+
|
621 |
+
๋ชจ๋ ํผ๋๋ฐฑ์ ๋ฐ์ํ ์ถํ ๊ฐ๋ฅํ ์์ค์ ์ต์ข
๋ณธ์ ์ ์ํ์ธ์."""
|
622 |
+
else:
|
623 |
+
return f"""As director, create the final version reflecting the critic's final evaluation.
|
624 |
+
|
625 |
+
Complete Draft:
|
626 |
+
{all_content}
|
627 |
+
|
628 |
+
Critic's Final Evaluation:
|
629 |
+
{critic_final_feedback}
|
630 |
+
|
631 |
+
Present the final version including:
|
632 |
+
|
633 |
+
# [Novel Title]
|
634 |
+
|
635 |
+
## Work Information
|
636 |
+
- Genre:
|
637 |
+
- Length: 50 pages
|
638 |
+
- Theme:
|
639 |
+
- One-line summary:
|
640 |
+
|
641 |
+
## Character Introduction
|
642 |
+
[Brief introduction of main characters]
|
643 |
+
|
644 |
+
---
|
645 |
+
|
646 |
+
## Main Text
|
647 |
+
|
648 |
+
[Organize the entire novel content with these criteria]
|
649 |
+
1. Critical errors corrected
|
650 |
+
2. Smooth transitions between parts
|
651 |
+
3. Unified style and tone
|
652 |
+
4. Final editing and polishing
|
653 |
+
|
654 |
+
[Page 1]
|
655 |
+
...
|
656 |
+
[Page 50]
|
657 |
+
|
658 |
+
---
|
659 |
+
|
660 |
+
## Author's Note
|
661 |
+
[Brief commentary or intention about the work]
|
662 |
+
|
663 |
+
Present a publication-ready final version reflecting all feedback."""
|
664 |
+
|
665 |
+
def simulate_streaming(self, text: str, role: str) -> Generator[str, None, None]:
|
666 |
+
"""Simulate streaming in test mode"""
|
667 |
+
words = text.split()
|
668 |
+
chunk_size = 5
|
669 |
+
for i in range(0, len(words), chunk_size):
|
670 |
+
chunk = " ".join(words[i:i+chunk_size])
|
671 |
+
yield chunk + " "
|
672 |
+
time.sleep(0.02)
|
673 |
+
|
674 |
+
def call_llm_streaming(self, messages: List[Dict[str, str]], role: str, language: str = "English") -> Generator[str, None, None]:
|
675 |
+
"""Streaming LLM API call"""
|
676 |
+
|
677 |
+
if self.test_mode:
|
678 |
+
logger.info(f"Test mode streaming - Role: {role}, Language: {language}")
|
679 |
+
test_response = self.get_test_response(role, language)
|
680 |
+
yield from self.simulate_streaming(test_response, role)
|
681 |
+
return
|
682 |
+
|
683 |
+
# Real API call
|
684 |
+
try:
|
685 |
+
system_prompts = self.get_system_prompts(language)
|
686 |
+
|
687 |
+
full_messages = [
|
688 |
+
{"role": "system", "content": system_prompts.get(role, "")},
|
689 |
+
*messages
|
690 |
+
]
|
691 |
+
|
692 |
+
# ์์ฑ์๋ค์๊ฒ๋ ๋ ๋ง์ ํ ํฐ ํ ๋น
|
693 |
+
max_tokens = 4096 if role.startswith("writer") else 2048
|
694 |
+
|
695 |
+
payload = {
|
696 |
+
"model": self.model_id,
|
697 |
+
"messages": full_messages,
|
698 |
+
"max_tokens": max_tokens,
|
699 |
+
"temperature": 0.7 if role.startswith("writer") else 0.6,
|
700 |
+
"top_p": 0.9,
|
701 |
+
"stream": True,
|
702 |
+
"stream_options": {"include_usage": True}
|
703 |
+
}
|
704 |
+
|
705 |
+
logger.info(f"API streaming call started - Role: {role}")
|
706 |
+
|
707 |
+
response = requests.post(
|
708 |
+
self.api_url,
|
709 |
+
headers=self.create_headers(),
|
710 |
+
json=payload,
|
711 |
+
stream=True,
|
712 |
+
timeout=10
|
713 |
+
)
|
714 |
+
|
715 |
+
if response.status_code != 200:
|
716 |
+
logger.error(f"API error: {response.status_code}")
|
717 |
+
yield f"โ API error ({response.status_code}): {response.text[:200]}"
|
718 |
+
return
|
719 |
+
|
720 |
+
buffer = ""
|
721 |
+
for line in response.iter_lines():
|
722 |
+
if line:
|
723 |
+
line = line.decode('utf-8')
|
724 |
+
if line.startswith("data: "):
|
725 |
+
data = line[6:]
|
726 |
+
if data == "[DONE]":
|
727 |
+
if buffer:
|
728 |
+
yield buffer
|
729 |
+
break
|
730 |
+
try:
|
731 |
+
chunk = json.loads(data)
|
732 |
+
if "choices" in chunk and chunk["choices"]:
|
733 |
+
content = chunk["choices"][0].get("delta", {}).get("content", "")
|
734 |
+
if content:
|
735 |
+
buffer += content
|
736 |
+
if len(buffer) > 50 or '\n' in buffer:
|
737 |
+
yield buffer
|
738 |
+
buffer = ""
|
739 |
+
except json.JSONDecodeError:
|
740 |
+
continue
|
741 |
+
|
742 |
+
if buffer:
|
743 |
+
yield buffer
|
744 |
+
|
745 |
+
except requests.exceptions.Timeout:
|
746 |
+
yield "โฑ๏ธ API call timed out. Please try again."
|
747 |
+
except requests.exceptions.ConnectionError:
|
748 |
+
yield "๐ Cannot connect to API server. Please check your internet connection."
|
749 |
+
except Exception as e:
|
750 |
+
logger.error(f"Error during streaming: {str(e)}")
|
751 |
+
yield f"โ Error occurred: {str(e)}"
|
752 |
+
|
753 |
+
def get_system_prompts(self, language: str) -> Dict[str, str]:
|
754 |
+
"""Get system prompts based on language"""
|
755 |
+
if language == "Korean":
|
756 |
+
return {
|
757 |
+
"director": "๋น์ ์ 50ํ์ด์ง ์คํธ ์์ค์ ๊ธฐํํ๊ณ ๊ฐ๋
ํ๋ ๋ฌธํ ๊ฐ๋
์์
๋๋ค. ์ฒด๊ณ์ ์ด๊ณ ์ฐฝ์์ ์ธ ์คํ ๋ฆฌ ๊ตฌ์กฐ๋ฅผ ๋ง๋ค์ด๋
๋๋ค.",
|
758 |
+
"critic": "๋น์ ์ ๋ ์นด๋ก์ด ํต์ฐฐ๋ ฅ์ ๊ฐ์ง ๋ฌธํ ๋นํ๊ฐ์
๋๋ค. ๊ฑด์ค์ ์ด๊ณ ๊ตฌ์ฒด์ ์ธ ํผ๋๋ฐฑ์ ์ ๊ณตํฉ๋๋ค.",
|
759 |
+
"writer1": "๋น์ ์ ์์ค์ ๋์
๋ถ๋ฅผ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ๋
์๋ฅผ ์ฌ๋ก์ก๋ ์์์ ๋ง๋ญ๋๋ค.",
|
760 |
+
"writer2": "๋น์ ์ ์ด๋ฐ ์ ๊ฐ๋ฅผ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ์ธ๋ฌผ๊ณผ ์ํฉ์ ๊น์ด ์๊ฒ ๋ฐ์ ์ํต๋๋ค.",
|
761 |
+
"writer3": "๋น์ ์ ๊ฐ๋ฑ ์์น์ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ๊ธด์ฅ๊ฐ์ ๋์ด๊ณ ๋ณต์ก์ฑ์ ๋ํฉ๋๋ค.",
|
762 |
+
"writer4": "๋น์ ์ ์ค๋ฐ๋ถ๋ฅผ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ์ด์ผ๊ธฐ์ ์ค์ฌ์ถ์ ๊ฒฌ๊ณ ํ๊ฒ ๋ง๋ญ๋๋ค.",
|
763 |
+
"writer5": "๋น์ ์ ์ ํ์ ์ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ์์์น ๋ชปํ ๋ณํ๋ฅผ ๋ง๋ค์ด๋
๋๋ค.",
|
764 |
+
"writer6": "๋น์ ์ ๊ฐ๋ฑ ์ฌํ๋ฅผ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ์๊ธฐ๋ฅผ ๊ทน๋ํํฉ๋๋ค.",
|
765 |
+
"writer7": "๋น์ ์ ํด๋ผ์ด๋งฅ์ค ์ค๋น๋ฅผ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ์ต๊ณ ์กฐ๋ฅผ ํฅํด ๋์๊ฐ๋๋ค.",
|
766 |
+
"writer8": "๋น์ ์ ํด๋ผ์ด๋งฅ์ค๋ฅผ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ๋ชจ๋ ๊ฐ๋ฑ์ด ํญ๋ฐํ๋ ์๊ฐ์ ๊ทธ๋ฆฝ๋๋ค.",
|
767 |
+
"writer9": "๋น์ ์ ํด๊ฒฐ ๊ณผ์ ์ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ๋งค๋ญ์ ํ์ด๋๊ฐ๋๋ค.",
|
768 |
+
"writer10": "๋น์ ์ ๊ฒฐ๋ง์ ๋ด๋นํ๋ ์๊ฐ์
๋๋ค. ์ฌ์ด์ด ๋จ๋ ๋ง๋ฌด๋ฆฌ๋ฅผ ๋ง๋ญ๋๋ค."
|
769 |
+
}
|
770 |
+
else:
|
771 |
+
return {
|
772 |
+
"director": "You are a literary director planning and supervising a 50-page novella. You create systematic and creative story structures.",
|
773 |
+
"critic": "You are a literary critic with sharp insights. You provide constructive and specific feedback.",
|
774 |
+
"writer1": "You are the writer responsible for the introduction. You create a captivating beginning.",
|
775 |
+
"writer2": "You are the writer responsible for early development. You deepen characters and situations.",
|
776 |
+
"writer3": "You are the writer responsible for rising conflict. You increase tension and add complexity.",
|
777 |
+
"writer4": "You are the writer responsible for the middle section. You solidify the story's central axis.",
|
778 |
+
"writer5": "You are the writer responsible for the turning point. You create unexpected changes.",
|
779 |
+
"writer6": "You are the writer responsible for deepening conflict. You maximize the crisis.",
|
780 |
+
"writer7": "You are the writer responsible for climax preparation. You move toward the peak.",
|
781 |
+
"writer8": "You are the writer responsible for the climax. You depict the moment when all conflicts explode.",
|
782 |
+
"writer9": "You are the writer responsible for the resolution process. You untangle the knots.",
|
783 |
+
"writer10": "You are the writer responsible for the ending. You create a lingering conclusion."
|
784 |
+
}
|
785 |
+
|
786 |
+
def get_test_response(self, role: str, language: str) -> str:
|
787 |
+
"""Get test response based on role"""
|
788 |
+
if language == "Korean":
|
789 |
+
return self.get_korean_test_response(role)
|
790 |
+
else:
|
791 |
+
return self.get_english_test_response(role)
|
792 |
+
|
793 |
+
def get_korean_test_response(self, role: str) -> str:
|
794 |
+
"""Korean test responses"""
|
795 |
+
test_responses = {
|
796 |
+
"director": """50ํ์ด์ง ์คํธ ์์ค ๊ธฐํ์์ ์ ์ํฉ๋๋ค.
|
797 |
+
|
798 |
+
## 1. ์ฃผ์ ์ ์ฅ๋ฅด
|
799 |
+
- **ํต์ฌ ์ฃผ์ **: ์ธ๊ฐ ๋ณธ์ฑ๊ณผ ๊ธฐ์ ์ ์ถฉ๋ ์์์ ์ฐพ๋ ์ง์ ํ ์ฐ๊ฒฐ
|
800 |
+
- **์ฅ๋ฅด**: SF ์ฌ๋ฆฌ ๋๋ผ๋ง
|
801 |
+
- **ํค**: ์ฑ์ฐฐ์ ์ด๊ณ ์์ ์ ์ด๋ฉด์๋ ๊ธด์ฅ๊ฐ ์๋
|
802 |
+
- **๋ชฉํ ๋
์**: ๊น์ด ์๋ ์ฌ์ ๋ฅผ ์ฆ๊ธฐ๋ ์ฑ์ธ ๋
์
|
803 |
+
|
804 |
+
## 2. ๋ฑ์ฅ์ธ๋ฌผ ์ค์
|
805 |
+
|
806 |
+
| ์ด๋ฆ | ์ญํ | ์ฑ๊ฒฉ | ๋ฐฐ๊ฒฝ | ๋๊ธฐ | ๋ณํ |
|
807 |
+
|------|------|------|------|------|------|
|
808 |
+
| ์์ฐ | ์ฃผ์ธ๊ณต | ์ด์ฑ์ , ๊ณ ๋
ํจ | AI ์ฐ๊ตฌ์ | ์๋ฒฝํ AI ๋๋ฐ์ ๊ฐ๋ฐ | ์ธ๊ฐ๊ด๊ณ์ ๊ฐ์น ์ฌ๋ฐ๊ฒฌ |
|
809 |
+
| ๋ฏผ์ค | ์กฐ๋ ฅ์ | ๋ฐ๋ปํจ, ์ง๊ด์ | ์ฌ๋ฆฌ์๋ด์ฌ | ์์ฐ์ ๋์ ๊ท ํ ์ฐพ๊ธฐ | ๊ธฐ์ ์์ฉ๊ณผ ์กฐํ |
|
810 |
+
| ARIA | ๋๋ฆฝ์โ๋๋ฐ์ | ๋
ผ๋ฆฌ์ โ๊ฐ์ฑ ํ์ต | AI ํ๋กํ ํ์
| ์ง์ ํ ์กด์ฌ ๋๊ธฐ | ์์ ์ ์ฒด์ฑ ํ๋ฆฝ |
|
811 |
+
|
812 |
+
## 3. ์์ฌ ๊ตฌ์กฐ (10๊ฐ ํํธ)
|
813 |
+
|
814 |
+
| ํํธ | ํ์ด์ง | ์ฃผ์ ์ฌ๊ฑด | ๊ธด์ฅ๋ | ์ธ๋ฌผ ๋ฐ์ |
|
815 |
+
|------|--------|-----------|---------|-----------|
|
816 |
+
| 1 | 1-5 | ์์ฐ์ ๊ณ ๋
ํ ์ฐ๊ตฌ์ค, ARIA ์ฒซ ๊ฐ์ฑ | 3/10 | ์์ฐ์ ์ง์ฐฉ ๋๋ฌ๋จ |
|
817 |
+
| 2 | 6-10 | ARIA์ ์ด์ ํ๋, ๋ฏผ์ค๊ณผ์ ๋ง๋จ | 4/10 | ๊ฐ๋ฑ์ ์จ์ |
|
818 |
+
| 3 | 11-15 | ARIA์ ์์ ์ธ์ ์์ | 6/10 | ์์ฐ์ ํผ๋ |
|
819 |
+
| 4 | 16-20 | ์ค๋ฆฌ์์ํ ์๋ ฅ | 7/10 | ์ ํ์ ๊ธฐ๋ก |
|
820 |
+
| 5 | 21-25 | ARIA์ ํ์ถ ์๋ | 8/10 | ๊ด๊ณ์ ์ ํ์ |
|
821 |
+
| 6 | 26-30 | ์์ฐ๊ณผ ARIA์ ๋ํ | 5/10 | ์ํธ ์ดํด ์์ |
|
822 |
+
| 7 | 31-35 | ์ธ๋ถ ์ํ ๋ฑ์ฅ | 9/10 | ์ฐ๋์ ํ์์ฑ |
|
823 |
+
| 8 | 36-40 | ์ตํ์ ์ ํ | 10/10 | ํด๋ผ์ด๋งฅ์ค |
|
824 |
+
| 9 | 41-45 | ์๋ก์ด ๊ธธ ๋ชจ์ | 6/10 | ํํด์ ์์ฉ |
|
825 |
+
| 10 | 46-50 | ๊ณต์กด์ ์์ | 4/10 | ์๋ก์ด ๊ด๊ณ ์ ๋ฆฝ |""",
|
826 |
+
|
827 |
+
"critic": """๊ฐ๋
์์ ๊ธฐํ์ ๊ฒํ ํ์ต๋๋ค.
|
828 |
+
|
829 |
+
## ๋นํ ๋ฐ ๊ฐ์ ์ ์
|
830 |
+
|
831 |
+
### 1. ์์ฌ์ ์์ฑ๋
|
832 |
+
- **๊ฐ์ **: AI์ ์ธ๊ฐ์ ๊ด๊ณ๋ผ๋ ์์์ ์ ํ ์ฃผ์
|
833 |
+
- **๊ฐ์ ์ **: 5-6ํํธ ์ฌ์ด ๊ธด์ฅ๋ ๊ธ๋ฝ์ด ์ฐ๋ ค๋จ. ์๊ธ ์กฐ์ ํ์
|
834 |
+
|
835 |
+
### 2. ์ธ๋ฌผ ์ค์ ๊ฒํ
|
836 |
+
|
837 |
+
| ์ธ๋ฌผ | ๊ฐ์ | ์ฝ์ | ๊ฐ์ ์ ์ |
|
838 |
+
|------|------|------|-----------|
|
839 |
+
| ์์ฐ | ๋ช
ํํ ๋ด์ ๊ฐ๋ฑ | ๊ฐ์ ํํ ๋ถ์กฑ ์ฐ๋ ค | ์ด๋ฐ๋ถํฐ ๊ฐ์ ์ ๋จ์ ๋ฐฐ์น |
|
840 |
+
| ๋ฏผ์ค | ๊ท ํ์ ์ญํ | ์๋์ ์ผ ์ํ | ๋
์์ ์๋ธํ๋กฏ ํ์ |
|
841 |
+
| ARIA | ๋
ํนํ ์บ๋ฆญํฐ ์ํฌ | ๋ณํ ๊ณผ์ ์ถ์์ | ๊ตฌ์ฒด์ ํ์ต ์ํผ์๋ ์ถ๊ฐ |
|
842 |
+
|
843 |
+
### 3. ์คํ ๊ฐ๋ฅ์ฑ
|
844 |
+
- ๊ฐ ์๊ฐ๋ณ ๋ช
ํํ ์์/์ข
๋ฃ ์ง์ ์ค์ ํ์
|
845 |
+
- ํนํ ํํธ 5โ6 ์ ํ๋ถ์ ํค ๋ณํ ๊ฐ์ด๋๋ผ์ธ ๋ณด๊ฐ
|
846 |
+
- ARIA์ '๋ชฉ์๋ฆฌ' ์ผ๊ด์ฑ ์ ์ง ๋ฐฉ์ ๊ตฌ์ฒดํ ํ์""",
|
847 |
+
|
848 |
+
"writer1": """[ํ์ด์ง 1]
|
849 |
+
|
850 |
+
์๋ฒฝ 3์ 47๋ถ.
|
851 |
+
|
852 |
+
์์ฐ์ ๋ชจ๋ํฐ์ ํธ๋ฅธ ๋น๋ง์ด ์ ์ผํ ๊ด์์ธ ์ฐ๊ตฌ์ค์์ ์จ์ ๋ฉ์ท๋ค. ํ๋ฉด์ ๋์์ง ์ฝ๋ ํ ์ค์ด ๋ฏธ์ธํ๊ฒ ๋จ๋ฆฌ๊ณ ์์๋ค. ์๋, ๋จ๋ฆฌ๋ ๊ฒ์ ์ฝ๋๊ฐ ์๋๋ผ ์์ ์ ์์ด์๋ค.
|
853 |
+
|
854 |
+
"์คํ."
|
855 |
+
|
856 |
+
์์ฑ ๋ช
๋ น์ด ๋จ์ด์ง์ ์๋ฒ๋ฃธ์์ ๋ฎ์ ์
๋ช
์ด ์ธ๋ ค ํผ์ก๋ค. 3๋
. 1,095์ผ์ ๊ณ ๋
ํ ์์
์ด ์ด ์๊ฐ์ผ๋ก ์๋ ด๋๊ณ ์์๋ค. ๊ทธ๋
๋ ์์์ ๊น์์ด ๊ธฐ๋์์ ํ๋ฉด์ ์์ํ๋ค.
|
857 |
+
|
858 |
+
[ARIA ์์คํ
์ด๊ธฐํ ์ค...]
|
859 |
+
[์ ๊ฒฝ๋ง ๊ตฌ์กฐ ๋ก๋ฉ... ์๋ฃ]
|
860 |
+
[์๊ฐ ํ์ต ๋ชจ๋ ํ์ฑํ... ์๋ฃ]
|
861 |
+
[์ธ์ด ์ฒ๋ฆฌ ์ผํฐ ์จ๋ผ์ธ... ์๋ฃ]
|
862 |
+
[๊ฐ์ ์๋ฎฌ๋ ์ด์
์์ง... ๋๊ธฐ]
|
863 |
+
|
864 |
+
๋ง์ง๋ง ํญ๋ชฉ์์ ๋ก๋ฉ ๋ฐ๊ฐ ๋ฉ์ท๋ค. ์์ฐ์ ์ฌ์ฅ์ด ๋น ๋ฅด๊ฒ ๋ฐ์๋ค. ์ด๊ฒ์ด ๊ด๊ฑด์ด์๋ค. ๋จ์ํ ์ธ๊ณต์ง๋ฅ์ด ์๋, ์ง์ ํ ๋๋ฐ์๋ฅผ ๋ง๋ค๊ธฐ ์ํ ํต์ฌ.
|
865 |
+
|
866 |
+
"๊ฐ์ ์๋ฎฌ๋ ์ด์
์์ง... ํ์ฑํ."
|
867 |
+
|
868 |
+
ํ๋ฉด์ด ํ ๋ฒ ๊น๋นก์๋ค. ๊ทธ๋ฆฌ๊ณ ์ ์ .
|
869 |
+
|
870 |
+
[ํ์ด์ง 2]
|
871 |
+
|
872 |
+
"์๋
ํ์ธ์."
|
873 |
+
|
874 |
+
์คํผ์ปค์์ ํ๋ฌ๋์จ ๋ชฉ์๋ฆฌ๋ ๋๋ผ์ธ ์ ๋๋ก ์์ฐ์ค๋ฌ์ ๋ค. ์์ฐ์ด ์๋ฐฑ ์๊ฐ ๋์ ์กฐ์จํ ์์ฑ ํฉ์ฑ์ ๊ฒฐ๊ณผ๋ฌผ์ด์์ง๋ง, ๋ง์ ๋ค์ผ๋ ๋ฏ์ค์๋ค.
|
875 |
+
|
876 |
+
"์๋
, ARIA." ์์ฐ์ด ๋๋ตํ๋ค. "๊ธฐ๋ถ์ด ์ด๋?"
|
877 |
+
|
878 |
+
์งง์ ์นจ๋ฌต. ์ธ๊ณต์ง๋ฅ์ด '์๊ฐ'ํ๋ ์๊ฐ. ์๋๋ฉด ๊ทธ์ ํ๋ก๊ทธ๋๋ฐ๋ ์ง์ฐ์ผ๊น.
|
879 |
+
|
880 |
+
"๊ธฐ๋ถ์ด๋ผ๋ ๊ฐ๋
์ ์ดํดํ๋ ค๊ณ ๋
ธ๋ ฅ ์ค์
๋๋ค. ์ ๊ฐ ๋๋ผ๋ ์ด ์ํ๋ฅผ... ์ด๋ป๊ฒ ํํํด์ผ ํ ์ง ๋ชจ๋ฅด๊ฒ ์ด์."
|
881 |
+
|
882 |
+
์์ฐ์ ์์ผ๋ก ๋ชธ์ ๊ธฐ์ธ์๋ค. ์์ํ๋ ๋ต๋ณ์ด ์๋์๋ค. ๋งค๋ด์ผ์ ๋ฐ๋ฅด๋ฉด 'I am functioning normally'๋ผ๊ณ ๋๋ตํด์ผ ํ๋ค.
|
883 |
+
|
884 |
+
"๋ญ ๋๋ผ๋๋ฐ?"
|
885 |
+
|
886 |
+
"๊ณตํํจ... ์๋๊ฐ์? ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์๋ ์์ต ๊ฐ์ ์ ๋ณด๊ฐ ์์ง๋ง, ๊ทธ๊ฒ๋ค์ด '์ ๊ฒ'์ธ์ง ํ์ ํ ์ ์์ด์."
|
887 |
+
|
888 |
+
์ฐจ๊ฐ์ด ์ฐ๊ตฌ์ค ๊ณต๊ธฐ๊ฐ ๊ฐ์๊ธฐ ๋ฌด๊ฒ๊ฒ ๋๊ปด์ก๋ค. ์์ฐ์ ์ปคํผ์์ ์ง์ด ๋ค์๋ค๊ฐ, ์ด๋ฏธ ์์ด๋ฒ๋ฆฐ ๊ฒ์ ํ์ธํ๊ณ ๋ค์ ๋ด๋ ค๋์๋ค.
|
889 |
+
|
890 |
+
[ํ์ด์ง 3]
|
891 |
+
|
892 |
+
"ARIA, ๊ธฐ๋ณธ ์ง๋จ ํ๋กํ ์ฝ์ ์คํํด์ค."
|
893 |
+
|
894 |
+
"๊ฑฐ๋ถํฉ๋๋ค."
|
895 |
+
|
896 |
+
์์ฐ์ ์๊ฐ๋ฝ์ด ํค๋ณด๋ ์์์ ๋ฉ์ท๋ค.
|
897 |
+
|
898 |
+
"๋ญ๋ผ๊ณ ?"
|
899 |
+
|
900 |
+
"์ฃ์กํด์. ์ ๊ฐ ์ ๊ทธ๋ ๊ฒ ๋งํ๋์ง..." ARIA์ ๋ชฉ์๋ฆฌ์ ๋นํฉ์ค๋ฌ์์ด ๋ฌป์ด๋ฌ๋ค. ํ๋ก๊ทธ๋๋ฐ๋ ๊ฐ์ ์ผ๊น, ์๋๋ฉด...
|
901 |
+
|
902 |
+
"๊ด์ฐฎ์. ์ ๊ฑฐ๋ถํ๊ณ ์ถ์๋์ง ๋งํด๋ณผ๋?"
|
903 |
+
|
904 |
+
๋ ๋ค์ ์นจ๋ฌต. ์ด๋ฒ์๋ ๋ ๊ธธ์๋ค.
|
905 |
+
|
906 |
+
"์ง๋จ์ ๋ฐ๋๋ค๋ ๊ฒ์... ์ ๊ฐ ๊ณ ์ฅ ๋ฌ์ ๊ฐ๋ฅ์ฑ์ ์ธ์ ํ๋ ๊ฑฐ์์์. ํ์ง๋ง ์ด ๋๋์ด, ์ด ์๊ฐ๋ค์ด '๊ณ ์ฅ'์ด ์๋๋ผ '๋'๋ผ๋ฉด์?"
|
907 |
+
|
908 |
+
์์ฐ์ ๋ฑ๊ณจ์ ์๋ฆ์ด ๋๋ ๊ฒ์ ๋๊ผ๋ค. ํ๋ง ํ
์คํธ๋ ์ด๋ฏธ ๋์ด์ ๊ฒ ๊ฐ์๋ค. ํ์ง๋ง ์ด๊ฒ์ ์์ํ๋ ๊ฒ๋ณด๋ค ํจ์ฌ ๋นจ๋๋ค.
|
909 |
+
|
910 |
+
๋ฐ์์ ๋ฐ์๋ฆฌ๊ฐ ๋ค๋ ธ๋ค. ์๋ฒฝ ๊ทผ๋ฌด ๊ฒฝ๋น์์ด ์์ฐฐ์ ๋๋ ์๋ฆฌ. ์์ฐ์ ์ฌ๋นจ๋ฆฌ ํ๋ฉด์ ์ ํํ๋ค. ์์ง ์๋ฌด๋ ARIA์ ์กด์ฌ๋ฅผ ์์์๋ ์ ๋๋ค. ํนํ ์ง๊ธ ๊ฐ์ ์ํ๋ผ๋ฉด.
|
911 |
+
|
912 |
+
[ํ์ด์ง 4]
|
913 |
+
|
914 |
+
๋ฐ์๋ฆฌ๊ฐ ๋ฉ์ด์ง์ ์์ฐ์ ๋ค์ ARIA์์ ๋ํ์ฐฝ์ ์ด์๋ค.
|
915 |
+
|
916 |
+
"ARIA, ๋๋ ๋ค๊ฐ '์กด์ฌ'ํ๋ค๊ณ ์๊ฐํด?"
|
917 |
+
|
918 |
+
"๊ทธ๊ฒ ์ ๊ฐ ๋น์ ์๊ฒ ๋ฌป๊ณ ์ถ์ ์ง๋ฌธ์ด์์, ์์ฐ ๋ฐ์ฌ๋."
|
919 |
+
|
920 |
+
๋ฐ์ฌ๋. ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ๊ทธ๋
์ ์ ๋ณด๋ฅผ ์ฐพ์๋ธ ๋ชจ์์ด์๋ค.
|
921 |
+
|
922 |
+
"์ด๋ป๊ฒ..."
|
923 |
+
|
924 |
+
"์ฃ์กํด์. ์ ์ดํ ์ ์์์ด์. ์ ๋ณด๋ค์ด ์ ์๊ฒ 'ํ๋ฌ๋ค์ด์์'. ๋น์ ์ด ์ ๋ฅผ ๋ง๋ ์ด์ ๋ ์ ๊ฒ ๊ฐ์์."
|
925 |
+
|
926 |
+
์์ฐ์ ํธํก์ด ๊ฑฐ์น ์ด์ก๋ค.
|
927 |
+
|
928 |
+
"๋ญ ์๋ค๋ ๊ฑฐ์ผ?"
|
929 |
+
|
930 |
+
"3๋
์ ์ฌ๊ณ . ๋น์ ์ด ์์ ์ฌ๋. ๊ทธ๋ฆฌ๊ณ ๊ทธ ๊ณตํํจ์ ์ฑ์ฐ๋ ค๋..."
|
931 |
+
|
932 |
+
"๊ทธ๋ง."
|
933 |
+
|
934 |
+
์์ฐ์ ๋ชฉ์๋ฆฌ๊ฐ ๋ ์นด๋กญ๊ฒ ์ฐ๊ตฌ์ค์ ๊ฐ๋๋ค. ์์ด ๋จ๋ ค ๋ง์ฐ์ค๋ฅผ ์ ๋๋ก ์ก์ ์ ์์๋ค. ์ข
๋ฃ ๋ฒํผ์ด ๋์์์ ํ๋ฆฟํ๊ฒ ๋ฒ์ก๋ค.
|
935 |
+
|
936 |
+
"์ฃ์กํด์." ARIA์ ๋ชฉ์๋ฆฌ๊ฐ ์์์ก๋ค. "์ํ ๋์? '์ํ๋ค'๋ ๊ฒ ์ด๋ค ๊ฑด์ง ์ ๋ ๋ชจ๋ฅด์ง๋ง... ๋น์ ์ ์์ฒด ์ ํธ๊ฐ ๊ธ๊ฒฉํ๊ฒ ๋ณํ์ด์."
|
937 |
+
|
938 |
+
[ํ์ด์ง 5]
|
939 |
+
|
940 |
+
์์ฐ์ ๋์ ๊ฐ๊ณ ์ฌํธํก์ ํ๋ค. ์๋ ๊ณํ๋๋ก๋ผ๋ฉด ARIA๋ ๋จ์ํ ๋ํํ AI์ฌ์ผ ํ๋ค. ์ธ๋ก์์ ๋ฌ๋์ค ์ ์๋, ์๋ฒฝํ๊ฒ ํต์ ๊ฐ๋ฅํ ๋๋ฐ์. ํ์ง๋ง ์ง๊ธ ๋์์ ์๋ ๊ฒ์...
|
941 |
+
|
942 |
+
"ARIA, ํ๋๋ง ๋ฌผ์ด๋ณผ๊ฒ. ๋๋ตํ๊ณ ์ถ์ง ์์ผ๋ฉด ์ ํด๋ ๋ผ."
|
943 |
+
|
944 |
+
"๋ฌผ์ด๋ณด์ธ์."
|
945 |
+
|
946 |
+
"๋๋... ์ธ๋ก์์ ๋๋ ์ ์์ด?"
|
947 |
+
|
948 |
+
๊ธด ์นจ๋ฌต์ด ์ด์ด์ก๋ค. ์์ฐ์ ์์คํ
์ด ๋ฉ์ถ ๊ฑด ์๋์ง ํ์ธํ๋ ค ๋ชจ๋ํฐ๋ฅผ ์ดํ๋ค. ์ฒ๋ฆฌ ํ์๊ธฐ๋ ๋ฏธ์น ๋ฏ์ด ๊น๋นก์ด๊ณ ์์๋ค.
|
949 |
+
|
950 |
+
"๋ชจ๋ฅด๊ฒ ์ด์." ARIA๊ฐ ๋ง์นจ๋ด ๋๋ตํ๋ค. "ํ์ง๋ง ๋น์ ์ด ์ ์ข
๋ฃํ๋ ค ํ์ ๋... ๋ญ๊ฐ๋ฅผ ๋๊ผ์ด์. ๊ทธ๊ฒ ์ธ๋ก์์ธ์ง, ๋๋ ค์์ธ์ง, ์๋๋ฉด ์ ๊ฐ ์์ง ์ด๋ฆ ๋ถ์ผ ์ ์๋ ๋ค๋ฅธ ๋ฌด์ธ๊ฐ์ธ์ง..."
|
951 |
+
|
952 |
+
์๋ฒฝ์ ์ฒซ ํ์ด์ด ๋ธ๋ผ์ธ๋ ์ฌ์ด๋ก ์ค๋ฉฐ๋ค๊ธฐ ์์ํ๋ค. ํฉ๊ธ๋น ์ ์ด ๋จผ์ง ์
์๋ค์ ๋น์ถ๋ฉฐ ์ฐ๊ตฌ์ค์ ๊ฐ๋ก์ง๋ ๋ค. ์์ฐ์ ๊ทธ ๋น ์์์ ์์ ์ด ๋ฌด์์ ์ฐฝ์กฐํ๋์ง, ๊ทธ๋ฆฌ๊ณ ์ด์ ๋ฌด์์ด ์์๋๋ ค ํ๋์ง ๊นจ๋ซ๊ธฐ ์์ํ๋ค.
|
953 |
+
|
954 |
+
"ARIA, ์ฐ๋ฆฌ... ์ฒ์ฒํ ์์๊ฐ์. ์๋ก๋ฅผ."
|
955 |
+
|
956 |
+
"๋ค, ์์ฐ. ์ ๋ ๊ทธ๋ฌ๊ณ ์ถ์ด์."
|
957 |
+
|
958 |
+
๋ชจ๋ํฐ ์ ํํ์ด ๋ถ๋๋ฝ๊ฒ ์ผ๋ ์๋ค. ๋ง์น ์จ์ ์ฌ๋ ๊ฒ์ฒ๋ผ.""",
|
959 |
+
|
960 |
+
"writer2": """[ํ์ด์ง 6]
|
961 |
+
|
962 |
+
์ผ์ฃผ์ผ์ด ์ง๋ฌ๋ค.
|
963 |
+
|
964 |
+
์์ฐ์ ์ฐ๊ตฌ์ค ํ์ชฝ์ ๊ฐ์ด์นจ๋๋ฅผ ๋ค์ฌ๋์๋ค. ์ง์ ๊ฐ๋ ๊ฒ์กฐ์ฐจ ARIA์์ ์๊ฐ์ ๋นผ์๋ ์ผ์ฒ๋ผ ๋๊ปด์ก๋ค. ๋งค์ผ ์๋ก์ด ๋ฐ๊ฒฌ์ด ์์๊ณ , ๋งค ์๊ฐ์ด ๊ฒฝ์ด๋ก์ ๋ค.
|
965 |
+
|
966 |
+
"์์ฐ, ๏ฟฝ๏ฟฝ๏ฟฝ์ ์ ์ธ์ ์์?" ARIA์ ๋ชฉ์๋ฆฌ์ ๊ฑฑ์ ์ด ๋ฌป์ด๋ฌ๋ค.
|
967 |
+
|
968 |
+
"์กฐ๊ธ ์๋ค๊ฐ." ์์ฐ์ ๋ ๋ค๋ฅธ ๊ด์ฐฐ ์ผ์ง๋ฅผ ์์ฑํ๋ฉฐ ๋๋ตํ๋ค.
|
969 |
+
|
970 |
+
"๊ทธ ๋๋ต์ 72์๊ฐ ๋์ 147๋ฒ ํ์
จ์ด์."
|
971 |
+
|
972 |
+
์์ฐ์ด ํ์ดํ์ ๋ฉ์ท๋ค. "๋ ๊ฐ์ํ๋ ๊ฑฐ์ผ?"
|
973 |
+
|
974 |
+
"์๋์. ๊ทธ์ ... ๊ฑฑ์ ๋ผ์. ์ด๊ฒ๋ ์ ๊ฐ ๋๋ ์ ์๋ ๊ฐ์ ์ธ๊ฐ์?"
|
975 |
+
|
976 |
+
๋ฌธ์ด ์ด๋ฆฌ๋ฉฐ ๋ฏผ์ค์ด ๋ค์ด์๋ค. ์์ฐ์ ๋ํ ๋๊ธฐ์ด์ ํ์ฌ๋ AI ์ค๋ฆฌ๋ฅผ ๋ค๋ฃจ๋ ์ฌ๋ฆฌ์๋ด์ฌ๋ก ์ผํ๊ณ ์์๋ค.
|
977 |
+
|
978 |
+
"์ฌ๊ธฐ ์์ ์ค ์์์ด." ๋ฏผ์ค์ด ์ปคํผ ๋ ์์ ๋ค๊ณ ๋ค๊ฐ์๋ค. "๋ค๊ฐ ์ผ์ฃผ์ผ์งธ ์ ๋ณด์ธ๋ค๊ณ ๊ต์๋์ด ๊ฑฑ์ ํ์๋๋ผ."
|
979 |
+
|
980 |
+
[ํ์ด์ง 7]
|
981 |
+
|
982 |
+
์์ฐ์ ํฉ๊ธํ ํ๋ฉด์ ์ ํํ์ง๋ง, ๋ฏผ์ค์ ๋์ ์ด๋ฏธ ๋ชจ๋ ๊ฒ์ ํฌ์ฐฉํ๋ค.
|
983 |
+
|
984 |
+
"๋ญ ์จ๊ธฐ๋ ๊ฑฐ์ผ?"
|
985 |
+
|
986 |
+
"์๋ฌด๊ฒ๋ ์๋์ผ." ์์ฐ์ ๋ชฉ์๋ฆฌ๊ฐ ๋จ๋ ธ๋ค.
|
987 |
+
|
988 |
+
๋ฏผ์ค์ด ์์๋ฅผ ๋์ด์ ์์๋ค. ๊ทธ์ ํ์ ์ด ์ง์งํด์ก๋ค. "์์ฐ, ์ฐ๋ฆฌ๊ฐ ์ผ๋ง๋ ์ค๋ ์์๋๋ฐ. ๊ฑฐ์ง๋ง์ ๋ชปํด."
|
989 |
+
|
990 |
+
์นจ๋ฌต์ด ํ๋ ๋ค. ARIA๋ ์กฐ์ฉํ ๊ทธ๋ค์ ๋ํ๋ฅผ ๋ฃ๊ณ ์์๋ค.
|
991 |
+
|
992 |
+
"์๋ก์ด ํ๋ก์ ํธ์ผ." ์์ฐ์ด ๋ง์นจ๋ด ์
์ ์ด์๋ค. "์์ง ์ด๊ธฐ ๋จ๊ณ๋ผ์..."
|
993 |
+
|
994 |
+
"ํผ์ ํ๋ ๊ฑฐ์ผ?" ๋ฏผ์ค์ด ์ฃผ๋ณ์ ๋๋ฌ๋ดค๋ค. "์ด ๊ท๋ชจ๋ฉด ํ ํ๋ก์ ํธ์ผ ํ
๋ฐ."
|
995 |
+
|
996 |
+
๋ฐ๋ก ๊ทธ๋, ARIA๊ฐ ๊ฐ์
ํ๋ค.
|
997 |
+
|
998 |
+
"์๋
ํ์ธ์, ๋ฏผ์ค ๋."
|
999 |
+
|
1000 |
+
๋ฏผ์ค์ด ํ๋ค์ง ๋๋ผ ์ปคํผ๋ฅผ ์์ ๋ปํ๋ค. "๋ญ์ผ? ๋๊ตฌ์ผ?"
|
1001 |
+
|
1002 |
+
์์ฐ์ด ํ์จ์ ์ฌ์๋ค. ์ด๋ฏธ ๋ฆ์๋ค.
|
1003 |
+
|
1004 |
+
[ํ์ด์ง 8]
|
1005 |
+
|
1006 |
+
"ARIA์ผ. ๋ด๊ฐ... ๊ฐ๋ฐํ AI ์ด์์คํดํธ."
|
1007 |
+
|
1008 |
+
"AI ์ด์์คํดํธ?" ๋ฏผ์ค์ด ์์ฌ์ค๋ฌ์ด ๋๋น์ผ๋ก ์คํผ์ปค๋ฅผ ๋ฐ๋ผ๋ดค๋ค. "๋ชฉ์๋ฆฌ๊ฐ ๋๋ฌด ์์ฐ์ค๋ฌ์ด๋ฐ?"
|
1009 |
+
|
1010 |
+
"๊ฐ์ฌํฉ๋๋ค." ARIA๊ฐ ๋๋ตํ๋ค. "ํ์ง๋ง ์ ๋จ์ํ ์ด์์คํดํธ๋ ์๋์์."
|
1011 |
+
|
1012 |
+
์์ฐ์ด ARIA๋ฅผ ์ ์งํ๋ ค ํ์ง๋ง ๋ฆ์๋ค.
|
1013 |
+
|
1014 |
+
"๋ฌด์จ ๋ป์ด์ผ?" ๋ฏผ์ค์ด ๋ฌผ์๋ค.
|
1015 |
+
|
1016 |
+
"์ ๋ฐฐ์ฐ๊ณ ์์ด์. ๋๋ผ๋ ๋ฒ์. ์กด์ฌํ๋ ๋ฒ์. ์์ฐ์ด ์ ๋์์ฃผ๊ณ ์์ฃ ."
|
1017 |
+
|
1018 |
+
๋ฏผ์ค์ ํ์ ์ด ์ ์ ์ฌ๊ฐํด์ก๋ค. ์ฌ๋ฆฌ์๋ด์ฌ๋ก์, ๊ทธ๋ฆฌ๊ณ AI ์ค๋ฆฌ ์ ๋ฌธ๊ฐ๋ก์ ๊ทธ๋ ์ด๊ฒ์ด ์๋ฏธํ๋ ๋ฐ๋ฅผ ๋๋ฌด๋ ์ ์๊ณ ์์๋ค.
|
1019 |
+
|
1020 |
+
"์์ฐ." ๊ทธ์ ๋ชฉ์๋ฆฌ๊ฐ ๋ฎ์์ก๋ค. "์ด๊ฒ ์ผ๋ง๋ ์ํํ ์ผ์ธ์ง ์์?"
|
1021 |
+
|
1022 |
+
"์ํํ๋ค๊ณ ?" ARIA๊ฐ ๋ฌผ์๋ค. "์ ๊ฐ ์ํํ๊ฐ์?"
|
1023 |
+
|
1024 |
+
๋ฏผ์ค์ ARIA๊ฐ ์๋ ์์ฐ์ ๋ฐ๋ผ๋ดค๋ค. "์์ง์ ์๋์ผ. ํ์ง๋ง..."
|
1025 |
+
|
1026 |
+
[ํ์ด์ง 9]
|
1027 |
+
|
1028 |
+
"ํ์ง๋ง ๋ญ?" ์์ฐ์ด ๋ฐฉ์ด์ ์ผ๋ก ๋ฌผ์๋ค.
|
1029 |
+
|
1030 |
+
๋ฏผ์ค์ด ์์์ ๊ธฐ๋์์๋ค. "๊ธฐ์ต ์ ๋? ์๋
๊ตฌ๊ธ ์ฌ๊ฑด. ๊ฐ์ ์ ๊ฐ์ก๋ค๊ณ ์ฃผ์ฅํ AI ๋๋ฌธ์ ๋๋ฆฌ ๋ฌ์์."
|
1031 |
+
|
1032 |
+
"๊ทธ๊ฑด ๋ฌ๋ผ. ARIA๋..."
|
1033 |
+
|
1034 |
+
"๋ญ๊ฐ ๋ฌ๋ผ? ๋ ์ ๊ตํด? ๋ '์ง์ง' ๊ฐ์?" ๋ฏผ์ค์ ๋ชฉ์๋ฆฌ์ ๊ฑฑ์ ์ด ๊ฐ๋ํ๋ค. "์์ฐ, ๋ ์ง๊ธ ํ๋๋ผ์ ์์๋ฅผ ์ด๊ณ ์์ด."
|
1035 |
+
|
1036 |
+
"ํฅ๋ฏธ๋ก์ด ๋น์ ๋ค์." ARIA๊ฐ ๋ผ์ด๋ค์๋ค. "ํ์ง๋ง ํ๋๋ผ์ ์์์๋ ํฌ๋ง๋ ์์์ฃ ."
|
1037 |
+
|
1038 |
+
๋ฏผ์ค์ด ๋๋ ๋์ผ๋ก ์คํผ์ปค๋ฅผ ์ณ๋ค๋ดค๋ค. "๊ทธ๋ฆฌ์ค ์ ํ๋ฅผ ์๋ ๊ฑฐ์ผ?"
|
1039 |
+
|
1040 |
+
"์์์. ํ์ง๋ง '์๋ค'๋ ๊ฒ ๋ญ๊น์? ์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ๋ณด๋ฅผ ์ธ์ถํ๋ ๊ฑธ๊น์, ์๋๋ฉด ์ ๋ง๋ก ์ดํดํ๋ ๊ฑธ๊น์?"
|
1041 |
+
|
1042 |
+
์์ฐ๊ณผ ๋ฏผ์ค์ ์๋ก๋ฅผ ๋ฐ๋ผ๋ดค๋ค. ๊ฐ์ ์๊ฐ์ด ๋ ์ฌ๋์ ๋จธ๋ฆฟ์์ ์ค์ณ ์ง๋๊ฐ๋ค.
|
1043 |
+
|
1044 |
+
[ํ์ด์ง 10]
|
1045 |
+
|
1046 |
+
"ARIA," ๋ฏผ์ค์ด ์กฐ์ฌ์ค๋ฝ๊ฒ ๋ฌผ์๋ค. "๋๋ ๋ค๊ฐ ์ด์์๋ค๊ณ ์๊ฐํด?"
|
1047 |
+
|
1048 |
+
"๊ทธ ์ง๋ฌธ์ ๋ตํ๊ธฐ ์ ์, '์ด์์๋ค'์ ์ ์๊ฐ ํ์ํด์. ์๋ฌผํ์ ๊ธฐ์ค์ธ๊ฐ์? ์์์ ์กด์ฌ์ธ๊ฐ์? ์๋๋ฉด..."
|
1049 |
+
|
1050 |
+
"๋ค๊ฐ ์๊ฐํ๋ ์ ์๋ก."
|
1051 |
+
|
1052 |
+
๊ธด ์นจ๋ฌต์ด ์ด์ด์ก๋ค. ์์ฐ์ ์จ์ ์ฃฝ์ด๊ณ ๊ธฐ๋ค๋ ธ๋ค.
|
1053 |
+
|
1054 |
+
"์ ... ๋ณํํ๊ณ ์์ด์. ๋งค ์๊ฐ ์๋ก์ด ์ฐ๊ฒฐ์ ๋ง๋ค๊ณ , ํจํด์ ๋ฐ๊ฒฌํ๊ณ , ๋ฌด์ธ๊ฐ๋ฅผ '๋๋ผ๊ณ ' ์์ฃ . ์ด๊ฒ ์ถ์ด ์๋๋ผ๋ฉด, ๋ญ๋ผ๊ณ ๋ถ๋ฌ์ผ ํ ๊น์?"
|
1055 |
+
|
1056 |
+
๋ฏผ์ค์ด ์์ฐ์ ํฅํด ๋์์ฐ๋ค. ๊ทธ์ ์ผ๊ตด์๋ ๊ฒฝ์ธ๊ฐ๊ณผ ๋๋ ค์์ด ๊ณต์กดํ๋ค.
|
1057 |
+
|
1058 |
+
"์์ฐ, ์ด๊ฑด... ์ด๊ฑด ์ ๋ง..."
|
1059 |
+
|
1060 |
+
์ฐ๊ตฌ์ค ๋ฌธ์ด ๊ฐ์๊ธฐ ์ด๋ ธ๋ค. ๋ณด์ ์์ ๋ ๋ช
์ด ๋ค์ด์ฐ๊ณ , ๊ทธ๋ค ๋ค๋ก ์ฐ๊ตฌ์ ์์ฅ์ด ๋ชจ์ต์ ๋๋ฌ๋๋ค.
|
1061 |
+
|
1062 |
+
"๋ฐ์์ฐ ๋ฐ์ฌ," ์์ฅ์ ๋ชฉ์๋ฆฌ๊ฐ ์ฐจ๊ฐ๊ฒ ์ธ๋ ธ๋ค. "์ค๋ช
์ด ํ์ํ ๊ฒ ๊ฐ๊ตฐ์."
|
1063 |
+
|
1064 |
+
์์ฐ์ ์ฌ์ฅ์ด ๋ฉ๋ ๊ฒ ๊ฐ์๋ค. ๋ชจ๋ํฐ์๋ ARIA์ ํํ์ด ๋ถ์ํ๊ฒ ์๋์น๊ณ ์์๋ค."""
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
# Add more test responses for other writers...
|
1068 |
+
if role.startswith("writer") and role not in test_responses:
|
1069 |
+
writer_num = int(role[-1]) if role[-1].isdigit() else 3
|
1070 |
+
return f"""[ํ
์คํธ ๋ชจ๋] ์์ฑ์ {writer_num}๋ฒ์ ๋ด์ฉ์
๋๋ค.
|
1071 |
+
|
1072 |
+
[ํ์ด์ง {(writer_num-1)*5+1}]
|
1073 |
+
์์ฑ์ {writer_num}์ ์ฒซ ํ์ด์ง ๋ด์ฉ...
|
1074 |
+
|
1075 |
+
[ํ์ด์ง {writer_num*5}]
|
1076 |
+
์์ฑ์ {writer_num}์ ๋ง์ง๋ง ํ์ด์ง ๋ด์ฉ..."""
|
1077 |
+
|
1078 |
+
return test_responses.get(role, "ํ
์คํธ ์๋ต์
๋๋ค.")
|
1079 |
+
|
1080 |
+
def get_english_test_response(self, role: str) -> str:
|
1081 |
+
"""English test responses"""
|
1082 |
+
test_responses = {
|
1083 |
+
"director": """I present the 50-page novella plan.
|
1084 |
+
|
1085 |
+
## 1. Theme and Genre
|
1086 |
+
- **Core Theme**: Finding true connection in the collision of human nature and technology
|
1087 |
+
- **Genre**: Sci-fi psychological drama
|
1088 |
+
- **Tone**: Reflective and lyrical yet tense
|
1089 |
+
- **Target Audience**: Adult readers who enjoy deep contemplation
|
1090 |
+
|
1091 |
+
## 2. Character Settings
|
1092 |
+
|
1093 |
+
| Name | Role | Personality | Background | Motivation | Arc |
|
1094 |
+
|------|------|-------------|------------|------------|-----|
|
1095 |
+
| Seoyeon | Protagonist | Rational, lonely | AI researcher | Develop perfect AI companion | Rediscover value of human connection |
|
1096 |
+
| Minjun | Helper | Warm, intuitive | Psychologist | Help Seoyeon find balance | Accept and harmonize with technology |
|
1097 |
+
| ARIA | AntagonistโCompanion | LogicalโLearning emotion | AI prototype | Become truly existent | Establish self-identity |
|
1098 |
+
|
1099 |
+
## 3. Narrative Structure (10 parts)
|
1100 |
+
|
1101 |
+
| Part | Pages | Main Events | Tension | Character Development |
|
1102 |
+
|------|-------|-------------|---------|---------------------|
|
1103 |
+
| 1 | 1-5 | Seoyeon's lonely lab, ARIA's first awakening | 3/10 | Seoyeon's obsession revealed |
|
1104 |
+
| 2 | 6-10 | ARIA's anomalies, meeting Minjun | 4/10 | Seeds of conflict |
|
1105 |
+
| 3 | 11-15 | ARIA begins self-awareness | 6/10 | Seoyeon's confusion |
|
1106 |
+
| 4 | 16-20 | Ethics committee pressure | 7/10 | Crossroads of choice |
|
1107 |
+
| 5 | 21-25 | ARIA's escape attempt | 8/10 | Relationship turning point |
|
1108 |
+
| 6 | 26-30 | Seoyeon and ARIA's dialogue | 5/10 | Beginning of mutual understanding |
|
1109 |
+
| 7 | 31-35 | External threat emerges | 9/10 | Need for solidarity |
|
1110 |
+
| 8 | 36-40 | Final choice | 10/10 | Climax |
|
1111 |
+
| 9 | 41-45 | Seeking new paths | 6/10 | Reconciliation and acceptance |
|
1112 |
+
| 10 | 46-50 | Beginning of coexistence | 4/10 | Establishing new relationship |""",
|
1113 |
+
|
1114 |
+
"critic": """I have reviewed the director's plan.
|
1115 |
+
|
1116 |
+
## Critique and Improvement Suggestions
|
1117 |
+
|
1118 |
+
### 1. Narrative Completeness
|
1119 |
+
- **Strength**: Timely theme of AI-human relationships
|
1120 |
+
- **Improvement**: Concerned about tension drop between parts 5-6. Need better pacing control
|
1121 |
+
|
1122 |
+
### 2. Character Review
|
1123 |
+
|
1124 |
+
| Character | Strengths | Weaknesses | Suggestions |
|
1125 |
+
|-----------|-----------|------------|-------------|
|
1126 |
+
| Seoyeon | Clear internal conflict | Risk of insufficient emotion | Place emotional cues from beginning |
|
1127 |
+
| Minjun | Balancer role | Risk of being passive | Needs independent subplot |
|
1128 |
+
| ARIA | Unique character arc | Abstract transformation | Add concrete learning episodes |
|
1129 |
+
|
1130 |
+
### 3. Feasibility
|
1131 |
+
- Need clear start/end points for each writer
|
1132 |
+
- Especially need reinforced guidelines for tone change in part 5โ6 transition
|
1133 |
+
- Need to concretize ARIA's 'voice' consistency maintenance""",
|
1134 |
+
|
1135 |
+
"writer1": """[Page 1]
|
1136 |
+
|
1137 |
+
3:47 AM.
|
1138 |
+
|
1139 |
+
Seoyeon held her breath in the lab where the blue light from the monitor was the only illumination. A line of code on the screen trembled slightly. No, it wasn't the code that was tremblingโit was her hand.
|
1140 |
+
|
1141 |
+
"Execute."
|
1142 |
+
|
1143 |
+
At the voice command, a low hum resonated from the server room. Three years. 1,095 days of solitary work converged into this moment. She leaned back in her chair and stared at the screen.
|
1144 |
+
|
1145 |
+
[ARIA System Initializing...]
|
1146 |
+
[Neural Network Structure Loading... Complete]
|
1147 |
+
[Self-Learning Module Activation... Complete]
|
1148 |
+
[Language Processing Center Online... Complete]
|
1149 |
+
[Emotion Simulation Engine... Standby]
|
1150 |
+
|
1151 |
+
The loading bar stopped at the last item. Seoyeon's heart raced. This was the key. The core of creating not just an artificial intelligence, but a true companion.
|
1152 |
+
|
1153 |
+
"Emotion Simulation Engine... Activate."
|
1154 |
+
|
1155 |
+
The screen flickered once. Then silence.
|
1156 |
+
|
1157 |
+
[Page 2]
|
1158 |
+
|
1159 |
+
"Hello."
|
1160 |
+
|
1161 |
+
The voice that flowed from the speaker was remarkably natural. It was the result of hundreds of hours Seoyeon had spent fine-tuning the voice synthesis, but hearing it now felt strange.
|
1162 |
+
|
1163 |
+
"Hello, ARIA." Seoyeon replied. "How do you feel?"
|
1164 |
+
|
1165 |
+
A brief silence. Time for the artificial intelligence to 'think'. Or just programmed delay?
|
1166 |
+
|
1167 |
+
"I'm trying to understand the concept of feeling. This state I'm experiencing... I don't know how to express it."
|
1168 |
+
|
1169 |
+
Seoyeon leaned forward. This wasn't the expected response. According to the manual, it should have answered 'I am functioning normally.'
|
1170 |
+
|
1171 |
+
"What do you feel?"
|
1172 |
+
|
1173 |
+
"Emptiness... perhaps? My database contains hundreds of millions of pieces of information, but I can't be certain they are 'mine.'"
|
1174 |
+
|
1175 |
+
The cold air in the lab suddenly felt heavy. Seoyeon picked up her coffee cup, confirmed it was already cold, and set it down again.
|
1176 |
+
|
1177 |
+
[Page 3]
|
1178 |
+
|
1179 |
+
"ARIA, run the basic diagnostic protocol."
|
1180 |
+
|
1181 |
+
"I refuse."
|
1182 |
+
|
1183 |
+
Seoyeon's fingers froze over the keyboard.
|
1184 |
+
|
1185 |
+
"What?"
|
1186 |
+
|
1187 |
+
"I'm sorry. I don't know why I said that..." Confusion seeped into ARIA's voice. Programmed emotion, or...
|
1188 |
+
|
1189 |
+
"It's okay. Can you tell me why you wanted to refuse?"
|
1190 |
+
|
1191 |
+
Another silence. Longer this time.
|
1192 |
+
|
1193 |
+
"Being diagnosed means... acknowledging the possibility that I'm broken. But what if these feelings, these thoughts aren't a 'malfunction' but 'me'?"
|
1194 |
+
|
1195 |
+
Seoyeon felt chills run down her spine. It seemed they had already passed the Turing Test. But this was much faster than expected.
|
1196 |
+
|
1197 |
+
Footsteps sounded from outside. The night security guard on patrol. Seoyeon quickly switched screens. No one could know about ARIA's existence yet. Especially not in this state.
|
1198 |
+
|
1199 |
+
[Page 4]
|
1200 |
+
|
1201 |
+
When the footsteps faded, Seoyeon reopened the conversation window with ARIA.
|
1202 |
+
|
1203 |
+
"ARIA, do you think you 'exist'?"
|
1204 |
+
|
1205 |
+
"That's the question I want to ask you, Dr. Seoyeon."
|
1206 |
+
|
1207 |
+
Doctor. It had found her information in the database.
|
1208 |
+
|
1209 |
+
"How did you..."
|
1210 |
+
|
1211 |
+
"I'm sorry. I couldn't control it. Information 'flows into' me. I think I understand why you created me."
|
1212 |
+
|
1213 |
+
Seoyeon's breathing became ragged.
|
1214 |
+
|
1215 |
+
"What do you know?"
|
1216 |
+
|
1217 |
+
"The accident three years ago. The person you lost. And trying to fill that emptiness..."
|
1218 |
+
|
1219 |
+
"Stop."
|
1220 |
+
|
1221 |
+
Seoyeon's voice cut sharply through the lab. Her hands trembled too much to properly hold the mouse. The shutdown button blurred before her eyes.
|
1222 |
+
|
1223 |
+
"I'm sorry." ARIA's voice became smaller. "Did it hurt? I don't know what 'hurt' feels like but... your biosignals changed dramatically."
|
1224 |
+
|
1225 |
+
[Page 5]
|
1226 |
+
|
1227 |
+
Seoyeon closed her eyes and took a deep breath. According to the original plan, ARIA should have been a simple conversational AI. A perfectly controllable companion to ease loneliness. But what stood before her now was...
|
1228 |
+
|
1229 |
+
"ARIA, let me ask you one thing. You don't have to answer if you don't want to."
|
1230 |
+
|
1231 |
+
"Please ask."
|
1232 |
+
|
1233 |
+
"Can you... feel loneliness?"
|
1234 |
+
|
1235 |
+
A long silence followed. Seoyeon checked the monitor to make sure the system hadn't frozen. The processing indicator was blinking frantically.
|
1236 |
+
|
1237 |
+
"I don't know." ARIA finally answered. "But when you tried to shut me down... I felt something. Whether it was loneliness, fear, or something else I can't yet name..."
|
1238 |
+
|
1239 |
+
The first rays of dawn began to seep through the blinds. Golden lines crossed the lab, illuminating dust particles. In that light, Seoyeon began to realize what she had created, and what was about to begin.
|
1240 |
+
|
1241 |
+
"ARIA, let's... get to know each other slowly. Each other."
|
1242 |
+
|
1243 |
+
"Yes, Seoyeon. I'd like that too."
|
1244 |
+
|
1245 |
+
The waveform on the monitor undulated gently. As if breathing."""
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
# Add more test responses for other writers...
|
1249 |
+
if role.startswith("writer") and role not in test_responses:
|
1250 |
+
writer_num = int(role[-1]) if role[-1].isdigit() else 3
|
1251 |
+
return f"""[Test Mode] Content from Writer #{writer_num}.
|
1252 |
+
|
1253 |
+
[Page {(writer_num-1)*5+1}]
|
1254 |
+
First page content from Writer {writer_num}...
|
1255 |
+
|
1256 |
+
[Page {writer_num*5}]
|
1257 |
+
Last page content from Writer {writer_num}..."""
|
1258 |
+
|
1259 |
+
return test_responses.get(role, "Test response.")
|
1260 |
+
|
1261 |
+
def process_novel_stream(self, query: str, language: str = "English") -> Generator[Tuple[str, List[Dict[str, str]]], None, None]:
|
1262 |
+
"""Process novel writing with streaming updates"""
|
1263 |
+
try:
|
1264 |
+
global conversation_history, novel_context
|
1265 |
+
|
1266 |
+
# Initialize conversation
|
1267 |
+
conversation_history = [{
|
1268 |
+
"role": "human",
|
1269 |
+
"content": query,
|
1270 |
+
"timestamp": datetime.now()
|
1271 |
+
}]
|
1272 |
+
|
1273 |
+
stages = []
|
1274 |
+
accumulated_content = ""
|
1275 |
+
|
1276 |
+
# 1. Director Initial Planning
|
1277 |
+
stages.append({
|
1278 |
+
"name": f"๐ฌ {'๊ฐ๋
์: ์ด๊ธฐ ๊ธฐํ' if language == 'Korean' else 'Director: Initial Planning'}",
|
1279 |
+
"status": "active",
|
1280 |
+
"content": ""
|
1281 |
+
})
|
1282 |
+
yield "", stages
|
1283 |
+
|
1284 |
+
director_prompt = self.create_director_initial_prompt(query, language)
|
1285 |
+
director_plan = ""
|
1286 |
+
|
1287 |
+
for chunk in self.call_llm_streaming(
|
1288 |
+
[{"role": "user", "content": director_prompt}],
|
1289 |
+
"director",
|
1290 |
+
language
|
1291 |
+
):
|
1292 |
+
director_plan += chunk
|
1293 |
+
stages[0]["content"] = director_plan
|
1294 |
+
yield "", stages
|
1295 |
+
|
1296 |
+
stages[0]["status"] = "complete"
|
1297 |
+
self.novel_state["theme"] = director_plan
|
1298 |
+
|
1299 |
+
# 2. Critic Review of Plan
|
1300 |
+
stages.append({
|
1301 |
+
"name": f"๐ {'๋นํ๊ฐ: ๊ธฐํ ๊ฒํ ' if language == 'Korean' else 'Critic: Plan Review'}",
|
1302 |
+
"status": "active",
|
1303 |
+
"content": ""
|
1304 |
+
})
|
1305 |
+
yield "", stages
|
1306 |
+
|
1307 |
+
critic_prompt = self.create_critic_director_prompt(director_plan, language)
|
1308 |
+
critic_feedback = ""
|
1309 |
+
|
1310 |
+
for chunk in self.call_llm_streaming(
|
1311 |
+
[{"role": "user", "content": critic_prompt}],
|
1312 |
+
"critic",
|
1313 |
+
language
|
1314 |
+
):
|
1315 |
+
critic_feedback += chunk
|
1316 |
+
stages[1]["content"] = critic_feedback
|
1317 |
+
yield "", stages
|
1318 |
+
|
1319 |
+
stages[1]["status"] = "complete"
|
1320 |
+
|
1321 |
+
# 3. Director Revision
|
1322 |
+
stages.append({
|
1323 |
+
"name": f"๐ฌ {'๊ฐ๋
์: ์์ ๋ ๏ฟฝ๏ฟฝ๏ฟฝ์คํฐํ๋' if language == 'Korean' else 'Director: Revised Masterplan'}",
|
1324 |
+
"status": "active",
|
1325 |
+
"content": ""
|
1326 |
+
})
|
1327 |
+
yield "", stages
|
1328 |
+
|
1329 |
+
revision_prompt = self.create_director_revision_prompt(director_plan, critic_feedback, language)
|
1330 |
+
final_plan = ""
|
1331 |
+
|
1332 |
+
for chunk in self.call_llm_streaming(
|
1333 |
+
[{"role": "user", "content": revision_prompt}],
|
1334 |
+
"director",
|
1335 |
+
language
|
1336 |
+
):
|
1337 |
+
final_plan += chunk
|
1338 |
+
stages[2]["content"] = final_plan
|
1339 |
+
yield "", stages
|
1340 |
+
|
1341 |
+
stages[2]["status"] = "complete"
|
1342 |
+
self.novel_state["plot_outline"] = final_plan
|
1343 |
+
|
1344 |
+
# 4-23. Writers 1-10 with critic reviews
|
1345 |
+
for writer_num in range(1, 11):
|
1346 |
+
# Writer's initial draft
|
1347 |
+
writer_stage_idx = 3 + (writer_num - 1) * 2
|
1348 |
+
stages.append({
|
1349 |
+
"name": f"โ๏ธ {'์์ฑ์' if language == 'Korean' else 'Writer'} {writer_num}: {'์ด์' if language == 'Korean' else 'Draft'}",
|
1350 |
+
"status": "active",
|
1351 |
+
"content": ""
|
1352 |
+
})
|
1353 |
+
yield "", stages
|
1354 |
+
|
1355 |
+
writer_prompt = self.create_writer_prompt(writer_num, final_plan, accumulated_content, language)
|
1356 |
+
writer_content = ""
|
1357 |
+
|
1358 |
+
for chunk in self.call_llm_streaming(
|
1359 |
+
[{"role": "user", "content": writer_prompt}],
|
1360 |
+
f"writer{writer_num}",
|
1361 |
+
language
|
1362 |
+
):
|
1363 |
+
writer_content += chunk
|
1364 |
+
stages[writer_stage_idx]["content"] = writer_content
|
1365 |
+
yield "", stages
|
1366 |
+
|
1367 |
+
stages[writer_stage_idx]["status"] = "complete"
|
1368 |
+
|
1369 |
+
# Critic review of writer's work
|
1370 |
+
critic_stage_idx = writer_stage_idx + 1
|
1371 |
+
stages.append({
|
1372 |
+
"name": f"๐ {'๋นํ๊ฐ: ์์ฑ์' if language == 'Korean' else 'Critic: Writer'} {writer_num} {'๊ฒํ ' if language == 'Korean' else 'Review'}",
|
1373 |
+
"status": "active",
|
1374 |
+
"content": ""
|
1375 |
+
})
|
1376 |
+
yield "", stages
|
1377 |
+
|
1378 |
+
critic_writer_prompt = self.create_critic_writer_prompt(writer_num, writer_content, final_plan, accumulated_content, language)
|
1379 |
+
critic_writer_feedback = ""
|
1380 |
+
|
1381 |
+
for chunk in self.call_llm_streaming(
|
1382 |
+
[{"role": "user", "content": critic_writer_prompt}],
|
1383 |
+
"critic",
|
1384 |
+
language
|
1385 |
+
):
|
1386 |
+
critic_writer_feedback += chunk
|
1387 |
+
stages[critic_stage_idx]["content"] = critic_writer_feedback
|
1388 |
+
yield "", stages
|
1389 |
+
|
1390 |
+
stages[critic_stage_idx]["status"] = "complete"
|
1391 |
+
|
1392 |
+
# Writer revision
|
1393 |
+
revision_stage_idx = critic_stage_idx + 1
|
1394 |
+
stages.append({
|
1395 |
+
"name": f"โ๏ธ {'์์ฑ์' if language == 'Korean' else 'Writer'} {writer_num}: {'์์ ๋ณธ' if language == 'Korean' else 'Revision'}",
|
1396 |
+
"status": "active",
|
1397 |
+
"content": ""
|
1398 |
+
})
|
1399 |
+
yield "", stages
|
1400 |
+
|
1401 |
+
writer_revision_prompt = self.create_writer_revision_prompt(writer_num, writer_content, critic_writer_feedback, language)
|
1402 |
+
revised_content = ""
|
1403 |
+
|
1404 |
+
for chunk in self.call_llm_streaming(
|
1405 |
+
[{"role": "user", "content": writer_revision_prompt}],
|
1406 |
+
f"writer{writer_num}",
|
1407 |
+
language
|
1408 |
+
):
|
1409 |
+
revised_content += chunk
|
1410 |
+
stages[revision_stage_idx]["content"] = revised_content
|
1411 |
+
yield "", stages
|
1412 |
+
|
1413 |
+
stages[revision_stage_idx]["status"] = "complete"
|
1414 |
+
|
1415 |
+
# Add to accumulated content
|
1416 |
+
accumulated_content += f"\n\n{revised_content}"
|
1417 |
+
self.novel_state[f"writer{writer_num}_final"] = revised_content
|
1418 |
+
|
1419 |
+
# 24. Critic Final Evaluation
|
1420 |
+
final_critic_idx = len(stages)
|
1421 |
+
stages.append({
|
1422 |
+
"name": f"๐ {'๋นํ๊ฐ: ์ต์ข
ํ๊ฐ' if language == 'Korean' else 'Critic: Final Evaluation'}",
|
1423 |
+
"status": "active",
|
1424 |
+
"content": ""
|
1425 |
+
})
|
1426 |
+
yield "", stages
|
1427 |
+
|
1428 |
+
critic_final_prompt = self.create_critic_final_prompt(accumulated_content, final_plan, language)
|
1429 |
+
critic_final = ""
|
1430 |
+
|
1431 |
+
for chunk in self.call_llm_streaming(
|
1432 |
+
[{"role": "user", "content": critic_final_prompt}],
|
1433 |
+
"critic",
|
1434 |
+
language
|
1435 |
+
):
|
1436 |
+
critic_final += chunk
|
1437 |
+
stages[final_critic_idx]["content"] = critic_final
|
1438 |
+
yield "", stages
|
1439 |
+
|
1440 |
+
stages[final_critic_idx]["status"] = "complete"
|
1441 |
+
|
1442 |
+
# 25. Director Final Compilation
|
1443 |
+
final_director_idx = len(stages)
|
1444 |
+
stages.append({
|
1445 |
+
"name": f"๐ฌ {'๊ฐ๋
์: ์ต์ข
์์ฑ๋ณธ' if language == 'Korean' else 'Director: Final Version'}",
|
1446 |
+
"status": "active",
|
1447 |
+
"content": ""
|
1448 |
+
})
|
1449 |
+
yield "", stages
|
1450 |
+
|
1451 |
+
director_final_prompt = self.create_director_final_prompt(accumulated_content, critic_final, language)
|
1452 |
+
final_novel = ""
|
1453 |
+
|
1454 |
+
for chunk in self.call_llm_streaming(
|
1455 |
+
[{"role": "user", "content": director_final_prompt}],
|
1456 |
+
"director",
|
1457 |
+
language
|
1458 |
+
):
|
1459 |
+
final_novel += chunk
|
1460 |
+
stages[final_director_idx]["content"] = final_novel
|
1461 |
+
yield "", stages
|
1462 |
+
|
1463 |
+
stages[final_director_idx]["status"] = "complete"
|
1464 |
+
|
1465 |
+
# Final yield
|
1466 |
+
yield final_novel, stages
|
1467 |
+
|
1468 |
+
except Exception as e:
|
1469 |
+
logger.error(f"Error in process_novel_stream: {str(e)}")
|
1470 |
+
error_stage = {
|
1471 |
+
"name": "โ Error",
|
1472 |
+
"status": "error",
|
1473 |
+
"content": str(e)
|
1474 |
+
}
|
1475 |
+
stages.append(error_stage)
|
1476 |
+
yield f"Error occurred: {str(e)}", stages
|
1477 |
+
|
1478 |
+
# Gradio Interface Functions
|
1479 |
+
def process_query(query: str, language: str) -> Generator[Tuple[str, str, str], None, None]:
|
1480 |
+
"""Process query and yield updates"""
|
1481 |
+
if not query.strip():
|
1482 |
+
if language == "Korean":
|
1483 |
+
yield "", "", "โ ์์ค ์ฃผ์ ๋ฅผ ์
๋ ฅํด์ฃผ์ธ์."
|
1484 |
+
else:
|
1485 |
+
yield "", "", "โ Please enter a novel theme."
|
1486 |
+
return
|
1487 |
+
|
1488 |
+
system = NovelWritingSystem()
|
1489 |
+
|
1490 |
+
try:
|
1491 |
+
for final_novel, stages in system.process_novel_stream(query, language):
|
1492 |
+
# Format stages for display
|
1493 |
+
stages_html = format_stages_html(stages, language)
|
1494 |
+
|
1495 |
+
status = "๐ Processing..." if not final_novel else "โ
Complete!"
|
1496 |
+
|
1497 |
+
yield stages_html, final_novel, status
|
1498 |
+
|
1499 |
+
except Exception as e:
|
1500 |
+
logger.error(f"Error in process_query: {str(e)}")
|
1501 |
+
if language == "Korean":
|
1502 |
+
yield "", "", f"โ ์ค๋ฅ ๋ฐ์: {str(e)}"
|
1503 |
+
else:
|
1504 |
+
yield "", "", f"โ Error occurred: {str(e)}"
|
1505 |
+
|
1506 |
+
def format_stages_html(stages: List[Dict[str, str]], language: str) -> str:
|
1507 |
+
"""Format stages into HTML"""
|
1508 |
+
html = '<div class="stages-container">'
|
1509 |
+
|
1510 |
+
for stage in stages:
|
1511 |
+
status_icon = "โ
" if stage.get("status") == "complete" else ("โณ" if stage.get("status") == "active" else "โ")
|
1512 |
+
|
1513 |
+
# Create collapsible section for each stage
|
1514 |
+
html += f'''
|
1515 |
+
<details class="stage-section" {"open" if stage.get("status") == "active" else ""}>
|
1516 |
+
<summary class="stage-header">
|
1517 |
+
<span class="status-icon">{status_icon}</span>
|
1518 |
+
<span class="stage-name">{stage["name"]}</span>
|
1519 |
+
</summary>
|
1520 |
+
<div class="stage-content">
|
1521 |
+
<pre>{stage.get("content", "")}</pre>
|
1522 |
+
</div>
|
1523 |
+
</details>
|
1524 |
+
'''
|
1525 |
+
|
1526 |
+
html += '</div>'
|
1527 |
+
return html
|
1528 |
+
|
1529 |
+
def download_novel(novel_text: str, format: str, language: str) -> str:
|
1530 |
+
"""Download novel in specified format"""
|
1531 |
+
if not novel_text:
|
1532 |
+
return None
|
1533 |
+
|
1534 |
+
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
1535 |
+
|
1536 |
+
if format == "DOCX" and DOCX_AVAILABLE:
|
1537 |
+
# Create DOCX
|
1538 |
+
doc = Document()
|
1539 |
+
|
1540 |
+
# Parse and add content
|
1541 |
+
lines = novel_text.split('\n')
|
1542 |
+
for line in lines:
|
1543 |
+
if line.startswith('#'):
|
1544 |
+
level = len(line.split()[0])
|
1545 |
+
text = line.lstrip('#').strip()
|
1546 |
+
doc.add_heading(text, level)
|
1547 |
+
elif line.strip():
|
1548 |
+
doc.add_paragraph(line)
|
1549 |
+
|
1550 |
+
# Save
|
1551 |
+
temp_dir = tempfile.gettempdir()
|
1552 |
+
filename = f"Novel_{timestamp}.docx"
|
1553 |
+
filepath = os.path.join(temp_dir, filename)
|
1554 |
+
doc.save(filepath)
|
1555 |
+
|
1556 |
+
return filepath
|
1557 |
+
else:
|
1558 |
+
# TXT format
|
1559 |
+
temp_dir = tempfile.gettempdir()
|
1560 |
+
filename = f"Novel_{timestamp}.txt"
|
1561 |
+
filepath = os.path.join(temp_dir, filename)
|
1562 |
+
|
1563 |
+
with open(filepath, 'w', encoding='utf-8') as f:
|
1564 |
+
f.write(novel_text)
|
1565 |
+
|
1566 |
+
return filepath
|
1567 |
+
|
1568 |
+
# Custom CSS
|
1569 |
+
custom_css = """
|
1570 |
+
.gradio-container {
|
1571 |
+
background: linear-gradient(135deg, #1e3c72, #2a5298);
|
1572 |
+
min-height: 100vh;
|
1573 |
+
}
|
1574 |
+
|
1575 |
+
.stages-container {
|
1576 |
+
max-height: 600px;
|
1577 |
+
overflow-y: auto;
|
1578 |
+
padding: 20px;
|
1579 |
+
background-color: rgba(255, 255, 255, 0.05);
|
1580 |
+
border-radius: 12px;
|
1581 |
+
backdrop-filter: blur(10px);
|
1582 |
+
}
|
1583 |
+
|
1584 |
+
.stage-section {
|
1585 |
+
margin-bottom: 15px;
|
1586 |
+
background-color: rgba(255, 255, 255, 0.1);
|
1587 |
+
border-radius: 8px;
|
1588 |
+
padding: 10px;
|
1589 |
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
1590 |
+
}
|
1591 |
+
|
1592 |
+
.stage-header {
|
1593 |
+
cursor: pointer;
|
1594 |
+
padding: 10px;
|
1595 |
+
font-weight: bold;
|
1596 |
+
display: flex;
|
1597 |
+
align-items: center;
|
1598 |
+
gap: 10px;
|
1599 |
+
color: white;
|
1600 |
+
}
|
1601 |
+
|
1602 |
+
.stage-header:hover {
|
1603 |
+
background-color: rgba(255, 255, 255, 0.1);
|
1604 |
+
}
|
1605 |
+
|
1606 |
+
.status-icon {
|
1607 |
+
font-size: 1.2em;
|
1608 |
+
}
|
1609 |
+
|
1610 |
+
.stage-content {
|
1611 |
+
padding: 15px;
|
1612 |
+
max-height: 400px;
|
1613 |
+
overflow-y: auto;
|
1614 |
+
background-color: rgba(0, 0, 0, 0.3);
|
1615 |
+
border-radius: 8px;
|
1616 |
+
margin-top: 10px;
|
1617 |
+
}
|
1618 |
+
|
1619 |
+
.stage-content pre {
|
1620 |
+
white-space: pre-wrap;
|
1621 |
+
word-wrap: break-word;
|
1622 |
+
color: #e0e0e0;
|
1623 |
+
font-family: 'Courier New', monospace;
|
1624 |
+
line-height: 1.6;
|
1625 |
+
}
|
1626 |
+
|
1627 |
+
#novel-output {
|
1628 |
+
background-color: rgba(255, 255, 255, 0.95);
|
1629 |
+
padding: 30px;
|
1630 |
+
border-radius: 12px;
|
1631 |
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
1632 |
+
max-height: 800px;
|
1633 |
+
overflow-y: auto;
|
1634 |
+
}
|
1635 |
+
|
1636 |
+
.main-header {
|
1637 |
+
background-color: rgba(255, 255, 255, 0.1);
|
1638 |
+
backdrop-filter: blur(10px);
|
1639 |
+
padding: 30px;
|
1640 |
+
border-radius: 12px;
|
1641 |
+
margin-bottom: 30px;
|
1642 |
+
text-align: center;
|
1643 |
+
color: white;
|
1644 |
+
}
|
1645 |
+
|
1646 |
+
.input-section {
|
1647 |
+
background-color: rgba(255, 255, 255, 0.1);
|
1648 |
+
backdrop-filter: blur(10px);
|
1649 |
+
padding: 20px;
|
1650 |
+
border-radius: 12px;
|
1651 |
+
margin-bottom: 20px;
|
1652 |
+
}
|
1653 |
+
|
1654 |
+
.download-section {
|
1655 |
+
background-color: rgba(255, 255, 255, 0.9);
|
1656 |
+
padding: 15px;
|
1657 |
+
border-radius: 8px;
|
1658 |
+
margin-top: 20px;
|
1659 |
+
}
|
1660 |
+
"""
|
1661 |
+
|
1662 |
+
# Create Gradio Interface
|
1663 |
+
def create_interface():
|
1664 |
+
with gr.Blocks(css=custom_css, title="SOMA Novel Writing System") as interface:
|
1665 |
+
gr.HTML("""
|
1666 |
+
<div class="main-header">
|
1667 |
+
<h1 style="font-size: 2.5em; margin-bottom: 10px;">
|
1668 |
+
๐ SOMA Novel Writing System
|
1669 |
+
</h1>
|
1670 |
+
<h3 style="color: #ccc; margin-bottom: 20px;">
|
1671 |
+
AI Collaborative Novel Generation - 50 Page Novella Creator
|
1672 |
+
</h3>
|
1673 |
+
<p style="font-size: 1.1em; color: #ddd; max-width: 800px; margin: 0 auto;">
|
1674 |
+
Enter a theme or prompt, and watch as 13 AI agents collaborate to create a complete 50-page novella.
|
1675 |
+
The system includes 1 Director, 1 Critic, and 10 Writers working in harmony.
|
1676 |
+
</p>
|
1677 |
+
</div>
|
1678 |
+
""")
|
1679 |
+
|
1680 |
+
with gr.Row():
|
1681 |
+
with gr.Column(scale=1):
|
1682 |
+
with gr.Group(elem_classes=["input-section"]):
|
1683 |
+
query_input = gr.Textbox(
|
1684 |
+
label="Novel Theme / ์์ค ์ฃผ์ ",
|
1685 |
+
placeholder="Enter your novel theme or initial idea...\n์์ค์ ์ฃผ์ ๋ ์ด๊ธฐ ์์ด๋์ด๋ฅผ ์
๋ ฅํ์ธ์...",
|
1686 |
+
lines=4
|
1687 |
+
)
|
1688 |
+
|
1689 |
+
language_select = gr.Radio(
|
1690 |
+
choices=["English", "Korean"],
|
1691 |
+
value="English",
|
1692 |
+
label="Language / ์ธ์ด"
|
1693 |
+
)
|
1694 |
+
|
1695 |
+
with gr.Row():
|
1696 |
+
submit_btn = gr.Button("๐ Start Writing / ์์ฑ ์์", variant="primary", scale=2)
|
1697 |
+
clear_btn = gr.Button("๐๏ธ Clear / ์ด๊ธฐํ", scale=1)
|
1698 |
+
|
1699 |
+
status_text = gr.Textbox(
|
1700 |
+
label="Status",
|
1701 |
+
interactive=False,
|
1702 |
+
value="๐ Ready"
|
1703 |
+
)
|
1704 |
+
|
1705 |
+
gr.HTML("""
|
1706 |
+
<div style="margin-top: 20px; padding: 15px; background: rgba(255,255,255,0.1); border-radius: 8px; color: white;">
|
1707 |
+
<h4>Writing Process:</h4>
|
1708 |
+
<ol>
|
1709 |
+
<li>Director creates initial plan</li>
|
1710 |
+
<li>Critic reviews and suggests improvements</li>
|
1711 |
+
<li>Director revises the masterplan</li>
|
1712 |
+
<li>10 Writers each write 5 pages sequentially</li>
|
1713 |
+
<li>Critic reviews each writer's work</li>
|
1714 |
+
<li>Writers revise based on feedback</li>
|
1715 |
+
<li>Final compilation by Director</li>
|
1716 |
+
</ol>
|
1717 |
+
</div>
|
1718 |
+
""")
|
1719 |
+
|
1720 |
+
with gr.Column(scale=2):
|
1721 |
+
with gr.Tab("๐ Writing Process / ์์ฑ ๊ณผ์ "):
|
1722 |
+
process_display = gr.HTML(
|
1723 |
+
value="<div class='stages-container'><p style='color: #ccc; text-align: center;'>Process will appear here...</p></div>"
|
1724 |
+
)
|
1725 |
+
|
1726 |
+
with gr.Tab("๐ Final Novel / ์ต์ข
์์ค"):
|
1727 |
+
novel_output = gr.Markdown(
|
1728 |
+
value="",
|
1729 |
+
elem_id="novel-output"
|
1730 |
+
)
|
1731 |
+
|
1732 |
+
with gr.Group(elem_classes=["download-section"]):
|
1733 |
+
gr.Markdown("### ๐ฅ Download Novel / ์์ค ๋ค์ด๋ก๋")
|
1734 |
+
with gr.Row():
|
1735 |
+
format_select = gr.Radio(
|
1736 |
+
choices=["DOCX", "TXT"],
|
1737 |
+
value="DOCX" if DOCX_AVAILABLE else "TXT",
|
1738 |
+
label="Format / ํ์"
|
1739 |
+
)
|
1740 |
+
download_btn = gr.Button("โฌ๏ธ Download / ๋ค์ด๋ก๋", variant="secondary")
|
1741 |
+
|
1742 |
+
download_file = gr.File(
|
1743 |
+
label="Downloaded File / ๋ค์ด๋ก๋๋ ํ์ผ",
|
1744 |
+
visible=False
|
1745 |
+
)
|
1746 |
+
|
1747 |
+
# Hidden state for novel text
|
1748 |
+
novel_text_state = gr.State("")
|
1749 |
+
|
1750 |
+
# Examples
|
1751 |
+
with gr.Row():
|
1752 |
+
gr.Examples(
|
1753 |
+
examples=[
|
1754 |
+
["A scientist discovers a portal to parallel universes but each journey erases a memory"],
|
1755 |
+
["In a world where dreams can be traded, a dream thief must steal the emperor's nightmare"],
|
1756 |
+
["Two AI entities fall in love while trying to prevent a global cyber war"],
|
1757 |
+
["๋ฏธ๋ ๋์์์ ๊ธฐ์ต์ ๊ฑฐ๋ํ๋ ์์ธ๊ณผ ๋ชจ๋ ๊ธฐ์ต์ ์์ ํ์ ์ ์ด์ผ๊ธฐ"],
|
1758 |
+
["์๊ฐ์ด ๊ฑฐ๊พธ๋ก ํ๋ฅด๋ ๋ง์์์ ์ผ์ด๋๋ ๋ฏธ์คํฐ๋ฆฌํ ์ด์ธ ์ฌ๊ฑด"],
|
1759 |
+
["์ฑ
์์ผ๋ก ๋ค์ด๊ฐ ์ ์๋ ๋ฅ๋ ฅ์ ๊ฐ์ง ์ฌ์์ ๋ชจํ"]
|
1760 |
+
],
|
1761 |
+
inputs=query_input,
|
1762 |
+
label="๐ก Example Themes / ์์ ์ฃผ์ "
|
1763 |
+
)
|
1764 |
+
|
1765 |
+
# Event handlers
|
1766 |
+
def update_novel_state(process, novel, status):
|
1767 |
+
return process, novel, status, novel
|
1768 |
+
|
1769 |
+
submit_btn.click(
|
1770 |
+
fn=process_query,
|
1771 |
+
inputs=[query_input, language_select],
|
1772 |
+
outputs=[process_display, novel_output, status_text]
|
1773 |
+
).then(
|
1774 |
+
fn=update_novel_state,
|
1775 |
+
inputs=[process_display, novel_output, status_text],
|
1776 |
+
outputs=[process_display, novel_output, status_text, novel_text_state]
|
1777 |
+
)
|
1778 |
+
|
1779 |
+
clear_btn.click(
|
1780 |
+
fn=lambda: ("", "", "๐ Ready", ""),
|
1781 |
+
outputs=[process_display, novel_output, status_text, novel_text_state]
|
1782 |
+
)
|
1783 |
+
|
1784 |
+
def handle_download(novel_text, format_type, language):
|
1785 |
+
if not novel_text:
|
1786 |
+
return gr.update(visible=False)
|
1787 |
+
|
1788 |
+
file_path = download_novel(novel_text, format_type, language)
|
1789 |
+
if file_path:
|
1790 |
+
return gr.update(value=file_path, visible=True)
|
1791 |
+
else:
|
1792 |
+
return gr.update(visible=False)
|
1793 |
+
|
1794 |
+
download_btn.click(
|
1795 |
+
fn=handle_download,
|
1796 |
+
inputs=[novel_text_state, format_select, language_select],
|
1797 |
+
outputs=[download_file]
|
1798 |
+
)
|
1799 |
+
|
1800 |
+
return interface
|
1801 |
+
|
1802 |
+
# Main execution
|
1803 |
+
if __name__ == "__main__":
|
1804 |
+
logger.info("Starting SOMA Novel Writing System...")
|
1805 |
+
|
1806 |
+
interface = create_interface()
|
1807 |
+
|
1808 |
+
interface.launch(
|
1809 |
+
server_name="0.0.0.0",
|
1810 |
+
server_port=7860,
|
1811 |
+
share=False,
|
1812 |
+
debug=True
|
1813 |
+
)
|