Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
AI彼女の感情制御を頑張る話
Search
kokushin
June 26, 2023
Programming
940
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AI彼女の感情制御を頑張る話
【LT大会】AI捻じ伏せプロンプト選手権 〜言うこと聞いてよLLM2023〜
https://connpass.com/event/285636/
kokushin
June 26, 2023
Transcript
28 slides
AI彼女の感情制御を頑張る話 @kokushing AI捻じ伏せプロンプト選手権 〜言うこと聞いてよLLM2023〜
自己紹介 Yusuke Ishiguro (こくしん) 株式会社メイクリー Co-Founder 得意: Webフロントエンド領域 趣味: 一人ハッカソン
最近はAIイラスト, 合成音声技術を研究中 Twitter: @kokushing
AI彼女について
ChatGPT×Live2Dを用いたブラウザで動く対話型アプリ Next.js+Vercelで実装 PWA対応 https://ai-girl.app/
一つ大きな問題が...
None
返答と感情が一致していない😭 ※現状、ランダムでモーションを再生しているため
このままだとUXが良くないため、感情の制御を行う どう実装するか? Natural Language API や kuromoji.js などを用いてネガポジ判定を行う? でも料金/実装コストがかかりそうだし、レスポンス速度が落ちそう...
ChatGPTに感情を出力してもらおう!
JSON形式で返却するように指定してみる { role: "system", content: ` ... キャラ設定 ... また、セリフの感情を判断して、ポジティブなら
1、ネガティブなら-1を 下記のJSONフォーマットで出力してください { "emotion": "" } ` }
None
None
なんかいけそう?と思ったが... • JSON形式で返してくれない (よく見たらオブジェクト...) • 指定したプロパティや値で返してくれない • そもそもメッセージだけでJSONを返してくれない
どうしよ〜🤔と悩んでいた頃...
Function calling 爆誕!
Function calling とは? • ユーザが入力した内容に応じて、任意の関数を実行できる機能 → 返答に関数呼び出しが必要とGPTが判断した場合に実行される → 外部APIとの連携処理などを簡単に組み込める •
サードパーティ製に頼らず、OpenAI純正のAPIとして実装できる • 現状 gpt-3.5-turbo-0613 及び gpt-4-0613 モデルでのみ利用可能
簡単な図解 「明日の天気教えて」 (アカン...これはAPIで取得せな...) 「明日は晴れです」 「晴れやで」 「やったぜ」 GPT 天気API ユーザ Function
calling !!
Function calling 使って AI彼女の返答と感情を JSON形式で取得してみる
Function callingでJSON形式の結果を得るには ポイントは2つ 1. createChatCompletion の function_call に関数名を直接指定する → デフォルトは
"auto" (GPTが関数呼び出しを判断する) → 直接関数名を指定することで、必ず呼び出すことができる function_call: { name: "getMessageAndEmotion" } 2. GPTがFunction callingを行うと function_call オブジェクトをJSON形式(string)で 取得できるため、JSON.parseしてそのまま返答として利用する
関数はこんな感じ
関数が呼ばれた結果 ※ createChatCompletion のレスポンス内容
クライアント側でのレスポンス結果 ※ emotion: 1 は「喜」の感情
JSON形式で取得できた👏
他の感情も問題なさそう
あとはLive2Dと連携すれば...
None
素敵な笑顔が見れました!
Thank You 🙏 ご清聴ありがとうございました。 メイクリーではAI×サブカルチャー領域での お仕事を募集しております! ご相談は @kokushing まで DMお待ちしてます!
More Decks by kokushin
See All by kokushin
趣味全開のAITuber開発
kokushin
0
1.1k
AI彼女とペアプロする話
kokushin
2
620
window.matchMediaの話
kokushin
1
200
サイト制作における、より効果的な演出テクニックとは?
kokushin
1
140
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
320
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
5.8k
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
570
Spec-driven Development with AI
simas
PRO
0
2.3k
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
130
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
240
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
620
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
310
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
320
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
4
3.9k
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
120
Featured
See All Featured
Ruling the World: When Life Gets Gamed
codingconduct
0
440
How to Ace a Technical Interview
jacobian
280
24k
Marketing to machines
jonoalderson
1
6k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880
Thoughts on Productivity
jonyablonski
76
5.5k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.9k
Test your architecture with Archunit
thirion
2
2.5k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
3k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
640
Skip the Path - Find Your Career Trail
mkilby
1
290
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k