1. 시작하기 전에
이 Codelab에서는 Gemini API의 함수 호출 및 멀티모달 기능을 사용하여 Google Workspace 작업을 자동화하는 방법을 알아봅니다.
기본 요건
- Apps Script, JavaScript 또는 유사한 프로그래밍 언어에 대한 기본적인 지식
학습 내용
- Gemini API의 함수 호출 및 멀티모달 기능을 활용하는 방법
- 여러 Gemini API 호출을 함께 연결하는 방법
- Gemini API로 Google Workspace 작업을 자동화하는 방법
필요한 항목
- 웹브라우저
- Gmail 계정 또는 Gemini API의 특정 설정을 구현한 Google Workspace 계정
- Gemini API의 지원되는 리전에서 연결
- 선택사항: 직접 API 요청을 테스트하는
curl프로그램이 있는 명령줄 인터페이스
이 Codelab의 전체 코드는 GitHub의 Gemini API Cookbook에서 확인할 수 있습니다. 완료된 코드가 필요한 경우 확인해 보세요.
2. Gemini API 설정
Gemini 정보
Gemini 모델은 Google의 가장 크고 강력한 AI 모델군입니다. 앱에서 이러한 모델을 활용하려면 Gemini API를 사용하면 됩니다. Google AI Studio에서도 Gemini API를 사용해 볼 수 있습니다. Google AI Studio는 코드를 작성하지 않고도 프롬프트를 시도하고, 모델 설정을 조정하고, 맞춤 모델을 미세 조정할 수 있는 API용 웹 인터페이스입니다.
키 가져오기
- Gemini API를 사용하려면 Google AI Studio에서 API 키를 생성하세요.
선택사항: 키 테스트
curl이 있는 명령줄에 액세스할 수 있는 경우 다음 블록의 첫 번째 줄에 키를 추가한 다음 터미널에서 실행하여 API 키를 테스트합니다.
export GOOGLE_API_KEY=Paste_your_API_key_here
curl "https://generativelanguage.googleapis.com/v1beta/models?key=${GOOGLE_API_KEY}"
models/gemini-1.0-pro와 같은 모델 목록이 JSON 형식으로 표시됩니다. 이는 작동했음을 의미합니다.
3. 선택사항: Gemini API에 요청하기
이 선택사항 단계에서는 콘텐츠 생성 방식을 더 잘 이해하기 위해 Gemini API에 요청을 보낸 후 Apps Script 앱에 추가합니다.
모델 정보
Gemini API는 기능과 제한사항이 다른 여러 모델을 제공합니다. 각 모델은 Gemini 모델 페이지에 기능과 함께 나열되어 있습니다.
첫 번째 요청하기
Gemini API가 텍스트 프롬프트를 완성하도록 하려면 JSON 요청을 빌드하여 REST API 엔드포인트로 전송합니다.
단계는 다음과 같습니다.
- 새 파일에 다음 JSON 요청을 입력합니다.
{
contents: [
{
parts: [
{ text: 'The most important aspects of a persuasive presentation are:' }
]
}
]
}
JSON 요청에는 The most important aspects of a persuasive presentation are: 프롬프트가 포함됩니다. 모델이 이 안내를 완료하고 결과를 직접 제공합니다.
JSON 요청에는 contents, generationConfig, safetySettings의 세 가지 최상위 필드가 있습니다. contents만 필요합니다. 나머지는 출력을 제어하는 메커니즘을 제공합니다.
- 이 JSON을
presentation.txt파일에 저장한 다음 다음과 같이curl에 직접 전달합니다.
curl -H 'Content-Type: application/json' -X POST -d @presentation.txt \
'https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro-latest:generateContent?key='${GOOGLE_API_KEY}
이 예에서는 URL에 다음 값을 설정합니다.
v1beta는 API 버전을 지정합니다.gemini-1.0-pro-latest는 Gemini 1.0 Pro를 모델로 지정하고 최신 스냅샷을 사용합니다.generateContent는 호출하는 API 메서드를 지정합니다.
다음과 비슷한 결과가 표시됩니다.
{
"candidates": [
{
"content": {
"parts": [
{
"text": "* **Credibility:** The audience must trust that you are an expert on the subject matter and that you have their best interests at heart.\n* **Clearness:** Your message must be easy to understand and follow. Avoid using jargon or technical terms that your audience may not be familiar with.\n* **Concreteness:** Use specific examples and data to support your arguments. Avoid making vague or general claims.\n* **Emotional appeal:** In addition to appealing to the audience's logical side, you should also try to connect with them on an emotional level. Use storytelling, humor, and personal anecdotes to make your points more memorable and engaging.\n* **Strong closing:** End your presentation with a strong call to action. Tell the audience what you want them to do and why it is important for them to do it."
}
],
"role": "model"
},
"finishReason": "STOP",
"index": 0,
"safetyRatings": [...]
}
],
"promptFeedback": {
"safetyRatings": [...]
}
}
가독성을 위해 터미널 출력을 일반 형식으로 표시합니다.
- 신뢰성: 시청자는 내가 주제에 대한 전문가이며 시청자를 최우선으로 생각한다고 믿어야 합니다.
- 명확성: 메시지는 이해하고 따르기 쉬워야 합니다. 잠재고객이 익숙하지 않을 수 있는 전문 용어나 기술 용어는 사용하지 마세요.
- 구체성: 구체적인 예와 데이터를 사용하여 주장을 뒷받침합니다. 모호하거나 일반적인 주장을 하지 마세요.
- 감성적 호소: 시청자의 논리적인 측면에 호소하는 것 외에도 감정적인 수준에서 시청자와 소통해야 합니다. 스토리텔링, 유머, 개인적인 일화를 사용하여 요점을 더 기억에 남고 흥미롭게 만드세요.
- 강력한 마무리: 강력한 클릭 유도 문구로 프레젠테이션을 마무리합니다. 청중에게 원하는 행동과 그 행동이 중요한 이유를 설명합니다.
generationConfig 및 safetySettings을 비롯한 다른 설정에 대해 자세히 알아보려면 프롬프트 및 안전 가이드를 참고하세요.
4. Apps Script에서 Gemini API 호출
- script.new를 방문하면
code.gsApps Script 파일이 자동으로 생성됩니다. code.gs파일 위로 커서를 가져간 다음
> 이름 바꾸기를 클릭합니다.- 파일 이름을
utils.gs로 변경합니다. - 파일에서
myFunction함수를 삭제하여 파일이 비어 있도록 합니다.
프로젝트에 API 키 추가
- 탐색 메뉴에서 프로젝트 설정을 선택합니다.
- 스크립트 속성에서 스크립트 속성 추가를 클릭합니다.
- 속성에
GOOGLE_API_KEY를 입력합니다. - 값에 Google AI Studio의 API 키를 입력합니다.

- 스크립트 속성 저장을 클릭합니다.
- 편집기로 다시 이동합니다.
Gemini API 코드 추가
utils.gs 파일에서 다음 단계를 따르세요.
API 키와 엔드포인트를 설정합니다.
const properties = PropertiesService.getScriptProperties().getProperties();
const geminiApiKey = properties['GOOGLE_API_KEY'];
const geminiEndpoint = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro-latest:generateContent?key=${geminiApiKey}`;
- 특정 프롬프트로 Gemini API를 호출하는 다음 함수를 추가합니다.
function callGemini(prompt, temperature=0) {
const payload = {
"contents": [
{
"parts": [
{
"text": prompt
},
]
}
],
"generationConfig": {
"temperature": temperature,
},
};
const options = {
'method' : 'post',
'contentType': 'application/json',
'payload': JSON.stringify(payload)
};
const response = UrlFetchApp.fetch(geminiEndpoint, options);
const data = JSON.parse(response);
const content = data["candidates"][0]["content"]["parts"][0]["text"];
return content;
}
- 프롬프트를 설정하는 다음 함수를 추가합니다.
function testGemini() {
const prompt = "The best thing since sliced bread is";
const output = callGemini(prompt);
console.log(prompt, output);
}
테스트
저장을 클릭합니다.- 함수 드롭다운 목록에서
testGemini을 선택하고
을 클릭합니다. - 필요한 권한을 수락합니다. 코드가 실행되고 실행 로그에 결과가 포함된 콘솔 출력이 표시됩니다.

문이 열렸어!
5. 이미지로 Gemini API 호출
Gemini 모델 제품군의 가장 강력한 기능 중 하나는 멀티모달 입력을 지원한다는 것입니다. 즉, 텍스트뿐만 아니라 다양한 입력을 제공할 수 있습니다. 이 섹션에서는 이미지를 사용하여 Gemini API를 호출하는 함수를 추가합니다.
- 기존
const geminiEndpoint선언 후utils.gs파일 상단에 다음 줄을 추가합니다.
const geminiProVisionEndpoint = `https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro-vision-latest:generateContent?key=${geminiApiKey}`;
Gemini Vision 코드 추가
utils.gs파일에 함수를 추가하여 새로 추가된 엔드포인트를 호출합니다.
function callGeminiProVision(prompt, image, temperature=0) {
const imageData = Utilities.base64Encode(image.getAs('image/png').getBytes());
const payload = {
"contents": [
{
"parts": [
{
"text": prompt
},
{
"inlineData": {
"mimeType": "image/png",
"data": imageData
}
}
]
}
],
"generationConfig": {
"temperature": temperature,
},
};
const options = {
'method' : 'post',
'contentType': 'application/json',
'payload': JSON.stringify(payload)
};
const response = UrlFetchApp.fetch(geminiProVisionEndpoint, options);
const data = JSON.parse(response);
const content = data["candidates"][0]["content"]["parts"][0]["text"];
return content;
}
- 다음 테스트 함수를 추가합니다.
function testGeminiVision() {
const prompt = "Provide a fun fact about this object.";
const image = UrlFetchApp.fetch('https://storage.googleapis.com/generativeai-downloads/images/instrument.jpg').getBlob();
const output = callGeminiProVision(prompt, image);
console.log(prompt, output);
}
이 함수는 인터넷에서 테스트 이미지를 로드하여 정의한 함수에 전달합니다. 나중에 스프레드시트의 차트를 사용하도록 연결하므로 이는 테스트일 뿐입니다.
테스트
testGeminiVision함수를 저장하고 실행한 다음 출력을 검사합니다.

6. 도구를 사용하여 Gemini API 호출
텍스트와 이미지 외에도 프롬프트에서 도구에 대한 액세스 권한을 제공할 수 있습니다.
도구 처리 코드 추가
- 도구 사양을 허용하는 함수를
utils.gs파일에 추가합니다.
function callGeminiWithTools(prompt, tools, temperature=0) {
const payload = {
"contents": [
{
"parts": [
{
"text": prompt
},
]
}
],
"tools" : tools,
"generationConfig": {
"temperature": temperature,
},
};
const options = {
'method' : 'post',
'contentType': 'application/json',
'payload': JSON.stringify(payload)
};
const response = UrlFetchApp.fetch(geminiEndpoint, options);
const data = JSON.parse(response);
const content = data["candidates"][0]["content"]["parts"][0]["functionCall"];
return content;
}
이 스키마와 사용 가능한 필드에 대한 자세한 내용은 FunctionDeclaration API 참조를 확인하세요.
테스트
- 모델이 현재 날짜와 시간을 찾는 데 사용할 수 있는 도구를 정의합니다.
function testGeminiTools() {
const prompt = "Tell me how many days there are left in this month.";
const tools = {
"function_declarations": [
{
"name": "datetime",
"description": "Returns the current date and time as a formatted string.",
"parameters": {
"type": "string"
}
}
]
};
const output = callGeminiWithTools(prompt, tools);
console.log(prompt, output);
}
여기에서 사용되는 형식은 FunctionDeclaration 스키마입니다. 실제로 날짜-시간 함수를 호출하지는 않습니다. 모델이 함수 호출을 요청했다는 표시만 표시됩니다. 함수 호출은 이후 단계에서 처리합니다.
testGeminiTools함수를 저장하고 실행하여 출력을 확인합니다.

7. Google Workspace와의 데모 통합 개요
함수 호출의 작동 방식을 이해했으므로 Gemini 모델의 기능을 다른 서비스로 쉽게 확장할 수 있습니다. 다음 몇 섹션에서는 Google Drive, Google Slides, Google Sheets와 같은 Google Workspace 제품에 대한 통합을 빌드합니다. 다음은 간단한 다이어그램입니다.

간단히 말해 사용자의 질문이 들어오면 Gemini API의 함수 호출을 사용하여 사용할 도구를 결정합니다. 다음 작업을 수행할 수 있는 세 가지 도구를 빌드합니다.
- 회의를 설정합니다. 다이어그램의
setupMeeting()함수는 Gemini 1.0 Pro API를 호출하여 Google Drive의 블로그를 요약하고 Google Calendar에서 새로 만든 회의에 요약을 추가합니다. - 차트의 통계를 기반으로 이메일 초안 작성 다이어그램의
draftEmail()함수는 Gemini 1.0 Pro Vision을 호출하여 Google Sheets의 차트를 분석하고 분석을 기반으로 Gmail에서 이메일을 작성합니다. - 기본 슬라이드 자료 만들기 다이어그램의
createDeck()함수는 Gemini 1.0 Pro를 호출하여 Google Slides의 슬라이드에 대한 글머리 기호를 브레인스토밍합니다.
각 도구에 대해 다음 세 가지 작업을 수행해야 합니다.
- Gemini API의 함수 호출 응답이
if...else블록에서 특정 도구를 호출하도록 요청하는지 확인합니다. - 도구 기능을 구현하는 실제 함수를 추가합니다.
- Gemini 모델이 도구의 존재를 알고 올바른 함수 호출 응답을 반환할 수 있도록 Gemini API로 도구를 선언합니다.
8. Apps Script로 회의 설정하기
먼저 Google Calendar에서 회의 설정을 자동화하지만 Google Drive의 파일 요약인 설명을 추가합니다.
단계는 다음과 같습니다.
- Gemini 1.5 Pro 출시 블로그의 텍스트 사본인 이 텍스트 파일을 다운로드합니다.
- Google Drive의 루트 폴더에 파일을 업로드합니다.
- 편집기에서
main.gs파일을 만든 후 다음 코드를 추가합니다.
function main() {
const userQuery = "Set up a meeting at 10AM tomorrow with Helen to discuss the news in the Gemini-blog.txt file.";
var tool_use = callGeminiWithTools(userQuery, WORKSPACE_TOOLS);
Logger.log(tool_use);
if(tool_use['name'] == "setupMeeting") {
setupMeeting(tool_use['args']['time'], tool_use['args']['recipient'], tool_use['args']['filename']);
Logger.log("Your meeting has been set up.");
}
else
Logger.log("no proper tool found");
}
여기서는 Gemini API의 함수 호출 기능을 호출합니다. 다음으로 도구 함수를 정의해야 합니다.
- 편집기 왼쪽의 서비스 옆에 있는 + 서비스 추가 > Google Calendar API > 추가를 클릭합니다. 이렇게 하면 나중에 일부 고급 API를 사용하는 데 필요한 고급 Google Calendar 서비스가 사용 설정됩니다.

utils.gs파일에서 다음 코드를 추가합니다.
function attachFileToMeeting(event, file, fileName) {
// Get the iCal ID for the event.
const iCalEventId = event.getId();
// Log the ID and title for debugging.
console.log(`iCal event ID: ${iCalEventId}`);
console.log(`event Title: ${event.getTitle()}`);
// Set up the options for listing the event with the advanced Google Calendar service.
const options = {
iCalUID: iCalEventId,
};
// Use the primary calendar as the calendar ID to list events.
const calendarId = 'primary';
// Use the advanced Google Calendar service to list the event.
const calEvents = Calendar.Events.list(calendarId, options);
// Get the Calendar ID used by the advanced Google Calendar service.
const eventId = calEvents.items[0].id;
// Get the file URL for the attachment.
const fileUrl = file.getUrl();
// Set up the patch options to add the file.
var patch = {
attachments: [{
'fileUrl': fileUrl,
'title': fileName
}]
};
// Patch the event to add the file as an attachment.
Calendar.Events.patch(patch, 'primary', eventId, {"supportsAttachments": true});
}
function setupMeeting(time, recipient, filename) {
const files = DriveApp.getFilesByName(filename);
const file = files.next();
const blogContent = file.getAs("text/*").getDataAsString();
var geminiOutput = callGemini("Give me a really short title of this blog and a summary with less than three sentences. Please return the result as a JSON with two fields: title and summary. \n" + blogContent);
// The Gemini model likes to enclose the JSON with ```json and ```
geminiOutput = JSON.parse(geminiOutput.replace(/```(?:json|)/g, ""));
const title = geminiOutput['title'];
const fileSummary = geminiOutput['summary'];
const event = CalendarApp.getDefaultCalendar().createEventFromDescription(`meet ${recipient} at ${time} to discuss "${title}"`);
event.setDescription(fileSummary);
attachFileToMeeting(event, file, filename);
}
이 코드는 다음 작업을 실행합니다.
setupMeeting()함수는 Google Drive를 통해Gemini-blog.txt파일을 찾습니다. 이 파일 이름은 3단계에서 Gemini API의 함수 호출에 의해 자동으로 반환됩니다.setupMeeting()함수는 Gemini API를 호출하여 파일의 콘텐츠를 요약하고, 자유 형식 설명을 사용하여 CalendarApp으로 회의를 설정하고, 요약을 회의에 추가합니다.setupMeeting()함수는attachFileToMeeting()함수를 호출하여 고급 Google Calendar 서비스를 사용하여 블로그 파일을 회의에 첨부합니다.
utils.gs파일 상단에 다음 코드를 추가합니다.
const WORKSPACE_TOOLS = {
"function_declarations": [
{
"name": "setupMeeting",
"description": "Sets up a meeting in Google Calendar.",
"parameters": {
"type": "object",
"properties": {
"time": {
"type": "string",
"description": "The time of the meeting."
},
"recipient": {
"type": "string",
"description": "The name of the recipient."
},
"filename": {
"type": "string",
"description": "The name of the file."
},
},
"required": [
"time",
"recipient",
"filename"
]
}
},
// You add tools here.
]
};
- 편집기에서
main.gs파일로 돌아가
을 클릭합니다. - Google Workspace에서 스크립트를 실행할 권한을 요청하면 확인을 클릭합니다.
몇 초 후 실행 로그에 회의가 설정되었음을 알리는 메시지가 표시됩니다.
- Google Calendar에서 요약과 첨부파일이 있는 회의를 찾습니다.

9. Apps Script로 이메일 초안 작성하기
다음으로 Gmail에서 이메일 초안 작성을 자동화합니다. 다음과 같은 시나리오를 가정해 보겠습니다. Google Sheets에서 데이터 분석을 수행한다고 가정해 보겠습니다. 모든 숫자를 적절한 위치에 배치하고 차트를 만듭니다. Gemini Pro Vision API를 사용하여 차트를 기반으로 이메일을 작성하려고 합니다.
단계는 다음과 같습니다.
- 이 시트를 열고 파일 -> 사본 만들기를 클릭합니다.
- 문서 복사 대화상자의 이름 텍스트 상자에서 기본 이름
Copy of CollegeExpenses을CollegeExpenses로 바꿉니다. main.gs파일에서 이전 사용자 쿼리를 새 쿼리로 바꾼 다음if...else문에 다음 코드를 추가합니다.
function main() {
// const userQuery = "Set up a meeting at 5PM with Helen to discuss the news in the Gemini-1.5-blog.txt file.";
const userQuery = "Draft an email for Mary with insights from the chart in the CollegeExpenses sheet.";
if(...) {...}
// Add this code
else if(tool_use['name'] == "draftEmail") {
draftEmail(tool_use['args']['sheet_name'], tool_use['args']['recipient']);
Logger.log("Check your Gmail to review the draft");
}
else {...}
}
utils.gs파일에서 다음 코드를 추가합니다.
function draftEmail(sheet_name, recipient) {
const prompt = `Compose the email body for ${recipient} with your insights for this chart. Use information in this chart only and do not do historical comparisons. Be concise.`;
var files = DriveApp.getFilesByName(sheet_name);
var sheet = SpreadsheetApp.openById(files.next().getId()).getSheetByName("Sheet1");
var expenseChart = sheet.getCharts()[0];
var chartFile = DriveApp.createFile(expenseChart.getBlob().setName("ExpenseChart.png"));
var emailBody = callGeminiProVision(prompt, expenseChart);
GmailApp.createDraft(recipient+"@demo-email-provider.com", "College expenses", emailBody, {
attachments: [chartFile.getAs(MimeType.PNG)],
name: 'myname'
});
}
이 함수는 시트에서 대학 비용 차트를 가져와 Gemini Pro Vision에 전송하여 이메일 초안을 작성합니다. Gemini Pro Vision이 차트에서 정보를 추출하고 사용자를 대신하여 이메일 본문을 작성합니다.
utils.gs파일에서You add tools here주석 뒤의WORKSPACE_TOOLS객체에 다음 코드를 추가합니다.
WORKSPACE_TOOLS = {
"function_declarations": [
// You add tools here.
{
"name": "draftEmail",
"description": "Write an email by analyzing data or charts in a Google Sheets file.",
"parameters": {
"type": "object",
"properties": {
"sheet_name": {
"type": "string",
"description": "The name of the sheet to analyze."
},
"recipient": {
"type": "string",
"description": "The name of the recipient."
},
},
"required": [
"sheet_name",
"recipient"
]
}
},
]
};
- 편집기에서
main.gs파일로 다시 이동한 다음
을 클릭합니다. - 10~20초 후 Gmail을 엽니다. 다음과 같은 이메일 초안이 표시됩니다.
이메일 초안을 수정하고 전송할 수 있습니다. 이메일은 짧은 프롬프트와 차트를 제공하면 Gemini Pro Vision이 완전히 작성합니다.
10. Apps Script로 스켈레톤 슬라이드 만들기
다음으로 Apps Script를 사용하여 Google Slides에서 스켈레톤 자료의 생성을 자동화합니다.
단계는 다음과 같습니다.
main.gs파일에서 이전 사용자 쿼리를 새 쿼리로 바꾸고if...else문에 다음 코드를 추가합니다.
function main() {
// const userQuery = "Draft an email for Mary with insights from the chart in the CollegeExpenses sheet.";
const userQuery = "Help me put together a deck about water conservation.";
if(...) {...}
// Add this code
else if(tool_use['name'] == 'createDeck') {
deckURL = createDeck(tool_use['args']['topic']);
Logger.log("Deck URL: " + deckURL);
}
else {...}
}
utils.gs파일에서 다음 코드를 추가합니다.
function createDeck(topic) {
const prompt = `I'm preparing a ${NUM_SLIDES}-slide deck to discuss ${topic}. Please help me brainstorm and generate main bullet points for each slide. Keep the title of each slide short. Please produce the result as a valid JSON so that I can pass it to other APIs.`;
var geminiOutput = callGemini(prompt, 0.4);
// The Gemini model likes to enclose the JSON with ```json and ```
geminiOutput = geminiOutput.replace(/```(?:json|)/g, "");
const bulletPoints = JSON.parse(geminiOutput);
// Create a Google Slides presentation.
const presentation = SlidesApp.create("My New Presentation");
// Set up the opening slide.
var slide = presentation.getSlides()[0];
var shapes = slide.getShapes();
shapes[0].getText().setText(topic);
var body;
for (var i = 0; i < NUM_SLIDES; i++) {
slide = presentation.appendSlide(SlidesApp.PredefinedLayout.TITLE_AND_BODY);
shapes = slide.getShapes();
// Set title.
shapes[0].getText().setText(bulletPoints['slides'][i]['title']);
// Set body.
body = "";
for (var j = 0; j < bulletPoints['slides'][i]['bullets'].length; j++) {
body += '* ' + bulletPoints['slides'][i]['bullets'][j] + '\n';
}
shapes[1].getText().setText(body);
}
return presentation.getUrl();
}
이 함수는 Gemini API를 호출하여 특정 주제에 대해 브레인스토밍하고,
JSON을 가져온 다음 Apps Script를 사용하여 스켈레톤 슬라이드를 채웁니다.
utils.gs파일에서You add tools here주석 뒤의WORKSPACE_TOOLS객체에 다음 코드를 추가합니다.
WORKSPACE_TOOLS = {
"function_declarations": [
// You add tools here.
{
"name": "createDeck",
"description": "Build a simple presentation deck with Google Slides and return the URL.",
"parameters": {
"type": "object",
"properties": {
"topic": {
"type": "string",
"description": "The topic that the presentation is about."
},
},
"required": [
"topic"
]
}
},
]
};
utils.gs파일 상단에서 다음 상수를 정의합니다.
const NUM_SLIDES = 3;
시작 슬라이드 외에 Gemini 모델이 만드는 슬라이드 수입니다.
- 편집기에서
main.gs파일로 다시 이동한 다음
을 클릭합니다. 몇 초 후 실행 로그에 프레젠테이션 URL이 표시됩니다. - 브라우저를 사용하여 URL을 엽니다. 글머리 기호로 채워진 스켈레톤 데크가 표시됩니다.

11. 살펴볼 만한 아이디어
이 세 가지 통합 외에도 다음 아이디어를 살펴볼 수 있습니다.
- Google Chat에서 챗봇 빌드하기 대규모 언어 모델 (LLM)의 가장 인기 있는 사용 사례 중 하나는 챗봇을 구축하는 것입니다. Gemini API를 사용하면 Google Chat용 챗봇을 쉽게 빌드할 수 있습니다. 자세한 내용은 Google Chat API 및 Codelab Gemini로 Google Chat용 앱 빌드를 참고하세요.
- Google Drive 또는 Keep의 자체 데이터를 사용한 검색 증강 생성 (RAG) 이 Codelab에서는 요약에 하나의 텍스트 파일만 사용합니다. 하지만 개인 Google Drive 및 Keep(예: 메모, PDF, 이미지)의 콘텐츠를 Gemini API, 벡터 데이터베이스, 선택적으로 오케스트레이션 도구(예: LangChain)와 함께 사용하여 RAG를 실행하고 데이터에 따라 모델의 대답을 맞춤설정할 수도 있습니다.
- Gemini API의 멀티턴 함수 호출 기능 사용 Gemini API의 함수 호출은 한 번의 턴으로 제한되지 않으며, 더 복잡한 작업을 위해 멀티턴 함수 호출을 사용할 수 있습니다.
- Google Workspace 그 이상 이제 Gemini API를 Google Workspace와 통합하는 방법을 이해했으므로 Google Workspace를 넘어 전 세계의 다른 API를 활용할 수 있습니다.
12. 축하합니다
Gemini API의 멀티모달 기능과 함수 호출에 대해 알아봤습니다. Apps Script를 사용하여 일부 Google Workspace 작업을 자동화하는 데 사용되었습니다.