Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -485,9 +485,6 @@ class ScreenplayGenerationSystem:
|
|
485 |
"Authorization": f"Bearer {self.api_key}"
|
486 |
}
|
487 |
|
488 |
-
def get_session_data(self, session_id: str) -> Optional[Dict]:
|
489 |
-
"""세션 데이터 조회 - 인스턴스 메서드"""
|
490 |
-
return ScreenplayDatabase.get_session_data(session_id)
|
491 |
|
492 |
|
493 |
def call_llm_streaming(self, messages: List[Dict[str, str]], max_tokens: int = 8000) -> Generator[str, None, None]:
|
@@ -967,18 +964,22 @@ class ScreenplayGenerationSystem:
|
|
967 |
|
968 |
return '\n'.join(cleaned)
|
969 |
|
|
|
|
|
970 |
@staticmethod
|
971 |
def get_session_data(session_id: str) -> Optional[Dict]:
|
972 |
"""세션 데이터 조회"""
|
973 |
with ScreenplayDatabase.get_db() as conn:
|
974 |
-
|
|
|
975 |
'SELECT * FROM screenplay_sessions WHERE session_id = ?',
|
976 |
(session_id,)
|
977 |
).fetchone()
|
978 |
if row:
|
979 |
-
|
|
|
980 |
return None
|
981 |
-
|
982 |
def _create_act_prompt(self, role: str, act_name: str, current_content: str,
|
983 |
planning_data: Dict, previous_acts: Dict, stage_type: str) -> str:
|
984 |
"""막 작성 프롬프트 생성 - 개선된 버전"""
|
@@ -1471,11 +1472,10 @@ def create_interface():
|
|
1471 |
for line in lines:
|
1472 |
stripped = line.strip()
|
1473 |
|
1474 |
-
# 빈 줄 유지
|
1475 |
if not stripped:
|
1476 |
result.append("")
|
1477 |
-
continue
|
1478 |
-
|
1479 |
# 씬 헤더 감지 및 포맷팅 (INT. 또는 EXT.로 시작)
|
1480 |
if stripped.startswith(('INT.', 'EXT.', 'INT ', 'EXT ')):
|
1481 |
scene_number += 1
|
|
|
485 |
"Authorization": f"Bearer {self.api_key}"
|
486 |
}
|
487 |
|
|
|
|
|
|
|
488 |
|
489 |
|
490 |
def call_llm_streaming(self, messages: List[Dict[str, str]], max_tokens: int = 8000) -> Generator[str, None, None]:
|
|
|
964 |
|
965 |
return '\n'.join(cleaned)
|
966 |
|
967 |
+
|
968 |
+
|
969 |
@staticmethod
|
970 |
def get_session_data(session_id: str) -> Optional[Dict]:
|
971 |
"""세션 데이터 조회"""
|
972 |
with ScreenplayDatabase.get_db() as conn:
|
973 |
+
cursor = conn.cursor()
|
974 |
+
row = cursor.execute(
|
975 |
'SELECT * FROM screenplay_sessions WHERE session_id = ?',
|
976 |
(session_id,)
|
977 |
).fetchone()
|
978 |
if row:
|
979 |
+
columns = [description[0] for description in cursor.description]
|
980 |
+
return dict(zip(columns, row))
|
981 |
return None
|
982 |
+
|
983 |
def _create_act_prompt(self, role: str, act_name: str, current_content: str,
|
984 |
planning_data: Dict, previous_acts: Dict, stage_type: str) -> str:
|
985 |
"""막 작성 프롬프트 생성 - 개선된 버전"""
|
|
|
1472 |
for line in lines:
|
1473 |
stripped = line.strip()
|
1474 |
|
|
|
1475 |
if not stripped:
|
1476 |
result.append("")
|
1477 |
+
continue
|
1478 |
+
|
1479 |
# 씬 헤더 감지 및 포맷팅 (INT. 또는 EXT.로 시작)
|
1480 |
if stripped.startswith(('INT.', 'EXT.', 'INT ', 'EXT ')):
|
1481 |
scene_number += 1
|