Source code for langchain_community.agent_toolkits.office365.toolkit

from __future__ import annotations

from typing import TYPE_CHECKING, List

from langchain_core.pydantic_v1 import Field
from import BaseToolkit

from import BaseTool
from import (
from import O365SearchEvents
from import O365SearchEmails
from import O365SendEvent
from import O365SendMessage
from import authenticate

    from O365 import Account

[docs]class O365Toolkit(BaseToolkit): """Toolkit for interacting with Office 365. *Security Note*: This toolkit contains tools that can read and modify the state of a service; e.g., by reading, creating, updating, deleting data associated with this service. For example, this toolkit can be used search through emails and events, send messages and event invites, and create draft messages. Please make sure that the permissions given by this toolkit are appropriate for your use case. See for more information. """ account: Account = Field(default_factory=authenticate) class Config: """Pydantic config.""" arbitrary_types_allowed = True
[docs] def get_tools(self) -> List[BaseTool]: """Get the tools in the toolkit.""" return [ O365SearchEvents(), O365CreateDraftMessage(), O365SearchEmails(), O365SendEvent(), O365SendMessage(), ]