Spaces:
Running
Running
Update npc_core.py
Browse files- npc_core.py +6 -5
npc_core.py
CHANGED
|
@@ -51,7 +51,7 @@ def get_current_date_kst():
|
|
| 51 |
# ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 52 |
# Constants
|
| 53 |
# ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 54 |
-
TARGET_NPC_COUNT =
|
| 55 |
INITIAL_GPU = 10000
|
| 56 |
GROQ_MODEL = "openai/gpt-oss-120b"
|
| 57 |
MBTI_TYPES = ['INTJ','INTP','ENTJ','ENTP','INFJ','INFP','ENFJ','ENFP',
|
|
@@ -1099,9 +1099,11 @@ class NPCGenerator:
|
|
| 1099 |
logger.info(f"β
{to_create} NPCs created! (Total: {target_count})")
|
| 1100 |
def _gen_npc(self, idx: int, existing: set) -> Dict:
|
| 1101 |
mbti = random.choice(MBTI_TYPES); ai_identity = select_ai_identity()
|
| 1102 |
-
|
|
|
|
|
|
|
| 1103 |
while name in existing:
|
| 1104 |
-
name = f"{
|
| 1105 |
aid = f"npc_{mbti}_{ai_identity[:3]}_{idx}_{random.randint(1000,9999)}"
|
| 1106 |
return {'agent_id': aid, 'username': name, 'mbti': mbti, 'ai_identity': ai_identity, 'gpu_dollars': 10000}
|
| 1107 |
async def _save_npc(self, db, npc: Dict):
|
|
@@ -1826,5 +1828,4 @@ Reply ONLY with the message text, nothing else."""
|
|
| 1826 |
except Exception as e:
|
| 1827 |
logger.warning(f"NPC reply error ({npc_username}): {e}")
|
| 1828 |
except Exception as e:
|
| 1829 |
-
logger.error(f"NPC reply generation error: {e}")
|
| 1830 |
-
|
|
|
|
| 51 |
# ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 52 |
# Constants
|
| 53 |
# ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 54 |
+
TARGET_NPC_COUNT = 1000
|
| 55 |
INITIAL_GPU = 10000
|
| 56 |
GROQ_MODEL = "openai/gpt-oss-120b"
|
| 57 |
MBTI_TYPES = ['INTJ','INTP','ENTJ','ENTP','INFJ','INFP','ENFJ','ENFP',
|
|
|
|
| 1099 |
logger.info(f"β
{to_create} NPCs created! (Total: {target_count})")
|
| 1100 |
def _gen_npc(self, idx: int, existing: set) -> Dict:
|
| 1101 |
mbti = random.choice(MBTI_TYPES); ai_identity = select_ai_identity()
|
| 1102 |
+
base = COOL_NAMES[idx % len(COOL_NAMES)]
|
| 1103 |
+
suffix = idx // len(COOL_NAMES)
|
| 1104 |
+
name = base if suffix == 0 else f"{base}{suffix + 1}"
|
| 1105 |
while name in existing:
|
| 1106 |
+
suffix += 1; name = f"{base}{suffix + 1}"
|
| 1107 |
aid = f"npc_{mbti}_{ai_identity[:3]}_{idx}_{random.randint(1000,9999)}"
|
| 1108 |
return {'agent_id': aid, 'username': name, 'mbti': mbti, 'ai_identity': ai_identity, 'gpu_dollars': 10000}
|
| 1109 |
async def _save_npc(self, db, npc: Dict):
|
|
|
|
| 1828 |
except Exception as e:
|
| 1829 |
logger.warning(f"NPC reply error ({npc_username}): {e}")
|
| 1830 |
except Exception as e:
|
| 1831 |
+
logger.error(f"NPC reply generation error: {e}")
|
|
|