File size: 3,456 Bytes
e65d325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0777aa4
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
import sys
import asyncio
from langchain_core.prompts import PromptTemplate

from crawl import marketing_crawling


company_prompt_template = PromptTemplate.from_template("""
# Task
This is the scraped content from the company website. Read this content and extract the key information in an easy-to-read, professional format.

#**Instructions:**
- Focus on the most important details and present them in a structured, clear format.
- Follow the example below for formatting and style.
- Organize the content into clear sections such as:
    - **About the Company**
    - **Services Offered** (with sub-sections for each service)
    - **Why Choose the Company** (highlight unique selling points and certifications)
    - **Company Information** (contact details, address, and other relevant details)
- Avoid irrelevant details, redundant information, and generic text.
- Use professional, concise language that is easy to understand.
- Ensure consistency in formatting and tone.

#**Example:**

#### **About All Solar Works**
All Solar Works specializes in **solar panels, battery storage, EV chargers, and electrical services** across Sussex, UK. They offer expert installation and high-quality solutions to help customers save money on energy bills while reducing their carbon footprint.

----------

### **Services Offered**

#### **1. Solar Panels**
- Install various solar panel systems to fit different budgets.
- Helps customers reduce bills and enjoy long-term savings.
- **Complete Solar Panel System Package includes:**
    - **X** kWp Solar PV System
    - **X** W Aiko Panels
    - **X** kW Hybrid Inverter
    - **Online Monitoring, DNO application, Warranty, and MCS certification**
    - Available **with or without battery storage**.

#### **2. Battery Storage**
- Certified **Fox ESS Elite Installer**, ensuring top performance and reliability.
- Stores excess solar energy for use at night or during low sunlight hours.

#### **3. EV Charging Solutions**
- Install home and workplace **EV chargers**.
- Compatible with **all Type-2 electric vehicles**.
- Includes a dedicated app for full control over charging.

#### **4. Electrical Services**
- Professional and reliable services, including:
    - **Rewiring, consumer unit replacement, additional power points, and more.**

----------

### **Why Choose All Solar Works?**
 **Certified Fox ESS Elite Installer** – Ensures optimal battery storage performance.
**Customizable Solar Solutions** – Tailored to individual energy needs.
**Energy Independence** – Reduce reliance on the grid and lower bills.
**Long-Term Savings** – Financially beneficial with eco-friendly advantages.

----------

### **Company Information**
**Company Name:** All Solar Works
**Location:** Edgehill Close, Worthing, West Sussex, BN XX
**Contact:** info@allsolarworks.com | +44 XXX XXXX
**Operating Hours:** Monday – Friday (9 AM – 5 PM), Saturday (10 AM – 2 PM)

----------

Use this format and structure when extracting the content from the website. Ensure the final output is clean, structured, and easy to understand.

----------

**Company Information:**
{company_information}

""")


def company_content(llm, state):
    url = state["url"]
    content = asyncio.run(marketing_crawling(url))
    prompt = company_prompt_template.invoke({"company_information": content})
    response = llm.invoke(prompt)
    print(response.content)
    return {"company_information": response.content}