File size: 4,190 Bytes
798b705
 
57b2968
d54e3e7
 
feec3b3
57b2968
 
 
 
 
 
 
feec3b3
 
57b2968
 
 
 
 
 
 
 
feec3b3
57b2968
 
 
 
 
 
 
 
 
 
 
feec3b3
57b2968
 
 
 
 
 
 
 
 
 
feec3b3
57b2968
 
 
 
 
 
 
 
 
feec3b3
57b2968
 
 
 
 
 
 
 
 
 
feec3b3
57b2968
 
 
 
 
 
feec3b3
d54e3e7
57b2968
 
 
 
798b705
57b2968
798b705
d54e3e7
 
 
798b705
 
 
 
feec3b3
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import gradio as gr

# Enhanced Hydraulic Q&A
def hydraulics_assistant(message, history):
    message = message.lower()

    if "pressure range" in message or "operating pressure" in message:
        return (
            "🧭 **Recommended Pressure Range:**\n"
            "For standard hydraulic presses, the operating pressure is typically between 120 and 180 bar. "
            "However, this can vary based on the type of machinery and application. Always consult your equipment manual "
            "or manufacturer to ensure the pressure setting aligns with system requirements."
        )

    elif "oil" in message and "200 bar" in message:
        return (
            "πŸ›’οΈ **Oil Type for 200 Bar Press:**\n"
            "Use ISO VG 46 or VG 68 grade hydraulic oil for 200 bar hydraulic systems. These oils provide a good balance of viscosity, "
            "thermal stability, and wear protection. Selection depends on ambient operating temperatures:\n"
            "- Use VG 46 in moderate climates\n"
            "- Use VG 68 in hotter environments\n"
            "βœ… Always verify compatibility with OEM recommendations or consult your equipment supplier."
        )

    elif "overheating" in message or "too hot" in message:
        return (
            "πŸ”₯ **Hydraulic System Overheating – Possible Causes & Fixes:**\n"
            "- Dirty or clogged filters causing restricted flow\n"
            "- Low fluid levels or poor-quality oil\n"
            "- Undersized or failing heat exchanger\n"
            "- Continuous high-duty cycle without rest\n\n"
            "**Fix:**\n"
            "Clean or replace filters, top-up fluid, inspect cooling system, and monitor temperature with a thermal gun. "
            "If persistent, consider upgrading the cooling system."
        )

    elif "noise" in message or "whining" in message:
        return (
            "πŸ”Š **Why Your Pump is Making a Whining Noise:**\n"
            "This could be caused by:\n"
            "- Cavitation due to air bubbles in the fluid\n"
            "- Low hydraulic fluid level\n"
            "- Clogged suction line or filter\n"
            "- Failing pump bearings\n\n"
            "πŸ‘‰ Check fluid level, inspect for air leaks, and clean the filters. Prolonged noise may damage components, so act promptly."
        )

    elif "fluid change" in message or "oil change" in message:
        return (
            "πŸ”„ **Hydraulic Fluid Change Frequency:**\n"
            "Hydraulic oil should typically be replaced every 2000 operating hours, but this can vary depending on:\n"
            "- Operating environment (dusty, hot, etc.)\n"
            "- Load cycles and pressure\n"
            "- Fluid quality and contamination\n\n"
            "πŸ“˜ Tip: Monitor oil condition using sampling kits and follow the OEM schedule."
        )

    elif "pressure drop" in message:
        return (
            "πŸ“‰ **Pressure Drop in Hydraulic Systems:**\n"
            "Potential reasons include:\n"
            "- Leaks in hoses, fittings, or seals\n"
            "- Clogged return filters\n"
            "- Faulty pressure relief valves\n"
            "- Air in the hydraulic lines\n\n"
            "πŸ” Start by inspecting visible components, then move to internal checks if needed."
        )

    elif "spare part" in message or "replacement" in message:
        return (
            "πŸ”§ **Spare Parts or Replacements:**\n"
            "Please contact your authorized dealer or the maintenance support team with your equipment model number. "
            "They can guide you to compatible parts or help verify the specifications for ordering replacements."
        )

    else:
        return (
            "πŸ€– Sorry, I don't have information on that specific query.\n"
            "Please consult your maintenance engineer or refer to the equipment manual for detailed guidance."
        )

# Launch the Gradio chatbot
demo = gr.ChatInterface(
    hydraulics_assistant,
    title="Hydraulic Maintenance Assistant Bot",
    description="Ask your hydraulic maintenance questions β€” get instant answers to common issues!"
)

if __name__ == "__main__":
    demo.launch()