If an NPC calls to AI to talk...
And no one is around to listen, are we just wasting tokens? Yup.
This commit is contained in:
parent
9e77eb87ad
commit
5f2df4341e
2 changed files with 17 additions and 15 deletions
|
|
@ -436,12 +436,13 @@ class Dragon(Traveler):
|
||||||
"say Look at all these luscious peoples.",
|
"say Look at all these luscious peoples.",
|
||||||
"emote waves to everyone.",
|
"emote waves to everyone.",
|
||||||
"emote waves to everybody."
|
"emote waves to everybody."
|
||||||
])
|
]
|
||||||
delay(5, self.do_cmd, cmd)
|
delay(5, self.do_cmd, cmd)
|
||||||
|
|
||||||
def goodbye(self, new_room=None):
|
def goodbye(self, new_room=None):
|
||||||
if self.location.key == "Wyldwood Bar":
|
if self.location.key == "Wyldwood Bar":
|
||||||
self.do_cmd("drop drink")
|
self.do_cmd("drop drink")
|
||||||
|
if self.location.characters_here():
|
||||||
system_prompt = self.setting_and_backstory()
|
system_prompt = self.setting_and_backstory()
|
||||||
messages = [{"role": "user", "content": "Say goodbye."}]
|
messages = [{"role": "user", "content": "Say goodbye."}]
|
||||||
reply = self._think(system_prompt, messages)
|
reply = self._think(system_prompt, messages)
|
||||||
|
|
|
||||||
|
|
@ -846,6 +846,7 @@ class AI:
|
||||||
and 'messages' from the JSON history function,
|
and 'messages' from the JSON history function,
|
||||||
appended with all 'events' recorded since last time.
|
appended with all 'events' recorded since last time.
|
||||||
"""
|
"""
|
||||||
|
if self.location.characters_here():
|
||||||
system_prompt = self.setting_and_backstory(speaker)
|
system_prompt = self.setting_and_backstory(speaker)
|
||||||
messages = self.history(speaker)
|
messages = self.history(speaker)
|
||||||
recent_events = self.pop_recent_events(speech)
|
recent_events = self.pop_recent_events(speech)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue