utils

package
v0.0.0-...-35bb69c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeCtlMain           = "projects/demo-lab/agent/intents/<replace-this-with-your-dialogflow-intent-id-1>"
	KubeCtlServiceInfo    = "projects/demo-lab/agent/intents/<replace-this-with-your-dialogflow-intent-id-2>"
	KubeCtlVirtualService = "projects/demo-lab/agent/intents/<replace-this-with-your-dialogflow-intent-id-3>"
)

replace the whole intent key or just the intent-id from the based upon your dialogflow request

Variables

This section is empty.

Functions

func DecodeDialogFlowRequest

func DecodeDialogFlowRequest(r *http.Request) (*dialogflow.GoogleCloudDialogflowV2WebhookRequest, error)

DecodeDialogFlowRequest parses the dialog flow

func DecodeParameters

func DecodeParameters(jsonBytes []byte) (map[string]string, error)

DecodeParameters decodes the parameters from the webhook request

func MakeErrorWebhookResponse

func MakeErrorWebhookResponse(msg string) dialogflow.GoogleCloudDialogflowV2WebhookResponse

MakeErrorWebhookResponse makes error response if something fails

func MakeWebhookResponse

func MakeWebhookResponse(expectUserResponse bool, msg string, outputCOntexts []*dialogflow.GoogleCloudDialogflowV2Context) dialogflow.GoogleCloudDialogflowV2WebhookResponse

MakeWebhookResponse make dialogflow webhook response

func PrintResponse

func PrintResponse(response dialogflow.GoogleCloudDialogflowV2WebhookResponse)

PrintResponse prints the dialogflow response

Types

type FollowupEventInput

type FollowupEventInput struct {
	Name         string `json:"name"`
	LanguageCode string `json:"languageCode"`
	Parameters   struct {
		Param string `json:"param"`
	} `json:"parameters"`
}

FollowupEventInput struct

type Item

type Item struct {
	SimpleResponse SimpleResponse `json:"simpleResponse"`
}

Item struct

type ResponseGoogle

type ResponseGoogle struct {
	ExpectUserResponse bool                  `json:"expectUserResponse"`
	RichResponse       RichResponse          `json:"richResponse"`
	SystemIntent       *ResponseSystemIntent `json:"systemIntent,omitempty"`
}

ResponseGoogle struct

type ResponsePayload

type ResponsePayload struct {
	Google ResponseGoogle `json:"google"`
}

ResponsePayload struct

type ResponseSystemIntent

type ResponseSystemIntent struct {
	Intent string                   `json:"intent"`
	Data   ResponseSystemIntentData `json:"data"`
}

ResponseSystemIntent struct

type ResponseSystemIntentData

type ResponseSystemIntentData struct {
	Type        string   `json:"@type"`
	OptContext  string   `json:"optContext"`
	Permissions []string `json:"permissions"`
}

ResponseSystemIntentData struct

type RichResponse

type RichResponse struct {
	Items []Item `json:"items"`
}

RichResponse struct

type SimpleResponse

type SimpleResponse struct {
	TextToSpeech string `json:"textToSpeech"`
}

SimpleResponse struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳