{"id":8679,"date":"2023-12-25T23:49:31","date_gmt":"2023-12-25T14:49:31","guid":{"rendered":"https:\/\/auto-worker.com\/blog\/?p=8679"},"modified":"2023-12-26T03:14:31","modified_gmt":"2023-12-25T18:14:31","slug":"post-8679","status":"publish","type":"post","link":"https:\/\/auto-worker.com\/blog\/?p=8679","title":{"rendered":"GAS\u3067Gemini API\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\uff01\u4f1a\u8a71\u5c65\u6b74\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u3082\u3010\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u4ed8\u304d\u3011"},"content":{"rendered":"\n<p>2023\u5e7412\u67086\u65e5\u306bGoogle\u306e\u6b21\u4e16\u4ee3AI\u30e2\u30c7\u30eb\u3067\u3042\u308bGemini\u304c\u767a\u8868\u3055\u308c\u305f1\u9031\u9593\u5f8c\u3001Gemini API\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>Google AI Studio\u3067Gemini Pro\u30e2\u30c7\u30eb\u3092API\u7d4c\u7531\u3067\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067Google Apps Script(GAS)\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Gemini Pro\u3078\u306e\u5358\u4f53\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u52a0\u3048\u3001\u904e\u53bb\u306e\u3084\u308a\u53d6\u308a\u3082\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u542b\u3081\u305f\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u3092\u51fa\u529b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u4ed8\u304d\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gemini Pro\u306eAPI\u304c12\/13\u63d0\u4f9b\u958b\u59cb<\/h2>\n\n\n\n<p>Google\u306f12\u670813\u65e5\u306b\u6b21\u4e16\u4ee3AI\u30e2\u30c7\u30eb\u3067\u3042\u308bGemini\u306eAPI\u63d0\u4f9b\u3092\u958b\u59cb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>Google\u304cGemini\u3092\u767a\u8868\u3057\u305f\u5f53\u521d\u306f\u3001\u5bfe\u8a71AI\u3067\u3042\u308bBard\u3067\u3057\u304bGemini\u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001Google AI Studio\u3067Gemini API\u3092\u516c\u958b\u3057\u3001Gemini\u306e3\u3064\u306e\u30e2\u30c7\u30eb\u306e\u3046\u3061\u3001\u4e2d\u7d1a\u30e2\u30c7\u30eb\u306eGemini Pro\u304cAPI\u7d4c\u7531\u3067\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>OpenAI\u306eChatGPT\u3084GPT-4\u306b\u5339\u6575\u3059\u308b\u751f\u6210AI\u3067\u3042\u308bGemini\u3092API\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>Gemini API\u304c\u516c\u958b\u3055\u308c\u305f\u3053\u3068\u3067Gemini\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ea\u3084\u30c1\u30e3\u30c3\u30c8\u30dc\u30c3\u30c8\u306a\u3069\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u958b\u767a\u3057\u305f\u308a\u3001\u81ea\u5206\u306e\u30a2\u30d7\u30ea\u306bGemini\u3092\u7d44\u307f\u8fbc\u3080\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Gemini API\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306bGAS\u306e\u89e3\u8aac\u306a\u3057\u2026<\/h2>\n\n\n\n<p><a href=\"https:\/\/makersuite.google.com\/\" target=\"_blank\" rel=\"noopener\">Google AI Studio\u306eGemini API\u306e\u30da\u30fc\u30b8<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001Gemini API\u306e\u30b9\u30bf\u30fc\u30c8\u30ac\u30a4\u30c9\u306e\u30ea\u30f3\u30af\u304c\u7528\u610f\u3055\u308c\u3001Gemini API\u306e\u4f7f\u3044\u65b9\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"408\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008.jpg\" alt=\"Gemini API\u306e\u30b9\u30bf\u30fc\u30c8\u30ac\u30a4\u30c9\u306b\u306fGoogle Apps Script(GAS)\u3067\u306e\u5229\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u304c\u306a\u3044\" class=\"wp-image-8687\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008-768x392.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008-530x270.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008-565x288.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008-710x362.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_008-725x370.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u305f\u3060\u3001Gemini API\u306e\u30b9\u30bf\u30fc\u30c8\u30ac\u30a4\u30c9\u306b\u306f\u3001Python\u3084Go\u3001Node.js\u306a\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u306e\u5229\u7528\u65b9\u6cd5\u306e\u307f\u3067\u3059\u3002<\/p>\n\n\n\n<p>Google Apps Script(GAS)\u306eGemini API\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u65b9\u6cd5\u306f\u89e3\u8aac\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>REST API\u306e\u89e3\u8aac\u30da\u30fc\u30b8\u3092\u8aad\u3093\u3067\u89e3\u91c8\u3059\u308c\u3070\u3001GAS\u306e\u5b9f\u884c\u65b9\u6cd5\u306f\u5206\u304b\u308b\u3082\u306e\u306e\u3001Google\u304c\u63d0\u4f9b\u3059\u308b\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u89e3\u8aac\u3057\u3066\u307b\u3057\u3044\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001GAS\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001AutoWorker\u3067\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u305aGemini API\u306eAPI\u30ad\u30fc\u3092\u7528\u610f<\/h2>\n\n\n\n<p>Google Apps Script(GAS)\u3067Gemini API\u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u307e\u305aAPI\u30ad\u30fc\u3092\u7528\u610f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203bAutoWorker\u306e\u8a18\u4e8b\u3067API\u30ad\u30fc\u306e\u767a\u884c\u30fb\u53d6\u5f97\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-autoworker-google-apps-script-gas-sikuli wp-block-embed-autoworker-google-apps-script-gas-sikuli\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"IczvsxawC9\"><a href=\"https:\/\/auto-worker.com\/blog\/?p=8667\">Gemini\u306eAPI\u30ad\u30fc\u306e\u767a\u884c\u65b9\u6cd5\u3092\u89e3\u8aac\uff01API\u30ad\u30fc\u306e\u518d\u53d6\u5f97\u30fb\u524a\u9664\u624b\u9806\u3082\u7d39\u4ecb<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Gemini\u306eAPI\u30ad\u30fc\u306e\u767a\u884c\u65b9\u6cd5\u3092\u89e3\u8aac\uff01API\u30ad\u30fc\u306e\u518d\u53d6\u5f97\u30fb\u524a\u9664\u624b\u9806\u3082\u7d39\u4ecb&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=8667&#038;embed=true#?secret=HKQMQETsED#?secret=IczvsxawC9\" data-secret=\"IczvsxawC9\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><a href=\"https:\/\/makersuite.google.com\/app\/apikey\" target=\"_blank\" rel=\"noopener\">Google AI Studio\u306eGemini API\u306e\u30da\u30fc\u30b8\u306b\u3042\u308b\u300cGet API Key\u300d<\/a>\u304b\u3089API\u30ad\u30fc\u3092\u767a\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"404\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005.jpg\" alt=\"Gemini API\u306eGet API Key\u306e\u30da\u30fc\u30b8\u3067API\u30ad\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001API\u30ad\u30fc\u304c\u8868\u793a\u3055\u308c\u3066Copy\u30dc\u30bf\u30f3\u3067API\u30ad\u30fc\u3092\u53d6\u5f97\" class=\"wp-image-8672\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005-300x152.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005-768x388.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005-530x268.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005-565x285.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005-710x359.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231224_auto_005-725x366.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>Gemini API\u306e\u30ad\u30fc\u3092\u767a\u884c\u3057\u305f\u3089Copy\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u3001\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc\u3057\u3066API\u30ad\u30fc\u3092\u53d6\u5f97\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">GAS\u3067Gemini API\u3092\u5b9f\u884c\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h2>\n\n\n\n<p>Gemini API\u306eAPI\u30ad\u30fc\u3092\u7528\u610f\u3067\u304d\u305f\u3089\u3001Google Apps Script(GAS)\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067GAS\u3067Gemini API\u3092\u5b9f\u884c\u3059\u308b\u65b9\u6cd5\u3092\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4ea4\u3048\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Gemini API\u306e\u30ad\u30fc\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u4e8b\u524d\u8a2d\u5b9a<\/h3>\n\n\n\n<p>\u307e\u305a\u4e8b\u524d\u6e96\u5099\u3068\u3057\u3066\u3001\u7528\u610f\u3057\u305fGemini API\u306e\u30ad\u30fc\u3092GAS\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203b\u30b3\u30fc\u30c9\u306b\u76f4\u66f8\u304d\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001API\u30ad\u30fc\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u683c\u7d0d\u3059\u308b\u306e\u304c\u5b89\u5168\u3067\u3059\u3002<\/p>\n\n\n\n<p>\uff11\uff0e\u65b0\u3057\u3044GAS\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u958b\u3044\u305f\u3089\u3001\u5de6\u30e1\u30cb\u30e5\u30fc\u306b\u3042\u308b\u300c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u5b9a\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"417\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001.jpg\" alt=\"Gemini API\u306eAPI\u30ad\u30fc\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30bb\u30c3\u30c8\u3059\u308b\u305f\u3081\u3001Google Apps Script(GAS)\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u5b9a\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\" class=\"wp-image-8680\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001-300x156.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001-768x400.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001-530x276.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001-565x295.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001-710x370.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_001-725x378.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\uff12\uff0e\u30b9\u30af\u30ed\u30fc\u30eb\u3059\u308b\u3068\u8868\u793a\u3055\u308c\u308b\u300c\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u8ffd\u52a0\u300d\u3092\u62bc\u4e0b\u3057\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\uff1aAPIKEY\u3001\u5024\uff1a\u7528\u610f\u3057\u305fAPI\u30ad\u30fc\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3001\u4fdd\u5b58\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"420\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002.jpg\" alt=\"Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u304d\u308b\u3088\u3046\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u8ffd\u52a0\u3067API\u30ad\u30fc\u3092\u5024\u306b\u30bb\u30c3\u30c8\u3057\u3066\u4fdd\u5b58\" class=\"wp-image-8681\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002-300x158.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002-768x403.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002-530x278.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002-565x297.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002-710x373.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_002-725x381.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Gemini API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308bGAS\u30b3\u30fc\u30c9<\/h3>\n\n\n\n<p>API\u30ad\u30fc\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30bb\u30c3\u30c8\u3057\u305f\u3089\u3001\u4e0b\u8a18\u306eGemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3066GAS\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u306b\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-javascript\"><code class=\"language-javascript\">function getGeminiApi(prompt = '\u3042\u306a\u305f\u304c\u3067\u304d\u308b\u3053\u3068\u306f\u4f55\u3067\u3059\u304b\uff1f') {\n  \/\/\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u304b\u3089API\u30ad\u30fc\u3092\u53d6\u5f97\n  const apiKey = PropertiesService.getScriptProperties().getProperty('APIKEY');\n  \/\/Gemini\u306eAPI\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8URL\u3092\u8a2d\u5b9a\n  const apiUrl = `https:\/\/generativelanguage.googleapis.com\/v1beta\/models\/gemini-pro:generateContent?key=${apiKey}`;\n  \/\/\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u52a0\u3048\u3001Gemini API\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5fc5\u8981\u306a\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u8a2d\u5b9a\n  const payload = {\n    \"contents\": [\n      {\"role\": \"user\",\"parts\": { \"text\": prompt }}\n    ],\n  };\n  \/\/payload\u3084HTTP\u901a\u4fe1\u7a2e\u5225\u3001\u8a8d\u8a3c\u60c5\u5831\u3092option\u3067\u8a2d\u5b9a\n  const options = {\n    'payload': JSON.stringify(payload),\n    'method' : 'POST',\n    'muteHttpExceptions': true,\n    'contentType':'application\/json'\n  };\n  \/\/Gemini API\u306bAPI\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308a\u3001\u7d50\u679c\u3092\u5909\u6570\u306b\u683c\u7d0d\n  const response = JSON.parse(UrlFetchApp.fetch(apiUrl, options).getContentText()); \n  console.log(response.candidates[0].content.parts[0].text); \n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"420\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003.jpg\" alt=\"Google Apps Script(GAS)\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066Gemini Pro\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u9001\u3063\u3066\u5fdc\u7b54\u3092\u30ed\u30b0\u51fa\u529b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\" class=\"wp-image-8682\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003-300x158.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003-768x403.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003-530x278.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003-565x297.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003-710x373.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_003-725x381.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>1\u884c\u76ee\u306bGemini Pro\u306bAPI\u7d4c\u7531\u3067\u9001\u4fe1\u3059\u308b\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3055\u304d\u307b\u3069\u4e8b\u524d\u8a2d\u5b9a\u3057\u305fAPI\u30ad\u30fc\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u304b\u3089\u547c\u3073\u51fa\u3057\u3001Gemini API\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306b\u30d5\u30a7\u30c3\u30c1\u3057\u3001\u5fdc\u7b54\u7d50\u679c\u3092\u5b9f\u884c\u30ed\u30b0\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u306a\u304a\u3001Gemini API\u304b\u3089\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u306f\u5165\u529b\u30c8\u30fc\u30af\u30f3\u6570\u3084\u51fa\u529b\u30c8\u30fc\u30af\u30f3\u6570\u306a\u3069\u8272\u3005\u306a\u60c5\u5831\u304cJSON\u5f62\u5f0f\u3067\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u306e\u4e2d\u304b\u3089Gemini Pro\u306e\u5fdc\u7b54\u6587\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u306e\u304c21\u884c\u76ee\u3067\u6307\u5b9a\u3057\u305f\u8981\u7d20\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u300cgetGeminiAPI\u300d\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5b9f\u884c\u30ed\u30b0\u306b\u5fdc\u7b54\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"406\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004.jpg\" alt=\"Google Apps Script(GAS)\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066Gemini Pro\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u9001\u3063\u3066\u5fdc\u7b54\u3092\u30ed\u30b0\u51fa\u529b\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u5b9f\u884c\u7d50\u679c\" class=\"wp-image-8683\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004-300x152.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004-768x390.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004-530x269.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004-565x287.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004-710x360.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_004-725x368.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u203b\u521d\u56de\u5b9f\u884c\u6642\u306b\u306f\u8a8d\u8a3c\u304c\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u3001\u521d\u56de\u8a8d\u8a3c\u306e\u8a31\u53ef\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044(<a href=\"https:\/\/auto-worker.com\/blog\/?p=609\" target=\"_blank\" rel=\"noopener\">\u521d\u56de\u8a8d\u8a3c\u306e\u8a31\u53ef\u65b9\u6cd5\u89e3\u8aac\u8a18\u4e8b<\/a>)\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306bGAS\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u5fdc\u7b54\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Gemini API\u30ea\u30af\u30a8\u30b9\u30c8\u7528\u306eGAS\u95a2\u6570\u3092\u4f5c\u6210<\/h3>\n\n\n\n<p>\u4e0a\u8a18\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u5b9f\u884c\u30ed\u30b0\u306b\u51fa\u529b\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001getGeminiAPI\u95a2\u6570\u306ereturn\u6587\u306b\u5fdc\u7b54\u7d50\u679c\u3092\u30bb\u30c3\u30c8\u3059\u308b\u3053\u3068\u3067\u3001Gemini API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308bGAS\u95a2\u6570\u3092\u4f5c\u6210\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-javascript\"><code class=\"language-javascript\">function getGeminiApi(prompt = '\u3042\u306a\u305f\u304c\u3067\u304d\u308b\u3053\u3068\u306f\u4f55\u3067\u3059\u304b\uff1f') {\n  \/\/\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u304b\u3089API\u30ad\u30fc\u3092\u53d6\u5f97\n  const apiKey = PropertiesService.getScriptProperties().getProperty('APIKEY');\n  \/\/Gemini\u306eAPI\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8URL\u3092\u8a2d\u5b9a\n  const apiUrl = `https:\/\/generativelanguage.googleapis.com\/v1beta\/models\/gemini-pro:generateContent?key=${apiKey}`;\n  \/\/\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u52a0\u3048\u3001Gemini API\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5fc5\u8981\u306a\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u8a2d\u5b9a\n  const payload = {\n    \"contents\": [\n      {\"role\": \"user\",\"parts\": { \"text\": prompt }}\n    ],\n  };\n  \/\/payload\u3084HTTP\u901a\u4fe1\u7a2e\u5225\u3001\u8a8d\u8a3c\u60c5\u5831\u3092option\u3067\u8a2d\u5b9a\n  const options = {\n    'payload': JSON.stringify(payload),\n    'method' : 'POST',\n    'muteHttpExceptions': true,\n    'contentType':'application\/json'\n  };\n  \/\/Gemini API\u306bAPI\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308a\u3001\u7d50\u679c\u3092\u5909\u6570\u306b\u683c\u7d0d\n  const response = JSON.parse(UrlFetchApp.fetch(apiUrl, options).getContentText()); \n  return response.candidates[0].content.parts[0].text; \n}\n\nfunction runGemini(){\n  console.log(getGeminiApi(\"\u65e5\u672c\u306e\u9996\u90fd\u306f\uff1f\"));\n}<\/code><\/pre>\n\n\n\n<p>runGemini\u95a2\u6570\u3067\u3001getGeminiApi\u95a2\u6570\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u306e\u6587\u5b57\u5217\u3092\u5f15\u6570\u6307\u5b9a\u3059\u308b\u3068\u3001Gemini API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"417\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005.jpg\" alt=\"Gemini Pro\u3078\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u5f15\u6570\u306b\u8a2d\u5b9a\u3057\u3066Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308bGoogle Apps Script(GAS)\u306e\u95a2\u6570\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\" class=\"wp-image-8684\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005.jpg 800w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005-300x156.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005-768x400.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005-530x276.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005-565x295.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005-710x370.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_005-725x378.jpg 725w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u3001\u4ed6\u306e\u51e6\u7406\u306e\u4e2d\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u51e6\u7406\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f1a\u8a71\u5c65\u6b74\u306e\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u6587\u3092Gemini API\u3067\u5f97\u308b\u306b\u306f\uff1f<\/h2>\n\n\n\n<p>\u524d\u8ff0\u3057\u305fGemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308bGoogle Apps Script(GAS)\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u3001\u5358\u4f53\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u5bfe\u3059\u308bGemini Pro\u306e\u5fdc\u7b54\u7d50\u679c\u3092\u51fa\u529b\u3059\u308b\u3082\u306e\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3057\u304b\u3057\u3001Gemini API\u306f\u904e\u53bb\u306e\u4f1a\u8a71\u5c65\u6b74\u3082API\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u4e2d\u306b\u542b\u3081\u308b\u3053\u3068\u3067\u3001Gemini Pro\u304b\u3089\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001\u4f1a\u8a71\u5c65\u6b74\u3082API\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u8a2d\u5b9a\u3057\u3066\u6587\u8108\u306b\u5fdc\u3058\u305fGemini Pro\u306e\u5fdc\u7b54\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3082\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3055\u304d\u307bGAS\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u30d9\u30fc\u30b9\u306b\u4f5c\u6210\u3057\u305fGemini Pro\u3078\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u52a0\u3048\u3001\u904e\u53bb\u306e\u4f1a\u8a71\u5c65\u6b74\u3092\u914d\u5217\u306b\u683c\u7d0d\u3057\u305fconversation\u5909\u6570\u306e2\u3064\u306e\u5f15\u6570\u3092\u6301\u3064getGeminiAptChat\u95a2\u6570\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-javascript\"><code class=\"language-javascript\">function getGeminiApiChat(prompt = '\u3042\u306a\u305f\u304c\u3067\u304d\u308b\u3053\u3068\u306f\u4f55\u3067\u3059\u304b\uff1f',conversation=[]) {\n  \/\/\u30b9\u30af\u30ea\u30d7\u30c8\u30d7\u30ed\u30d1\u30c6\u30a3\u304b\u3089API\u30ad\u30fc\u3092\u53d6\u5f97\n  const apiKey = PropertiesService.getScriptProperties().getProperty('APIKEY');\n  \/\/Gemini\u306eAPI\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8URL\u3092\u8a2d\u5b9a\n  const apiUrl = `https:\/\/generativelanguage.googleapis.com\/v1beta\/models\/gemini-pro:generateContent?key=${apiKey}`;\n  \/\/\u904e\u53bb\u306e\u4f1a\u8a71\u3068\u30d7\u30ed\u30f3\u30d7\u30c8\u3092message\u5909\u6570\u306b\u30bb\u30c3\u30c8\u3057\u3001\u30da\u30a4\u30ed\u30fc\u30c9\u3092\u8a2d\u5b9a\n  let messages = [];  \n  for(let i=0;i&lt;conversation.length;i++){\n    if(i%2==0){\n      messages.push({'role': 'user', \"parts\": { \"text\": conversation[i]} });\n    }\n    else{\n      messages.push({'role': 'model', \"parts\": { \"text\": conversation[i]} });\n    }\n  }\n  messages.push({'role': 'user', \"parts\": { \"text\": prompt} });\n  const payload = {\n    \"contents\": messages\n  };\n  \/\/payload\u3084HTTP\u901a\u4fe1\u7a2e\u5225\u3001\u8a8d\u8a3c\u60c5\u5831\u3092option\u3067\u8a2d\u5b9a\n  const options = {\n    'payload': JSON.stringify(payload),\n    'method' : 'POST',\n    'muteHttpExceptions': true,\n    'contentType':'application\/json'\n  };\n  \/\/Gemini API\u306bAPI\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308a\u3001\u7d50\u679c\u3092\u5909\u6570\u306b\u683c\u7d0d\n  const response = JSON.parse(UrlFetchApp.fetch(apiUrl, options).getContentText()); \n  return response.candidates[0].content.parts[0].text; \n}\n\nfunction runGeminiChat(){\n  \/\/\u4e8b\u524d\u306eGemini\u3068\u306e\u5bfe\u8a71\u306e\u5c65\u6b74\u3092\u914d\u5217\u3067\u5b9a\u7fa9\n  const conversation = ['\u65e5\u672c\u3067\u6700\u3082\u4eba\u53e3\u306e\u591a\u3044\u90fd\u9053\u5e9c\u770c\u306f\uff1f','\u6771\u4eac','2\u756a\u76ee\u306f?','\u795e\u5948\u5ddd'];\n  console.log(getGeminiApiChat(\"\u4e00\u756a\u5c11\u306a\u3044\u306e\u306f\uff1f\",conversation));\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"613\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009.jpg\" alt=\"Gemini Pro\u304b\u3089\u4f1a\u8a71\u5c65\u6b74\u306e\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u308bGoogle Apps Script\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\" class=\"wp-image-8688\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009.jpg 1200w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-1024x523.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-768x392.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-530x271.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-565x289.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-710x363.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_009-725x370.jpg 725w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>conversation\u5909\u6570\u306b\u683c\u7d0d\u3057\u305f\u4f1a\u8a71\u5c65\u6b74\u3092\u3092user(\u5229\u7528\u8005)\u3068model(Gemini Pro)\u3054\u3068\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u914d\u5217\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203b\u4f1a\u8a71\u306e\u8d77\u70b9\u306fmodel\u3067\u306f\u306a\u304fuser\u3068\u306a\u308b\u524d\u63d0\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306egetGeminiAptChat\u95a2\u6570\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u3068\u4f1a\u8a71\u5c65\u6b74\u306e\u914d\u5217\u3092\u5f15\u6570\u6307\u5b9a\u3057\u305f\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3068\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u6587\u3092Gemini API\u304b\u3089\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"612\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007.jpg\" alt=\"Gemini API\u3092\u4f7f\u3044\u3001\u4f1a\u8a71\u5c65\u6b74\u306e\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u3092\u8fd4\u3059Google Apps Script(GAS)\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u5b9f\u884c\u7d50\u679c\u306e\u30ed\u30b0\u51fa\u529b\" class=\"wp-image-8686\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007.jpg 1200w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-300x153.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-1024x522.jpg 1024w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-768x392.jpg 768w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-530x270.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-565x288.jpg 565w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-710x362.jpg 710w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2023\/12\/20231225_auto_007-725x370.jpg 725w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>\u4e8b\u524d\u306e\u4f1a\u8a71\u5c65\u6b74\u3067\u306f\u65e5\u672c\u3067\u6700\u3082\u4eba\u53e3\u306e\u591a\u3044\u90fd\u9053\u5e9c\u770c\u3092\u8cea\u554f\u3057\u305f\u3046\u3048\u3067\u3001\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u300c\u4e00\u756a\u5c11\u306a\u3044\u306e\u306f\uff1f\u300d\u3092\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5358\u4f53\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3060\u3051\u3067\u306f\u96e3\u3057\u3044\u3067\u3059\u304c\u3001\u4f1a\u8a71\u5c65\u6b74\u3082Gemini API\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u3044\u308b\u3053\u3068\u3067\u300c\u9ce5\u53d6\u770c\u300d\u3068\u6700\u3082\u4eba\u53e3\u304c\u5c11\u306a\u3044\u90fd\u9053\u5e9c\u770c\u3092\u56de\u7b54\u3057\u3066\u304f\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u4f1a\u8a71\u5c65\u6b74\u3082Gemini API\u306eAPI\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u542b\u3081\u308b\u3053\u3068\u3067\u3001Gemini Pro\u304b\u3089\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u3092API\u7d4c\u7531\u3067\u3082\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u203b\u306a\u304a\u3001getGeminiAptChat\u95a2\u6570\u306f\u7b2c\u4e8c\u5f15\u6570\u3067\u3042\u308b\u4f1a\u8a71\u5c65\u6b74\u306e\u914d\u5217\u3092\u30bb\u30c3\u30c8\u3057\u306a\u3044\u5834\u5408\u3082\u3001\u7b2c\u4e00\u5f15\u6570\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u5bfe\u3059\u308bGemini Pro\u306e\u5fdc\u7b54\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081\u30fb\u7d42\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u4eca\u56de\u3001Google Apps Script(GAS)\u3067Gemini API\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>2023\u5e7412\u670813\u65e5\u306bGemini API\u304c\u516c\u958b\u3055\u308c\u3001Google\u306e\u6700\u65b0AI\u30e2\u30c7\u30eb\u306eGemini Pro\u3092API\u7d4c\u7531\u3067\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>GAS\u3067\u306eGemini API\u306e\u5229\u7528\u65b9\u6cd5\u306fGoogle AI Studio\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u3082\u306a\u304b\u3063\u305f\u305f\u3081\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u4ed8\u304d\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u5358\u4f53\u306e\u30d7\u30ed\u30f3\u30d7\u30c8\u3092API\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u65b9\u6cd5\u306b\u52a0\u3048\u3066\u3001\u4f1a\u8a71\u5c65\u6b74\u3082\u8ffd\u52a0\u3057\u3066\u6587\u8108\u306b\u5fdc\u3058\u305f\u5fdc\u7b54\u3092\u5f97\u308bGAS\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3082\u63b2\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>GAS\u306f\u7121\u6599\u3067\u624b\u8efd\u306bGemini API\u3092\u8a66\u305b\u308b\u306e\u3067\u3001\u305c\u3072\u4eca\u56de\u7d39\u4ecb\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u3066Gemini API\u3092\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2023\u5e7412\u67086\u65e5\u306bGoogle\u306e\u6b21\u4e16\u4ee3AI\u30e2\u30c7\u30eb\u3067\u3042\u308bGemini\u304c\u767a\u8868\u3055\u308c\u305f1\u9031\u9593\u5f8c\u3001Gemini API\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u3002 Google AI Studio\u3067Gemini Pro\u30e2\u30c7\u30eb\u3092API\u7d4c\u7531\u3067\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2,1265],"tags":[14,1341,1333],"class_list":["post-8679","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-gas","category-ai","tag-gas","tag-gemini-api","tag-gemini-pro"],"_links":{"self":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8679"}],"version-history":[{"count":5,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8679\/revisions"}],"predecessor-version":[{"id":8693,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/8679\/revisions\/8693"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/8686"}],"wp:attachment":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}