Documentation
¶
Index ¶
- Constants
- func DecodeDialogFlowRequest(r *http.Request) (*dialogflow.GoogleCloudDialogflowV2WebhookRequest, error)
- func DecodeParameters(jsonBytes []byte) (map[string]string, error)
- func MakeErrorWebhookResponse(msg string) dialogflow.GoogleCloudDialogflowV2WebhookResponse
- func MakeWebhookResponse(expectUserResponse bool, msg string, ...) dialogflow.GoogleCloudDialogflowV2WebhookResponse
- func PrintResponse(response dialogflow.GoogleCloudDialogflowV2WebhookResponse)
- type FollowupEventInput
- type Item
- type ResponseGoogle
- type ResponsePayload
- type ResponseSystemIntent
- type ResponseSystemIntentData
- type RichResponse
- type SimpleResponse
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 ¶
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 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 SimpleResponse ¶
type SimpleResponse struct {
TextToSpeech string `json:"textToSpeech"`
}
SimpleResponse struct
Click to show internal directories.
Click to hide internal directories.