ozellik: google oauth, gmail-drive araclari ve admin durum kartlarini ekle

This commit is contained in:
2026-03-22 18:50:06 +03:00
parent 177fd8e1a7
commit ad847b1cf4
20 changed files with 970 additions and 14 deletions

View File

@@ -4,11 +4,14 @@ from sqlalchemy.orm import Session
from app.config import get_settings
from app.db import SecretORM
from app.google.auth import GoogleAuthManager
from app.models import RuntimeSettings
from app.tools.apple_notes import AppleNotesTool
from app.tools.browser_use import BrowserUseTool
from app.tools.brave_search import BraveSearchTool
from app.tools.files import FilesTool
from app.tools.gmail import GmailTool
from app.tools.google_drive import GoogleDriveTool
from app.tools.second_brain import SecondBrainTool
from app.tools.terminal import TerminalTool
from app.tools.web_fetch import WebFetchTool
@@ -18,6 +21,7 @@ def build_tools(runtime: RuntimeSettings, workspace_root: Path, session: Session
enabled = {tool.name for tool in runtime.tools if tool.enabled}
tools: dict[str, object] = {}
settings = get_settings()
google_auth = GoogleAuthManager(settings, Path(__file__).resolve().parents[2])
if "files" in enabled:
tools["files"] = FilesTool(workspace_root)
@@ -39,6 +43,10 @@ def build_tools(runtime: RuntimeSettings, workspace_root: Path, session: Session
workspace_slug=runtime.anythingllm_workspace_slug,
api_key=api_key,
)
if "gmail" in enabled:
tools["gmail"] = GmailTool(google_auth)
if "google_drive" in enabled:
tools["google_drive"] = GoogleDriveTool(google_auth)
if "web_fetch" in enabled:
tools["web_fetch"] = WebFetchTool()
if "terminal" in enabled: