Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersDiscordFacebook MessengerGMailiMessageFine-Tuning on LangSmith Chat DatasetsFine-Tuning on LangSmith LLM RunsSlacktelegramTwitter (via Apify)WeChatWhatsAppComponentsChat loadersGMailGMailThis loader goes over how to load data from GMail. There are many ways you could want to load data from GMail. This loader is currently fairly opinionated in how to do so. The way it does it is it first looks for all messages that you have sent. It then looks for messages where you are responding to a previous email. It then fetches that previous email, and creates a training example of that email, followed by your email.Note that there are clear limitations here. For example, all examples created are only looking at the previous email for context.To use:Set up a Google Developer Account: Go to the Google Developer Console, create a project, and enable the Gmail API for that project. This will give you a credentials.json file that you'll need later.Install the Google Client Library: Run the following command to install the Google Client Library:pip install --upgrade google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-clientimport os.pathimport base64import jsonimport reimport timefrom google.auth.transport.requests import Requestfrom google.oauth2.credentials import Credentialsfrom google_auth_oauthlib.flow import InstalledAppFlowfrom googleapiclient.discovery import buildimport loggingimport requestsSCOPES = ['https://www.googleapis.com/auth/gmail.readonly']creds = None# The file token.json stores the user's access and refresh tokens, and is# created automatically when the authorization flow completes for the first# time.if
This loader goes over how to load data from GMail. There are many ways you could want to load data from GMail. This loader is currently fairly opinionated in how to do so. The way it does it is it first looks for all messages that you have sent. It then looks for messages where you are responding to a previous email. It then fetches that previous email, and creates a training example of that email, followed by your email.
This loader goes over how to load data from GMail. There are many ways you could want to load data from GMail. This loader is currently fairly opinionated in how to do so. The way it does it is it first looks for all messages that you have sent. It then looks for messages where you are responding to a previous email. It then fetches that previous email, and creates a training example of that email, followed by your email. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersDiscordFacebook MessengerGMailiMessageFine-Tuning on LangSmith Chat DatasetsFine-Tuning on LangSmith LLM RunsSlacktelegramTwitter (via Apify)WeChatWhatsAppComponentsChat loadersGMailGMailThis loader goes over how to load data from GMail. There are many ways you could want to load data from GMail. This loader is currently fairly opinionated in how to do so. The way it does it is it first looks for all messages that you have sent. It then looks for messages where you are responding to a previous email. It then fetches that previous email, and creates a training example of that email, followed by your email.Note that there are clear limitations here. For example, all examples created are only looking at the previous email for context.To use:Set up a Google Developer Account: Go to the Google Developer Console, create a project, and enable the Gmail API for that project. This will give you a credentials.json file that you'll need later.Install the Google Client Library: Run the following command to install the Google Client Library:pip install --upgrade google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-clientimport os.pathimport base64import jsonimport reimport timefrom google.auth.transport.requests import Requestfrom google.oauth2.credentials import Credentialsfrom google_auth_oauthlib.flow import InstalledAppFlowfrom googleapiclient.discovery import buildimport loggingimport requestsSCOPES = ['https://www.googleapis.com/auth/gmail.readonly']creds = None# The file token.json stores the user's access and refresh tokens, and is# created automatically when the authorization flow completes for the first# time.if