Update TextGen/router.py
Browse files- TextGen/router.py +5 -2
TextGen/router.py
CHANGED
@@ -49,9 +49,12 @@ class Generate(BaseModel):
|
|
49 |
|
50 |
def generate_text(messages: List[str], npc:str):
|
51 |
print(npc)
|
52 |
-
|
|
|
|
|
|
|
53 |
print(system_prompt)
|
54 |
-
new_messages=[{"role": "
|
55 |
for index, message in enumerate(messages):
|
56 |
if index%2==0:
|
57 |
new_messages.append({"role": "user", "content": message})
|
|
|
49 |
|
50 |
def generate_text(messages: List[str], npc:str):
|
51 |
print(npc)
|
52 |
+
if npc in main_npcs:
|
53 |
+
system_prompt=main_npc_system_prompts[npc]
|
54 |
+
else:
|
55 |
+
system_prompt="you're a character in a video game. Play along."
|
56 |
print(system_prompt)
|
57 |
+
new_messages=[{"role": "user", "content": system_prompt}]
|
58 |
for index, message in enumerate(messages):
|
59 |
if index%2==0:
|
60 |
new_messages.append({"role": "user", "content": message})
|