{"id":16709,"date":"2023-06-22T11:31:53","date_gmt":"2023-06-22T02:31:53","guid":{"rendered":"https:\/\/sendgrid.kke.co.jp\/blog\/?p=16709"},"modified":"2025-06-20T13:24:20","modified_gmt":"2025-06-20T04:24:20","slug":"chatgpt%e3%81%aeapi%e3%81%a7%e3%83%a1%e3%83%bc%e3%83%ab%e3%82%92%e4%bd%9c%e6%88%90%e3%81%97%e3%81%a6sendgrid%e3%81%a7%e9%80%81%e4%bf%a1%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/sendgrid.kke.co.jp\/blog\/?p=16709","title":{"rendered":"ChatGPT\u306eAPI\u3067\u30e1\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3066SendGrid\u3067\u9001\u4fe1\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2023\/06\/20230622_blog-1.png\" alt=\"ChatGPT\u306eAPI\u3067\u30e1\u30fc\u30eb\u3092\u4f5c\u6210\u3057\u3066SendGrid\u3067\u9001\u4fe1\u3059\u308b\u65b9\u6cd5\" width=\"100%\" class=\"aligncenter size-full wp-image-19168\" srcset=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2023\/06\/20230622_blog-1.png 650w, https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2023\/06\/20230622_blog-1-300x185.png 300w, https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2023\/06\/20230622_blog-1-225x139.png 225w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><\/p>\n<p>ChatGPT\u304c2022\u5e7411\u6708\u672b\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u4ee5\u964d\u3001LLM(Large Language Model; \u5927\u898f\u6a21\u8a00\u8a9e\u30e2\u30c7\u30eb)\u306e\u6d3b\u7528\u304c\u6025\u901f\u306b\u9032\u3093\u3067\u3044\u307e\u3059\u3002\u5358\u306bChatGPT\u3068\u3044\u3046\u30a2\u30d7\u30ea\u81ea\u4f53\u306e\u6d41\u884c\u308a\u306b\u7559\u307e\u3089\u305a\u3001GPT\u3092\u4ed6\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u7d44\u307f\u8fbc\u3093\u3067\u3001ChatGPT\u3060\u3051\u3067\u306f\u3067\u304d\u306a\u3044\u30bf\u30b9\u30af\u3082\u81ea\u7136\u8a00\u8a9e\u3067\u89e3\u6c7a\u3059\u308b\u8a66\u307f\u304c\u5e83\u307e\u3063\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002GPT\u30b7\u30ea\u30fc\u30ba\u3092\u958b\u767a\u3057\u3066\u3044\u308bOpenAI\u793e\u3082\u983b\u7e41\u306bAPI\u3092\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u6d41\u308c\u3092\u52a0\u901f\u3055\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u76f4\u8fd1\u3067\u306f2023\u5e746\u670813\u65e5\u306b\u300c<a href=\"https:\/\/openai.com\/blog\/function-calling-and-other-api-updates\" rel=\"noopener\" target=\"_blank\">Function calling<\/a>\u300d\u3068\u3044\u3046\u6a5f\u80fd\u304cAPI\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u306f\u95a2\u6570\u306e\u5b9a\u7fa9\u3092GPT\u306b\u3042\u3089\u304b\u3058\u3081\u4e0e\u3048\u3066\u304a\u3051\u3070\u3001\u305d\u308c\u3092\u7528\u3044\u308b\u3079\u304d\u8cea\u554f\u304c\u6765\u305f\u6642\u306b\u3001\u305d\u306e\u95a2\u6570\u306b\u4e0e\u3048\u308b\u3079\u304d\u5f15\u6570\u3092\u8fd4\u7b54\u3059\u308b\u3082\u306e\u3067\u3059\uff08\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\uff09\u3002OpenAI\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u306f\u3001\u4f8b\u3068\u3057\u3066\u5929\u6c17\u4e88\u5831\u3084\u30e1\u30fc\u30eb\u9001\u4fe1\u304c\u6319\u3052\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u4f8b\u306b\u3068\u308b\u3068\u3001\u300c\u3007\u3007\u3055\u3093\u306b\u00d7\u00d7\u3068\u3044\u3046\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u3066\u304f\u308c\u300d\u3068\u983c\u3081\u3070\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306b\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\uff08To\u3001Subject\u3001\u672c\u6587\u306a\u3069\uff09\u3092\u8fd4\u7b54\u3057\u3066\u304f\u308c\u307e\u3059\u3002GPT\u81ea\u4f53\u304c\u30e1\u30fc\u30eb\u9001\u4fe1\u3084\u5929\u6c17\u4e88\u5831\u3092\u884c\u3048\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u3001GPT\u304b\u3089\u8fd4\u3055\u308c\u305f\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5074\u3067\u95a2\u6570\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001GPT\u306e\u8fd4\u7b54\u3092\u5143\u306b\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b\u7c21\u5358\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u3001SendGrid\u306e\u30e1\u30fc\u30eb\u9001\u4fe1API\u3092\u7528\u3044\u3066\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210<\/h3>\n<p>\u5b9f\u88c5\u306b\u306fPython\u3092\u5229\u7528\u3057\u307e\u3059\u3002Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u7c21\u5358\u306b\u69cb\u7bc9\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea<a href=\"https:\/\/streamlit.io\/\" rel=\"noopener\" target=\"_blank\">Streamlit<\/a>\u3092\u7528\u3044\u3001\u300c\u30e1\u30fc\u30eb\u306e\u6982\u8981\u3092\u8a18\u8ff0\u3059\u308b\u3060\u3051\u3067GPT\u306b\u30e1\u30fc\u30eb\u6587\u9762\u3092\u4f5c\u6210\u3057\u3066\u3082\u3089\u3044\u3001\u305d\u308c\u3092SendGrid\u3067\u9001\u4fe1\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u5b8c\u6210\u5f62\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/sendgrid.kke.co.jp\/blog\/wp\/wp-content\/uploads\/2023\/06\/mail_generator_.gif\" alt=\"\u30e1\u30fc\u30eb\u306e\u6982\u8981\u3092\u8a18\u8ff0\u3059\u308b\u3060\u3051\u3067GPT\u306b\u30e1\u30fc\u30eb\u6587\u9762\u3092\u4f5c\u6210\u3057\u3066\u3082\u3089\u3044\u3001\u305d\u308c\u3092SendGrid\u3067\u9001\u4fe1\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\" width=\"100%\" class=\"aligncenter size-full wp-image-16711\" \/><\/p>\n<h4>\u6e96\u5099<\/h4>\n<p>\u307e\u305a\u3001\u5229\u7528\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002Streamlit\u306e\u307b\u304b\u306b\u3001GPT\u306eAPI\u3092\u4f7f\u3046\u305f\u3081\u306bopenai\u30e9\u30a4\u30d6\u30e9\u30ea\u3001SendGrid\u3092\u7528\u3044\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3059\u308b\u305f\u3081\u306bsendgrid\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5fc5\u8981\u3067\u3059\u3002\u30d1\u30c3\u30b1\u30fc\u30b8\u7ba1\u7406\u30c4\u30fc\u30eb\u306bpip\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npip install openai streamlit sendgrid\r\n<\/pre>\n<p>\u4eca\u56de\u79c1\u304c\u4f7f\u7528\u3057\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>Python 3.10.8<\/li>\n<li>openai 0.27.8<\/li>\n<li>streamlit 1.23.1<\/li>\n<li>sendgrid 6.10.0<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001OpenAI\u3068SendGrid\u306eAPI\u30ad\u30fc\u3092\u74b0\u5883\u5909\u6570\u306b\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nOPENAI_API_KEY=sk-XXXXXXXXXX\r\nSENDGRID_API_KEY=SG.XXXXXXXXXX\r\n<\/pre>\n<h4>\u5b9f\u88c5<\/h4>\n<p>1\u3064\u306ePython\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4e2d\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u540d\u524d\u3092app.py\u3068\u3057\u307e\u3059\u3002<br \/>\n\u6700\u521d\u306f\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30dd\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport os\r\nimport json\r\nimport openai\r\nimport streamlit as st\r\nfrom sendgrid import SendGridAPIClient\r\nfrom sendgrid.helpers.mail import Mail\r\n<\/pre>\n<p>\u6b21\u306bGPT\u306eAPI\u3092\u547c\u3073\u51fa\u3059\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nfunctions = &#x5B;\r\n    {\r\n        &quot;name&quot;: &quot;generate_email&quot;,\r\n        &quot;description&quot;: &quot;Generate an email from a given context&quot;,\r\n        &quot;parameters&quot;: {\r\n            &quot;type&quot;: &quot;object&quot;,\r\n            &quot;properties&quot;: {\r\n                &quot;to&quot;: {\r\n                    &quot;type&quot;: &quot;string&quot;,\r\n                },\r\n                &quot;subject&quot;: {\r\n                    &quot;type&quot;: &quot;string&quot;\r\n                },\r\n                &quot;body&quot;: {\r\n                    &quot;type&quot;: &quot;string&quot;\r\n                }\r\n            },\r\n            &quot;required&quot;: &#x5B;&quot;to&quot;, &quot;subject&quot;, &quot;body&quot;]\r\n        },\r\n    }\r\n]\r\n\r\ndef generate_email(content):\r\n    response = openai.ChatCompletion.create(\r\n        model=&quot;gpt-3.5-turbo-0613&quot;,\r\n        messages=&#x5B;\r\n            {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: content}\r\n        ],\r\n        functions=functions,\r\n        function_call={&quot;name&quot;: &quot;generate_email&quot;}\r\n    )\r\n    return json.loads(response&#x5B;&quot;choices&quot;]&#x5B;0]&#x5B;&quot;message&quot;]&#x5B;&quot;function_call&quot;]&#x5B;&quot;arguments&quot;])\r\n<\/pre>\n<p>\u521d\u3081\u306efunctions\u914d\u5217\u306fGPT\u306eAPI\u306b\u6307\u5b9a\u3059\u308b\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002GPT\u306e\u8fd4\u7b54\u3068\u3057\u3066\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306b\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3042\u308bto\uff08\u5b9b\u5148\uff09\u3001subject\uff08\u4ef6\u540d\uff09\u3001body\uff08\u672c\u6587\uff09\u3092\u8fd4\u5374\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002\u672c\u6765\u306f\u5404\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u610f\u5473\u3092\u305d\u308c\u305e\u308cdescription\u3067\u5b9a\u7fa9\u3059\u308b\u3079\u304d\u306a\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u540d\u524d\u304b\u3089\u610f\u5473\u304c\u660e\u767d\u3060\u3063\u305f\u305f\u3081\u304b\u3001description\u304c\u306a\u304f\u3066\u3082\u52d5\u4f5c\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>generate_email\u95a2\u6570\u306f\u30e6\u30fc\u30b6\u306e\u5165\u529b\u3092\u5143\u306bGPT\u306e\u8fd4\u7b54\u3092\u5f97\u308b\u51e6\u7406\u3092\u3057\u307e\u3059\u3002\u5185\u90e8\u3067\u306f\u3001openai\u30e9\u30a4\u30d6\u30e9\u30ea\u306e<a href=\"https:\/\/platform.openai.com\/docs\/guides\/gpt\/chat-completions-api\" rel=\"noopener\" target=\"_blank\">Chat Completion API<\/a>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002functions\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u6307\u5b9a\u3055\u308c\u305f\u95a2\u6570\u3092\u7528\u3044\u308b\u3079\u304d\u8cea\u554f\u304c\u5165\u529b\u3055\u308c\u305f\u6642\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u5f62\u5f0f\u3067\u8fd4\u7b54\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u307e\u305ffunction_call\u5f15\u6570\u3067\u95a2\u6570\u540d\u3092\u660e\u793a\u7684\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u306e\u95a2\u6570\u306e\u4f7f\u7528\u3092\u5f37\u5236\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4eca\u56de\u3001\u95a2\u6570\u306e\u623b\u308a\u5024\u306fto\u3001subject\u3001body\u304b\u3089\u306a\u308bdictionary\u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d9a\u3044\u3066\u30e1\u30fc\u30eb\u9001\u4fe1\u3092\u884c\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\ndef send_email(to, subject, body):\r\n    sg = SendGridAPIClient(api_key=os.environ.get(&quot;SENDGRID_API_KEY&quot;))\r\n    mail = Mail(from_email=&quot;test@example.com&quot;, to_emails=to, subject=subject, plain_text_content=body)\r\n    response = sg.send(mail)\r\n    return response\r\n<\/pre>\n<p>send_mail\u95a2\u6570\u3067\u306f\u3001\u6307\u5b9a\u3055\u308c\u305fto\u3001subject\u3001body\u306e\u30e1\u30fc\u30eb\u3092SendGrid\u3067\u9001\u4fe1\u3059\u308b\u51e6\u7406\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u9001\u4fe1\u5143From\u30a2\u30c9\u30ec\u30b9\u3092test@example.com\u3068\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u3001SendGrid\u3067\u306f\u5b9f\u8cea3\u884c\u306e\u30b3\u30fc\u30c9\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u5404API\u3092\u547c\u3073\u51fa\u3059\u95a2\u6570\u304c\u5b9a\u7fa9\u3067\u304d\u305f\u306e\u3067\u3001\u3053\u3053\u304b\u3089\u306fStreamlit\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nst.title(&quot;Mail Generator&quot;)\r\nst.write(&quot;\u81ea\u7136\u8a00\u8a9e\u3067\u30e1\u30fc\u30eb\u3092\u751f\u6210\u3057\u3066\u9001\u4fe1\u3059\u308b\u30a2\u30d7\u30ea\u3067\u3059&quot;)\r\n\r\nwith st.form(&quot;generate_email&quot;):\r\n    text = st.text_area(&quot;\u30e1\u30fc\u30eb\u306e\u6982\u8981\u3092\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044&quot;)\r\n    submitted = st.form_submit_button(&quot;\u751f\u6210&quot;)\r\nif submitted:\r\n    try:\r\n        with st.spinner(&quot;\u751f\u6210\u4e2d...&quot;):\r\n            response_json = generate_email(text)\r\n        for key, value in response_json.items():\r\n            st.session_state&#x5B;key] = value\r\n    except Exception as e:\r\n        st.error(f&quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {e}&quot;)\r\n<\/pre>\n<p>\u3053\u306e\u90e8\u5206\u3067\u306f\u30e6\u30fc\u30b6\u304c\u30d5\u30a9\u30fc\u30e0\u306b\u5165\u529b\u3057\u305f\u5185\u5bb9\u3092generate_email\u95a2\u6570\u306b\u6e21\u3057\u3066\u3001\u30e1\u30fc\u30eb\u9001\u4fe1\u306b\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306edictionary\u3092\u53d7\u3051\u53d6\u308a\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u4fdd\u6301\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u30e1\u30fc\u30eb\u306e\u9001\u4fe1\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nif &quot;body&quot; in st.session_state:\r\n    with st.form(&quot;send_email&quot;):\r\n        st.write(&quot;\u4ee5\u4e0b\u306e\u5185\u5bb9\u3067\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3057\u307e\u3059&quot;)\r\n        to_text = st.text_input(&quot;To&quot;, key=&quot;to&quot;)\r\n        subject_text = st.text_input(&quot;Subject&quot;, key=&quot;subject&quot;)\r\n        body_text = st.text_area(&quot;Content&quot;, key=&quot;body&quot;, height=320)\r\n        sent = st.form_submit_button(&quot;\u9001\u4fe1&quot;)\r\n    if sent:\r\n        try:\r\n            with st.spinner(&quot;\u9001\u4fe1\u4e2d...&quot;):\r\n                res = send_email(to_text, subject_text, body_text)\r\n            st.success(&quot;\u9001\u4fe1\u3057\u307e\u3057\u305f&quot;)\r\n        except Exception as e:\r\n            st.error(f&quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {e}&quot;)\r\n<\/pre>\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u5024\u304c\u5165\u3063\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092if\u3067\u5224\u65ad\u3057\u3001GPT\u304b\u3089\u53d7\u3051\u53d6\u3063\u305fto\u3001subject\u3001body\u306e\u5024\u3092\u30d5\u30a9\u30fc\u30e0\u3068\u3057\u3066\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u30e6\u30fc\u30b6\u304c\u518d\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002\u300c\u9001\u4fe1\u300d\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\u3089\u3001\u305d\u306e\u5185\u5bb9\u3092send_mail\u95a2\u6570\u306b\u6e21\u3057\u3066SendGrid\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<h4>\u5b9f\u884c<\/h4>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3053\u308c\u3067\u5b8c\u6210\u3067\u3059\u3002\u65e9\u901f\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u300cstreamlit run app.py\u300d\u3092\u8d70\u3089\u305b\u308b\u3068\u3001Web\u30d6\u30e9\u30a6\u30b6\u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u7acb\u3061\u4e0a\u304c\u308a\u307e\u3059\u3002\u4e0a\u306e\u52d5\u753b\u306e\u3088\u3046\u306b\u30e1\u30fc\u30eb\u306e\u6982\u8981\u3092\u5165\u529b\u3059\u308b\u3068GPT\u304c\u6587\u9762\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u3001\u9069\u5b9c\u4fee\u6b63\u3057\u305f\u4e0a\u3067\u30e1\u30fc\u30eb\u9001\u4fe1\u3067\u304d\u307e\u3059\u3002<br \/>\n\u52d5\u753b\u3067\u306f\u5b9b\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001GPT\u306fyoshida@example.com\u3068\u51fa\u529b\u3057\u3066\u3044\u307e\u3057\u305f\u3002GPT\u306b\u30e1\u30fc\u30eb\u751f\u6210\uff08generate_email\u95a2\u6570\u306e\u4f7f\u7528\uff09\u3092\u5f37\u5236\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u9069\u5207\u306a\u6307\u793a\u304c\u306a\u3044\u3068\u52dd\u624b\u306b\u88dc\u5b8c\u3059\u308b\u3088\u3046\u3067\u3059\u3002\u304d\u3061\u3093\u3068\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u793a\u3059\u308c\u3070To\u306b\u305d\u306e\u5b9b\u5148\u304c\u5165\u308a\u307e\u3059\u3002\u5b58\u5728\u3059\u308b\u30a2\u30c9\u30ec\u30b9\u306b\u9001\u308c\u3070\u3001SendGrid\u304b\u3089\u30e1\u30fc\u30eb\u304c\u5c4a\u304f\u3053\u3068\u304c\u78ba\u304b\u3081\u3089\u308c\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306f\u30ed\u30fc\u30ab\u30eb\u4e0a\u3067\u306e\u5b9f\u884c\u65b9\u6cd5\u3067\u3059\u304c\u3001Streamlit\u306fGitHub\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u9023\u643a\u3055\u305b\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30c7\u30d7\u30ed\u30a4\u3067\u304d\u308b<a href=\"https:\/\/streamlit.io\/cloud\" rel=\"noopener\" target=\"_blank\">Community Cloud<\/a>\u3068\u3044\u3046\u30b5\u30fc\u30d3\u30b9\u3082\u63d0\u4f9b\u3057\u3066\u304a\u308a\u3001\u5916\u90e8\u516c\u958b\u3082\u7c21\u5358\u306b\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u304a\u308f\u308a\u306b<\/h3>\n<p>100\u884c\u306b\u6e80\u305f\u306a\u3044\u30b3\u30fc\u30c9\u3067\u3001GPT\u306eAPI\u3068SendGrid\u306eAPI\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3067\u304d\u307e\u3057\u305f\u3002\u305f\u3060\u3057\u3001\u672c\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305fGPT\u306eAPI\u547c\u3073\u51fa\u3057\u51e6\u7406\u3084\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306a\u3069\u306f\u6700\u5c0f\u9650\u306e\u5b9f\u88c5\u306a\u306e\u3067\u3001\u8a73\u7d30\u306f\u5404\u7a2e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li>OpenAI <a href=\"https:\/\/openai.com\/blog\/function-calling-and-other-api-updates\" rel=\"noopener\" target=\"_blank\">\u30d6\u30ed\u30b0\u8a18\u4e8b\uff08Function calling\u306e\u30ea\u30ea\u30fc\u30b9\uff09<\/a><\/li>\n<li>OpenAI <a href=\"https:\/\/platform.openai.com\/docs\/guides\/gpt\/function-calling\" rel=\"noopener\" target=\"_blank\">\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306eFunction calling\u30ac\u30a4\u30c9<\/a><\/li>\n<li>OpenAI <a href=\"https:\/\/platform.openai.com\/docs\/api-reference\/chat\/create\" rel=\"noopener\" target=\"_blank\">API\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/a><\/li>\n<li>SendGrid <a href=\"https:\/\/sendgrid.kke.co.jp\/docs\/API_Reference\/Web_API_v3\/Mail\/index.html\" rel=\"noopener\" target=\"_blank\">API\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\uff08\u30e1\u30fc\u30eb\u9001\u4fe1\uff09<\/a><\/li>\n<li>SendGrid <a href=\"https:\/\/github.com\/sendgrid\/sendgrid-python\" rel=\"noopener\" target=\"_blank\">Python\u30e9\u30a4\u30d6\u30e9\u30ea<\/a><\/li>\n<\/ul>\n<p>ChatGPT\u306e\u767b\u5834\u306b\u3088\u308a\u69d8\u3005\u306a\u5834\u9762\u3067\u696d\u52d9\u751f\u7523\u6027\u304c\u4e0a\u304c\u3063\u3066\u3044\u307e\u3059\u3002\u5916\u90e8API\u3068\u306e\u9023\u643a\u306f\u305d\u308c\u3092\u3055\u3089\u306b\u52a0\u901f\u3055\u305b\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u7279\u306b\u30e1\u30fc\u30eb\u306e\u4f5c\u6210\u3068\u9001\u4fe1\u306f\u3001ChatGPT\u306e\u9ad8\u3044\u6587\u7ae0\u751f\u6210\u80fd\u529b\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u5927\u304d\u304f\u52b9\u7387\u3092\u4e0a\u3052\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30e1\u30fc\u30eb\u9001\u4fe1API\u304c\u5fc5\u8981\u306b\u306a\u3063\u305f\u3089\u305c\u3072SendGrid\u3092\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ChatGPT\u304c2022\u5e7411\u6708\u672b\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u4ee5\u964d\u3001LLM(Large Language Model; \u5927\u898f\u6a21\u8a00\u8a9e\u30e2\u30c7\u30eb)\u306e\u6d3b\u7528\u304c\u6025\u901f\u306b\u9032\u3093\u3067\u3044\u307e\u3059\u3002\u5358\u306bChatGPT\u3068\u3044\u3046\u30a2\u30d7\u30ea\u81ea\u4f53\u306e\u6d41\u884c\u308a\u306b\u7559\u307e\u3089\u305a\u3001GPT\u3092\u4ed6\u306e <a class=\"read-more\" href=\"https:\/\/sendgrid.kke.co.jp\/blog\/?p=16709\">&#8230;\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":15,"featured_media":19168,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[11,8],"tags":[],"class_list":["post-16709","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical","category-product"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/16709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=16709"}],"version-history":[{"count":6,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/16709\/revisions"}],"predecessor-version":[{"id":19171,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/16709\/revisions\/19171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=\/wp\/v2\/media\/19168"}],"wp:attachment":[{"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=16709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=16709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sendgrid.kke.co.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=16709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}