From 2a7871ad8ea260983ca1c8e35535aeaba82cba80 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Tue, 15 Apr 2025 09:29:26 -0700 Subject: [PATCH] update to use requirements --- open-webui-send-email.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/open-webui-send-email.py b/open-webui-send-email.py index 3e3bcdc..07f5c7b 100644 --- a/open-webui-send-email.py +++ b/open-webui-send-email.py @@ -1,29 +1,16 @@ """ title: Send Email author: Josh Knapp -version: 0.4.0 -description="Send email via SMTP to user specificed address" +version: 0.7.0 +description: "Send email via SMTP to user specificed address" +requirements: smtplib, email """ import subprocess, sys from pydantic import BaseModel, Field - - -# Try to import required packages, install if not present -try: - import smtplib - from email.mime.text import MIMEText - from email.mime.multipart import MIMEMultipart -except ImportError: - print("Packages not found. Attempting to install...") - try: - subprocess.check_call([sys.executable, "-m", "pip", "install", "smtplib"]) - subprocess.check_call([sys.executable, "-m", "pip", "install", "email"]) - - print("Packages installed successfully") - except subprocess.CalledProcessError as e: - print(f"Failed to install packages: {str(e)}") - +import smtplib +from email.mime.text import MIMEText +from email.mime.multipart import MIMEMultipart class Tools: class Valves(BaseModel):