28 lines
712 B
Python
28 lines
712 B
Python
#!/usr/bin/env python3
|
|
import sys
|
|
sys.path.insert(0, 'backend')
|
|
|
|
import asyncio
|
|
from services.role_detector import RoleDetector
|
|
from services.ollama_service import OllamaService
|
|
|
|
async def test():
|
|
# Read the actual story
|
|
with open('Test Story.txt', 'r') as f:
|
|
story = f.read()
|
|
|
|
print(f'Story length: {len(story)} characters\n')
|
|
|
|
# Test role detection
|
|
ollama_service = OllamaService()
|
|
role_detector = RoleDetector(ollama_service=ollama_service)
|
|
|
|
print('Testing role detection...')
|
|
roles = await role_detector.detect_roles(story)
|
|
|
|
print(f'\nDetected {len(roles)} roles:')
|
|
for role in roles:
|
|
print(f' - {role["label"]}')
|
|
|
|
asyncio.run(test())
|