File size: 1,257 Bytes
5889992
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import logging
from src.llm.agents.conversation_agent import ConversationAgent
from src.llm.utils.logging import TheryBotLogger
from src.llm.core.config import settings

def main():
    # Initialize logger
    logger = TheryBotLogger()
    
    # Initialize main conversation agent
    agent = ConversationAgent()
    
    # Example interaction
    query = "But I have been try to do this for quite a while now and I am still not able to get it right."
    
    try:
        # Process query
        response = agent.process(query)
        
        # Log interaction
        logger.log_interaction(
            interaction_type="user_interaction",
            data={
                "query": query,
                "response": response.response,
                "status": "success"
            },
            level=logging.INFO
        )
        
        # Print response
        print(f"Thery AI: {response.response}")
        
    except Exception as e:
        logger.log_interaction(
            interaction_type="error",
            data={
                "query": query,
                "error": str(e)
            },
            level=logging.ERROR
        )
        print("An error occurred. Please try again.")

if __name__ == "__main__":
    main()