Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AI彼女の感情制御を頑張る話
Search
kokushin
June 26, 2023
Programming
3
880
AI彼女の感情制御を頑張る話
【LT大会】AI捻じ伏せプロンプト選手権 〜言うこと聞いてよLLM2023〜
https://connpass.com/event/285636/
kokushin
June 26, 2023
Tweet
Share
More Decks by kokushin
See All by kokushin
趣味全開のAITuber開発
kokushin
0
880
AI彼女とペアプロする話
kokushin
2
560
window.matchMediaの話
kokushin
1
170
サイト制作における、より効果的な演出テクニックとは?
kokushin
1
120
Other Decks in Programming
See All in Programming
Patterns of Patterns
denyspoltorak
0
410
ゆくKotlin くるRust
exoego
1
190
Vibe codingでおすすめの言語と開発手法
uyuki234
0
160
TestingOsaka6_Ozono
o3
0
260
大規模Cloud Native環境におけるFalcoの運用
owlinux1000
0
240
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
210
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
520
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
130
CSC307 Lecture 01
javiergs
PRO
0
650
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
280
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
180
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
93
Ethics towards AI in product and experience design
skipperchong
1
150
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
39
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
170
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
120
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
27
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
400
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
160
Practical Orchestrator
shlominoach
190
11k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
270
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お待ちしてます!