from langchain_core.tools import tool from tools.intelligent_retrieval_tool import get_machine_context_async @tool async def wurthlac_machine_expert(query: str) -> str: """ Use this tool for ANY question about products, machinery, or specific models, such as 'JDT75' or 'Cantek DT65'. It is the primary source of truth for all product-related inquiries, including features, price, specifications, comparisons, or recommendations. Do NOT use this tool for simple greetings or general questions about the company (e.g., 'who are you?', 'what are your shipping policies?'). """ print(f"--- Agent decided to call the Wurthlac Machine Expert tool ---") ... print(f"--- Passing query: '{query}' to the expert tool... ---") context = await get_machine_context_async(query=query) print("\n" + "="*50) print("--- [TOOL DEBUG] RAW CONTEXT RETURNED FROM RETRIEVER ---") print(f"RAW DATA: {context}") print("--- [TOOL DEBUG] END OF RAW CONTEXT ---") print("="*50 + "\n") return context all_tools = [wurthlac_machine_expert]