Amazon Alexa Dev – [email protected]
播放電影預告片
Show me some latest movies.
Play the trailer for number X.
17
https://www.youtube.com/watch?v=aKg85qEFMHs
Slide 17
Slide 17 text
Amazon Alexa Dev – [email protected]
播放音樂
• Just say, “Alexa!” and then…
– “Play [song name] by [artist]”.
– “Pause” pauses the currently playing track.
– “Play [Discover Weekly] playlist”.
– “Volume up/down” turns volume up or down.
– “Stop” stops the currently playing track.
19
Slide 18
Slide 18 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Who is the president of united states?
The US President is
Donald Trump.
20
Slide 19
Slide 19 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Are you hungry?
I don't get hungry or thirsty,
but thank you for asking.
21
Slide 20
Slide 20 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Do you have a brain?
I don't have a brain like you do.
My smarts live in the cloud.
22
Slide 21
Slide 21 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
How old are you?
In years if you're counting it's three.
23
Slide 22
Slide 22 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Are you hot?
No, I don't really feel hot or cold,
but thanks for asking.
24
Slide 23
Slide 23 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Can you speak Chinese?
I speak fluent English and conversational
Pig Latin. My accent is atrocious, but it's
good enough to keep me from getting lost
in Pig Latium.
25
Slide 24
Slide 24 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Pick a card
Your card is
the four of spades.
26
Slide 25
Slide 25 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Roll a six sided die
I rolled a die
and got 4.
27
Slide 26
Slide 26 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Flip a coin
Flipping...
it's heads.
28
Slide 27
Slide 27 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
Good morning
Good morning, and happy birthday
to comedian Ellen Degeneres. She's a
funny lady who loves to dance. I'm
pretty sure we'd be BFFs, if we ever
got a chance to hang out!
29
Slide 28
Slide 28 text
Amazon Alexa Dev – [email protected]
可以跟Alexa聊什麼?
How much are you?
You can search on Amazon.com
to see how much I cost.
30
Amazon Alexa Dev – [email protected]
開發前準備事項
• an Amazon Web Services (AWS) account
• an AWS Profile
• an Amazon Developer Portal account
• the ASK CLI tool
59
Amazon Alexa Dev – [email protected]
設定例句句型
• 設定AnswerIntent的例句
– I think the most popular program is { }
– 設定Slot name為Course
• Slot Type設定為TrainingProgram
76
Slide 74
Slide 74 text
Amazon Alexa Dev – [email protected]
繼續增加更多例句
• I think it's {Course}
• It is {Course}
• The answer is {Course}
• It should be {Course}
77
Slide 75
Slide 75 text
Amazon Alexa Dev – [email protected]
終端機
• 建立專案 ask new
• 選擇執行環境 Node.js V8
• 選擇樣板 Hello World
• 設定技能名稱 one-quiz
• 建立完成
78
Slide 76
Slide 76 text
Amazon Alexa Dev – [email protected]
VS Code
• 開啟專案資料夾
• 編輯 models/en-US.json
– 設定Invocation Name
– 增加AnswerIntent、samples、slots
– 增加一個type為TrainingProgram、設定相關value
79
Amazon Alexa Dev – [email protected]
終端機
• 建立專案 ask new
• 選擇執行環境 Node.js V8
• 選擇樣板 Hello World
• 設定技能名稱 my-cold-joke-xxxx
• 建立完成
96
Slide 94
Slide 94 text
Amazon Alexa Dev – [email protected]
VS Code
• 開啟專案資料夾
• 編輯 models/en-US.json
– 設定Invocation Name:you go cold joke
– 增加Intent:GetNewJokeIntent
• 在這個Intent底下增加 samples
– suprise me with a cold joke
– shoot me a cold joke
– give me a joke
– give me a cole joke
– tell me a joke
– tell me a cold joke
97
Amazon Alexa Dev – [email protected]
部署與測試
• 終端機部署 ask deploy
• 終端機測試 ask dialog -l en-US
107
• 網站測試 alexa dev site -> Test
Slide 105
Slide 105 text
Amazon Alexa Dev – [email protected]
應用程式邏輯
tell me a joke
tell me a cold joke
give me a joke
give me a cold joke
shoot me a cold jpke
Surprise me with a cold joke
Joke 1
Joke 2
Joke 3
Joke 4
Joke 5
Joke 6
Joke 7
Joke 8
Joke 9
Joke 10
108
Intent : GetNewJoke