Spaces:
Sleeping
Sleeping
Download src/tools.py from zclap/Wurth_LouisAssistant: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/spaces/zclap/Wurth_LouisAssistant/resolve/main/src/tools.py
- Command line
-
hf download hf://spaces/zclap/Wurth_LouisAssistant/src/tools.py
-
curl -L -o tools.py https://huggingface.co/spaces/zclap/Wurth_LouisAssistant/resolve/main/src/tools.py
1.09 kB
| from langchain_core.tools import tool | |
| from tools.intelligent_retrieval_tool import get_machine_context_async | |
| 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] |