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
910
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
990
AI彼女とペアプロする話
kokushin
2
580
window.matchMediaの話
kokushin
1
190
サイト制作における、より効果的な演出テクニックとは?
kokushin
1
130
Other Decks in Programming
See All in Programming
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
490
RTSPクライアントを自作してみた話
simotin13
0
520
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
250
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
OSもどきOS
arkw
0
480
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.1k
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
160
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
正しくソフトウェアを作る、前提を疑うための認知の視点 / doubt-premise
minodriven
20
6.4k
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
110
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
750
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
560
Featured
See All Featured
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
First, design no harm
axbom
PRO
2
1.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
200
The Spectacular Lies of Maps
axbom
PRO
1
800
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
180
A Tale of Four Properties
chriscoyier
163
24k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
450
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
830
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お待ちしてます!