Free Gemini Integration in Google Sheets
Are you eager to integrate sophisticated AI capabilities into your Google Sheets? You might be wondering if Google's Gemini can be used within your spreadsheets, and whether there's a free way to do so. In this guide, we'll explore the free alternatives to using Gemini in Google Sheets and discuss how to leverage these options to enhance your workflow.
Before delving into the free methods, let's clarify that Google's Gemini is a large language model developed by Google Research. As of now, Gemini is not directly integrated into Google Sheets or any other Google Workspace applications. However, there are alternative AI models that you can use within Google Sheets to perform various tasks like data analysis, text generation, and more.
Leveraging Google Apps Script
Google Apps Script is a JavaScript-based scripting language built into the Google Workspace ecosystem. It allows you to automate tasks, connect different Google services, and even integrate external APIs. To use AI models like Gemini, you can create custom functions using Google Apps Script that make API calls to services offering similar functionalities.
Here's how you can create a custom function to fetch chat responses using a third-party API like Hugging Face's model hub, which hosts open-source AI models similar to Gemini:
Setting up a custom function with Google Apps Script
1. In your Google Sheets document, click on Extensions in the menu, then Apps Script.
2. Delete any existing code in the Code.gs file, and paste the following function:
function GeminiChat zwوعي(recipient, message) {
const options = {
'method': 'post',
'contentType': 'application/json',
'payload': JSON.stringify({
"inputs": {
"prompt": `Chat with Gemini: ${message}`
}
})
};
const response = UrlFetchApp.fetch('https://api-inference.huggingface.co/models/bigscience/bloom', options);
const json = JSON.parse(response.getContentText());
return json.answer;
}
3. Save the file with a new name, e.g., GeminiChat, by clicking the floppy disk icon or pressing Ctrl+S.
Using the custom function in Google Sheets
4. In your Google Sheets document, enter the following formula in any cell: =GeminiChat("Your question"). Replace "Your question" with the text you want to use as input for the AI model.
5. Press Enter or Return, and the function will retrieve the AI-generated response from the Hugging Face API and display it in the cell.
Using.,_addIns_
In addition to Google Apps Script, you can also leverage available add-ons (also referred to as add-ins) in the Google Workspace Marketplace to integrate AI functionalities into your Google Sheets. Some add-ons provide AI chat functionalities similar to Gemini, allowing you to interact with AI models directly within your spreadsheets.
To explore these add-ons:
- Click on Extensions in the menu, then Add-ons, and finally Get Add-ons.
- Browse or search for add-ons offering AI chat functionalities, like "Chat Bot for Google Sheets" or "AI Chatbot by Intried.
- Once you've found an add-on you like, click + FREE or Install to add it to your Google Sheets.
- After installation, review the add-on's documentation to learn how to use its AI chat features within your spreadsheets.
As Google Gemini is not yet directly integrated into Google Sheets, leveraging free alternatives like Google Apps Script and add-ons can help you harness AI chat functionalities within your spreadsheets. Keep an eye on Google Workspace updates for official Gemini integration in the future. Happy exploring!