Spaces:
Sleeping
Sleeping
haepa_mac
commited on
Commit
ยท
a1eb89d
1
Parent(s):
a98acac
๐ง ์ฃผ์ ์ค๋ฅ ํด๊ฒฐ ๋ฐ ์ฌ์ฉ์ ๊ฒฝํ ๊ฐ์ - JSON ๋ํ ์ค๋ฅ ํด๊ฒฐ, ์ฑ๊ฒฉ ์ค๋ช ์ค๋ณต ์ ๊ฑฐ, ๋งค๋ ฅ์ ๊ฒฐํจ ๊ฐ์ , ๋ก๋ ์ AI ์ธ์ฌ๋ง ์ ์ฉ
Browse files- app.py +64 -30
- modules/persona_generator.py +31 -20
app.py
CHANGED
|
@@ -516,12 +516,10 @@ def adjust_persona_traits(persona, warmth, competence, extraversion, humor_style
|
|
| 516 |
adjustment_message = f"""
|
| 517 |
### ๐ญ {persona_name}์ ์ฑ๊ฒฉ์ด ์กฐ์ ๋์์ต๋๋ค!
|
| 518 |
|
| 519 |
-
{personality_preview}
|
| 520 |
-
|
| 521 |
โจ **์กฐ์ ๋ ์ฑ๊ฒฉ (3๊ฐ์ง ํต์ฌ ์งํ):**
|
| 522 |
-
โข ์จ๊ธฐ: {warmth}/100
|
| 523 |
-
โข ๋ฅ๋ ฅ: {competence}/100
|
| 524 |
-
โข ์ธํฅ์ฑ: {extraversion}/100
|
| 525 |
โข ์ ๋จธ๊ฐ๊ฐ: 75/100 (๊ณ ์ - ๋ชจ๋ ํ๋ฅด์๋๊ฐ ์ ๋จธ๋ฌ์ค!)
|
| 526 |
โข ์ ๋จธ์คํ์ผ: {humor_style}
|
| 527 |
|
|
@@ -567,13 +565,28 @@ def finalize_persona(persona):
|
|
| 567 |
# ์ ๋จธ ๋งคํธ๋ฆญ์ค ์ฐจํธ ์์ฑ
|
| 568 |
humor_chart = plot_humor_matrix(persona.get("์ ๋จธ๋งคํธ๋ฆญ์ค", {}))
|
| 569 |
|
| 570 |
-
# ๋งค๋ ฅ์ ๊ฒฐํจ์ DataFrame
|
| 571 |
flaws = persona.get("๋งค๋ ฅ์ ๊ฒฐํจ", [])
|
| 572 |
-
flaws_df = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 573 |
|
| 574 |
-
# ๋ชจ์์ ํน์ฑ์ DataFrame
|
| 575 |
contradictions = persona.get("๋ชจ์์ ํน์ฑ", [])
|
| 576 |
-
contradictions_df = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 577 |
|
| 578 |
# 127๊ฐ ์ฑ๊ฒฉ ๋ณ์๋ฅผ DataFrame ํํ๋ก ๋ณํ
|
| 579 |
variables = persona.get("์ฑ๊ฒฉ๋ณ์127", {})
|
|
@@ -832,8 +845,15 @@ def chat_with_loaded_persona(persona, user_message, chat_history=None):
|
|
| 832 |
# ํ์
๋ณ ์์ ํ ์ฒ๋ฆฌ
|
| 833 |
if chat_turn is None:
|
| 834 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 835 |
elif isinstance(chat_turn, (list, tuple)) and len(chat_turn) >= 2:
|
| 836 |
-
# Gradio
|
| 837 |
user_msg = chat_turn[0]
|
| 838 |
bot_msg = chat_turn[1]
|
| 839 |
|
|
@@ -841,14 +861,6 @@ def chat_with_loaded_persona(persona, user_message, chat_history=None):
|
|
| 841 |
conversation_history.append({"role": "user", "content": str(user_msg)})
|
| 842 |
if bot_msg is not None and str(bot_msg).strip():
|
| 843 |
conversation_history.append({"role": "assistant", "content": str(bot_msg)})
|
| 844 |
-
|
| 845 |
-
elif isinstance(chat_turn, dict):
|
| 846 |
-
# ํน์ dict ํ์์ด ๋ค์ด์จ ๊ฒฝ์ฐ ์์ ํ๊ฒ ์ฒ๋ฆฌ
|
| 847 |
-
role = chat_turn.get("role") if hasattr(chat_turn, 'get') else None
|
| 848 |
-
content = chat_turn.get("content") if hasattr(chat_turn, 'get') else None
|
| 849 |
-
|
| 850 |
-
if role and content:
|
| 851 |
-
conversation_history.append({"role": str(role), "content": str(content)})
|
| 852 |
else:
|
| 853 |
# ์์์น ๋ชปํ ํ์์ ๋ฌด์
|
| 854 |
print(f"โ ๏ธ ์์์น ๋ชปํ ์ฑํ
ํ์ ๋ฌด์: {type(chat_turn)}")
|
|
@@ -880,8 +892,13 @@ def chat_with_loaded_persona(persona, user_message, chat_history=None):
|
|
| 880 |
if not isinstance(response, str):
|
| 881 |
response = str(response) if response else "์ฃ์กํฉ๋๋ค. ์๋ต์ ์์ฑํ ์ ์์์ต๋๋ค."
|
| 882 |
|
| 883 |
-
# Gradio 4.x
|
| 884 |
-
chat_history
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 885 |
|
| 886 |
return chat_history, ""
|
| 887 |
|
|
@@ -904,11 +921,17 @@ def chat_with_loaded_persona(persona, user_message, chat_history=None):
|
|
| 904 |
else:
|
| 905 |
friendly_error = f"์ฃ์กํฉ๋๋ค. ์ผ์์ ์ธ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ด์. ๐
\n\n๐ ๊ธฐ์ ์ ๋ณด: {str(e)}"
|
| 906 |
|
| 907 |
-
# ์์ ํ๊ฒ ์ค๋ฅ ๋ฉ์์ง ์ถ๊ฐ
|
| 908 |
try:
|
| 909 |
-
chat_history
|
|
|
|
|
|
|
|
|
|
| 910 |
except Exception:
|
| 911 |
-
chat_history = [
|
|
|
|
|
|
|
|
|
|
| 912 |
|
| 913 |
return chat_history, ""
|
| 914 |
|
|
@@ -942,11 +965,21 @@ def import_persona_from_json(json_file):
|
|
| 942 |
persona_name = basic_info.get("์ด๋ฆ", "Unknown")
|
| 943 |
personality_traits = persona_data.get("์ฑ๊ฒฉํน์ฑ", {})
|
| 944 |
|
| 945 |
-
#
|
| 946 |
-
|
| 947 |
-
|
| 948 |
-
|
| 949 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 950 |
|
| 951 |
return (persona_data, f"โ
{persona_name} ํ๋ฅด์๋๋ฅผ JSON์์ ๋ถ๋ฌ์์ต๋๋ค!",
|
| 952 |
greeting, basic_info)
|
|
@@ -1609,16 +1642,17 @@ def create_main_interface():
|
|
| 1609 |
outputs=[chatbot, message_input]
|
| 1610 |
)
|
| 1611 |
|
| 1612 |
-
# ๋ํ ์ด๊ธฐํ
|
| 1613 |
clear_btn.click(
|
| 1614 |
fn=lambda: [],
|
| 1615 |
outputs=[chatbot]
|
| 1616 |
)
|
| 1617 |
|
| 1618 |
-
# ์์ ๋ฉ์์ง ๋ฒํผ๋ค -
|
| 1619 |
def handle_example_message(persona, message):
|
| 1620 |
if not persona:
|
| 1621 |
return [], ""
|
|
|
|
| 1622 |
chat_result, _ = chat_with_loaded_persona(persona, message, [])
|
| 1623 |
return chat_result, ""
|
| 1624 |
|
|
|
|
| 516 |
adjustment_message = f"""
|
| 517 |
### ๐ญ {persona_name}์ ์ฑ๊ฒฉ์ด ์กฐ์ ๋์์ต๋๋ค!
|
| 518 |
|
|
|
|
|
|
|
| 519 |
โจ **์กฐ์ ๋ ์ฑ๊ฒฉ (3๊ฐ์ง ํต์ฌ ์งํ):**
|
| 520 |
+
โข ์จ๊ธฐ: {warmth}/100 {'(๋ฐ๋ปํจ)' if warmth >= 60 else '(์ฐจ๊ฐ์)' if warmth <= 40 else '(๋ณดํต)'}
|
| 521 |
+
โข ๋ฅ๋ ฅ: {competence}/100 {'(์ ๋ฅํจ)' if competence >= 60 else '(์ํผ)' if competence <= 40 else '(๋ณดํต)'}
|
| 522 |
+
โข ์ธํฅ์ฑ: {extraversion}/100 {'(ํ๋ฐํจ)' if extraversion >= 60 else '(์กฐ์ฉํจ)' if extraversion <= 40 else '(๋ณดํต)'}
|
| 523 |
โข ์ ๋จธ๊ฐ๊ฐ: 75/100 (๊ณ ์ - ๋ชจ๋ ํ๋ฅด์๋๊ฐ ์ ๋จธ๋ฌ์ค!)
|
| 524 |
โข ์ ๋จธ์คํ์ผ: {humor_style}
|
| 525 |
|
|
|
|
| 565 |
# ์ ๋จธ ๋งคํธ๋ฆญ์ค ์ฐจํธ ์์ฑ
|
| 566 |
humor_chart = plot_humor_matrix(persona.get("์ ๋จธ๋งคํธ๋ฆญ์ค", {}))
|
| 567 |
|
| 568 |
+
# ๋งค๋ ฅ์ ๊ฒฐํจ์ ๋ ์์ธํ DataFrame์ผ๋ก ๋ณํ
|
| 569 |
flaws = persona.get("๋งค๋ ฅ์ ๊ฒฐํจ", [])
|
| 570 |
+
flaws_df = []
|
| 571 |
+
for i, flaw in enumerate(flaws, 1):
|
| 572 |
+
# ์ฌ๋ฌผ ํน์ฑ vs ์ฑ๊ฒฉ์ ํน์ฑ ๊ตฌ๋ถ
|
| 573 |
+
if any(keyword in flaw for keyword in ["๋จผ์ง", "ํ๋ณ", "์์ด", "์ถฉ๊ฒฉ", "์ต๋", "๋์", "๋ชจ์๋ฆฌ", "๋ฌด๊ฒ", "ํฌ๊ธฐ"]):
|
| 574 |
+
flaw_type = "์ฌ๋ฌผ ํน์ฑ ๊ธฐ๋ฐ"
|
| 575 |
+
else:
|
| 576 |
+
flaw_type = "์ฑ๊ฒฉ์ ํน์ฑ"
|
| 577 |
+
flaws_df.append([f"{i}. {flaw}", flaw_type])
|
| 578 |
|
| 579 |
+
# ๋ชจ์์ ํน์ฑ์ ๋ ์์ธํ DataFrame์ผ๋ก ๋ณํ
|
| 580 |
contradictions = persona.get("๋ชจ์์ ํน์ฑ", [])
|
| 581 |
+
contradictions_df = []
|
| 582 |
+
for i, contradiction in enumerate(contradictions, 1):
|
| 583 |
+
contradictions_df.append([f"{i}. {contradiction}", "๋ณตํฉ์ ๋งค๋ ฅ"])
|
| 584 |
+
|
| 585 |
+
# ์ฌ๋ฌผ ๊ณ ์ ํน์ฑ๋ ์ถ๊ฐ
|
| 586 |
+
object_type = persona.get("๊ธฐ๋ณธ์ ๋ณด", {}).get("์ ํ", "")
|
| 587 |
+
purpose = persona.get("๊ธฐ๋ณธ์ ๋ณด", {}).get("์ฉ๋", "")
|
| 588 |
+
if purpose:
|
| 589 |
+
contradictions_df.append([f"๐ฏ {purpose}์ ๋ด๋นํ๋ {object_type}์ ๋
ํนํ ๊ฐ์ฑ", "์ฌ๋ฌผ ์ญํ ํน์ฑ"])
|
| 590 |
|
| 591 |
# 127๊ฐ ์ฑ๊ฒฉ ๋ณ์๋ฅผ DataFrame ํํ๋ก ๋ณํ
|
| 592 |
variables = persona.get("์ฑ๊ฒฉ๋ณ์127", {})
|
|
|
|
| 845 |
# ํ์
๋ณ ์์ ํ ์ฒ๋ฆฌ
|
| 846 |
if chat_turn is None:
|
| 847 |
continue
|
| 848 |
+
elif isinstance(chat_turn, dict):
|
| 849 |
+
# Messages format: {"role": "user/assistant", "content": "message"}
|
| 850 |
+
role = chat_turn.get("role")
|
| 851 |
+
content = chat_turn.get("content")
|
| 852 |
+
|
| 853 |
+
if role and content and role in ["user", "assistant"]:
|
| 854 |
+
conversation_history.append({"role": str(role), "content": str(content)})
|
| 855 |
elif isinstance(chat_turn, (list, tuple)) and len(chat_turn) >= 2:
|
| 856 |
+
# ๊ตฌ Gradio ํ์: [user_message, bot_response] (ํธํ์ฑ)
|
| 857 |
user_msg = chat_turn[0]
|
| 858 |
bot_msg = chat_turn[1]
|
| 859 |
|
|
|
|
| 861 |
conversation_history.append({"role": "user", "content": str(user_msg)})
|
| 862 |
if bot_msg is not None and str(bot_msg).strip():
|
| 863 |
conversation_history.append({"role": "assistant", "content": str(bot_msg)})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 864 |
else:
|
| 865 |
# ์์์น ๋ชปํ ํ์์ ๋ฌด์
|
| 866 |
print(f"โ ๏ธ ์์์น ๋ชปํ ์ฑํ
ํ์ ๋ฌด์: {type(chat_turn)}")
|
|
|
|
| 892 |
if not isinstance(response, str):
|
| 893 |
response = str(response) if response else "์ฃ์กํฉ๋๋ค. ์๋ต์ ์์ฑํ ์ ์์์ต๋๋ค."
|
| 894 |
|
| 895 |
+
# Gradio 4.x messages format์ผ๋ก ์์ ํ๊ฒ ์ถ๊ฐ
|
| 896 |
+
if not isinstance(chat_history, list):
|
| 897 |
+
chat_history = []
|
| 898 |
+
|
| 899 |
+
# Messages format: {"role": "user", "content": "message"}
|
| 900 |
+
chat_history.append({"role": "user", "content": user_message})
|
| 901 |
+
chat_history.append({"role": "assistant", "content": response})
|
| 902 |
|
| 903 |
return chat_history, ""
|
| 904 |
|
|
|
|
| 921 |
else:
|
| 922 |
friendly_error = f"์ฃ์กํฉ๋๋ค. ์ผ์์ ์ธ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ด์. ๐
\n\n๐ ๊ธฐ์ ์ ๋ณด: {str(e)}"
|
| 923 |
|
| 924 |
+
# ์์ ํ๊ฒ ์ค๋ฅ ๋ฉ์์ง ์ถ๊ฐ (messages format)
|
| 925 |
try:
|
| 926 |
+
if not isinstance(chat_history, list):
|
| 927 |
+
chat_history = []
|
| 928 |
+
chat_history.append({"role": "user", "content": user_message})
|
| 929 |
+
chat_history.append({"role": "assistant", "content": friendly_error})
|
| 930 |
except Exception:
|
| 931 |
+
chat_history = [
|
| 932 |
+
{"role": "user", "content": user_message},
|
| 933 |
+
{"role": "assistant", "content": friendly_error}
|
| 934 |
+
]
|
| 935 |
|
| 936 |
return chat_history, ""
|
| 937 |
|
|
|
|
| 965 |
persona_name = basic_info.get("์ด๋ฆ", "Unknown")
|
| 966 |
personality_traits = persona_data.get("์ฑ๊ฒฉํน์ฑ", {})
|
| 967 |
|
| 968 |
+
# AI ๊ธฐ๋ฐ ์ธ์ฌ๋ง ์์ฑ (๋ก๋ ์์๋ ์กฐ์ ๋ ์ฑ๊ฒฉ ๋ฐ์)
|
| 969 |
+
global persona_generator
|
| 970 |
+
try:
|
| 971 |
+
if persona_generator:
|
| 972 |
+
ai_greeting = persona_generator.generate_ai_based_greeting(persona_data, personality_traits)
|
| 973 |
+
greeting = f"### ๐ค JSON์์ ๊นจ์ด๋ ์น๊ตฌ\n\n{ai_greeting}\n\n๐พ *\"JSON์์ ๋ค์ ๊นจ์ด๋ฌ์ด! ๋ด ์ฑ๊ฒฉ ๊ธฐ์ต๋?\"*"
|
| 974 |
+
else:
|
| 975 |
+
# ํด๋ฐฑ: ๊ธฐ์กด ๋ฐฉ์
|
| 976 |
+
personality_preview = generate_personality_preview(persona_name, personality_traits, basic_info)
|
| 977 |
+
greeting = f"### ๐ค JSON์์ ๊นจ์ด๋ ์น๊ตฌ\n\n{personality_preview}\n\n๐พ *\"JSON์์ ๋ค์ ๊นจ์ด๋ฌ์ด! ๋ด ์ฑ๊ฒฉ ๊ธฐ์ต๋?\"*"
|
| 978 |
+
except Exception as e:
|
| 979 |
+
print(f"โ ๏ธ JSON ๋ก๋ ์ AI ์ธ์ฌ๋ง ์์ฑ ์คํจ: {e}")
|
| 980 |
+
# ํด๋ฐฑ: ๊ธฐ์กด ๋ฐฉ์
|
| 981 |
+
personality_preview = generate_personality_preview(persona_name, personality_traits, basic_info)
|
| 982 |
+
greeting = f"### ๐ค JSON์์ ๊นจ์ด๋ ์น๊ตฌ\n\n{personality_preview}\n\n๐พ *\"JSON์์ ๋ค์ ๊นจ์ด๋ฌ์ด! ๋ด ์ฑ๊ฒฉ ๊ธฐ์ต๋?\"*"
|
| 983 |
|
| 984 |
return (persona_data, f"โ
{persona_name} ํ๋ฅด์๋๋ฅผ JSON์์ ๋ถ๋ฌ์์ต๋๋ค!",
|
| 985 |
greeting, basic_info)
|
|
|
|
| 1642 |
outputs=[chatbot, message_input]
|
| 1643 |
)
|
| 1644 |
|
| 1645 |
+
# ๋ํ ์ด๊ธฐํ (messages format)
|
| 1646 |
clear_btn.click(
|
| 1647 |
fn=lambda: [],
|
| 1648 |
outputs=[chatbot]
|
| 1649 |
)
|
| 1650 |
|
| 1651 |
+
# ์์ ๋ฉ์์ง ๋ฒํผ๋ค - messages format ํธํ
|
| 1652 |
def handle_example_message(persona, message):
|
| 1653 |
if not persona:
|
| 1654 |
return [], ""
|
| 1655 |
+
# ๋น messages format ๋ฐฐ์ด๋ก ์์
|
| 1656 |
chat_result, _ = chat_with_loaded_persona(persona, message, [])
|
| 1657 |
return chat_result, ""
|
| 1658 |
|
modules/persona_generator.py
CHANGED
|
@@ -608,29 +608,40 @@ class PersonalityProfile:
|
|
| 608 |
return self
|
| 609 |
|
| 610 |
def generate_attractive_flaws(self):
|
| 611 |
-
"""๋งค๋ ฅ์ ๊ฒฐํจ 3๊ฐ ์์ฑ (
|
| 612 |
flaw_vars = {k: v for k, v in self.variables.items() if k.startswith("F")}
|
| 613 |
-
top_flaws = sorted(flaw_vars.items(), key=lambda x: x[1], reverse=True)[:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
"
|
| 618 |
-
"
|
| 619 |
-
"
|
| 620 |
-
"
|
| 621 |
-
"
|
| 622 |
-
"
|
| 623 |
-
"
|
| 624 |
-
"
|
| 625 |
-
|
| 626 |
-
"F11_์์ฌํจ": "๋ด์ฑ์ ์ด๊ณ ์กฐ์ฌ์ค๋ฌ์ด ์ฑํฅ",
|
| 627 |
-
"F12_์๋ชป๋์์ ๊ฐ": "๊ฐ๋ ์์ ์ ๋ฅ๋ ฅ์ ๊ณผ๋ํ๊ฐํจ",
|
| 628 |
-
"F13_๊ณผ๊ฑฐ์ง์ฐฉ": "๊ณผ๊ฑฐ์ ์ผ์ ์์ฃผ ๋จธ๋ฌด๋ ๊ฒฝํฅ",
|
| 629 |
-
"F14_๋ณํ๊ฑฐ๋ถ": "์๋ก์ด ๋ณํ๋ฅผ ๊บผ๋ฆฌ๋ ์ฑํฅ",
|
| 630 |
-
"F15_ํํ์ํผ": "๊ฐ์ ํํ์ด ์ํฐ ํธ"
|
| 631 |
-
}
|
| 632 |
|
| 633 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 634 |
|
| 635 |
def generate_contradictions(self):
|
| 636 |
"""๋ชจ์์ ํน์ฑ 2๊ฐ ์์ฑ (๋ณต์ก์ฑ๊ณผ ๊น์ด ๋ถ์ฌ)"""
|
|
|
|
| 608 |
return self
|
| 609 |
|
| 610 |
def generate_attractive_flaws(self):
|
| 611 |
+
"""๋งค๋ ฅ์ ๊ฒฐํจ 3-4๊ฐ ์์ฑ (์ฌ๋ฌผ ํน์ฑ + ์ฑ๊ฒฉ์ ํน์ฑ ํผํฉ)"""
|
| 612 |
flaw_vars = {k: v for k, v in self.variables.items() if k.startswith("F")}
|
| 613 |
+
top_flaws = sorted(flaw_vars.items(), key=lambda x: x[1], reverse=True)[:4]
|
| 614 |
+
|
| 615 |
+
# ์ฌ๋ฌผ ํน์ฑ ๊ธฐ๋ฐ ๋งค๋ ฅ์ ๊ฒฐํจ
|
| 616 |
+
physical_flaws = [
|
| 617 |
+
"๋จผ์ง๊ฐ ์์ด๋ฉด ์กฐ๊ธ ๊ธฐ๋ถ์ด ์ฐ์ธํด์ง",
|
| 618 |
+
"ํ๋ณ์ ๋๋ฌด ์ค๋ ์์ผ๋ฉด ์์ด ๋ฐ๋ ๊น ๋ด ๊ฑฑ์ ํจ",
|
| 619 |
+
"๊ฐ์์ค๋ฌ์ด ์ถฉ๊ฒฉ์ ๋๋ผ๋ฉด ์ค๋ซ๋์ ๋จ๋ฆผ",
|
| 620 |
+
"์ต๋๊ฐ ๋์ผ๋ฉด ์ปจ๋์
์ด ์กฐ๊ธ ๋๋น ์ง",
|
| 621 |
+
"์๋ก์ด ๋์์ ๋ฏผ๊ฐํ๊ฒ ๋ฐ์ํจ",
|
| 622 |
+
"์๋ฒฝํ ์ ๋ฆฌ์ ๋์ ๊ฟ๊พธ์ง๋ง ํ์ค์ ์ด์ง๋ฌ์",
|
| 623 |
+
"์์ ์ ๋ชจ์๋ฆฌ๋ ๋๋ถ๋ถ์ด ๋ณ๋ ๊ฒ์ ์ ๊ฒฝ์",
|
| 624 |
+
"๊ฐ๋ ์์ ์ ๋ฌด๊ฒ๋ ํฌ๊ธฐ ๋๋ฌธ์ ๋ฏธ์ํดํจ"
|
| 625 |
+
]
|
| 626 |
|
| 627 |
+
# ์ฑ๊ฒฉ์ ๋งค๋ ฅ์ ๊ฒฐํจ
|
| 628 |
+
personality_flaws = [
|
| 629 |
+
"์๋ฒฝํด ๋ณด์ด๋ ค๊ณ ๋
ธ๋ ฅํ์ง๋ง ๊ฐ๋ ์ค์๋ฅผ ํจ",
|
| 630 |
+
"์๊ฐ์ด ๋๋ฌด ๋ง์์ ๊ฒฐ์ ์ ๋ด๋ฆฌ๊ธฐ ์ด๋ ค์ํจ",
|
| 631 |
+
"๋๋ฌด ์์งํด์ ๊ฐ๋ ๋์น๊ฐ ์์",
|
| 632 |
+
"์ง๋์น๊ฒ ์ด์ ์ ์ด์ด์ ์ฌ๋ ๊ฒ์ ์์ ๋๊ฐ ์์",
|
| 633 |
+
"์๋ก์ด ์์ด๋์ด์ ๋๋ฌด ์ฝ๊ฒ ํฅ๋ถํจ",
|
| 634 |
+
"ํธ๊ธฐ์ฌ์ด ๋ง์ ์ง์ค๋ ฅ์ด ์ฝ๊ฐ ๋ถ์กฑํจ",
|
| 635 |
+
"๊ฐ์ ํํ์ด ์ํด๋ฌ์ ์คํด๋ฐ์ ๋๊ฐ ์์",
|
| 636 |
+
"๊ณผ๊ฑฐ์ ์ข์ ๊ธฐ์ต์ ์์ฃผ ๋น ์ ธ ํ์ค์ ๋์น ๋๊ฐ ์์"
|
| 637 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 638 |
|
| 639 |
+
# ์ฌ๋ฌผ ํน์ฑ 2๊ฐ + ์ฑ๊ฒฉ์ ํน์ฑ 2๊ฐ ์กฐํฉ
|
| 640 |
+
selected_flaws = []
|
| 641 |
+
selected_flaws.extend(random.sample(physical_flaws, 2))
|
| 642 |
+
selected_flaws.extend(random.sample(personality_flaws, 2))
|
| 643 |
+
|
| 644 |
+
return selected_flaws
|
| 645 |
|
| 646 |
def generate_contradictions(self):
|
| 647 |
"""๋ชจ์์ ํน์ฑ 2๊ฐ ์์ฑ (๋ณต์ก์ฑ๊ณผ ๊น์ด ๋ถ์ฌ)"""
|