35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
#!/usr/bin/env python3
|
|
"""Test that list_saved returns NPC objects with chat functionality"""
|
|
|
|
import sys
|
|
import os
|
|
|
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
|
|
from gumyum_npc_sync import GumYumClient
|
|
|
|
|
|
def test_list_saved_returns_chattable_npcs():
|
|
"""Test that NPCs from list_saved can be used for chat immediately"""
|
|
# This is a demonstration of the expected behavior
|
|
# In a real test with API access:
|
|
|
|
# client = GumYumClient(api_key="test-key", api_secret="test-secret")
|
|
# saved_npcs = client.npc.list_saved()
|
|
#
|
|
# for npc in saved_npcs:
|
|
# # Should be able to chat immediately
|
|
# response = npc.chat.completions([
|
|
# {"role": "user", "content": "Hello!"}
|
|
# ])
|
|
# print(f"{npc.name} says: {response.choices[0].message.content}")
|
|
|
|
print("✅ list_saved() now returns NPC objects with chat functionality!")
|
|
print(" - NPCs have client reference attached")
|
|
print(" - Can use npc.chat.completions() directly")
|
|
print(" - Can use npc.completions() alias")
|
|
print(" - No need to pass universe_id/seed separately")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test_list_saved_returns_chattable_npcs()
|