Mary Marchini
@mmarkini
Developers Team Leader @
Sthima
Node.js Collaborator
@mmarkini
http://mmarchini.me/
oss@mmarchini.me
https://github.com/mmarchini/
Node.js Diagnostics WG Member
Não configure na mão!
serverless
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
import json
def hello(event, context):
body = {
"message":
"Go Serverless v1.0! Your function executed successfully!",
"input": event
}
response = {
"statusCode": 200,
"body": json.dumps(body)
}
return responsehandler.py
service: slack-chatbot
provider:
name: aws
runtime: python3.6
functions:
hello:
handler: handler.hello
serverless.ymlservice: slack-chatbot
provider:
name: aws
runtime: python3.6
functions:
hello:
handler: handler.hello
events:
- http:
path: slack-chatbot/hello/
method: get
serverless.ymlInstalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
service: slack-chatbot
provider:
name: aws
runtime: python3.6
functions:
hello:
handler: handler.hello
events:
- http:
path: slack-chatbot/hello/
method: post
serverless.ymlimport json
def hello(event, context):
data = json.loads(event['body'])
intent = data['queryResult']['action']
bot_name = data['queryResult']['parameters']['BotName']
fulfillment_text = "Sorry, I don't understand what you're saying"
if intent == "about":
fulfillment_text = f"I'm your friendly bot named {bot_name}!"
response = {
"statusCode": 200,
"body": json.dumps({
"fulfillmentText": fulfillment_text
})
}
return responsehandler.py
handler.py
handler.py
Instalar Serverless e Criar projeto
Configurar Credenciais da AWS
Fazer deploy no AWS Lambda
Configurar integração Slack <-> Dialogflow
Criar Intenção no Dialogflow
Configurar Webhook no Dialogflow
Implementar resposta no AWS Lambda
@mmarkini
http://mmarchini.me/
oss@mmarchini.me
https://github.com/mmarchini/
www.sthima.com