from llm_agent import CustomerServiceAgent
from legacy_crm import CRMSystem
def handle_customer_query(customer_id, query):
# Initialize the LLM agent and legacy CRM system
agent = CustomerServiceAgent()
crm = CRMSystem()
# Retrieve customer information from the legacy system
customer_info = crm.get_customer_info(customer_id)
# Pass the query and customer info to the LLM agent
response = agent.process_query(query, customer_info)
# Update the CRM with the interaction details
crm.log_interaction(customer_id, query, response)
return response
# Example usage
customer_query = "I\'m having trouble with my recent order #12345"
response = handle_customer_query("CUST001", customer_query)
print(response)