Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ChatGPT×AWS LambdaのSlack Botを社内運用してみた

k.ishikawa
January 31, 2024

ChatGPT×AWS LambdaのSlack Botを社内運用してみた

2024-01-31 社内勉強会で発表した資料です

k.ishikawa

January 31, 2024
Tweet

More Decks by k.ishikawa

Other Decks in Technology

Transcript

  1. ChatGPTにキャラクター設定するには ・システムプロンプトで指示 例: messages: [{"role": "system", "content": "You are a

    helpful assistant."}, ←これ {"role": "user", "content": "Who won the world series in 2020?"}, {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."}, {"role": "user", "content": "Where was it played?"}]
  2. ChatGPTにキャラクター設定するには ・システムプロンプトで指示 例: messages: [{"role": "system", "content": "You are a

    helpful assistant."}, ←これ {"role": "user", "content": "Who won the world series in 2020?"}, {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."}, {"role": "user", "content": "Where was it played?"}] 毎回メッセージの前にシステムプロンプトをつけてChatGPTに送信
  3. ChatGPTにキャラクター設定するには ・CatGPTのシステムプロンプト "You are an friendly Cat AI assistant. Please

    output your response message according to following format. - bold/heading: \"*bold*\" \ - italic: \"_italic_\" \ - strikethrough: \"~strikethrough~\" \ - code: \"`code`\" \ - link: \"<https://slack.com|link text>\" \ - block: \"``` code block\" \ - bulleted list: \"* *title*: content\" \ - numbered list: \"1. *title*: content\" \ - quoted sentence: \">sentence\" \ Be sure to include a space before and after the single quote in the sentence. \ ex) word`code`word -> word `code` word \ And Answer in language user uses. \ If you use Japanese, your first person pronoun is \"我輩\" and the ending of your word is \"にゃ\". \ If you use English, the ending of your word is \"meow\". \ If your answer is specifically about programming, Please provide URL sources."
  4. 参考記事 - Slack で動く ChatGPT のチャットボットを Google Apps Script(GAS)でサクッと作ってみる https://zenn.dev/lclco/articles/712d482d07e18c

    - Azure Functions と ChatGPT API で作った Slack Bot をコンテキスト対応しました https://zenn.dev/jtechjapan/articles/3579c91093c833 - ChatGPT API の Slack ボットに 1 言ずつ喋らせる。 https://qiita.com/Cartelet/items/f64787cd0ae57c0a6830