-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: gmail_toolkit integration fixes issue #3189 #3205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
I still need to include the gmail keys to env variables file |
@Wendong-Fan, should be ready for review only a couple of things to note
|
@Wendong-Fan I have integrated a clean OAUTH authentication mechanism and made some fixes according to your IMAP review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @waleedalzarooni ! left some comments below
# Add camel to path - find the camel package directory | ||
current_file = Path(__file__).resolve() | ||
camel_root = current_file.parent.parent.parent | ||
sys.path.insert(0, str(camel_root)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this
from camel.agents import ChatAgent # noqa: E402 | ||
from camel.models import ModelFactory # noqa: E402 | ||
from camel.toolkits import GmailToolkit # noqa: E402 | ||
from camel.types import ModelPlatformType # noqa: E402 | ||
from camel.types.enums import ModelType # noqa: E402 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need # noqa: E402
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the functionality it works, but seems now we require both GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET and OAuth, do all those necessary?
return header['value'] | ||
return "" | ||
|
||
def _extract_message_body(self, message: Dict[str, Any]) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems this function cannot handle nested multipart message structures, only single-level multipart messages?
"googlemaps>=4.10.0,<5", | ||
"requests_oauthlib>=1.3.1,<2", | ||
"google-api-python-client==2.166.0", | ||
"google-auth>=2.0.0,<3.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need to add this dependency to [all]
if TYPE_CHECKING: | ||
from googleapiclient.discovery import Resource | ||
else: | ||
Resource = Any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where did Resource
used?
bcc (Optional[Union[str, List[str]]]): BCC recipient email | ||
address(es). | ||
attachments (Optional[List[str]]): List of file paths to attach. | ||
is_html (bool): Whether the body is HTML format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we add more description for this argument? how and when would this be used, same for other functions
query (str): Gmail search query string. | ||
max_results (int): Maximum number of emails to fetch. | ||
include_spam_trash (bool): Whether to include spam and trash. | ||
label_ids (Optional[List[str]]): List of label IDs to filter by. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what kind of label would be used here? I think we need more description to make it clear
Description
Integrated Gmail_toolkit with with requested tools
Checklist
Go over all the following points, and put an
x
in all the boxes that apply.Fixes #issue-number
in the PR description (required)pyproject.toml
anduv lock
If you are unsure about any of these, don't hesitate to ask. We are here to help!