CyberMax-tools commited on
Commit
9496ea8
·
verified ·
1 Parent(s): fc6ef92

CyberMax email_validate tool for smolagents

Browse files
Files changed (5) hide show
  1. README.md +16 -5
  2. app.py +5 -0
  3. index.html +11 -19
  4. requirements.txt +2 -0
  5. tool.py +18 -0
README.md CHANGED
@@ -1,10 +1,21 @@
1
  ---
2
- title: Email Validate Tool
3
- emoji: 🏃
4
- colorFrom: red
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
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
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
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. &#x27;ana@example.com,bob@gmial.com&#x27;</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>&copy; 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