dialogflow

package
v0.0.0-...-a8bd3f9 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	TextValue string `json:"text_value"`
	RawText   string `json:"raw_text"`
	Name      string `json:"name"`
}

type CarSearchParameters

type CarSearchParameters struct {
	CarGearboxOriginal string `json:"car_gearbox.original"`
	CarModelOriginal   string `json:"car_model.original"`
	CarModel           string `json:"car_model"`
	CarEnergy          string `json:"car_energy"`
	CarGearbox         string `json:"car_gearbox"`
	Year               string `json:"year"`
	CarKilometers      struct {
		Amount int    `json:"amount"`
		Unit   string `json:"unit"`
	} `json:"car_kilometers"`
	CarKilometersOriginal string `json:"car_kilometers.original"`
	CarEnergyOriginal     string `json:"car_energy.original"`
	CarBrand              string `json:"car_brand"`
	YearOriginal          string `json:"year.original"`
	CarBrandOriginal      string `json:"car_brand.original"`
}

CarSearchParameters is a struct that is sent from DF to the webhook

type Conversation

type Conversation struct {
	ConversationID    string `json:"conversation_id"`
	Type              int    `json:"type"`
	ConversationToken string `json:"conversation_token"`
}

Conversation holds information about the conversation

type Data

type Data struct {
	Inputs       Inputs      `json:"inputs"`
	User         User        `json:"user"`
	Conversation interface{} `json:"conversation"`
}

type Entities

type Entities []Entity

Entities is a slice of Entity

type Entity

type Entity struct {
	Value    string   `json:"value"`
	Synonyms []string `json:"synonyms"`
}

Entity is the representation of an entity

type Fulfillment

type Fulfillment struct {
	Messages interface{} `json:"messages"`
	Speech   string      `json:"speech"`
}

type Input

type Input struct {
	RawInputs []RawInput `json:"raw_inputs"`
	Intent    string     `json:"intent"`
	Arguments []Argument `json:"arguments"`
}

Input are the user inputs

type Inputs

type Inputs []Input

Inputs is a slice of Input

type Message

type Message struct {
	Speech string `json:"speech"`
	Type   int    `json:"type"`
}

type Metadata

type Metadata struct {
	IntentID                  string `json:"intentId"`
	WebhookForSlotFillingUsed string `json:"webhookForSlotFillingUsed"`
	IntentName                string `json:"intentName"`
	WebhookUsed               string `json:"webhookUsed"`
}

type OriginalRequest

type OriginalRequest struct {
	Source string `json:"source"`
	Data   Data   `json:"data"`
}

OriginalRequest is the initial request

type RawInput

type RawInput struct {
	Query     string `json:"query"`
	InputType int    `json:"input_type"`
}

type Request

type Request struct {
	Lang            string          `json:"lang"`
	Status          Status          `json:"status"`
	Timestamp       time.Time       `json:"timestamp"`
	SessionID       string          `json:"sessionId"`
	Result          Result          `json:"result"`
	ID              string          `json:"id"`
	OriginalRequest OriginalRequest `json:"originalRequest"`
}

Request is the main dialogflow request

type Response

type Response struct {
	Speech      string        `json:"speech"`
	DisplayText string        `json:"displayText"`
	Data        interface{}   `json:"data"`
	ContextOut  []interface{} `json:"contextOut"`
	Source      string        `json:"source"`
}

Response the structure of the expected response for dialogflow

type Result

type Result struct {
	Parameters       CarSearchParameters `json:"parameters"`
	Contexts         []interface{}       `json:"contexts"`
	ResolvedQuery    string              `json:"resolvedQuery"`
	Source           string              `json:"source"`
	Score            float64             `json:"score"`
	Speech           string              `json:"speech"`
	Fulfillment      Fulfillment         `json:"fulfillment"`
	ActionIncomplete bool                `json:"actionIncomplete"`
	Action           string              `json:"action"`
	Metadata         Metadata            `json:"metadata"`
}

Result is the result of the request

type Status

type Status struct {
	ErrorType string `json:"errorType"`
	Code      int    `json:"code"`
}

Status is the status of the request

type User

type User struct {
	UserID string `json:"user_id"`
}

User simply holds the user ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL