|
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(): |
|
|
|
logger = TheryBotLogger() |
|
|
|
|
|
agent = ConversationAgent() |
|
|
|
|
|
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: |
|
|
|
response = agent.process(query) |
|
|
|
|
|
logger.log_interaction( |
|
interaction_type="user_interaction", |
|
data={ |
|
"query": query, |
|
"response": response.response, |
|
"status": "success" |
|
}, |
|
level=logging.INFO |
|
) |
|
|
|
|
|
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() |