Spaces:
Sleeping
Sleeping
๐ญ ์ฑ๊ฒฉ ์กฐ์ ํ ๋์ ํน์ฑ ์ค๋ช ์ ๋ฐ์ดํธ ์์คํ ๊ตฌํ - format_personality_traits ํจ์ ์์ ๊ฐ์ ํ์ฌ ํ๋์ฝ๋ฉ ์ ๊ฑฐ, AI ๊ธฐ๋ฐ ๋์ ์ฑ๊ฒฉ ํน์ฑ ์ค๋ช ์์ฑ, ์ฑ๊ฒฉ ์์น ๋ณ๊ฒฝ ์ ํน์ฑ ์ค๋ช ์ค์๊ฐ ์ ๋ฐ์ดํธ, 127๊ฐ ๋ณ์์ ์์ ์ฐ๋
Browse files
app.py
CHANGED
|
@@ -701,6 +701,9 @@ def adjust_persona_traits(persona, warmth, competence, extraversion, humor_style
|
|
| 701 |
{change_analysis}{additional_changes}
|
| 702 |
"""
|
| 703 |
|
|
|
|
|
|
|
|
|
|
| 704 |
# ์กฐ์ ๋ ๋งค๋ ฅ์ ๊ฒฐํจ๊ณผ ๋ชจ์์ ํน์ฑ์ DataFrame์ผ๋ก ์์ฑ
|
| 705 |
flaws_df = []
|
| 706 |
if "๋งค๋ ฅ์ ๊ฒฐํจ" in adjusted_persona:
|
|
@@ -732,12 +735,12 @@ def adjust_persona_traits(persona, warmth, competence, extraversion, humor_style
|
|
| 732 |
contradiction_type = "๐ซ ๋ณตํฉ์ ๋งค๋ ฅ"
|
| 733 |
contradictions_df.append([f"{i}. {contradiction}", contradiction_type])
|
| 734 |
|
| 735 |
-
return adjusted_persona, adjustment_message, adjusted_info, variables_df, flaws_df, contradictions_df
|
| 736 |
|
| 737 |
except Exception as e:
|
| 738 |
import traceback
|
| 739 |
traceback.print_exc()
|
| 740 |
-
return persona, f"์กฐ์ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}", {}, [], [], []
|
| 741 |
|
| 742 |
def finalize_persona(persona):
|
| 743 |
"""ํ๋ฅด์๋ ์ต์ข
ํ์ - ํ๊ฒฝ๋ณ์ API ์ค์ ์ฌ์ฉ"""
|
|
@@ -1252,84 +1255,147 @@ def import_persona_from_json(json_file):
|
|
| 1252 |
return None, f"โ JSON ๋ถ๋ฌ์ค๊ธฐ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}", "", {}
|
| 1253 |
|
| 1254 |
def format_personality_traits(persona):
|
| 1255 |
-
"""
|
| 1256 |
global persona_generator
|
| 1257 |
|
| 1258 |
if not persona or "์ฑ๊ฒฉํน์ฑ" not in persona:
|
| 1259 |
return "ํ๋ฅด์๋๊ฐ ์์ฑ๋์ง ์์์ต๋๋ค."
|
| 1260 |
|
| 1261 |
-
# ๊ธ๋ก๋ฒ persona_generator ์ฌ์ฉ (API ์ค์ ์ด ์ ์ฉ๋ ์ํ)
|
| 1262 |
-
if persona_generator is None:
|
| 1263 |
-
persona_generator = PersonaGenerator()
|
| 1264 |
-
|
| 1265 |
# ๊ธฐ๋ณธ ์ ๋ณด์์ ์ฌ๋ฌผ์ ํน์ฑ ์ถ์ถ
|
| 1266 |
basic_info = persona.get("๊ธฐ๋ณธ์ ๋ณด", {})
|
| 1267 |
object_type = basic_info.get("์ ํ", "")
|
| 1268 |
purpose = basic_info.get("์ฉ๋", "")
|
| 1269 |
|
| 1270 |
-
# ์์ ์คํ ๋ฆฌ์์ ํน์ฑ ์ถ์ถ
|
| 1271 |
-
life_story = persona.get("์์ ์คํ ๋ฆฌ", {})
|
| 1272 |
-
|
| 1273 |
# ๋งค๋ ฅ์ ๊ฒฐํจ
|
| 1274 |
attractive_flaws = persona.get("๋งค๋ ฅ์ ๊ฒฐํจ", [])
|
| 1275 |
|
| 1276 |
-
# ์ฑ๊ฒฉ ํน์ฑ
|
| 1277 |
personality_traits = persona["์ฑ๊ฒฉํน์ฑ"]
|
| 1278 |
|
| 1279 |
-
# ํน์ฑ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1280 |
characteristics = []
|
| 1281 |
|
| 1282 |
-
# 1. ์จ๊ธฐ ํน์ฑ
|
| 1283 |
warmth = personality_traits.get("์จ๊ธฐ", 50)
|
| 1284 |
-
if warmth >=
|
| 1285 |
-
characteristics.append("๋ฐ๋ปํ๊ณ ํฌ๊ทผํ ๋ง์")
|
| 1286 |
-
elif warmth >=
|
| 1287 |
-
characteristics.append("
|
| 1288 |
-
|
|
|
|
|
|
|
| 1289 |
characteristics.append("์ฐจ๋ถํ๊ณ ์ง์คํ ๋ฉด")
|
|
|
|
|
|
|
| 1290 |
|
| 1291 |
-
# 2.
|
| 1292 |
-
|
| 1293 |
-
|
| 1294 |
-
|
| 1295 |
-
|
| 1296 |
-
|
| 1297 |
-
|
| 1298 |
-
|
| 1299 |
-
characteristics.append("์๊ฐ์ ์์คํจ์ ์๋ ค์ค")
|
| 1300 |
-
elif "์ฐํ" in object_type or "ํ" in object_type:
|
| 1301 |
-
characteristics.append("์ฐฝ์๊ณผ ๊ธฐ๋ก์ ๋๋ฐ์")
|
| 1302 |
else:
|
| 1303 |
-
characteristics.append(
|
| 1304 |
|
| 1305 |
-
# 3. ํ๋
|
| 1306 |
extraversion = personality_traits.get("์ธํฅ์ฑ", 50)
|
| 1307 |
-
if extraversion >=
|
| 1308 |
-
characteristics.append("
|
| 1309 |
-
elif extraversion
|
| 1310 |
-
characteristics.append("
|
| 1311 |
-
|
| 1312 |
characteristics.append("ํ๋ฃจ ์ข
์ผ ์ผ์ ํ ์๋์ง")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1313 |
|
| 1314 |
-
#
|
| 1315 |
if attractive_flaws:
|
| 1316 |
-
|
| 1317 |
-
if "
|
| 1318 |
-
characteristics.append("
|
| 1319 |
-
elif "
|
| 1320 |
-
characteristics.append("
|
| 1321 |
-
elif "์ผ๋ฃฉ" in flaw:
|
| 1322 |
-
characteristics.append("์์ ์ผ๋ฃฉ๋ ๋์ ๋์ด ๊ณ ๋ฏผ")
|
| 1323 |
-
elif "์" in flaw:
|
| 1324 |
-
characteristics.append("์์ด ๋ฐ๋๋ ๊ฒ์ ์กฐ๊ธ ๊ฑฑ์ ")
|
| 1325 |
else:
|
| 1326 |
-
characteristics.append("
|
| 1327 |
-
|
| 1328 |
-
# 5. ๊ธฐ์ต๊ณผ ๊ฒฝํ
|
| 1329 |
-
if life_story:
|
| 1330 |
-
characteristics.append("์ค๋๋ ์ด์ผ๊ธฐ๋ค ๊ธฐ์ต")
|
| 1331 |
else:
|
| 1332 |
-
characteristics.append("์๋ก์ด
|
| 1333 |
|
| 1334 |
# โจ ์์ด์ฝ๊ณผ ํจ๊ป ๋ฆฌ์คํธ ํํ๋ก ๋ฐํ
|
| 1335 |
result = ""
|
|
@@ -1828,7 +1894,7 @@ def create_main_interface():
|
|
| 1828 |
adjust_btn.click(
|
| 1829 |
fn=adjust_persona_traits,
|
| 1830 |
inputs=[current_persona, warmth_slider, competence_slider, extraversion_slider, humor_style_radio],
|
| 1831 |
-
outputs=[current_persona, adjustment_result, adjusted_info_output, personality_variables_output, attractive_flaws_output, contradictions_output]
|
| 1832 |
).then(
|
| 1833 |
# ๋ฐ์ ํ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ ์
๋ฐ์ดํธ
|
| 1834 |
fn=generate_realtime_preview,
|
|
|
|
| 701 |
{change_analysis}{additional_changes}
|
| 702 |
"""
|
| 703 |
|
| 704 |
+
# ๐ ์กฐ์ ๋ ํ๋ฅด์๋์ ์์ฝ ์์ฑ (๋์ ํน์ฑ ์ค๋ช
ํฌํจ)
|
| 705 |
+
adjusted_summary_display = display_persona_summary(adjusted_persona)
|
| 706 |
+
|
| 707 |
# ์กฐ์ ๋ ๋งค๋ ฅ์ ๊ฒฐํจ๊ณผ ๋ชจ์์ ํน์ฑ์ DataFrame์ผ๋ก ์์ฑ
|
| 708 |
flaws_df = []
|
| 709 |
if "๋งค๋ ฅ์ ๊ฒฐํจ" in adjusted_persona:
|
|
|
|
| 735 |
contradiction_type = "๐ซ ๋ณตํฉ์ ๋งค๋ ฅ"
|
| 736 |
contradictions_df.append([f"{i}. {contradiction}", contradiction_type])
|
| 737 |
|
| 738 |
+
return adjusted_persona, adjustment_message, adjusted_info, variables_df, flaws_df, contradictions_df, adjusted_summary_display
|
| 739 |
|
| 740 |
except Exception as e:
|
| 741 |
import traceback
|
| 742 |
traceback.print_exc()
|
| 743 |
+
return persona, f"์กฐ์ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}", {}, [], [], [], ""
|
| 744 |
|
| 745 |
def finalize_persona(persona):
|
| 746 |
"""ํ๋ฅด์๋ ์ต์ข
ํ์ - ํ๊ฒฝ๋ณ์ API ์ค์ ์ฌ์ฉ"""
|
|
|
|
| 1255 |
return None, f"โ JSON ๋ถ๋ฌ์ค๊ธฐ ์ค ์ค๋ฅ ๋ฐ์: {str(e)}", "", {}
|
| 1256 |
|
| 1257 |
def format_personality_traits(persona):
|
| 1258 |
+
"""๐ง ์์ ํ ๋ณ์ ๊ธฐ๋ฐ ๋์ ์ฑ๊ฒฉ ํน์ฑ ์ค๋ช
์์ฑ - ํ๋์ฝ๋ฉ ์ ๊ฑฐ"""
|
| 1259 |
global persona_generator
|
| 1260 |
|
| 1261 |
if not persona or "์ฑ๊ฒฉํน์ฑ" not in persona:
|
| 1262 |
return "ํ๋ฅด์๋๊ฐ ์์ฑ๋์ง ์์์ต๋๋ค."
|
| 1263 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1264 |
# ๊ธฐ๋ณธ ์ ๋ณด์์ ์ฌ๋ฌผ์ ํน์ฑ ์ถ์ถ
|
| 1265 |
basic_info = persona.get("๊ธฐ๋ณธ์ ๋ณด", {})
|
| 1266 |
object_type = basic_info.get("์ ํ", "")
|
| 1267 |
purpose = basic_info.get("์ฉ๋", "")
|
| 1268 |
|
|
|
|
|
|
|
|
|
|
| 1269 |
# ๋งค๋ ฅ์ ๊ฒฐํจ
|
| 1270 |
attractive_flaws = persona.get("๋งค๋ ฅ์ ๊ฒฐํจ", [])
|
| 1271 |
|
| 1272 |
+
# ์ฑ๊ฒฉ ํน์ฑ (์กฐ์ ๋ ๊ฐ๋ค)
|
| 1273 |
personality_traits = persona["์ฑ๊ฒฉํน์ฑ"]
|
| 1274 |
|
| 1275 |
+
# ๐ค AI ๊ธฐ๋ฐ ๋์ ํน์ฑ ์ค๋ช
์์ฑ ์๋
|
| 1276 |
+
if persona_generator and hasattr(persona_generator, 'api_key') and persona_generator.api_key:
|
| 1277 |
+
try:
|
| 1278 |
+
warmth = personality_traits.get("์จ๊ธฐ", 50)
|
| 1279 |
+
competence = personality_traits.get("๋ฅ๋ ฅ", 50)
|
| 1280 |
+
extraversion = personality_traits.get("์ธํฅ์ฑ", 50)
|
| 1281 |
+
humor_style = persona.get("์ ๋จธ์คํ์ผ", "๋ฐ๋ปํ ์ ๋จธ๋ฌ์ค")
|
| 1282 |
+
|
| 1283 |
+
ai_prompt = f"""
|
| 1284 |
+
๋ค์ ์ ๋ณด๋ฅผ ๋ฐํ์ผ๋ก ์ด ํ๋ฅด์๋์ 5๊ฐ์ง ํต์ฌ ํน์ฑ์ ๊ฐ๊ฒฐํ๊ฒ ์ค๋ช
ํด์ฃผ์ธ์.
|
| 1285 |
+
|
| 1286 |
+
**์ฌ๋ฌผ ์ ๋ณด:**
|
| 1287 |
+
- ์ ํ: {object_type}
|
| 1288 |
+
- ์ฉ๋: {purpose}
|
| 1289 |
+
|
| 1290 |
+
**์กฐ์ ๋ ์ฑ๊ฒฉ ์์น:**
|
| 1291 |
+
- ์จ๊ธฐ: {warmth}/100 {'(๋งค์ฐ ๋ฐ๋ปํจ)' if warmth >= 80 else '(๋ฐ๋ปํจ)' if warmth >= 60 else '(๋ณดํต)' if warmth >= 40 else '(์ฐจ๊ฐ์)' if warmth >= 20 else '(๋งค์ฐ ์ฐจ๊ฐ์)'}
|
| 1292 |
+
- ๋ฅ๋ ฅ: {competence}/100 {'(๋งค์ฐ ์ ๋ฅํจ)' if competence >= 80 else '(์ ๋ฅํจ)' if competence >= 60 else '(๋ณดํต)' if competence >= 40 else '(์ํผ)' if competence >= 20 else '(๋งค์ฐ ์ํผ)'}
|
| 1293 |
+
- ์ธํฅ์ฑ: {extraversion}/100 {'(๋งค์ฐ ํ๋ฐํจ)' if extraversion >= 80 else '(ํ๋ฐํจ)' if extraversion >= 60 else '(๋ณดํต)' if extraversion >= 40 else '(์กฐ์ฉํจ)' if extraversion >= 20 else '(๋งค์ฐ ์กฐ์ฉํจ)'}
|
| 1294 |
+
- ์ ๋จธ์คํ์ผ: {humor_style}
|
| 1295 |
+
|
| 1296 |
+
**๋งค๋ ฅ์ ๊ฒฐํจ:**
|
| 1297 |
+
{chr(10).join([f"- {flaw}" for flaw in attractive_flaws[:2]])}
|
| 1298 |
+
|
| 1299 |
+
**์์ฒญ์ฌํญ:**
|
| 1300 |
+
1. ์ฑ๊ฒฉ ์์น๋ฅผ ์ ํํ ๋ฐ์ํ ํน์ฑ ์ค๋ช
|
| 1301 |
+
2. ์ฌ๋ฌผ์ ๊ณ ์ ํน์ฑ๊ณผ ์ฑ๊ฒฉ์ ์กฐํฉ
|
| 1302 |
+
3. ๊ฐ ํน์ฑ์ 5-15์๋ก ๊ฐ๊ฒฐํ๊ฒ
|
| 1303 |
+
4. ๋งค๋ ฅ์ ์ด๊ณ ๊ฐ์ฑ์ ์ธ ํํ
|
| 1304 |
+
|
| 1305 |
+
**ํ์:**
|
| 1306 |
+
[์ฑ๊ฒฉ ๊ธฐ๋ฐ ํน์ฑ 1]
|
| 1307 |
+
[์ฌ๋ฌผ ๊ธฐ๋ฐ ํน์ฑ 1]
|
| 1308 |
+
[ํ๋/์๋์ง ํน์ฑ 1]
|
| 1309 |
+
[๊ฒฐํจ ๊ธฐ๋ฐ ํน์ฑ 1]
|
| 1310 |
+
[๊ฒฝํ/๊ธฐ์ต ํน์ฑ 1]
|
| 1311 |
+
"""
|
| 1312 |
+
|
| 1313 |
+
ai_response = persona_generator._generate_text_with_api(ai_prompt)
|
| 1314 |
+
|
| 1315 |
+
if ai_response and len(ai_response.strip()) > 20:
|
| 1316 |
+
lines = ai_response.strip().split('\n')
|
| 1317 |
+
ai_characteristics = []
|
| 1318 |
+
|
| 1319 |
+
for line in lines:
|
| 1320 |
+
clean_line = line.strip().lstrip('1234567890.-โข []').strip()
|
| 1321 |
+
if clean_line and len(clean_line) > 3:
|
| 1322 |
+
ai_characteristics.append(clean_line)
|
| 1323 |
+
|
| 1324 |
+
if len(ai_characteristics) >= 3:
|
| 1325 |
+
result = ""
|
| 1326 |
+
for char in ai_characteristics[:5]: # ์ต๋ 5๊ฐ
|
| 1327 |
+
result += f"โจ {char}\n\n"
|
| 1328 |
+
return result
|
| 1329 |
+
|
| 1330 |
+
except Exception as e:
|
| 1331 |
+
print(f"โ ๏ธ AI ํน์ฑ ์ค๋ช
์์ฑ ์คํจ: {e} - ๋ณ์ ๊ธฐ๋ฐ ํด๋ฐฑ ์ฌ์ฉ")
|
| 1332 |
+
|
| 1333 |
+
# ๐ง ํด๋ฐฑ: ์์ ๋ณ์ ๊ธฐ๋ฐ ๋
ผ๋ฆฌ์ ์์ฑ
|
| 1334 |
characteristics = []
|
| 1335 |
|
| 1336 |
+
# 1. ์จ๊ธฐ ๊ธฐ๋ฐ ํน์ฑ (์์น ๋ฐ์)
|
| 1337 |
warmth = personality_traits.get("์จ๊ธฐ", 50)
|
| 1338 |
+
if warmth >= 80:
|
| 1339 |
+
characteristics.append("๋งค์ฐ ๋ฐ๋ปํ๊ณ ํฌ๊ทผํ ๋ง์")
|
| 1340 |
+
elif warmth >= 65:
|
| 1341 |
+
characteristics.append("๋ฐ๋ปํ๊ณ ์น๊ทผํ ์ฑ๊ฒฉ")
|
| 1342 |
+
elif warmth >= 35:
|
| 1343 |
+
characteristics.append("์ ๋นํ ์น๊ทผํ ๊ท ํ๊ฐ")
|
| 1344 |
+
elif warmth >= 20:
|
| 1345 |
characteristics.append("์ฐจ๋ถํ๊ณ ์ง์คํ ๋ฉด")
|
| 1346 |
+
else:
|
| 1347 |
+
characteristics.append("์ ์คํ๊ณ ๋ด์ฑ์ ์ธ ๊น์ด")
|
| 1348 |
|
| 1349 |
+
# 2. ๋ฅ๋ ฅ ๊ธฐ๋ฐ ํน์ฑ (์์น ๋ฐ์)
|
| 1350 |
+
competence = personality_traits.get("๋ฅ๋ ฅ", 50)
|
| 1351 |
+
if competence >= 80:
|
| 1352 |
+
characteristics.append("์๋ฒฝ์ฃผ์์ ๊ผผ๊ผผํจ")
|
| 1353 |
+
elif competence >= 65:
|
| 1354 |
+
characteristics.append("๋ฏฟ์์งํ ์์ ๊ฐ")
|
| 1355 |
+
elif competence >= 35:
|
| 1356 |
+
characteristics.append("์ ๋นํ ์ฌ์ ๋ก์")
|
|
|
|
|
|
|
|
|
|
| 1357 |
else:
|
| 1358 |
+
characteristics.append("๊ฒธ์ํ๊ณ ๋ฐฐ์ฐ๋ ค๋ ๋ง์")
|
| 1359 |
|
| 1360 |
+
# 3. ์ธํฅ์ฑ ๊ธฐ๋ฐ ํ๋ ํน์ฑ (์์น ๋ฐ์)
|
| 1361 |
extraversion = personality_traits.get("์ธํฅ์ฑ", 50)
|
| 1362 |
+
if extraversion >= 80:
|
| 1363 |
+
characteristics.append("ํ๊ธฐ์ฐจ๊ณ ์๋์ง ๋์น๋ ๋ชจ์ต")
|
| 1364 |
+
elif extraversion >= 65:
|
| 1365 |
+
characteristics.append("๋ฎ์ ๋ ํ๋ฐํด์ง๋ ๋ฆฌ๋ฌ")
|
| 1366 |
+
elif extraversion >= 35:
|
| 1367 |
characteristics.append("ํ๋ฃจ ์ข
์ผ ์ผ์ ํ ์๋์ง")
|
| 1368 |
+
else:
|
| 1369 |
+
characteristics.append("์กฐ์ฉํ๊ณ ์ฐจ๋ถํ ์๊ฐ ์ ํธ")
|
| 1370 |
+
|
| 1371 |
+
# 4. ์ฌ๋ฌผ ๊ณ ์ ํน์ฑ (๋์ ์์ฑ)
|
| 1372 |
+
if object_type:
|
| 1373 |
+
if any(keyword in object_type.lower() for keyword in ["์ปต", "๋จธ๊ทธ", "์"]):
|
| 1374 |
+
characteristics.append("๋ฐ๋ปํ ์๋ฃ์ ํจ๊ปํ๋ ์๋ก")
|
| 1375 |
+
elif any(keyword in object_type.lower() for keyword in ["์ฑ
", "๋
ธํธ"]):
|
| 1376 |
+
characteristics.append("์ง์๊ณผ ์ด์ผ๊ธฐ๋ฅผ ํ์ ๊น์ด")
|
| 1377 |
+
elif any(keyword in object_type.lower() for keyword in ["์๊ณ", "์๋"]):
|
| 1378 |
+
characteristics.append("์๊ฐ์ ์์คํจ์ ์๋ ์ ํ์ฑ")
|
| 1379 |
+
elif any(keyword in object_type.lower() for keyword in ["๋จํ", "์กฐ๋ช
", "๋ฑ"]):
|
| 1380 |
+
characteristics.append("๋ฐ๋ปํ ๋น์ผ๋ก ๊ณต๊ฐ์ ๋ฐํ๋ ์ญํ ")
|
| 1381 |
+
elif any(keyword in object_type.lower() for keyword in ["์ธํ", "๊ณฐ", "์ฅ๋๊ฐ"]):
|
| 1382 |
+
characteristics.append("๋ถ๋๋ฌ์ด ์๋ก์ ๋ฐ๋ปํ ํฌ์น")
|
| 1383 |
+
else:
|
| 1384 |
+
characteristics.append(f"{object_type}๋ง์ ๋
ํนํ ๊ฐ์ฑ")
|
| 1385 |
+
else:
|
| 1386 |
+
characteristics.append("์ ์ ์๋ ์ ๋น๋ก์ด ๋งค๋ ฅ")
|
| 1387 |
|
| 1388 |
+
# 5. ๊ฒฐํจ/๊ฒฝํ ๊ธฐ๋ฐ ํน์ฑ (๋์ ๋ฐ์)
|
| 1389 |
if attractive_flaws:
|
| 1390 |
+
first_flaw = attractive_flaws[0]
|
| 1391 |
+
if any(keyword in first_flaw for keyword in ["์๋ฒฝ", "๊ฑฑ์ ", "์ ๊ฒฝ"]):
|
| 1392 |
+
characteristics.append("์ธ์ฌํ ๊ด์ฌ๊ณผ ๋ฐฐ๋ คํ๋ ๋ง์")
|
| 1393 |
+
elif any(keyword in first_flaw for keyword in ["์", "๋ชจ์", "์ธ๋ชจ"]):
|
| 1394 |
+
characteristics.append("์์ ์ ๋ชจ์ต์ ๋ํ ์์ํ ๊ณ ๋ฏผ")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1395 |
else:
|
| 1396 |
+
characteristics.append("์๋ฒฝํ์ง ์์ ๋ชจ์ต๋ ์์งํ๊ฒ ๋ฐ์๋ค์")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1397 |
else:
|
| 1398 |
+
characteristics.append("์๋ก์ด ๊ฒฝํ์ ๋ํ ๊ธฐ๋์ ํธ๊ธฐ์ฌ")
|
| 1399 |
|
| 1400 |
# โจ ์์ด์ฝ๊ณผ ํจ๊ป ๋ฆฌ์คํธ ํํ๋ก ๋ฐํ
|
| 1401 |
result = ""
|
|
|
|
| 1894 |
adjust_btn.click(
|
| 1895 |
fn=adjust_persona_traits,
|
| 1896 |
inputs=[current_persona, warmth_slider, competence_slider, extraversion_slider, humor_style_radio],
|
| 1897 |
+
outputs=[current_persona, adjustment_result, adjusted_info_output, personality_variables_output, attractive_flaws_output, contradictions_output, persona_summary_display]
|
| 1898 |
).then(
|
| 1899 |
# ๋ฐ์ ํ ๋ฏธ๋ฆฌ๋ณด๊ธฐ๋ ์
๋ฐ์ดํธ
|
| 1900 |
fn=generate_realtime_preview,
|