Refactor email agent, add more tools, cleanup code#14
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
SearchWithFallbackTooland removes the oldFallbackWebSearchTool. - 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_searchduplicates the name used by individual WebSearchTool instances, which may confuse consumers. Consider renaming this tosearch_with_fallbackor similar to differentiate it.
name = "web_search" # Consistent name for the agent to use
mxtoai/tools/search_with_fallback_tool.py:8
- The new
SearchWithFallbackToolclass lacks accompanying unit tests. Consider adding tests for success and failure scenarios of both primary and fallback search engines.
class SearchWithFallbackTool(Tool):
452c3c1 to
f7e6f6a
Compare
95a7700 to
94bd6c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.