diff --git a/navi/config.py b/navi/config.py index a114e2e..5931772 100644 --- a/navi/config.py +++ b/navi/config.py @@ -50,6 +50,10 @@ # Change if the server is behind a reverse proxy or runs on a different port. public_url: str = "http://localhost:8000" + # Gmail IMAP/SMTP (App Password auth) + gmail_address: str = "" + gmail_app_password: str = "" + # LLM call timeouts # complete() is non-streaming (planning, compression) — blocked until full response llm_complete_timeout: int = 120 diff --git a/tools/gmail.py b/tools/gmail.py index 7574cc1..f299f52 100644 --- a/tools/gmail.py +++ b/tools/gmail.py @@ -4,13 +4,13 @@ import imaplib import re import smtplib -import os from email import message_from_bytes from email.header import decode_header as _decode_hdr from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import html2text as _html2text +from navi.config import settings name = "gmail" description = ( @@ -78,8 +78,8 @@ # ─── Credentials ─────────────────────────────────────────────────────────── def _creds() -> tuple[str, str]: - addr = os.environ.get("GMAIL_ADDRESS", "") - pwd = os.environ.get("GMAIL_APP_PASSWORD", "") + addr = settings.gmail_address + pwd = settings.gmail_app_password if not addr or not pwd: raise RuntimeError( "Gmail not configured. Add to .env:\n"