models

package
v0.0.0-...-1cde290 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION             = "2.0.0-beta.20"
	DEFAULT_BASE_URL    = "https://api.dialogflow.com/v1/"
	DEFAULT_API_VERSION = "20150910"
	DEFAULT_CLIENT_LANG = "en"
)

Variables

View Source
var AVAILABLE_LANGUAGES = map[string]string{
	"EN":    "en",
	"DE":    "de",
	"ES":    "es",
	"PT_BR": "pt-BR",
	"ZH_HK": "zh-HK",
	"ZH_CN": "zh-CN",
	"ZH_TW": "zh-TW",
	"FR":    "fr",
	"NL":    "nl",
	"IT":    "it",
	"JA":    "ja",
	"KO":    "ko",
	"RU":    "ru",
	"UK":    "uk",
	"PT":    "pt",
}

Functions

This section is empty.

Types

type Context

type Context struct {
	Name       string           `json:"name,omitempty"`
	Lifespan   int              `json:"lifespan,omitempty"`
	Parameters ContextParameter `json:"parameters,omitempty"`
}

type ContextOut

type ContextOut struct {
	Name     string `json:"name,omitempty"`
	Lifespan int    `json:"lifespan,omitempty"`
}

type ContextParameter

type ContextParameter struct {
	IntentAction string `json:"intent_action,omitempty"`
	Name         string `json:"name,omitempty"`
	Value        string `json:"value,omitempty"`
}

type CortanaCommand

type CortanaCommand struct {
	NavigationOrService string `json:"navigationOrService,omitempty"`
	Target              string `json:"target,omitempty"`
}

type Data

type Data struct {
	Text        string `json:"text,omitempty"`
	Meta        string `json:"meta,omitempty"`
	Alias       string `json:"alias,omitempty"`
	UserDefined bool   `json:"userDefined,omitempty"`
}

type Entity

type Entity struct {
	ID                 string  `json:"id,omitempty"`
	Name               string  `json:"name,omitempty"`
	Count              int     `json:"count,omitempty"`
	Preview            string  `json:"preview,omitempty"`
	IsOverridable      bool    `json:"isOverridable,omitempty"`
	IsEnum             bool    `json:"isEnum,omitempty"`
	AutomatedExpansion bool    `json:"automatedExpansion,omitempty"`
	Entries            []Entry `json:"entries,omitempty"`
}

type Entry

type Entry struct {
	Value    string   `json:"value,omitempty"`
	Synonyms []string `json:"synonyms,omitempty"`
}

type Event

type Event struct {
	Name string            `json:"name,omitempty"`
	Data map[string]string `json:"data,omitempty"`
}

type Fulfillment

type Fulfillment struct {
	Speech   string    `json:"speech,omitempty"`
	Messages []Message `json:"messages,omitempty"`
}

type Intent

type Intent struct {
	ID                    string         `json:"id,omitempty"`
	Name                  string         `json:"name,omitempty"`
	Auto                  bool           `json:"auto,omitempty"`
	Contexts              []string       `json:"contexts,omitempty"`
	Templates             []string       `json:"templates,omitempty"`
	UserSays              []UserSay      `json:"userSays,omitempty"`
	Responses             []Response     `json:"responses,omitempty"`
	Priority              int            `json:"priority,omitempty"`
	WebhookUsed           bool           `json:"webhookUsed,omitempty"`
	WebhookForSlotFilling bool           `json:"webhookForSlotFilling,omitempty"`
	FallbackIntent        bool           `json:"fallbackIntent,omitempty"`
	CortanaCommand        CortanaCommand `json:"cortanaCommand,omitempty"`
	Events                []Event        `json:"events,omitempty"`
}

type IntentAgent

type IntentAgent struct {
	ID             string       `json:"id,omitempty"`
	Name           string       `json:"name,omitempty"`
	ContextIn      []string     `json:"contextIn,omitempty"`
	ContextOut     []ContextOut `json:"contextOut,omitempty"`
	Actions        []string     `json:"actions,omitempty"`
	Parameters     []Parameter  `json:"parameters,omitempty"`
	Priority       int          `json:"priority,omitempty"`
	FallbackIntent bool         `json:"fallbackIntent,omitempty"`
}

type Location

type Location struct {
	Latitude  float32 `json:"latitude,omitempty"`
	Longitude float32 `json:"longitude,omitempty"`
}

type Message

type Message struct {
	Type   interface{} `json:"type,omitempty"`
	Speech string      `json:"speech,omitempty"`
}

type Metadata

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

type Options

type Options struct {
	AccessToken string
	ApiLang     string
	ApiVersion  string
	ApiBaseUrl  string
	SessionID   string
}

type OriginalRequest

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

type Parameter

type Parameter struct {
	Name         string   `json:"name,omitempty"`
	Value        string   `json:"value,omitempty"`
	DefaultValue string   `json:"defaultValue,omitempty"`
	Required     bool     `json:"required,omitempty"`
	DataType     string   `json:"dataType,omitempty"`
	Prompts      []string `json:"prompts,omitempty"`
	IsList       bool     `json:"isList,omitempty"`
}

type Query

type Query struct {
	Query           string          `json:"query,omitempty"`
	E               Event           `json:"e,omitempty"`
	Event           Event           `json:"event,omitempty"`
	V               string          `json:"v,omitempty"`
	SessionID       string          `json:"sessionId,omitempty"`
	Lang            string          `json:"lang,omitempty"`
	Contexts        []Context       `json:"contexts,omitempty"`
	ResetContexts   bool            `json:"resetContexts,omitempty"`
	Entities        []Entity        `json:"entities,omitempty"`
	Timezone        string          `json:"timezone,omitempty"`
	Location        Location        `json:"location,omitempty"`
	OriginalRequest OriginalRequest `json:"originalRequest,omitempty"`
}

func (Query) ToMap

func (query Query) ToMap() map[string]string

type QueryResponse

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

type RequestOptions

type RequestOptions struct {
	URI         string
	Method      string
	Body        interface{}
	QueryParams map[string]string
}

type Response

type Response struct {
	Action           string      `json:"action,omitempty"`
	ResetContexts    bool        `json:"resetContexts,omitempty"`
	AffectedContexts []Context   `json:"affectedContexts,omitempty"`
	Parameters       []Parameter `json:"parameters,omitempty"`
	Messages         []Message   `json:"message,omitempty"`
}

type Result

type Result struct {
	Source           string                 `json:"source,omitempty"`
	Action           string                 `json:"action,omitempty"`
	ResolvedQuery    string                 `json:"resolvedQuery,omitempty"`
	ActionIncomplete bool                   `json:"actionIncomplete,omitempty"`
	Parameters       map[string]interface{} `json:"parameters,omitempty"`
	Contexts         []Context              `json:"contexts,omitempty"`
	Metadata         Metadata               `json:"metadata,omitempty"`
	Fulfillment      Fulfillment            `json:"fulfillment,omitempty"`
	Score            float32                `json:"score,omitempty"`
}

type Status

type Status struct {
	Code         int    `json:"code,omitempty"`
	ErrorDetails string `json:"errorDetails,omitempty"`
	ErrorID      string `json:"errorId,omitempty"`
	ErrorType    string `json:"errorType,omitempty"`
}

type UserEntity

type UserEntity struct {
	SessionID string  `json:"sessionId,omitempty"`
	Name      string  `json:"name,omitempty"`
	Extend    bool    `json:"extend,omitempty"`
	Entries   []Entry `json:"entries,omitempty"`
}

type UserSay

type UserSay struct {
	ID         string `json:"userSays,omitempty"`
	Data       Data   `json:"data,omitempty"`
	IsTemplate bool   `json:"isTemplate,omitempty"`
	Count      int    `json:"count,omitempty"`
}

Jump to

Keyboard shortcuts

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