CyberMax email_validate tool for smolagents
Browse files- README.md +16 -5
- app.py +5 -0
- index.html +11 -19
- requirements.txt +2 -0
- tool.py +18 -0
README.md
CHANGED
|
@@ -1,10 +1,21 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: email_validate
|
| 3 |
+
emoji: 🛠️
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- smolagents
|
| 10 |
+
- tool
|
| 11 |
+
short_description: Mailvett by CyberMax
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# email_validate
|
| 15 |
+
|
| 16 |
+
Mailvett by CyberMax: validate up to 10 email addresses (syntax, MX, disposable/role/free-provider flags, SPF/DMARC, typo suggestion) and get a deliverable/risky/undeliverable verdict with a score. Free tier, no key; paid keys at https://mailvett.cybermax-tools.workers.dev/docs
|
| 17 |
+
|
| 18 |
+
```python
|
| 19 |
+
from smolagents import load_tool
|
| 20 |
+
tool = load_tool("CyberMax-tools/email-validate-tool", trust_remote_code=True)
|
| 21 |
+
```
|
app.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from smolagents import launch_gradio_demo
|
| 2 |
+
from tool import EmailValidateTool
|
| 3 |
+
|
| 4 |
+
tool = EmailValidateTool()
|
| 5 |
+
launch_gradio_demo(tool)
|
index.html
CHANGED
|
@@ -1,19 +1,11 @@
|
|
| 1 |
-
<!doctype html>
|
| 2 |
-
<
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
<p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
|
| 13 |
-
<p>
|
| 14 |
-
Also don't forget to check the
|
| 15 |
-
<a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
|
| 16 |
-
</p>
|
| 17 |
-
</div>
|
| 18 |
-
</body>
|
| 19 |
-
</html>
|
|
|
|
| 1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
| 2 |
+
<title>email_validate: smolagents tool by CyberMax</title><meta name="description" content="Mailvett by CyberMax: validate up to 10 email addresses (syntax, MX, disposable/role/free-provider flags, SPF/DMARC, typo suggestion) and get a deliverable/risky/undeliverable verdict with a score. Free tier, no key; paid keys at https://mailvett.cybermax-tools.workers.dev/docs">
|
| 3 |
+
<style>body{font:16px/1.5 system-ui,sans-serif;max-width:760px;margin:0 auto;padding:24px 16px;background:#fff;color:#11141B}
|
| 4 |
+
code,pre{background:#F2F1EC;border-radius:6px}pre{padding:12px;overflow:auto}@media (prefers-color-scheme:dark){body{background:#1A1E27;color:#EDEAE3}code,pre{background:#2A303C}}</style></head>
|
| 5 |
+
<body><h1><code>email_validate</code></h1><p>Mailvett by CyberMax: validate up to 10 email addresses (syntax, MX, disposable/role/free-provider flags, SPF/DMARC, typo suggestion) and get a deliverable/risky/undeliverable verdict with a score. Free tier, no key; paid keys at https://mailvett.cybermax-tools.workers.dev/docs</p><h2>Inputs</h2><ul><li><code>emails</code> (string): Comma-separated email addresses, e.g. 'ana@example.com,bob@gmial.com'</li></ul>
|
| 6 |
+
<h2>Use it in a smolagents agent</h2><pre>from smolagents import load_tool, CodeAgent, InferenceClientModel
|
| 7 |
+
tool = load_tool("CyberMax-tools/email-validate-tool", trust_remote_code=True)
|
| 8 |
+
agent = CodeAgent(tools=[tool], model=InferenceClientModel())</pre>
|
| 9 |
+
<p>Code: <a href="https://huggingface.co/spaces/CyberMax-tools/email-validate-tool/blob/main/tool.py">tool.py</a>. Free tier, no key. More CyberMax APIs:
|
| 10 |
+
<a href="https://cybermax.cybermax-tools.workers.dev/apis/?utm_source=hf-smolagents">cybermax.cybermax-tools.workers.dev/apis</a>.</p>
|
| 11 |
+
<p>© 2026 CyberMax</p></body></html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
requests
|
| 2 |
+
smolagents
|
tool.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, Optional
|
| 2 |
+
from smolagents.tools import Tool
|
| 3 |
+
import requests
|
| 4 |
+
|
| 5 |
+
class EmailValidateTool(Tool):
|
| 6 |
+
name = "email_validate"
|
| 7 |
+
description = "Mailvett by CyberMax: validate up to 10 email addresses (syntax, MX, disposable/role/free-provider flags, SPF/DMARC, typo suggestion) and get a deliverable/risky/undeliverable verdict with a score. Free tier, no key; paid keys at https://mailvett.cybermax-tools.workers.dev/docs"
|
| 8 |
+
inputs = {'emails': {'type': 'string', 'description': "Comma-separated email addresses, e.g. 'ana@example.com,bob@gmial.com'"}}
|
| 9 |
+
output_type = "object"
|
| 10 |
+
|
| 11 |
+
def forward(self, emails: str):
|
| 12 |
+
import requests
|
| 13 |
+
r = requests.get("https://mailvett.cybermax-tools.workers.dev/api/validate",
|
| 14 |
+
params={"email": emails, "suggestTypos": "true", "via": "smolagents"}, timeout=30)
|
| 15 |
+
return r.json()
|
| 16 |
+
|
| 17 |
+
def __init__(self, *args, **kwargs):
|
| 18 |
+
self.is_initialized = False
|