Skip to content

Refactor email agent, add more tools, cleanup code#14

Merged
gautamp8 merged 1 commit intomasterfrom
email-agent-refactor
May 23, 2025
Merged

Refactor email agent, add more tools, cleanup code#14
gautamp8 merged 1 commit intomasterfrom
email-agent-refactor

Conversation

@gautamp8
Copy link
Collaborator

This PR adds new tools like Wikipedia api, refactor and improve existing ones(search tools with fallback). It cleans up the code in email agent initialisation. Reduces logging verbosity.

@satwikkansal satwikkansal requested a review from Copilot May 19, 2025 11:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors the email agent initialization to use a unified fallback search tool, adds Wikipedia search support, reduces logging verbosity, and cleans up related tooling code.

  • Adds a new SearchWithFallbackTool and removes the old FallbackWebSearchTool.
  • Introduces Wikipedia API dependency and tool.
  • Encapsulates search and research tool setup into helper methods and converts many info logs to debug.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Added wikipedia-api dependency.
mxtoai/tools/search_with_fallback_tool.py New generic fallback search tool combining multiple engines.
mxtoai/tools/fallback_search_tool.py Removed deprecated fallback search implementation.
mxtoai/tools/init.py Replaced export of old tool with SearchWithFallbackTool.
mxtoai/routed_litellm_model.py Cleaned up comments and streamlined logging.
mxtoai/agents/email_agent.py Refactored tool initialization into _initialize_* helpers, added Wikipedia and web search tools, and reduced log verbosity.
Comments suppressed due to low confidence (2)

mxtoai/tools/search_with_fallback_tool.py:14

  • The tool name web_search duplicates the name used by individual WebSearchTool instances, which may confuse consumers. Consider renaming this to search_with_fallback or similar to differentiate it.
name = "web_search"  # Consistent name for the agent to use

mxtoai/tools/search_with_fallback_tool.py:8

  • The new SearchWithFallbackTool class lacks accompanying unit tests. Consider adding tests for success and failure scenarios of both primary and fallback search engines.
class SearchWithFallbackTool(Tool):

@gautamp8 gautamp8 force-pushed the email-agent-refactor branch from 452c3c1 to f7e6f6a Compare May 21, 2025 10:54
@gautamp8 gautamp8 force-pushed the email-agent-refactor branch from 95a7700 to 94bd6c9 Compare May 23, 2025 03:51
@gautamp8 gautamp8 merged commit 282ee48 into master May 23, 2025
1 of 2 checks passed
@BhaveshKukreja29 BhaveshKukreja29 deleted the email-agent-refactor branch January 12, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants