arcade-mcp/toolkits/google/arcade_google/tools/constants.py
Renato Byrro 75da4bf8b0
Make search_contacts interface more LLM-friendly (#272)
Break down `search_contacts` into `search_contacts_by_name` and
`search_contacts_by_email`. The search_contacts' `query` argument was
not clear enough for LLMs.
2025-02-28 16:47:03 -03:00

21 lines
878 B
Python

import os
from arcade_google.tools.models import GmailReplyToWhom
# The default reply in Gmail is to only the sender. Since Gmail also offers the possibility of
# changing the default to 'reply to all', we support both options through an env variable.
# https://support.google.com/mail/answer/6585?hl=en&sjid=15399867888091633568-SA#null
try:
GMAIL_DEFAULT_REPLY_TO = GmailReplyToWhom(
# Values accepted are defined in the arcade_google.tools.models.GmailReplyToWhom Enum
os.getenv("ARCADE_GMAIL_DEFAULT_REPLY_TO", GmailReplyToWhom.ONLY_THE_SENDER.value).lower()
)
except ValueError as e:
raise ValueError(
"Invalid value for ARCADE_GMAIL_DEFAULT_REPLY_TO: "
f"'{os.getenv('ARCADE_GMAIL_DEFAULT_REPLY_TO')}'. Expected one of "
f"{list(GmailReplyToWhom.__members__.keys())}"
) from e
DEFAULT_SEARCH_CONTACTS_LIMIT = 30