Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VITE_BASE_URL=/api

VITE_PROXY_URL=https://dev.eigent.ai
# VITE_PROXY_URL=https://dev.eigent.ai

VITE_USE_LOCAL_PROXY=false
# VITE_USE_LOCAL_PROXY=false

# VITE_PROXY_URL=http://localhost:3001
# VITE_USE_LOCAL_PROXY=true
VITE_PROXY_URL=http://localhost:3001
VITE_USE_LOCAL_PROXY=true
33 changes: 31 additions & 2 deletions backend/app/controller/tool_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from loguru import logger
from app.utils.toolkit.notion_mcp_toolkit import NotionMCPToolkit
from app.utils.toolkit.google_calendar_toolkit import GoogleCalendarToolkit

from app.utils.toolkit.google_gmail_native_toolkit import GoogleGmailNativeToolkit

router = APIRouter(tags=["task"])

Expand Down Expand Up @@ -80,10 +80,32 @@ async def install_tool(tool: str):
status_code=500,
detail=f"Failed to install {tool}: {str(e)}"
)
elif tool == "gmail":
try:
# Use a dummy task_id for installation, as this is just for pre-authentication
toolkit = GoogleGmailNativeToolkit("install_auth")

# Get available tools to verify connection
tools = [tool_func.func.__name__ for tool_func in toolkit.get_tools()]
logger.info(f"Successfully pre-instantiated {tool} toolkit with {len(tools)} tools")

return {
"success": True,
"tools": tools,
"message": f"Successfully installed {tool} toolkit",
"count": len(tools),
"toolkit_name": "GoogleGmailNativeToolkit"
}
except Exception as e:
logger.error(f"Failed to install {tool} toolkit: {e}")
raise HTTPException(
status_code=500,
detail=f"Failed to install {tool}: {str(e)}"
)
else:
raise HTTPException(
status_code=404,
detail=f"Tool '{tool}' not found. Available tools: ['notion', 'google_calendar']"
detail=f"Tool '{tool}' not found. Available tools: ['notion', 'google_calendar', 'gmail']"
)


Expand All @@ -110,6 +132,13 @@ async def list_available_tools():
"description": "Google Calendar integration for managing events and schedules",
"toolkit_class": "GoogleCalendarToolkit",
"requires_auth": True
},
{
"name": "gmail",
"display_name": "Gmail",
"description": "Gmail integration for sending, reading, and managing emails",
"toolkit_class": "GoogleGmailNativeToolkit",
"requires_auth": True
}
]
}
8 changes: 4 additions & 4 deletions backend/app/utils/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from app.utils.toolkit.file_write_toolkit import FileToolkit
from app.utils.toolkit.google_calendar_toolkit import GoogleCalendarToolkit
from app.utils.toolkit.google_drive_mcp_toolkit import GoogleDriveMCPToolkit
from app.utils.toolkit.google_gmail_mcp_toolkit import GoogleGmailMCPToolkit
from app.utils.toolkit.google_gmail_native_toolkit import GoogleGmailNativeToolkit
from app.utils.toolkit.human_toolkit import HumanToolkit
from app.utils.toolkit.markitdown_toolkit import MarkItDownToolkit
from app.utils.toolkit.mcp_search_toolkit import McpSearchToolkit
Expand Down Expand Up @@ -1262,7 +1262,7 @@ async def social_medium_agent(options: Chat):
*RedditToolkit.get_can_use_tools(options.task_id),
*await NotionMCPToolkit.get_can_use_tools(options.task_id),
# *SlackToolkit.get_can_use_tools(options.task_id),
*await GoogleGmailMCPToolkit.get_can_use_tools(options.task_id, options.get_bun_env()),
*GoogleGmailNativeToolkit.get_can_use_tools(options.task_id),
*GoogleCalendarToolkit.get_can_use_tools(options.task_id),
*HumanToolkit.get_can_use_tools(options.task_id, Agents.social_medium_agent),
*TerminalToolkit(options.task_id, agent_name=Agents.social_medium_agent, clone_current_env=False).get_tools(),
Expand Down Expand Up @@ -1357,7 +1357,7 @@ async def social_medium_agent(options: Chat):
LinkedInToolkit.toolkit_name(),
RedditToolkit.toolkit_name(),
NotionMCPToolkit.toolkit_name(),
GoogleGmailMCPToolkit.toolkit_name(),
GoogleGmailNativeToolkit.toolkit_name(),
GoogleCalendarToolkit.toolkit_name(),
HumanToolkit.toolkit_name(),
TerminalToolkit.toolkit_name(),
Expand Down Expand Up @@ -1437,7 +1437,7 @@ async def get_toolkits(tools: list[str], agent_name: str, api_task_id: str):
"github_toolkit": GithubToolkit,
"google_calendar_toolkit": GoogleCalendarToolkit,
"google_drive_mcp_toolkit": GoogleDriveMCPToolkit,
"google_gmail_mcp_toolkit": GoogleGmailMCPToolkit,
"google_gmail_native_toolkit": GoogleGmailNativeToolkit,
"image_analysis_toolkit": ImageAnalysisToolkit,
"linkedin_toolkit": LinkedInToolkit,
"mcp_search_toolkit": McpSearchToolkit,
Expand Down
12 changes: 12 additions & 0 deletions backend/app/utils/toolkit/google_gmail_mcp_toolkit.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
DEPRECATED: This MCP-based Gmail toolkit is no longer used.
Use GoogleGmailNativeToolkit instead for Gmail integration.

This file is kept for reference only and is not imported anywhere in the codebase.
"""

from camel.toolkits import BaseToolkit, FunctionTool, MCPToolkit
from app.component.environment import env, env_or_fail
from app.component.command import bun
Expand All @@ -6,6 +13,11 @@


class GoogleGmailMCPToolkit(BaseToolkit, AbstractToolkit):
"""
DEPRECATED: Use GoogleGmailNativeToolkit instead.

This MCP-based implementation is no longer integrated into the agent system.
"""
agent_name: str = Agents.social_medium_agent

def __init__(
Expand Down
Loading