Skip to content
Using Gemini as a c...
 
Notifications
Clear all

Using Gemini as a chat model to read Gmail but not getting results

14 Posts
4 Users
0 Reactions
5 Views
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

Instead, the output from the chat model is “I AM SORRY, I DO NOT HAVE THE CAPABILITY TO ACCESS YOUR EMAILS. I NEED MORE INFORMATION TO COMPLETE YOUR REQUEST.” or something similar. The Gmail node appears to be connected (although I was only given the “Sign in With Google” option, so no Client ID or Client Secret windows were made available for credentials) and I’m using Gemini 1.5 flash latest. Thanks in advance for your help. I’m very new at this.

 
Posted : 18/05/2025 4:15 am
star_corp_30
(@star_corp_30)
Posts: 5
Active Member
 

Gemini (or any chat model) does not automatically access your Gmail data, even if you have authenticated the Gmail API. Here's what's happening:

  1. "Sign in with Google" only authorizes the Gmail node, not the chat model.
  2. Gemini needs to be supplied with the actual email content as input – it doesn't retrieve it on its own.
  3. The response "I'm sorry, I don't have the capability..." indicates that Gemini was not provided with sufficient context.
 
Posted : 18/05/2025 10:19 am
star_corp_30
(@star_corp_30)
Posts: 5
Active Member
 

You'll need to manually input email content from Gmail into the Gemini model.

1- Utilize the Gmail Node to retrieve unread emails or list messages (e.g., Get Messages).
2- Format the Email Content, converting it into a string.
3- Pass the formatted string as a prompt to Gemini 1.5 Flash, instructing it on the desired action (such as summarizing, extracting dates, or replying).

 
Posted : 18/05/2025 10:21 am
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

Thank you for taking the time to review my question and provide a response. I've included some screenshots of my workflow; please let me know if there's a more efficient way to share this information.

I was following a tutorial video, with the only difference being that I am using Gemini as the model instead of Anthropic.

The video does not cover formatting email content, converting to a string, or similar steps. Am I missing some crucial stages in my workflow?

 
Posted : 18/05/2025 6:15 pm
star_corp_30
(@star_corp_30)
Posts: 5
Active Member
 

When testing the workflow, does the Gmail Get All Messages node successfully retrieve your emails?

 
Posted : 19/05/2025 7:15 pm
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

It says “Workflow executed successfully.”

 
Posted : 19/05/2025 9:23 pm
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

I've switched the Gemini Chat model for the OpenAI Chat model (as recommended in the video), and it's now functioning correctly. I'm uncertain why one works while the other doesn't, but I suspect Gemini might not possess the same email reading capabilities as OpenAI. Thanks again for your input.

 
Posted : 19/05/2025 10:42 pm
cute_cute
(@cute_cute)
Posts: 8
Active Member
 
  1. Utilize a Gmail node to retrieve email content initially.
    Confirm that you are employing a Gmail > Read Email (or comparable) node prior to the Gemini node, and configure it to fetch the message body intended for analysis.

  2. Input the email data into the Gemini prompt.
    Within the Gemini node, refer to the content from the Gmail node in your prompt as follows:
    Here’s an email I received: {{$json["body"]}}
    Could you please provide a summary?

 
Posted : 20/05/2025 8:12 am
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

Apologies, but I don't quite grasp your instructions. From what I can see, there isn't a prompt window within the Gemini node in callin.io.

Could you please clarify your request?

 
Posted : 20/05/2025 10:54 pm
Grot
 Grot
(@grot)
Posts: 13
Active Member
 

Hi, I think I can assist.

Could you please share your workflow? Here's a guide.

n8n attach workflow

 
Posted : 23/05/2025 7:54 pm
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

Hi Grot, this is the workflow that isn't functioning:

When I substitute the Google Gemini Chat node with the OpenAI Chat node, it functions correctly when I instruct the agent to retrieve information about unread emails, for instance.

 
Posted : 24/05/2025 8:59 pm
Grot
 Grot
(@grot)
Posts: 13
Active Member
 

Ah, I understand. The issue might stem from Gemini 1.5 being a less capable model. The LLM is responsible for invoking the tool usage.

You can enhance this by adding instructions to your system prompt or user message to always call the tool, which I'd suggest doing.

Additionally, consider switching the model to this one: models/gemini-2.5-flash-preview-04-17. It performs significantly better.

 
Posted : 24/05/2025 10:51 pm
frednitwo
(@frednitwo)
Posts: 7
Active Member
Topic starter
 

Thanks! Switching to Gemini-2.5 resolved the issue. While it's not performing as well as OpenAI, I can now retrieve emails.

 
Posted : 25/05/2025 8:49 pm
Grot
 Grot
(@grot)
Posts: 13
Active Member
 

Glad to hear it.

Also, I recommend reviewing this function calling benchmark. Currently, the OpenAI models lead the list.

Regards

 
Posted : 25/05/2025 9:11 pm
Share: