openfree commited on
Commit
278cd2c
ยท
verified ยท
1 Parent(s): 2586db7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1316,7 +1316,7 @@ All detected repetitions must be removed."""
1316
  return lang_prompts.get(language, lang_prompts["Korean"])
1317
 
1318
 
1319
- def create_writer_revision_prompt(self, writer_number: int, initial_content: str,
1320
  critic_feedback: str, language: str) -> str:
1321
  """์ž‘๊ฐ€ ์ˆ˜์ • ํ”„๋กฌํ”„ํŠธ"""
1322
  target_words = MIN_WORDS_PER_WRITER
@@ -1347,7 +1347,7 @@ All detected repetitions must be removed."""
1347
  ์ „๋ฉด ์žฌ์ž‘์„ฑ์ด ํ•„์š”ํ•˜๋ฉด ๊ณผ๊ฐํžˆ ์ˆ˜์ •ํ•˜์„ธ์š”.
1348
  ์ˆ˜์ •๋ณธ๋งŒ ์ œ์‹œํ•˜์„ธ์š”."""
1349
 
1350
- def create_editor_prompt(self, complete_novel: str, issues: List[str], language: str) -> str:
1351
  """ํŽธ์ง‘์ž ํ”„๋กฌํ”„ํŠธ - ๋ฐ˜๋ณต ์ œ๊ฑฐ ์ „๋ฌธ"""
1352
 
1353
  lang_prompts = {
@@ -1438,7 +1438,7 @@ Briefly summarize major changes."""
1438
 
1439
  return lang_prompts.get(language, lang_prompts["Korean"])
1440
 
1441
- def create_critic_final_prompt(self, complete_novel: str, word_count: int, language: str) -> str:
1442
  """์ตœ์ข… ๋น„ํ‰ - AGI ํ‰๊ฐ€ ๊ธฐ์ค€"""
1443
 
1444
  lang_prompts = {
@@ -1544,7 +1544,7 @@ Carefully review for any remaining repetitions after editing."""
1544
  return lang_prompts.get(language, lang_prompts["Korean"])
1545
 
1546
  # --- LLM ํ˜ธ์ถœ ํ•จ์ˆ˜๋“ค ---
1547
- def call_llm_sync(self, messages: List[Dict[str, str]], role: str, language: str) -> str:
1548
  full_content = ""
1549
  for chunk in self.call_llm_streaming(messages, role, language):
1550
  full_content += chunk
@@ -1552,7 +1552,7 @@ Carefully review for any remaining repetitions after editing."""
1552
  raise Exception(f"LLM Call Failed: {full_content}")
1553
  return full_content
1554
 
1555
- def call_llm_streaming(self, messages: List[Dict[str, str]], role: str, language: str) -> Generator[str, None, None]:
1556
  try:
1557
  system_prompts = self.get_system_prompts(language)
1558
  full_messages = [{"role": "system", "content": system_prompts.get(role, "")}, *messages]
 
1316
  return lang_prompts.get(language, lang_prompts["Korean"])
1317
 
1318
 
1319
+ def create_writer_revision_prompt(self, writer_number: int, initial_content: str,
1320
  critic_feedback: str, language: str) -> str:
1321
  """์ž‘๊ฐ€ ์ˆ˜์ • ํ”„๋กฌํ”„ํŠธ"""
1322
  target_words = MIN_WORDS_PER_WRITER
 
1347
  ์ „๋ฉด ์žฌ์ž‘์„ฑ์ด ํ•„์š”ํ•˜๋ฉด ๊ณผ๊ฐํžˆ ์ˆ˜์ •ํ•˜์„ธ์š”.
1348
  ์ˆ˜์ •๋ณธ๋งŒ ์ œ์‹œํ•˜์„ธ์š”."""
1349
 
1350
+ def create_editor_prompt(self, complete_novel: str, issues: List[str], language: str) -> str:
1351
  """ํŽธ์ง‘์ž ํ”„๋กฌํ”„ํŠธ - ๋ฐ˜๋ณต ์ œ๊ฑฐ ์ „๋ฌธ"""
1352
 
1353
  lang_prompts = {
 
1438
 
1439
  return lang_prompts.get(language, lang_prompts["Korean"])
1440
 
1441
+ def create_critic_final_prompt(self, complete_novel: str, word_count: int, language: str) -> str:
1442
  """์ตœ์ข… ๋น„ํ‰ - AGI ํ‰๊ฐ€ ๊ธฐ์ค€"""
1443
 
1444
  lang_prompts = {
 
1544
  return lang_prompts.get(language, lang_prompts["Korean"])
1545
 
1546
  # --- LLM ํ˜ธ์ถœ ํ•จ์ˆ˜๋“ค ---
1547
+ def call_llm_sync(self, messages: List[Dict[str, str]], role: str, language: str) -> str:
1548
  full_content = ""
1549
  for chunk in self.call_llm_streaming(messages, role, language):
1550
  full_content += chunk
 
1552
  raise Exception(f"LLM Call Failed: {full_content}")
1553
  return full_content
1554
 
1555
+ def call_llm_streaming(self, messages: List[Dict[str, str]], role: str, language: str) -> Generator[str, None, None]:
1556
  try:
1557
  system_prompts = self.get_system_prompts(language)
1558
  full_messages = [{"role": "system", "content": system_prompts.get(role, "")}, *messages]