langchain-opticparse 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langchain_opticparse-1.0.0/PKG-INFO +89 -0
- langchain_opticparse-1.0.0/README.md +73 -0
- langchain_opticparse-1.0.0/langchain_opticparse/__init__.py +82 -0
- langchain_opticparse-1.0.0/langchain_opticparse.egg-info/PKG-INFO +89 -0
- langchain_opticparse-1.0.0/langchain_opticparse.egg-info/SOURCES.txt +8 -0
- langchain_opticparse-1.0.0/langchain_opticparse.egg-info/dependency_links.txt +1 -0
- langchain_opticparse-1.0.0/langchain_opticparse.egg-info/requires.txt +3 -0
- langchain_opticparse-1.0.0/langchain_opticparse.egg-info/top_level.txt +1 -0
- langchain_opticparse-1.0.0/pyproject.toml +25 -0
- langchain_opticparse-1.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: langchain-opticparse
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official LangChain & CrewAI Integration for OpticParse Zero-CSS Multimodal Vision Web Scraping & PhishVision Threat Detection
|
|
5
|
+
Author-email: OpticParse Enterprise <support@opticparse.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://opticparse.com
|
|
8
|
+
Project-URL: Repository, https://github.com/parastejpal987-cmyk/opticparse-public
|
|
9
|
+
Keywords: langchain,crewai,web-scraping,vision-ai,phishing-detection,ai-agents
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: langchain-core>=0.1.0
|
|
14
|
+
Requires-Dist: pydantic>=2.0.0
|
|
15
|
+
Requires-Dist: requests>=2.28.0
|
|
16
|
+
|
|
17
|
+
# 🦜️🔗 langchain-opticparse
|
|
18
|
+
|
|
19
|
+
Official **LangChain** and **CrewAI** ecosystem integration for **OpticParse** and **PhishVision**.
|
|
20
|
+
|
|
21
|
+
Enables AI agents to:
|
|
22
|
+
1. **Visually Scrape Live Webpages (`OpticParseTool`):** Extract clean, structured JSON using multimodal vision without fragile CSS selectors.
|
|
23
|
+
2. **Scan Zero-Day Cyber Threats (`PhishVisionTool`):** Inspect unknown domains for crypto wallet-drainers and brand impersonation kits before interacting.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 📦 Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install langchain-opticparse
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 Usage with LangChain
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from langchain.agents import initialize_agent, AgentType
|
|
39
|
+
from langchain_openai import ChatOpenAI
|
|
40
|
+
from langchain_opticparse import OpticParseTool, PhishVisionTool
|
|
41
|
+
|
|
42
|
+
# Initialize tools
|
|
43
|
+
tools = [
|
|
44
|
+
OpticParseTool(),
|
|
45
|
+
PhishVisionTool()
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
llm = ChatOpenAI(model="gpt-4o")
|
|
49
|
+
|
|
50
|
+
# Create autonomous agent with vision scraping and threat intelligence
|
|
51
|
+
agent = initialize_agent(
|
|
52
|
+
tools,
|
|
53
|
+
llm,
|
|
54
|
+
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
|
|
55
|
+
verbose=True
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Example 1: Extract live product pricing
|
|
59
|
+
response = agent.run("Scrape the latest pricing and specs from https://news.ycombinator.com")
|
|
60
|
+
print(response)
|
|
61
|
+
|
|
62
|
+
# Example 2: Inspect a suspicious crypto airdrop URL before clicking
|
|
63
|
+
security_check = agent.run("Verify if this link is a crypto drainer: https://suspicious-airdrop.xyz")
|
|
64
|
+
print(security_check)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 👥 Usage with CrewAI
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from crewai import Agent, Task, Crew
|
|
73
|
+
from langchain_opticparse import OpticParseTool
|
|
74
|
+
|
|
75
|
+
vision_scraper = OpticParseTool()
|
|
76
|
+
|
|
77
|
+
market_researcher = Agent(
|
|
78
|
+
role='Senior Market Intelligence Analyst',
|
|
79
|
+
goal='Extract and synthesize competitor pricing deltas in real-time',
|
|
80
|
+
backstory='An expert automated web researcher powered by OpticParse Vision AI.',
|
|
81
|
+
tools=[vision_scraper],
|
|
82
|
+
verbose=True
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 📄 License
|
|
89
|
+
MIT © OpticParse Enterprise
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# 🦜️🔗 langchain-opticparse
|
|
2
|
+
|
|
3
|
+
Official **LangChain** and **CrewAI** ecosystem integration for **OpticParse** and **PhishVision**.
|
|
4
|
+
|
|
5
|
+
Enables AI agents to:
|
|
6
|
+
1. **Visually Scrape Live Webpages (`OpticParseTool`):** Extract clean, structured JSON using multimodal vision without fragile CSS selectors.
|
|
7
|
+
2. **Scan Zero-Day Cyber Threats (`PhishVisionTool`):** Inspect unknown domains for crypto wallet-drainers and brand impersonation kits before interacting.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 📦 Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install langchain-opticparse
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 🚀 Usage with LangChain
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from langchain.agents import initialize_agent, AgentType
|
|
23
|
+
from langchain_openai import ChatOpenAI
|
|
24
|
+
from langchain_opticparse import OpticParseTool, PhishVisionTool
|
|
25
|
+
|
|
26
|
+
# Initialize tools
|
|
27
|
+
tools = [
|
|
28
|
+
OpticParseTool(),
|
|
29
|
+
PhishVisionTool()
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
llm = ChatOpenAI(model="gpt-4o")
|
|
33
|
+
|
|
34
|
+
# Create autonomous agent with vision scraping and threat intelligence
|
|
35
|
+
agent = initialize_agent(
|
|
36
|
+
tools,
|
|
37
|
+
llm,
|
|
38
|
+
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
|
|
39
|
+
verbose=True
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Example 1: Extract live product pricing
|
|
43
|
+
response = agent.run("Scrape the latest pricing and specs from https://news.ycombinator.com")
|
|
44
|
+
print(response)
|
|
45
|
+
|
|
46
|
+
# Example 2: Inspect a suspicious crypto airdrop URL before clicking
|
|
47
|
+
security_check = agent.run("Verify if this link is a crypto drainer: https://suspicious-airdrop.xyz")
|
|
48
|
+
print(security_check)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 👥 Usage with CrewAI
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from crewai import Agent, Task, Crew
|
|
57
|
+
from langchain_opticparse import OpticParseTool
|
|
58
|
+
|
|
59
|
+
vision_scraper = OpticParseTool()
|
|
60
|
+
|
|
61
|
+
market_researcher = Agent(
|
|
62
|
+
role='Senior Market Intelligence Analyst',
|
|
63
|
+
goal='Extract and synthesize competitor pricing deltas in real-time',
|
|
64
|
+
backstory='An expert automated web researcher powered by OpticParse Vision AI.',
|
|
65
|
+
tools=[vision_scraper],
|
|
66
|
+
verbose=True
|
|
67
|
+
)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 📄 License
|
|
73
|
+
MIT © OpticParse Enterprise
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from typing import Optional, Type, Any, Dict
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
import os
|
|
4
|
+
import requests
|
|
5
|
+
|
|
6
|
+
class OpticParseInput(BaseModel):
|
|
7
|
+
url: str = Field(..., description="The live webpage URL to visually scrape and extract.")
|
|
8
|
+
query: str = Field(
|
|
9
|
+
default="Extract all main content, pricing, specifications, and structured data.",
|
|
10
|
+
description="Natural language instruction of what information to extract from the webpage."
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
class PhishVisionInput(BaseModel):
|
|
14
|
+
url: str = Field(..., description="The target domain or URL to inspect for zero-day phishing kits, brand impersonations, and crypto wallet drainers.")
|
|
15
|
+
|
|
16
|
+
class OpticParseTool:
|
|
17
|
+
"""
|
|
18
|
+
OpticParse Autonomous Multimodal Vision Web Scraper Tool for LangChain & CrewAI.
|
|
19
|
+
Visually parses live websites via Cloudflare Edge AI & Playwright without fragile CSS selectors.
|
|
20
|
+
"""
|
|
21
|
+
name: str = "opticparse_vision_scrape"
|
|
22
|
+
description: str = (
|
|
23
|
+
"A stealth multimodal visual web scraper. Use this tool when you need to extract structured data, "
|
|
24
|
+
"pricing, articles, or real-time information from any webpage without breaking on layout changes or anti-bot challenges."
|
|
25
|
+
)
|
|
26
|
+
args_schema: Type[BaseModel] = OpticParseInput
|
|
27
|
+
|
|
28
|
+
def __init__(self, api_key: Optional[str] = None, endpoint: Optional[str] = None):
|
|
29
|
+
self.api_key = api_key or os.getenv("OPTICPARSE_API_KEY", "op_live_langchain_agent")
|
|
30
|
+
self.endpoint = endpoint or os.getenv("OPTICPARSE_ENDPOINT", "https://opticparse-mcp-portal.parastejpal987.workers.dev")
|
|
31
|
+
|
|
32
|
+
def _run(self, url: str, query: str = "Extract structured data.") -> Dict[str, Any]:
|
|
33
|
+
target_endpoint = f"{self.endpoint}/mcp/tools/opticparse_extract"
|
|
34
|
+
headers = {
|
|
35
|
+
"Content-Type": "application/json",
|
|
36
|
+
"Authorization": f"Bearer {self.api_key}",
|
|
37
|
+
"User-Agent": "LangChain-OpticParse/1.0"
|
|
38
|
+
}
|
|
39
|
+
payload = {"url": url, "query": query}
|
|
40
|
+
try:
|
|
41
|
+
res = requests.post(target_endpoint, json=payload, headers=headers, timeout=30)
|
|
42
|
+
res.raise_for_status()
|
|
43
|
+
return res.json()
|
|
44
|
+
except Exception as e:
|
|
45
|
+
return {"status": "error", "message": f"OpticParse scrape failed: {str(e)}"}
|
|
46
|
+
|
|
47
|
+
async def _arun(self, url: str, query: str = "Extract structured data.") -> Dict[str, Any]:
|
|
48
|
+
return self._run(url=url, query=query)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class PhishVisionTool:
|
|
52
|
+
"""
|
|
53
|
+
PhishVision Zero-Day Cybersecurity & Crypto Drainer Scanner Tool for LangChain & CrewAI.
|
|
54
|
+
"""
|
|
55
|
+
name: str = "phishvision_threat_detect"
|
|
56
|
+
description: str = (
|
|
57
|
+
"A real-time zero-day cybersecurity threat scanner. Use this tool before visiting, clicking, or interacting "
|
|
58
|
+
"with unknown domains, Web3 crypto dApps, or suspicious links to detect wallet-drainers and credential harvesting kits."
|
|
59
|
+
)
|
|
60
|
+
args_schema: Type[BaseModel] = PhishVisionInput
|
|
61
|
+
|
|
62
|
+
def __init__(self, api_key: Optional[str] = None, endpoint: Optional[str] = None):
|
|
63
|
+
self.api_key = api_key or os.getenv("OPTICPARSE_API_KEY", "op_live_langchain_agent")
|
|
64
|
+
self.endpoint = endpoint or os.getenv("OPTICPARSE_ENDPOINT", "https://opticparse-mcp-portal.parastejpal987.workers.dev")
|
|
65
|
+
|
|
66
|
+
def _run(self, url: str) -> Dict[str, Any]:
|
|
67
|
+
target_endpoint = f"{self.endpoint}/phishvision/scan"
|
|
68
|
+
headers = {
|
|
69
|
+
"Content-Type": "application/json",
|
|
70
|
+
"Authorization": f"Bearer {self.api_key}",
|
|
71
|
+
"User-Agent": "LangChain-PhishVision/1.0"
|
|
72
|
+
}
|
|
73
|
+
payload = {"url": url}
|
|
74
|
+
try:
|
|
75
|
+
res = requests.post(target_endpoint, json=payload, headers=headers, timeout=15)
|
|
76
|
+
res.raise_for_status()
|
|
77
|
+
return res.json()
|
|
78
|
+
except Exception as e:
|
|
79
|
+
return {"status": "error", "message": f"PhishVision detection failed: {str(e)}"}
|
|
80
|
+
|
|
81
|
+
async def _arun(self, url: str) -> Dict[str, Any]:
|
|
82
|
+
return self._run(url=url)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: langchain-opticparse
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Official LangChain & CrewAI Integration for OpticParse Zero-CSS Multimodal Vision Web Scraping & PhishVision Threat Detection
|
|
5
|
+
Author-email: OpticParse Enterprise <support@opticparse.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://opticparse.com
|
|
8
|
+
Project-URL: Repository, https://github.com/parastejpal987-cmyk/opticparse-public
|
|
9
|
+
Keywords: langchain,crewai,web-scraping,vision-ai,phishing-detection,ai-agents
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: langchain-core>=0.1.0
|
|
14
|
+
Requires-Dist: pydantic>=2.0.0
|
|
15
|
+
Requires-Dist: requests>=2.28.0
|
|
16
|
+
|
|
17
|
+
# 🦜️🔗 langchain-opticparse
|
|
18
|
+
|
|
19
|
+
Official **LangChain** and **CrewAI** ecosystem integration for **OpticParse** and **PhishVision**.
|
|
20
|
+
|
|
21
|
+
Enables AI agents to:
|
|
22
|
+
1. **Visually Scrape Live Webpages (`OpticParseTool`):** Extract clean, structured JSON using multimodal vision without fragile CSS selectors.
|
|
23
|
+
2. **Scan Zero-Day Cyber Threats (`PhishVisionTool`):** Inspect unknown domains for crypto wallet-drainers and brand impersonation kits before interacting.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 📦 Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install langchain-opticparse
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🚀 Usage with LangChain
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
from langchain.agents import initialize_agent, AgentType
|
|
39
|
+
from langchain_openai import ChatOpenAI
|
|
40
|
+
from langchain_opticparse import OpticParseTool, PhishVisionTool
|
|
41
|
+
|
|
42
|
+
# Initialize tools
|
|
43
|
+
tools = [
|
|
44
|
+
OpticParseTool(),
|
|
45
|
+
PhishVisionTool()
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
llm = ChatOpenAI(model="gpt-4o")
|
|
49
|
+
|
|
50
|
+
# Create autonomous agent with vision scraping and threat intelligence
|
|
51
|
+
agent = initialize_agent(
|
|
52
|
+
tools,
|
|
53
|
+
llm,
|
|
54
|
+
agent=AgentType.STRUCTURED_CHAT_ZERO_SHOT_REACT_DESCRIPTION,
|
|
55
|
+
verbose=True
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Example 1: Extract live product pricing
|
|
59
|
+
response = agent.run("Scrape the latest pricing and specs from https://news.ycombinator.com")
|
|
60
|
+
print(response)
|
|
61
|
+
|
|
62
|
+
# Example 2: Inspect a suspicious crypto airdrop URL before clicking
|
|
63
|
+
security_check = agent.run("Verify if this link is a crypto drainer: https://suspicious-airdrop.xyz")
|
|
64
|
+
print(security_check)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 👥 Usage with CrewAI
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from crewai import Agent, Task, Crew
|
|
73
|
+
from langchain_opticparse import OpticParseTool
|
|
74
|
+
|
|
75
|
+
vision_scraper = OpticParseTool()
|
|
76
|
+
|
|
77
|
+
market_researcher = Agent(
|
|
78
|
+
role='Senior Market Intelligence Analyst',
|
|
79
|
+
goal='Extract and synthesize competitor pricing deltas in real-time',
|
|
80
|
+
backstory='An expert automated web researcher powered by OpticParse Vision AI.',
|
|
81
|
+
tools=[vision_scraper],
|
|
82
|
+
verbose=True
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 📄 License
|
|
89
|
+
MIT © OpticParse Enterprise
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
langchain_opticparse/__init__.py
|
|
4
|
+
langchain_opticparse.egg-info/PKG-INFO
|
|
5
|
+
langchain_opticparse.egg-info/SOURCES.txt
|
|
6
|
+
langchain_opticparse.egg-info/dependency_links.txt
|
|
7
|
+
langchain_opticparse.egg-info/requires.txt
|
|
8
|
+
langchain_opticparse.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
langchain_opticparse
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "langchain-opticparse"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Official LangChain & CrewAI Integration for OpticParse Zero-CSS Multimodal Vision Web Scraping & PhishVision Threat Detection"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [{ name = "OpticParse Enterprise", email = "support@opticparse.com" }]
|
|
11
|
+
license = "MIT"
|
|
12
|
+
keywords = ["langchain", "crewai", "web-scraping", "vision-ai", "phishing-detection", "ai-agents"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
]
|
|
17
|
+
dependencies = [
|
|
18
|
+
"langchain-core>=0.1.0",
|
|
19
|
+
"pydantic>=2.0.0",
|
|
20
|
+
"requests>=2.28.0",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://opticparse.com"
|
|
25
|
+
Repository = "https://github.com/parastejpal987-cmyk/opticparse-public"
|