openfree commited on
Commit
1c836be
ยท
verified ยท
1 Parent(s): 96d5203

Update app-backup.py

Browse files
Files changed (1) hide show
  1. app-backup.py +69 -11
app-backup.py CHANGED
@@ -186,7 +186,7 @@ class ProgressiveNarrativeTracker:
186
  issues.append(f"์˜๋ฏธ๊ฐ€ ๋ฐœ์ „ํ•˜์ง€ ์•Š์€ ์ƒ์ง•: {', '.join(static_symbols)}")
187
 
188
  return len(issues) == 0, issues
189
-
190
  def generate_phase_requirements(self, phase: int) -> str:
191
  """๊ฐ ๋‹จ๊ณ„๋ณ„ ํ•„์ˆ˜ ์š”๊ตฌ์‚ฌํ•ญ ์ƒ์„ฑ"""
192
  requirements = []
@@ -222,6 +222,11 @@ class ProgressiveNarrativeTracker:
222
  requirements.append("- ๋ณ€ํ™”๋œ ์ผ์ƒ์˜ ๋ชจ์Šต")
223
  requirements.append("- ํ•ด๊ฒฐ๋˜์ง€ ์•Š์€ ์งˆ๋ฌธ๋“ค")
224
  requirements.append("- ์—ฌ์šด๊ณผ ์„ฑ์ฐฐ์˜ ์—ฌ์ง€")
 
 
 
 
 
225
 
226
  # ๋ฐ˜๋ณต ๋ฐฉ์ง€ ์š”๊ตฌ์‚ฌํ•ญ
227
  requirements.append("\nโš ๏ธ ์ ˆ๋Œ€ ๊ธˆ์ง€์‚ฌํ•ญ:")
@@ -230,6 +235,8 @@ class ProgressiveNarrativeTracker:
230
  requirements.append("- ํ”Œ๋กฏ์ด ์ œ์ž๋ฆฌ๊ฑธ์Œํ•˜๊ธฐ")
231
 
232
  return "\n".join(requirements)
 
 
233
 
234
 
235
  class NovelDatabase:
@@ -516,12 +523,18 @@ class ProgressiveLiterarySystem:
516
  """๊ฐ๋…์ž ์ดˆ๊ธฐ ๊ธฐํš - ํ†ตํ•ฉ๋œ ์„œ์‚ฌ ๊ตฌ์กฐ"""
517
  search_results_str = ""
518
  if self.web_search.enabled:
519
- queries = [f"{user_query} ์‚ฌํšŒ ๋ฌธ์ œ", f"{user_query} ํ˜„๋Œ€ ํ•œ๊ตญ"]
520
- for q in queries[:1]:
 
 
 
 
 
 
521
  results = self.web_search.search(q, count=2, language=language)
522
  if results:
523
  search_results_str += self.web_search.extract_relevant_info(results) + "\n"
524
-
525
  lang_prompts = {
526
  "Korean": f"""๋‹น์‹ ์€ ํ˜„๋Œ€ ํ•œ๊ตญ ๋ฌธํ•™์˜ ๊ฑฐ์žฅ์ž…๋‹ˆ๋‹ค.
527
  ๋‹จํŽธ์ด ์•„๋‹Œ ์ค‘ํŽธ ์†Œ์„ค(8,000๋‹จ์–ด ์ด์ƒ)์„ ์œ„ํ•œ ํ†ตํ•ฉ๋œ ์„œ์‚ฌ ๊ตฌ์กฐ๋ฅผ ๊ธฐํšํ•˜์„ธ์š”. ์ ˆ๋Œ€ '์ˆ˜๋™ํƒœ'๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ๋งˆ์„ธ์š”.
@@ -580,7 +593,7 @@ class ProgressiveLiterarySystem:
580
 
581
  ํ•˜๋‚˜์˜ ๊ฐ•๋ ฅํ•œ ์„œ์‚ฌ๊ฐ€ ์‹œ์ž‘๋ถ€ํ„ฐ ๋๊นŒ์ง€ ๊ด€ํ†ตํ•˜๋Š” ์ž‘ํ’ˆ์„ ๊ธฐํšํ•˜์„ธ์š”.""",
582
 
583
- "English": f"""You are a master of contemporary literary fiction.
584
  Plan an integrated narrative structure for a novella (8,000+ words), not a collection of short stories.
585
 
586
  **Theme:** {user_query}
@@ -637,9 +650,12 @@ Plan an integrated narrative structure for a novella (8,000+ words), not a colle
637
 
638
  Create a work with one powerful narrative from beginning to end."""
639
  }
640
-
641
  return lang_prompts.get(language, lang_prompts["Korean"])
642
 
 
 
 
643
  def create_critic_director_prompt(self, director_plan: str, user_query: str, language: str) -> str:
644
  """๋น„ํ‰๊ฐ€์˜ ๊ฐ๋…์ž ๊ธฐํš ๊ฒ€ํ†  - ์„œ์‚ฌ ํ†ตํ•ฉ์„ฑ ์ค‘์‹ฌ"""
645
  lang_prompts = {
@@ -933,7 +949,9 @@ Specific progression directions for each writer."""
933
 
934
  def create_critic_final_prompt(self, complete_novel: str, word_count: int, language: str) -> str:
935
  """์ตœ์ข… ๋น„ํ‰ - AGI ํ‰๊ฐ€ ๊ธฐ์ค€"""
936
- return f"""์™„์„ฑ๋œ ์†Œ์„ค์„ AGI ํŠœ๋งํ…Œ์ŠคํŠธ ๊ธฐ์ค€์œผ๋กœ ํ‰๊ฐ€ํ•˜์„ธ์š”.
 
 
937
 
938
  **์ž‘ํ’ˆ ์ •๋ณด:**
939
  - ์ด ๋ถ„๋Ÿ‰: {word_count}๋‹จ์–ด
@@ -944,19 +962,19 @@ Specific progression directions for each writer."""
944
 
945
  **ํ‰๊ฐ€ ๊ธฐ์ค€ (AGI ํŠœ๋งํ…Œ์ŠคํŠธ):**
946
 
947
- 1. **์žฅํŽธ์†Œ์„ค๋กœ์„œ์˜ ์™„์„ฑ๋„ (40์ )**
948
  - ํ†ตํ•ฉ๋œ ์„œ์‚ฌ ๊ตฌ์กฐ (๋ฐ˜๋ณต ์—†์Œ)
949
  - ์ธ๋ฌผ์˜ ๋ช…ํ™•ํ•œ ๋ณ€ํ™” arc
950
  - ํ”Œ๋กฏ์˜ ์ถ•์ ๊ณผ ํ•ด๊ฒฐ
951
  - 8,000๋‹จ์–ด ์ด์ƒ ๋ถ„๋Ÿ‰
952
 
953
- 2. **๋ฌธํ•™์  ์„ฑ์ทจ (30์ )**
954
  - ์ฃผ์ œ ์˜์‹์˜ ๊นŠ์ด
955
  - ์ธ๋ฌผ ์‹ฌ๋ฆฌ์˜ ์„ค๋“๋ ฅ
956
  - ๋ฌธ์ฒด์˜ ์ผ๊ด€์„ฑ๊ณผ ์•„๋ฆ„๋‹ค์›€
957
  - ์ƒ์ง•๊ณผ ์€์œ ์˜ ํšจ๊ณผ
958
 
959
- 3. **์‚ฌํšŒ์  ํ†ต์ฐฐ (20์ )**
960
  - ํ˜„๋Œ€ ์‚ฌํšŒ ๋ฌธ์ œ ํฌ์ฐฉ
961
  - ๊ฐœ์ธ๊ณผ ๊ตฌ์กฐ์˜ ์—ฐ๊ฒฐ
962
  - ๋ณดํŽธ์„ฑ๊ณผ ํŠน์ˆ˜์„ฑ ๊ท ํ˜•
@@ -968,7 +986,47 @@ Specific progression directions for each writer."""
968
 
969
  **์ด์ : /100์ **
970
 
971
- ํŠนํžˆ '๋ฐ˜๋ณต ๊ตฌ์กฐ' ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋Š”์ง€ ์—„๊ฒฉํžˆ ํ‰๊ฐ€ํ•˜์„ธ์š”."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972
 
973
  # --- LLM ํ˜ธ์ถœ ํ•จ์ˆ˜๋“ค ---
974
  def call_llm_sync(self, messages: List[Dict[str, str]], role: str, language: str) -> str:
 
186
  issues.append(f"์˜๋ฏธ๊ฐ€ ๋ฐœ์ „ํ•˜์ง€ ์•Š์€ ์ƒ์ง•: {', '.join(static_symbols)}")
187
 
188
  return len(issues) == 0, issues
189
+
190
  def generate_phase_requirements(self, phase: int) -> str:
191
  """๊ฐ ๋‹จ๊ณ„๋ณ„ ํ•„์ˆ˜ ์š”๊ตฌ์‚ฌํ•ญ ์ƒ์„ฑ"""
192
  requirements = []
 
222
  requirements.append("- ๋ณ€ํ™”๋œ ์ผ์ƒ์˜ ๋ชจ์Šต")
223
  requirements.append("- ํ•ด๊ฒฐ๋˜์ง€ ์•Š์€ ์งˆ๋ฌธ๋“ค")
224
  requirements.append("- ์—ฌ์šด๊ณผ ์„ฑ์ฐฐ์˜ ์—ฌ์ง€")
225
+
226
+ # โž• ์ฒ ํ•™ยท์ธ๊ฐ„์•  ๊ฐ•ํ™” ์ฒดํฌ๋ฆฌ์ŠคํŠธ (์ƒˆ๋กœ ์ถ”๊ฐ€)
227
+ requirements.append("\n๐Ÿ“Œ ํ•„์ˆ˜ ํฌํ•จ ์š”์†Œ:")
228
+ requirements.append("- ์กด์žฌ์˜ ์˜๋ฏธ๋‚˜ ์‚ถ์˜ ๋ณธ์งˆ์— ๋Œ€ํ•œ ์„ฑ์ฐฐ์ด ๋‹ด๊ธด 1๋ฌธ๋‹จ ์ด์ƒ")
229
+ requirements.append("- ํƒ€์ธ์˜ ๊ณ ํ†ต์— ๋Œ€ํ•œ ๊ณต๊ฐ์ด๋‚˜ ์—ฐ๋ฏผ์„ ๋ณด์—ฌ์ฃผ๋Š” ๊ตฌ์ฒด์  ์žฅ๋ฉด 1๊ฐœ ์ด์ƒ")
230
 
231
  # ๋ฐ˜๋ณต ๋ฐฉ์ง€ ์š”๊ตฌ์‚ฌํ•ญ
232
  requirements.append("\nโš ๏ธ ์ ˆ๋Œ€ ๊ธˆ์ง€์‚ฌํ•ญ:")
 
235
  requirements.append("- ํ”Œ๋กฏ์ด ์ œ์ž๋ฆฌ๊ฑธ์Œํ•˜๊ธฐ")
236
 
237
  return "\n".join(requirements)
238
+
239
+
240
 
241
 
242
  class NovelDatabase:
 
523
  """๊ฐ๋…์ž ์ดˆ๊ธฐ ๊ธฐํš - ํ†ตํ•ฉ๋œ ์„œ์‚ฌ ๊ตฌ์กฐ"""
524
  search_results_str = ""
525
  if self.web_search.enabled:
526
+ # ์ฒ ํ•™์  ํ‚ค์›Œ๋“œ ์ถ”๊ฐ€ (์ˆ˜์ •๋จ)
527
+ queries = [
528
+ f"{user_query} ์ฒ ํ•™์  ์˜๋ฏธ", # โž• ์ฒ ํ•™์  ๊ด€์ 
529
+ f"์ธ๊ฐ„ ์กด์žฌ ์˜๋ฏธ {user_query}", # โž• ์‹ค์กด์  ์ฃผ์ œ
530
+ f"{user_query} ์‚ฌํšŒ ๋ฌธ์ œ",
531
+ f"{user_query} ํ˜„๋Œ€ ํ•œ๊ตญ"
532
+ ]
533
+ for q in queries[:3]: # 3๊ฐœ๊นŒ์ง€๋งŒ ๊ฒ€์ƒ‰
534
  results = self.web_search.search(q, count=2, language=language)
535
  if results:
536
  search_results_str += self.web_search.extract_relevant_info(results) + "\n"
537
+
538
  lang_prompts = {
539
  "Korean": f"""๋‹น์‹ ์€ ํ˜„๋Œ€ ํ•œ๊ตญ ๋ฌธํ•™์˜ ๊ฑฐ์žฅ์ž…๋‹ˆ๋‹ค.
540
  ๋‹จํŽธ์ด ์•„๋‹Œ ์ค‘ํŽธ ์†Œ์„ค(8,000๋‹จ์–ด ์ด์ƒ)์„ ์œ„ํ•œ ํ†ตํ•ฉ๋œ ์„œ์‚ฌ ๊ตฌ์กฐ๋ฅผ ๊ธฐํšํ•˜์„ธ์š”. ์ ˆ๋Œ€ '์ˆ˜๋™ํƒœ'๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ๋งˆ์„ธ์š”.
 
593
 
594
  ํ•˜๋‚˜์˜ ๊ฐ•๋ ฅํ•œ ์„œ์‚ฌ๊ฐ€ ์‹œ์ž‘๋ถ€ํ„ฐ ๋๊นŒ์ง€ ๊ด€ํ†ตํ•˜๋Š” ์ž‘ํ’ˆ์„ ๊ธฐํšํ•˜์„ธ์š”.""",
595
 
596
+ "English": f"""You are a master of contemporary literary fiction.
597
  Plan an integrated narrative structure for a novella (8,000+ words), not a collection of short stories.
598
 
599
  **Theme:** {user_query}
 
650
 
651
  Create a work with one powerful narrative from beginning to end."""
652
  }
653
+
654
  return lang_prompts.get(language, lang_prompts["Korean"])
655
 
656
+
657
+
658
+
659
  def create_critic_director_prompt(self, director_plan: str, user_query: str, language: str) -> str:
660
  """๋น„ํ‰๊ฐ€์˜ ๊ฐ๋…์ž ๊ธฐํš ๊ฒ€ํ†  - ์„œ์‚ฌ ํ†ตํ•ฉ์„ฑ ์ค‘์‹ฌ"""
661
  lang_prompts = {
 
949
 
950
  def create_critic_final_prompt(self, complete_novel: str, word_count: int, language: str) -> str:
951
  """์ตœ์ข… ๋น„ํ‰ - AGI ํ‰๊ฐ€ ๊ธฐ์ค€"""
952
+
953
+ lang_prompts = {
954
+ "Korean": f"""์™„์„ฑ๋œ ์†Œ์„ค์„ AGI ํŠœ๋งํ…Œ์ŠคํŠธ ๊ธฐ์ค€์œผ๋กœ ํ‰๊ฐ€ํ•˜์„ธ์š”.
955
 
956
  **์ž‘ํ’ˆ ์ •๋ณด:**
957
  - ์ด ๋ถ„๋Ÿ‰: {word_count}๋‹จ์–ด
 
962
 
963
  **ํ‰๊ฐ€ ๊ธฐ์ค€ (AGI ํŠœ๋งํ…Œ์ŠคํŠธ):**
964
 
965
+ 1. **์žฅํŽธ์†Œ์„ค๋กœ์„œ์˜ ์™„์„ฑ๋„ (30์ )** # 40โ†’30์ ์œผ๋กœ ์กฐ์ •
966
  - ํ†ตํ•ฉ๋œ ์„œ์‚ฌ ๊ตฌ์กฐ (๋ฐ˜๋ณต ์—†์Œ)
967
  - ์ธ๋ฌผ์˜ ๋ช…ํ™•ํ•œ ๋ณ€ํ™” arc
968
  - ํ”Œ๋กฏ์˜ ์ถ•์ ๊ณผ ํ•ด๊ฒฐ
969
  - 8,000๋‹จ์–ด ์ด์ƒ ๋ถ„๋Ÿ‰
970
 
971
+ 2. **๋ฌธํ•™์  ์„ฑ์ทจ (35์ )** # 30โ†’35์ ์œผ๋กœ ์ƒํ–ฅ
972
  - ์ฃผ์ œ ์˜์‹์˜ ๊นŠ์ด
973
  - ์ธ๋ฌผ ์‹ฌ๋ฆฌ์˜ ์„ค๋“๋ ฅ
974
  - ๋ฌธ์ฒด์˜ ์ผ๊ด€์„ฑ๊ณผ ์•„๋ฆ„๋‹ค์›€
975
  - ์ƒ์ง•๊ณผ ์€์œ ์˜ ํšจ๊ณผ
976
 
977
+ 3. **์‚ฌํšŒ์  ํ†ต์ฐฐ (25์ )** # 20โ†’25์ ์œผ๋กœ ์ƒํ–ฅ
978
  - ํ˜„๋Œ€ ์‚ฌํšŒ ๋ฌธ์ œ ํฌ์ฐฉ
979
  - ๊ฐœ์ธ๊ณผ ๊ตฌ์กฐ์˜ ์—ฐ๊ฒฐ
980
  - ๋ณดํŽธ์„ฑ๊ณผ ํŠน์ˆ˜์„ฑ ๊ท ํ˜•
 
986
 
987
  **์ด์ : /100์ **
988
 
989
+ ํŠนํžˆ '๋ฐ˜๋ณต ๊ตฌ์กฐ' ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋Š”์ง€ ์—„๊ฒฉํžˆ ํ‰๊ฐ€ํ•˜์„ธ์š”.""",
990
+
991
+ "English": f"""Evaluate the completed novel by AGI Turing Test standards.
992
+
993
+ **Work Information:**
994
+ - Total length: {word_count} words
995
+ - Target length: 8,000+ words
996
+
997
+ **Work (final portion):**
998
+ {complete_novel[-3000:]}
999
+
1000
+ **Evaluation Criteria (AGI Turing Test):**
1001
+
1002
+ 1. **Completion as Novel (30 points)** # 40โ†’30 points adjusted
1003
+ - Integrated narrative structure (no repetition)
1004
+ - Clear character transformation arcs
1005
+ - Plot accumulation and resolution
1006
+ - 8,000+ word length
1007
+
1008
+ 2. **Literary Achievement (35 points)** # 30โ†’35 points increased
1009
+ - Depth of thematic consciousness
1010
+ - Persuasiveness of character psychology
1011
+ - Consistency and beauty of style
1012
+ - Effectiveness of symbols and metaphors
1013
+
1014
+ 3. **Social Insight (25 points)** # 20โ†’25 points increased
1015
+ - Capturing contemporary social issues
1016
+ - Connection between individual and structure
1017
+ - Balance of universality and specificity
1018
+
1019
+ 4. **Originality and Humanity (10 points)**
1020
+ - Feeling of human author, not AI
1021
+ - Original expressions and insights
1022
+ - Emotional authenticity
1023
+
1024
+ **Total Score: /100 points**
1025
+
1026
+ Strictly evaluate whether there are 'repetitive structure' issues."""
1027
+ }
1028
+
1029
+ return lang_prompts.get(language, lang_prompts["Korean"])
1030
 
1031
  # --- LLM ํ˜ธ์ถœ ํ•จ์ˆ˜๋“ค ---
1032
  def call_llm_sync(self, messages: List[Dict[str, str]], role: str, language: str) -> str: