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
Google製LLM PaLM2と対話できるLINE_Botを爆速開発ハンズオン
Search
Kento.Yamada
October 11, 2023
Programming
0
43
Google製LLM PaLM2と対話できるLINE_Botを爆速開発ハンズオン
Kento.Yamada
October 11, 2023
Tweet
Share
More Decks by Kento.Yamada
See All by Kento.Yamada
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
480
Azure以外のクラウドではじめる.NET
ymd65536
1
48
Microsoft Playwrightで始めるブラウザテスト
ymd65536
0
280
個人的に注目したMicrosoftとGitHubのアップデート情報
ymd65536
1
81
Azure Developer CLIの振り返りとDeep Dive
ymd65536
0
250
Azure Developer CLIでNotebookが動くテンプレートを作ってみた
ymd65536
0
170
実務に携わる前に知っておきたいこと-エンジニアの心技体
ymd65536
0
24
俺達のSREとNew_Relicを読んでみた
ymd65536
0
420
Momentoの管理インターフェイス周りを調べてみた。(Momento CLIをハンズオン)
ymd65536
0
230
Other Decks in Programming
See All in Programming
Introducing Kotlin Multiplatform in an existing mobile app - Workshop Edition | AndroidMakers Paris
prof18
0
140
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
240
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
2
200
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
230
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Ruby GitHub Packages
bkuhlmann
0
630
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
7
1.3k
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
Fragment Composition of GraphQL
quramy
13
1.4k
0→1と1→10の狭間で Javaという技術選定を振り返る/Reflecting on the Decision to Choose Java Between Scaling from 0 to 1 and 1 to 10
jaguar_imo
2
390
"config" ってなんだ? / What is "config"?
okashoi
0
250
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
200
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
358
22k
Git: the NoSQL Database
bkeepers
PRO
423
63k
Building Flexible Design Systems
yeseniaperezcruz
320
37k
The Pragmatic Product Professional
lauravandoore
26
5.8k
How to name files
jennybc
65
93k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
21
1.4k
We Have a Design System, Now What?
morganepeng
44
6.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
6
1.3k
The Language of Interfaces
destraynor
151
23k
Ruby is Unlike a Banana
tanoku
96
10k
Transcript
Google製LLM「PaLM2」と対話できるLINE Botを 爆速開発ハンズオン 1
本日やること • 本日やること • 自己紹介 • 完成品の動作 • 構成 •
今回使う技術 • VertexAIとは • PaLM2とは • CloudRunとは • 実際に作ろう • まとめ 2
自己紹介 3 Amazon ベストセラー獲得 Kento.Yamada (github,Twitter,zenn,Qiita@ymd65536) 経歴 • 2022年10月~現在 虎ノ門のCIer
◦ Multi Cloud Developer • (2016年~2022年9月)某通信キャリアの子会社 ◦ ITスペシャリスト
完成品の動作 4 デモをやります!
全体構成 5 Artifact Registry Cloud Run Vertex AI
デプロイ時の構成 6 Artifact Registry Cloud Run 2.コンテナイメージをpull 1.イメージをpush
Vertex AIとの疎通確認 7 Cloud Run Vertex AI 2. text-bison@001のAPIを実行 1.
エンドポイント接続 (GETリクエスト) 3.結果を取得 4.ブラウザで結果を参照
LINE botからVertex AIのAPIを実行 8 Cloud Run 1.Webhookによる接続 Vertex AI 2.
chat-bison@001のAPIを実行 2. chat-bison@001のAPIを実行 3.結果を取得 4.LINEアプリ上で結果を閲覧
今回使う技術 • LINE API ◦ Messaging API • Google Cloud
◦ CloudRun ◦ Artifact Registry ◦ Vertex AI 9
LINE Messaging API 👈詳しく知りたい人はこちら 10 https://www.youtube.com/watch?v=KiuLRTSuTzg
CloudRunとは コンテナを実行できるマネージドサービス 特徴 • サーバレスコンピューティング • 受信リクエストに合わせて、コンテナが自動的にスケール 今回はジョブではなく、サービスとしてコンテナを実行 LINE Messaging
APIのWebhook URLとして利用 11 CloudRunの料金:https://cloud.google.com/run/pricing?hl=ja
Artifact Registryとは 12 次世代の Container Registry 特徴 • パッケージと Docker
コンテナイメージを1 か所で保管し、管理できる • CloudBuildのアーティファクトを保存する場所として利用できる Caution 現在はContainer Registryではなく、Artifact Registryが推奨されています! 今回はCloudRunに使うコンテナのイメージを保存するために利用 Artifact Registryの料金:https://cloud.google.com/artifact-registry/pricing?hl=ja
VertexAIとは 13 エンタープライズ対応の生成 AI でイノベーションを加速する 特徴 • さまざまなAIモデルの提供およびトレーニング • 検証にちょうどいいGenerative
AI Studio • もちろん、PaLM2も提供 今回はCloudRunからVertex AIのAPIを実行してAIを呼び出す
PaLM2とは • Google が開発した最新のLLMであり、PaLMの後継 • 4種類のモデル:Gecko、Otter、Bison、Unicorn • 25 を超える Google
の製品と機能に搭載 なお、読み方は「パーム」 14 引用元:PaLM 2 のご紹介 https://japan.googleblog.com/2023/05/palm-2.html
Vertex AIでPaLM2を利用する時 1. text prompts a. 一問一答という形で利用する 2. chat prompts
a. 文字通りチャット、コンテキスト(文脈)を理解して返信 3. text embeddings a. テキスト同士の類似性を測定して返信 15
Vertex AI における生成 AI サポートの料金 16 Vertex AI における生成 AI
サポートの料金:https://cloud.google.com/vertex-ai/pricing?hl=ja 1,000文字あたり、$0.0010 1,000文字あたり、$0.0005
実際に作ろう 百聞は一つのハンズオンにしかず!! 17
まとめ • 今回はCloudRunを使ってVertexAIを実行した • VertexAIを使うと手軽に生成AIが扱える! • PaLM2は比較的に安い!すごい! • まだまだ知見は少ないけども、可能性は無限大! 18