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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
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
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
250
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
320
Seven New Principles of Software Engineering
yegor256
0
440
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.8k
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
280
Getting Started with Vibe Coding
miccheng
0
180
Groovy as a human and AI friendly programming language
paulk
0
170
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
340
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
14
11k
Kotlinの15年とServer-Side Kotlin
n_takehata
1
190
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
250
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
130
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
760
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
360
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
60k
How STYLIGHT went responsive
nonsquared
100
6.3k
Test your architecture with Archunit
thirion
2
2.5k
Site-Speed That Sticks
csswizardry
13
1.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.6k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
550
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Transcript
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お待ちしてます!