Spaces:
Sleeping
Sleeping
File size: 1,458 Bytes
514b626 76c6f71 514b626 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
"""
Phase 1 Example: Simple single persona query
This example demonstrates the basic functionality of querying
a single persona about an urban planning topic.
"""
import sys
from pathlib import Path
# Add parent directory to path
sys.path.insert(0, str(Path(__file__).parent.parent))
from src.pipeline.query_engine import QueryEngine
def main():
print("=" * 70)
print("Phase 1 Example: Single Persona Query")
print("=" * 70)
print()
# Initialize the query engine
print("Initializing system...")
engine = QueryEngine()
# Test system
print("\nTesting system components...")
if not engine.test_system():
print("System test failed. Please check your configuration.")
return
print("\n" + "=" * 70)
print()
# Define a planning question
question = "What do you think about the proposed bike lane on Main Street?"
# Query Sarah Chen (the progressive urban planner)
print(f"Question: {question}")
print("\nQuerying persona: Sarah Chen (Urban Planner)")
print("-" * 70)
response = engine.query(
persona_id="sarah_chen",
question=question,
context_id="downtown_district",
)
print(f"\n{response.persona_name} responds:")
print(f"\n{response.response}")
print()
print("-" * 70)
print(f"Generated at: {response.timestamp}")
print(f"Model: {response.model_used}")
print()
if __name__ == "__main__":
main()
|