Spaces:
Build error
Build error
Update main.py
Browse files
main.py
CHANGED
|
@@ -4,7 +4,8 @@ import os
|
|
| 4 |
os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf"
|
| 5 |
os.environ["HF_HOME"] = "/tmp/hf"
|
| 6 |
|
| 7 |
-
from
|
|
|
|
| 8 |
from langchain.agents.agent_types import AgentType
|
| 9 |
from langchain.tools import BaseTool
|
| 10 |
from transformers import pipeline
|
|
@@ -33,36 +34,30 @@ class MachineryReportTool(BaseTool):
|
|
| 33 |
def _run(self, query: str) -> str:
|
| 34 |
report = """
|
| 35 |
## Comprehensive Report on Mini Construction Equipment Project
|
| 36 |
-
|
| 37 |
### Overview
|
| 38 |
The project involves designing and building construction machinery tailored for the local South African market.
|
| 39 |
The focus is on developing cost-effective, high-performance machines that can compete with expensive American-made
|
| 40 |
equipment while leveraging local manufacturing strengths.
|
| 41 |
-
|
| 42 |
### 1. Equipment Details
|
| 43 |
- **Basic Gas-Powered Auction Unit**
|
| 44 |
- Price: $3,700
|
| 45 |
- Engine: 14 horsepower gas motor
|
| 46 |
- Configuration: Two pump system
|
| 47 |
- Capabilities: Digging, Scooping, Auger Operation, Trenching, Pallet Fork Operation
|
| 48 |
-
|
| 49 |
- **DRT 450**
|
| 50 |
- Original Price: $8,500 (current base price: $5,500-6,300)
|
| 51 |
- Engine: Twin cylinder Honda gas motor
|
| 52 |
- Pump System: Triple pump configuration
|
| 53 |
- Compatible Attachments: Mulcher, Brush Cutter, Harley Rake, Trencher
|
| 54 |
-
|
| 55 |
- **Mini Skid Steer (New Acquisition)**
|
| 56 |
- Price: $15,000
|
| 57 |
- Engine: Kubota diesel
|
| 58 |
- Control: Pilot controls with vertical lift arms
|
| 59 |
- Notable Feature: Mulcher attachment ($2,000)
|
| 60 |
-
|
| 61 |
- **Mini Excavators (Kimron Units)**
|
| 62 |
- Unit 1: One-ton unit with Briggs & Stratton engine
|
| 63 |
- Unit 2: 3,500 lb unit with Yanmar diesel engine
|
| 64 |
- Supplier: K&R Equipment (Oklahoma)
|
| 65 |
-
|
| 66 |
### 2. Market Comparison and Cost Impact
|
| 67 |
- **American Equivalents:** Bobcat MT100, Kubota SCCL1000, Ditch Witch SK900 ($38,000 to $45,000+).
|
| 68 |
- **Tariff Impact:**
|
|
@@ -70,7 +65,6 @@ class MachineryReportTool(BaseTool):
|
|
| 70 |
- Mini Skid Steer: ~$9,300 + ~$5,000 shipping + 10% tariff (~$930) = ~$16,000.
|
| 71 |
- **Competitive Advantage:**
|
| 72 |
Even with tariffs, Chinese equipment can be 25-30% the cost of American machines.
|
| 73 |
-
|
| 74 |
### 3. Designing and Building Locally in South Africa
|
| 75 |
- **Local Manufacturing Advantages:**
|
| 76 |
- "Made in South Africa" branding for local pride.
|
|
@@ -83,13 +77,11 @@ class MachineryReportTool(BaseTool):
|
|
| 83 |
- Pilot production, gather feedback, scale.
|
| 84 |
- Target local contractors/farmers.
|
| 85 |
- Check government incentives for local manufacturing.
|
| 86 |
-
|
| 87 |
### 4. Next Steps & Recommendations
|
| 88 |
- **R&D:** Prototypes + real-world testing.
|
| 89 |
- **Supply Chain:** Local suppliers, modular designs.
|
| 90 |
- **Financing:** Bank loans, grants, investor funding.
|
| 91 |
- **Compliance:** Prepare for certifications and warranties.
|
| 92 |
-
|
| 93 |
### Conclusion
|
| 94 |
Building "Made in South Africa" machinery meets a real need for affordable, durable equipment,
|
| 95 |
potentially disrupting a market dominated by high-priced American brands.
|
|
@@ -119,4 +111,4 @@ query = (
|
|
| 119 |
|
| 120 |
result = agent.run(query)
|
| 121 |
print("\n===== AGENT OUTPUT =====")
|
| 122 |
-
print(result)
|
|
|
|
| 4 |
os.environ["TRANSFORMERS_CACHE"] = "/tmp/hf"
|
| 5 |
os.environ["HF_HOME"] = "/tmp/hf"
|
| 6 |
|
| 7 |
+
from langchain_community.llms import HuggingFacePipeline
|
| 8 |
+
from langchain.agents import initialize_agent
|
| 9 |
from langchain.agents.agent_types import AgentType
|
| 10 |
from langchain.tools import BaseTool
|
| 11 |
from transformers import pipeline
|
|
|
|
| 34 |
def _run(self, query: str) -> str:
|
| 35 |
report = """
|
| 36 |
## Comprehensive Report on Mini Construction Equipment Project
|
|
|
|
| 37 |
### Overview
|
| 38 |
The project involves designing and building construction machinery tailored for the local South African market.
|
| 39 |
The focus is on developing cost-effective, high-performance machines that can compete with expensive American-made
|
| 40 |
equipment while leveraging local manufacturing strengths.
|
|
|
|
| 41 |
### 1. Equipment Details
|
| 42 |
- **Basic Gas-Powered Auction Unit**
|
| 43 |
- Price: $3,700
|
| 44 |
- Engine: 14 horsepower gas motor
|
| 45 |
- Configuration: Two pump system
|
| 46 |
- Capabilities: Digging, Scooping, Auger Operation, Trenching, Pallet Fork Operation
|
|
|
|
| 47 |
- **DRT 450**
|
| 48 |
- Original Price: $8,500 (current base price: $5,500-6,300)
|
| 49 |
- Engine: Twin cylinder Honda gas motor
|
| 50 |
- Pump System: Triple pump configuration
|
| 51 |
- Compatible Attachments: Mulcher, Brush Cutter, Harley Rake, Trencher
|
|
|
|
| 52 |
- **Mini Skid Steer (New Acquisition)**
|
| 53 |
- Price: $15,000
|
| 54 |
- Engine: Kubota diesel
|
| 55 |
- Control: Pilot controls with vertical lift arms
|
| 56 |
- Notable Feature: Mulcher attachment ($2,000)
|
|
|
|
| 57 |
- **Mini Excavators (Kimron Units)**
|
| 58 |
- Unit 1: One-ton unit with Briggs & Stratton engine
|
| 59 |
- Unit 2: 3,500 lb unit with Yanmar diesel engine
|
| 60 |
- Supplier: K&R Equipment (Oklahoma)
|
|
|
|
| 61 |
### 2. Market Comparison and Cost Impact
|
| 62 |
- **American Equivalents:** Bobcat MT100, Kubota SCCL1000, Ditch Witch SK900 ($38,000 to $45,000+).
|
| 63 |
- **Tariff Impact:**
|
|
|
|
| 65 |
- Mini Skid Steer: ~$9,300 + ~$5,000 shipping + 10% tariff (~$930) = ~$16,000.
|
| 66 |
- **Competitive Advantage:**
|
| 67 |
Even with tariffs, Chinese equipment can be 25-30% the cost of American machines.
|
|
|
|
| 68 |
### 3. Designing and Building Locally in South Africa
|
| 69 |
- **Local Manufacturing Advantages:**
|
| 70 |
- "Made in South Africa" branding for local pride.
|
|
|
|
| 77 |
- Pilot production, gather feedback, scale.
|
| 78 |
- Target local contractors/farmers.
|
| 79 |
- Check government incentives for local manufacturing.
|
|
|
|
| 80 |
### 4. Next Steps & Recommendations
|
| 81 |
- **R&D:** Prototypes + real-world testing.
|
| 82 |
- **Supply Chain:** Local suppliers, modular designs.
|
| 83 |
- **Financing:** Bank loans, grants, investor funding.
|
| 84 |
- **Compliance:** Prepare for certifications and warranties.
|
|
|
|
| 85 |
### Conclusion
|
| 86 |
Building "Made in South Africa" machinery meets a real need for affordable, durable equipment,
|
| 87 |
potentially disrupting a market dominated by high-priced American brands.
|
|
|
|
| 111 |
|
| 112 |
result = agent.run(query)
|
| 113 |
print("\n===== AGENT OUTPUT =====")
|
| 114 |
+
print(result)
|