skill

package
v0.0.0-...-2ebb6ce Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package skill serves generating the skill and model.

Package skill contains the builders for the skill manifest and interaction models.

Index

Constants

View Source
const (
	// DelegationSkillResponse delegates dialogs to lambda.
	DelegationSkillResponse string = "SKILL_RESPONSE"
	// DelegationAlways delegates dialogs to Alexa.
	DelegationAlways string = "ALWAYS"
)
View Source
const (
	ValidationTypeHasMatch      string = "hasEntityResolutionMatch"
	ValidationTypeInSet         string = "isInSet"
	ValidationTypeNotInSet      string = "isNotInSet"
	ValidationTypeGreaterThan   string = "isGreaterThan"
	ValidationTypeGreaterEqal   string = "isGreaterThanOrEqualTo"
	ValidationTypeLessThan      string = "isLessThan"
	ValidationTypeLessEqual     string = "isLessThanOrEqualTo"
	ValidationTypeInDuration    string = "isInDuration"
	ValidationTypeNotInDuration string = "isNotInDuration"
)

see https://developer.amazon.com/docs/custom-skills/validate-slot-values.html#validation-rules

View Source
const (
	// CountryAustralia is AU.
	CountryAustralia string = "AU"
	// CountryCanada is CA.
	CountryCanada string = "CA"
	// CountryGermany is DE.
	CountryGermany string = "DE"
	// CountryFrance is FR.
	CountryFrance string = "FR"
	// CountryGreatBritain is GB.
	CountryGreatBritain string = "GB"
	// CountryIndia is IN.
	CountryIndia string = "IN"
	// CountryItaly is IT.
	CountryItaly string = "IT"
	// CountryJapan is JP.
	CountryJapan string = "JP"
	// CountryUnitedStates is US.
	CountryUnitedStates string = "US"
)
View Source
const (
	FlagIsExportCompliant string = "IsExportCompliant"
	FlagContainsAds       string = "ContainsAds"
	FlagAllowsPurchases   string = "AllowsPurchases"
	FlagUsesPersonalInfo  string = "UsesPersonalInfo"
	FlagIsChildDirected   string = "IsChildDirected"
)

Flags for alexa.Privacy.

Variables

This section is empty.

Functions

func NewModelBuilder

func NewModelBuilder() *modelBuilder

NewModelBuilder returns an initialized modelBuilder.

func NewModelIntentBuilder

func NewModelIntentBuilder(name string) *modelIntentBuilder

NewModelIntentBuilder returns an initialized modelIntentBuilder.

func NewModelSlotBuilder

func NewModelSlotBuilder(intent, name, typeName string) *modelSlotBuilder

NewModelSlotBuilder returns an initialized modelSlotBuilder.

func NewModelTypeBuilder

func NewModelTypeBuilder(name string) *modelTypeBuilder

NewModelTypeBuilder returns an initialized modelTypeBuilder.

func NewModelValidationRulesBuilder

func NewModelValidationRulesBuilder() *modelValidationRulesBuilder

NewModelValidationRulesBuilder returns an initialized modelValidationBuilder.

func NewPromptVariations

func NewPromptVariations(intent, slot, promptType, varType string) *promptVariationsBuilder

NewPromptVariations returns an initialized builder with lookup key "$intent_$slot_$promptType_(Text|SSML)".

Types

type Apis

type Apis struct {
	ForBusiness *ForBusiness `json:"alexaForBusiness,omitempty"`
	Custom      *Custom      `json:"custom,omitempty"`
	// SmartHome *SmartHome `json:"smartHome"`
	FlashBriefing *FlashBriefing `json:"flashBriefing"`
	// Health     *Health	`json:"health"`
	// HouseholdList *HouseholdList `json:"householdList"`
	// Video *Video `json:"video"`
	Interfaces []string `json:"interfaces,omitempty"`
}

Apis of the Alexa Skill https://developer.amazon.com/de/docs/smapi/skill-manifest.html#apis

type Category

type Category string

Category of the Skill that is used for filtering in the Alexa App

see https://developer.amazon.com/de/docs/smapi/skill-manifest.html#category-enum

const (
	// CategoryAlarmsAndClocks is ALARMS_AND_CLOCKS.
	CategoryAlarmsAndClocks Category = "ALARMS_AND_CLOCKS"
	// CategoryAstrology is ASTROLOGY.
	CategoryAstrology Category = "ASTROLOGY"
	// CategoryBusinessAndFinance is BUSINESS_AND_FINANCE.
	CategoryBusinessAndFinance Category = "BUSINESS_AND_FINANCE"
	// CategoryCalculators is CALCULATORS.
	CategoryCalculators Category = "CALCULATORS"
	// CategoryCalendarsAndReminders is CALENDARS_AND_REMINDERS.
	CategoryCalendarsAndReminders Category = "CALENDARS_AND_REMINDERS"
	// CategoryChildrensEducationAndReference is CHILDRENS_EDUCATION_AND_REFERENCE.
	CategoryChildrensEducationAndReference Category = "CHILDRENS_EDUCATION_AND_REFERENCE"
	// CategoryChildrensGames is CHILDRENS_GAMES.
	CategoryChildrensGames Category = "CHILDRENS_GAMES"
	// CategoryChildrensMusicAndAudio is CHILDRENS_MUSIC_AND_AUDIO.
	CategoryChildrensMusicAndAudio Category = "CHILDRENS_MUSIC_AND_AUDIO"
	// CategoryChildrensNoveltyAndHumor is CHILDRENS_NOVELTY_AND_HUMOR.
	CategoryChildrensNoveltyAndHumor Category = "CHILDRENS_NOVELTY_AND_HUMOR"
	// CategoryCommunication is COMMUNICATION.
	CategoryCommunication Category = "COMMUNICATION"
	// CategoryConnectedCar is CONNECTED_CAR.
	CategoryConnectedCar Category = "CONNECTED_CAR"
	// CategoryCookingAndRecipe is COOKING_AND_RECIPE.
	CategoryCookingAndRecipe Category = "COOKING_AND_RECIPE"
	// CategoryCurrencyGuidesAndConverters is CURRENCY_GUIDES_AND_CONVERTERS.
	CategoryCurrencyGuidesAndConverters Category = "CURRENCY_GUIDES_AND_CONVERTERS"
	// CategoryDating is DATING.
	CategoryDating Category = "DATING"
	// CategoryDeliveryAndTakeout is DELIVERY_AND_TAKEOUT.
	CategoryDeliveryAndTakeout Category = "DELIVERY_AND_TAKEOUT"
	// CategoryDeviceTracking is DEVICE_TRACKING.
	CategoryDeviceTracking Category = "DEVICE_TRACKING"
	// CategoryEducationAndReference is EDUCATION_AND_REFERENCE.
	CategoryEducationAndReference Category = "EDUCATION_AND_REFERENCE"
	// CategoryEventFinders is EVENT_FINDERS.
	CategoryEventFinders Category = "EVENT_FINDERS"
	// CategoryExerciseAndWorkout is EXERCISE_AND_WORKOUT.
	CategoryExerciseAndWorkout Category = "EXERCISE_AND_WORKOUT"
	// CategoryFashionAndStyle is FASHION_AND_STYLE.
	CategoryFashionAndStyle Category = "FASHION_AND_STYLE"
	// CategoryFlightFinders is FLIGHT_FINDERS.
	CategoryFlightFinders Category = "FLIGHT_FINDERS"
	// CategoryFriendsAndFamily is FRIENDS_AND_FAMILY.
	CategoryFriendsAndFamily Category = "FRIENDS_AND_FAMILY"
	// CategoryGameInfoAndAccessory is GAME_INFO_AND_ACCESSORY.
	CategoryGameInfoAndAccessory Category = "GAME_INFO_AND_ACCESSORY"
	// CategoryGames is GAMES.
	CategoryGames Category = "GAMES"
	// CategoryHealthAndFitness is HEALTH_AND_FITNESS.
	CategoryHealthAndFitness Category = "HEALTH_AND_FITNESS"
	// CategoryHotelFinders is HOTEL_FINDERS.
	CategoryHotelFinders Category = "HOTEL_FINDERS"
	// CategoryKnowledgeAndTrivia is KNOWLEDGE_AND_TRIVIA.
	CategoryKnowledgeAndTrivia Category = "KNOWLEDGE_AND_TRIVIA"
	// CategoryMovieAndTvKnowledgeAndTrivia is MOVIE_AND_TV_KNOWLEDGE_AND_TRIVIA.
	CategoryMovieAndTvKnowledgeAndTrivia Category = "MOVIE_AND_TV_KNOWLEDGE_AND_TRIVIA"
	// CategoryMovieInfoAndReviews is MOVIE_INFO_AND_REVIEWS.
	CategoryMovieInfoAndReviews Category = "MOVIE_INFO_AND_REVIEWS"
	// CategoryMovieShowtimes is MOVIE_SHOWTIMES.
	CategoryMovieShowtimes Category = "MOVIE_SHOWTIMES"
	// CategoryMusicAndAudioAccessories is MUSIC_AND_AUDIO_ACCESSORIES.
	CategoryMusicAndAudioAccessories Category = "MUSIC_AND_AUDIO_ACCESSORIES"
	// CategoryMusicAndAudioKnowledgeAndTrivia is MUSIC_AND_AUDIO_KNOWLEDGE_AND_TRIVIA.
	CategoryMusicAndAudioKnowledgeAndTrivia Category = "MUSIC_AND_AUDIO_KNOWLEDGE_AND_TRIVIA"
	// CategoryMusicInfoReviewsAndRecognitionService is MUSIC_INFO_REVIEWS_AND_RECOGNITION_SERVICE.
	CategoryMusicInfoReviewsAndRecognitionService Category = "MUSIC_INFO_REVIEWS_AND_RECOGNITION_SERVICE"
	// CategoryNavigationAndTripPlanner is NAVIGATION_AND_TRIP_PLANNER.
	CategoryNavigationAndTripPlanner Category = "NAVIGATION_AND_TRIP_PLANNER"
	// CategoryNews is NEWS.
	CategoryNews Category = "NEWS"
	// CategoryNovelty is NOVELTY.
	CategoryNovelty Category = "NOVELTY"
	// CategoryOrganizersAndAssistants is ORGANIZERS_AND_ASSISTANTS.
	CategoryOrganizersAndAssistants Category = "ORGANIZERS_AND_ASSISTANTS"
	// CategoryPetsAndAnimal is PETS_AND_ANIMAL.
	CategoryPetsAndAnimal Category = "PETS_AND_ANIMAL"
	// CategoryPodcast is PODCAST.
	CategoryPodcast Category = "PODCAST"
	// CategoryPublicTransportation is PUBLIC_TRANSPORTATION.
	CategoryPublicTransportation Category = "PUBLIC_TRANSPORTATION"
	// CategoryReligionAndSpirituality is RELIGION_AND_SPIRITUALITY.
	CategoryReligionAndSpirituality Category = "RELIGION_AND_SPIRITUALITY"
	// CategoryRestaurantBookingInfoAndReview is RESTAURANT_BOOKING_INFO_AND_REVIEW.
	CategoryRestaurantBookingInfoAndReview Category = "RESTAURANT_BOOKING_INFO_AND_REVIEW"
	// CategorySchools is SCHOOLS.
	CategorySchools Category = "SCHOOLS"
	// CategoryScoreKeeping is SCORE_KEEPING.
	CategoryScoreKeeping Category = "SCORE_KEEPING"
	// CategorySelfImprovement is SELF_IMPROVEMENT.
	CategorySelfImprovement Category = "SELF_IMPROVEMENT"
	// CategoryShopping is SHOPPING.
	CategoryShopping Category = "SHOPPING"
	// CategorySmartHome is SMART_HOME.
	CategorySmartHome Category = "SMART_HOME"
	// CategorySocialNetworking is SOCIAL_NETWORKING.
	CategorySocialNetworking Category = "SOCIAL_NETWORKING"
	// CategorySportsGames is SPORTS_GAMES.
	CategorySportsGames Category = "SPORTS_GAMES"
	// CategorySportsNews is SPORTS_NEWS.
	CategorySportsNews Category = "SPORTS_NEWS"
	// CategoryStreamingService is STREAMING_SERVICE.
	CategoryStreamingService Category = "STREAMING_SERVICE"
	// CategoryTaxiAndRidesharing is TAXI_AND_RIDESHARING.
	CategoryTaxiAndRidesharing Category = "TAXI_AND_RIDESHARING"
	// CategoryToDoListsAndNotes is TO_DO_LISTS_AND_NOTES.
	CategoryToDoListsAndNotes Category = "TO_DO_LISTS_AND_NOTES"
	// CategoryTranslators is TRANSLATORS.
	CategoryTranslators Category = "TRANSLATORS"
	// CategoryTvGuides is TV_GUIDES.
	CategoryTvGuides Category = "TV_GUIDES"
	// CategoryUnitConverters is UNIT_CONVERTERS.
	CategoryUnitConverters Category = "UNIT_CONVERTERS"
	// CategoryWeather is WEATHER.
	CategoryWeather Category = "WEATHER"
	// CategoryWineAndBeverage is WINE_AND_BEVERAGE.
	CategoryWineAndBeverage Category = "WINE_AND_BEVERAGE"
	// CategoryZipCodeLookup is ZIP_CODE_LOOKUP.
	CategoryZipCodeLookup Category = "ZIP_CODE_LOOKUP"
)

type ContentGenre

type ContentGenre string

ContentGenre is an enum for flashBriefing feed content genre.

const (
	// ContentGenreHeadlineNews is HEADLINE_NEWS.
	ContentGenreHeadlineNews ContentGenre = "HEADLINE_NEWS"
	// ContentGenreBusiness is BUSINESS.
	ContentGenreBusiness ContentGenre = "BUSINESS"
	// ContentGenrePolitics is POLITICS.
	ContentGenrePolitics ContentGenre = "POLITICS"
	// ContentGenreEntertainment is ENTERTAINMENT.
	ContentGenreEntertainment ContentGenre = "ENTERTAINMENT"
	// ContentGenreTechnology is TECHNOLOGY.
	ContentGenreTechnology ContentGenre = "TECHNOLOGY"
	// ContentGenreHumor is HUMOR.
	ContentGenreHumor ContentGenre = "HUMOR"
	// ContentGenreLifestyle is LIFESTYLE.
	ContentGenreLifestyle ContentGenre = "LIFESTYLE"
	// ContentGenreSports is SPORTS.
	ContentGenreSports ContentGenre = "SPORTS"
	// ContentGenreScience is SCIENCE.
	ContentGenreScience ContentGenre = "SCIENCE"
	// ContentGenreHealthAndFitness is HEALTH_AND_FITNESS.
	ContentGenreHealthAndFitness ContentGenre = "HEALTH_AND_FITNESS"
	// ContentGenreArtsAndCulture is ARTS_AND_CULTURE.
	ContentGenreArtsAndCulture ContentGenre = "ARTS_AND_CULTURE"
	// ContentGenreProductivityAndUtilities is PRODUCTIVITY_AND_UTILITIES.
	ContentGenreProductivityAndUtilities ContentGenre = "PRODUCTIVITY_AND_UTILITIES"
	// ContentGenreOther is OTHER.
	ContentGenreOther ContentGenre = "OTHER"
)

type ContentType

type ContentType string

ContentType is an enum for flashBriefing feed content type.

const (
	// ContentTypeText is TEXT.
	ContentTypeText ContentType = "TEXT"
	// ContentTypeAudio is AUDIO.
	ContentTypeAudio ContentType = "AUDIO"
)

type Custom

type Custom struct {
	Endpoint   *Endpoint             `json:"endpoint"`
	Regions    *map[Region]RegionDef `json:"regions"`
	Interfaces []Interface           `json:"interfaces,omitempty"`
}

Custom API endpoint.

type Dialog

type Dialog struct {
	Delegation string         `json:"delegationStrategy"`
	Intents    []DialogIntent `json:"intents,omitempty"`
}

Dialog defines rules for conducting a multi-turn dialog with the user.

type DialogIntent

type DialogIntent struct {
	Name         string             `json:"name"`
	Confirmation bool               `json:"confirmationRequired"`
	Delegation   string             `json:"delegationStrategy,omitempty"`
	Prompts      IntentPrompt       `json:"prompts,omitempty"`
	Slots        []DialogIntentSlot `json:"slots,omitempty"`
}

DialogIntent defines an intent that has dialog rules associated with it.

type DialogIntentSlot

type DialogIntentSlot struct {
	Name         string           `json:"name"`
	Type         string           `json:"type"`
	Confirmation bool             `json:"confirmationRequired"`
	Elicitation  bool             `json:"elicitationRequired"`
	Prompts      SlotPrompts      `json:"prompts,omitempty"`
	Validations  []SlotValidation `json:"validations,omitempty"`
}

DialogIntentSlot defines a slot in this intent that has dialog rules.

type Endpoint

type Endpoint struct {
	URI                string `json:"uri"`
	SslCertificateType string `json:"sslCertificateType,omitempty"`
}

Endpoint definition.

type FlashBriefing

type FlashBriefing struct {
	Locales map[string]FlashBriefingLocaleDef `json:"locales"`
}

FlashBriefing API endpoint.

type FlashBriefingLocaleDef

type FlashBriefingLocaleDef struct {
	CustomErrorMessage string                    `json:"customErrorMessage"`
	Feeds              []FlashBriefingLocaleFeed `json:"feeds"`
}

FlashBriefingLocaleDef is locale definition for flashBriefing API.

type FlashBriefingLocaleFeed

type FlashBriefingLocaleFeed struct {
	Name            string          `json:"name"`
	IsDefault       bool            `json:"isDefault"`
	VuiPreamble     string          `json:"vuiPreamble"`
	UpdateFrequency UpdateFrequency `json:"updateFrequency"`
	Genre           ContentGenre    `json:"genre"`
	ImageURI        string          `json:"imageUri"`
	ContentType     ContentType     `json:"contentType"`
	URL             string          `json:"url"`
}

FlashBriefingLocaleFeed is a feed definition for flashBriefing API.

type ForBusiness

type ForBusiness struct {
	Endpoint   *Endpoint             `json:"endpoint"`
	Regions    *map[Region]RegionDef `json:"regions"`
	Interfaces []Interface           `json:"interfaces,omitempty"`
}

ForBusiness API are available in English only.

type IntentPrompt

type IntentPrompt struct {
	Confirmation string `json:"confirmation,omitempty"`
}

IntentPrompt defines a prompt for an intent.

type IntentProvider

type IntentProvider interface {
	GetIntents() map[string]string
	GetIntentSlots(intent string) map[string]string
}

IntentProvider exposes intents with optional slots.

type InteractionModel

type InteractionModel struct {
	Language LanguageModel `json:"languageModel"`
	Dialog   *Dialog       `json:"dialog,omitempty"`
	Prompts  []ModelPrompt `json:"prompts,omitempty"`
}

InteractionModel defines the base model structure.

type Interface

type Interface struct {
	Type InterfaceType `json:"type"`
}

Interface definition for API.

type InterfaceType

type InterfaceType string

InterfaceType string reference.

const (
	// InterfaceTypeAlexaPresentationAPL is ALEXA_PRESENTATION_APL.
	InterfaceTypeAlexaPresentationAPL InterfaceType = "ALEXA_PRESENTATION_APL"
	// InterfaceTypeAudioPlayer is AUDIO_PLAYER.
	InterfaceTypeAudioPlayer InterfaceType = "AUDIO_PLAYER"
	// InterfaceTypeCanFulfillIntentRequest is CAN_FULFILL_INTENT_REQUEST.
	InterfaceTypeCanFulfillIntentRequest InterfaceType = "CAN_FULFILL_INTENT_REQUEST"
	// InterfaceTypeGadgetController is GADGET_CONTROLLER.
	InterfaceTypeGadgetController InterfaceType = "GADGET_CONTROLLER"
	// InterfaceTypeGameEngine is GAME_ENGINE.
	InterfaceTypeGameEngine InterfaceType = "GAME_ENGINE"
	// InterfaceTypeRenderTemplate is RENDER_TEMPLATE.
	InterfaceTypeRenderTemplate InterfaceType = "RENDER_TEMPLATE"
	// InterfaceTypeVideoApp is VIDEO_APP.
	InterfaceTypeVideoApp InterfaceType = "VIDEO_APP"
)

type LanguageModel

type LanguageModel struct {
	Invocation string        `json:"invocationName"`
	Intents    []ModelIntent `json:"intents"`
	Types      []ModelType   `json:"types,omitempty"`
}

LanguageModel defines conversational primitives for the skill.

type LocaleDef

type LocaleDef struct {
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Summary      string   `json:"summary"`
	Examples     []string `json:"examplePhrases"`
	Keywords     []string `json:"keywords"`
	SmallIconURI string   `json:"smallIconUri"`
	LargeIconURI string   `json:"largeIconUri"`
}

LocaleDef description of each locale.

type Manifest

type Manifest struct {
	Version     string       `json:"manifestVersion"`
	Publishing  Publishing   `json:"publishingInformation"`
	Apis        *Apis        `json:"apis,omitempty"`
	Permissions []Permission `json:"permissions,omitempty"`
	Privacy     *Privacy     `json:"privacyAndCompliance"`
}

Manifest is the parent for all other elements.

type Model

type Model struct {
	Model InteractionModel `json:"interactionModel"`
}

Model is the root of an interactionModel.

type ModelIntent

type ModelIntent struct {
	Name    string      `json:"name"`
	Samples []string    `json:"samples,omitempty"`
	Slots   []ModelSlot `json:"slots,omitempty"`
}

ModelIntent defines intents and their slots.

type ModelPrompt

type ModelPrompt struct {
	ID         string            `json:"id"`
	Variations []PromptVariation `json:"variations"`
}

ModelPrompt defines cues to the user on behalf of the skill for eliciting data or providing feedback.

type ModelPromptBuilder

type ModelPromptBuilder struct {
	// contains filtered or unexported fields
}

ModelPromptBuilder will build a ModelPrompt object.

func NewConfirmationPromptBuilder

func NewConfirmationPromptBuilder(intent, slot string) *ModelPromptBuilder

NewConfirmationPromptBuilder returns an initialized ModelPromptBuilder for Confirmation.

func NewElicitationPromptBuilder

func NewElicitationPromptBuilder(intent, slot string) *ModelPromptBuilder

NewElicitationPromptBuilder returns an initialized ModelPromptBuilder for Elicitation.

func NewValidationPromptBuilder

func NewValidationPromptBuilder(slot, t string) *ModelPromptBuilder

NewValidationPromptBuilder returns an initialized ModelPromptBuilder for Validation.

func (*ModelPromptBuilder) BuildLocale

func (p *ModelPromptBuilder) BuildLocale(locale string) (ModelPrompt, error)

BuildLocale generates a ModelPrompt for the locale.

func (*ModelPromptBuilder) Variation

func (p *ModelPromptBuilder) Variation(varType string) *promptVariationsBuilder

Variation returns the variations for the varType.

func (*ModelPromptBuilder) WithLocaleRegistry

func (p *ModelPromptBuilder) WithLocaleRegistry(registry l10n.LocaleRegistry) *ModelPromptBuilder

WithLocaleRegistry passes a locale registry.

func (*ModelPromptBuilder) WithVariation

func (p *ModelPromptBuilder) WithVariation(varType string) *ModelPromptBuilder

WithVariation creates and sets variations for the varType.

type ModelSlot

type ModelSlot struct {
	Name    string   `json:"name"`
	Type    string   `json:"type"`
	Samples []string `json:"samples,omitempty"`
}

ModelSlot defines slots within the intent.

type ModelType

type ModelType struct {
	Name   string      `json:"name"`
	Values []TypeValue `json:"values"`
}

ModelType defines custom slot types.

type NameValue

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

NameValue defines a value of a custom slot type.

type Permission

type Permission struct {
	Name string `json:"name"`
}

Permission string.

type Privacy

type Privacy struct {
	IsExportCompliant bool                        `json:"isExportCompliant"`
	ContainsAds       bool                        `json:"containsAds"`
	AllowsPurchases   bool                        `json:"allowsPurchases"`
	UsesPersonalInfo  bool                        `json:"usesPersonalInfo"`
	IsChildDirected   bool                        `json:"isChildDirected"`
	Locales           map[string]PrivacyLocaleDef `json:"locales,omitempty"`
}

Privacy definition.

type PrivacyLocaleDef

type PrivacyLocaleDef struct {
	PrivacyPolicyURL string `json:"privacyPolicyUrl,omitempty"`
	TermsOfUse       string `json:"termsOfUse,omitempty"`
}

PrivacyLocaleDef defines.

type PromptVariation

type PromptVariation struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

PromptVariation defines a variation of the prompt.

type Publishing

type Publishing struct {
	Locales             map[string]LocaleDef `json:"locales"`
	Worldwide           bool                 `json:"isAvailableWorldwide"`
	Category            Category             `json:"category"`
	Countries           []string             `json:"distributionCountries,omitempty"`
	TestingInstructions string               `json:"testingInstructions"`
}

Publishing information.

type Region

type Region string

Region for Alexa.

const (
	// RegionNorthAmerica is NA.
	RegionNorthAmerica Region = "NA"
	// RegionEurope is EU.
	RegionEurope Region = "EU"
	// RegionFarEast is FE.
	RegionFarEast Region = "FE"
)

type RegionDef

type RegionDef struct {
	Endpoint *Endpoint `json:"endpoint"`
}

RegionDef for regional endpoints.

type Skill

type Skill struct {
	Manifest Manifest `json:"manifest"`
}

Skill is the Alexa `skill.json` top element.

type SkillBuilder

type SkillBuilder struct {
	// contains filtered or unexported fields
}

SkillBuilder helps to build the SKILL.json.

func NewSkillBuilder

func NewSkillBuilder() *SkillBuilder

NewSkillBuilder returns a new basic SkillBuilder.

func (*SkillBuilder) AddCountries

func (s *SkillBuilder) AddCountries(cs []string) *SkillBuilder

AddCountries adds a list of countries to the list of available countries.

func (*SkillBuilder) AddCountry

func (s *SkillBuilder) AddCountry(country string) *SkillBuilder

AddCountry add a single country to the list of available countries.

func (*SkillBuilder) AddLocale

func (s *SkillBuilder) AddLocale(locale string, opts ...l10n.RegisterFunc) *SkillBuilder

AddLocale creates, registers locale and adds a new locale builder.

func (*SkillBuilder) Build

func (s *SkillBuilder) Build() (*Skill, error)

Build builds an alexa.Skill object.

func (*SkillBuilder) BuildModels

func (s *SkillBuilder) BuildModels() (map[string]*Model, error)

BuildModels builds an alexa.Model for each locale.

func (*SkillBuilder) Locale

func (s *SkillBuilder) Locale(locale string) *SkillLocaleBuilder

Locale returns the corresponding locale builder.

func (*SkillBuilder) Model

func (s *SkillBuilder) Model() *modelBuilder

Model returns the corresponding model builder.

func (*SkillBuilder) WithCategory

func (s *SkillBuilder) WithCategory(category Category) *SkillBuilder

WithCategory sets the category of the skill.

func (*SkillBuilder) WithCountries

func (s *SkillBuilder) WithCountries(countries []string) *SkillBuilder

WithCountries sets the list of countries the skill is available in.

func (*SkillBuilder) WithDefaultLocale

func (s *SkillBuilder) WithDefaultLocale(locale string) *SkillBuilder

WithDefaultLocale sets the default locale for the skill (used for.

func (*SkillBuilder) WithDefaultLocaleTestingInstructions

func (s *SkillBuilder) WithDefaultLocaleTestingInstructions(instructions string) *SkillBuilder

WithDefaultLocaleTestingInstructions sets the actual testing instructions on the default locale.

func (*SkillBuilder) WithLocaleRegistry

func (s *SkillBuilder) WithLocaleRegistry(registry l10n.LocaleRegistry) *SkillBuilder

WithLocaleRegistry passes a LocaleRegistry instance to the builder.

func (*SkillBuilder) WithModel

func (s *SkillBuilder) WithModel() *SkillBuilder

WithModel creates and returns a new modelBuilder attached to the skill.

func (*SkillBuilder) WithPrivacyFlag

func (s *SkillBuilder) WithPrivacyFlag(flag string, value bool) *SkillBuilder

WithPrivacyFlag set a specific flag in the "privacyAndCompliance" section.

func (*SkillBuilder) WithTestingInstructions

func (s *SkillBuilder) WithTestingInstructions(instructions string) *SkillBuilder

WithTestingInstructions sets the testing instructions lookup key of the skill.

type SkillLocaleBuilder

type SkillLocaleBuilder struct {
	// contains filtered or unexported fields
}

SkillLocaleBuilder represents elements for a specific locale.

func NewSkillLocaleBuilder

func NewSkillLocaleBuilder(locale string) *SkillLocaleBuilder

NewSkillLocaleBuilder creates a new instance with default locale lookup keys.

func (*SkillLocaleBuilder) BuildPrivacyLocale

func (l *SkillLocaleBuilder) BuildPrivacyLocale() (PrivacyLocaleDef, error)

BuildPrivacyLocale builds "privacyAndCompliance" section for the locale.

func (*SkillLocaleBuilder) BuildPublishingLocale

func (l *SkillLocaleBuilder) BuildPublishingLocale() (LocaleDef, error)

BuildPublishingLocale builds "publishingInformation" entry for the locale.

func (*SkillLocaleBuilder) WithDescription

func (l *SkillLocaleBuilder) WithDescription(description string) *SkillLocaleBuilder

WithDescription sets the lookup key for the skill description.

func (*SkillLocaleBuilder) WithExamples

func (l *SkillLocaleBuilder) WithExamples(examples string) *SkillLocaleBuilder

WithExamples sets the lookup key for the skill example phrases.

func (*SkillLocaleBuilder) WithKeywords

func (l *SkillLocaleBuilder) WithKeywords(keywords string) *SkillLocaleBuilder

WithKeywords sets the lookup key for the skill keywords.

func (*SkillLocaleBuilder) WithLargeIcon

func (l *SkillLocaleBuilder) WithLargeIcon(largeicon string) *SkillLocaleBuilder

WithLargeIcon sets the lookup key for the skill large icon URL.

func (*SkillLocaleBuilder) WithLocaleDescription

func (l *SkillLocaleBuilder) WithLocaleDescription(description string) *SkillLocaleBuilder

WithLocaleDescription sets the description of the skill for the locale.

func (*SkillLocaleBuilder) WithLocaleExamples

func (l *SkillLocaleBuilder) WithLocaleExamples(examples []string) *SkillLocaleBuilder

WithLocaleExamples sets the example phrases for the locale (max. 3).

func (*SkillLocaleBuilder) WithLocaleKeywords

func (l *SkillLocaleBuilder) WithLocaleKeywords(keywords []string) *SkillLocaleBuilder

WithLocaleKeywords sets the keywords for the locale (max. 3).

func (*SkillLocaleBuilder) WithLocaleLargeIcon

func (l *SkillLocaleBuilder) WithLocaleLargeIcon(largeicon string) *SkillLocaleBuilder

WithLocaleLargeIcon sets the large icon URL for the locale.

func (*SkillLocaleBuilder) WithLocaleName

func (l *SkillLocaleBuilder) WithLocaleName(name string) *SkillLocaleBuilder

WithLocaleName sets the name of the skill for the locale.

func (*SkillLocaleBuilder) WithLocalePrivacyURL

func (l *SkillLocaleBuilder) WithLocalePrivacyURL(privacyURL string) *SkillLocaleBuilder

WithLocalePrivacyURL sets the privacy URL for the locale.

func (*SkillLocaleBuilder) WithLocaleRegistry

func (l *SkillLocaleBuilder) WithLocaleRegistry(registry l10n.LocaleRegistry) *SkillLocaleBuilder

WithLocaleRegistry passes a LocaleRegistry instance to the builder.

func (*SkillLocaleBuilder) WithLocaleSmallIcon

func (l *SkillLocaleBuilder) WithLocaleSmallIcon(smallicon string) *SkillLocaleBuilder

WithLocaleSmallIcon sets the small icon URL for the locale.

func (*SkillLocaleBuilder) WithLocaleSummary

func (l *SkillLocaleBuilder) WithLocaleSummary(summary string) *SkillLocaleBuilder

WithLocaleSummary sets the summary of the skill for the locale.

func (*SkillLocaleBuilder) WithLocaleTermsURL

func (l *SkillLocaleBuilder) WithLocaleTermsURL(termsURL string) *SkillLocaleBuilder

WithLocaleTermsURL sets the terms URL for the locale.

func (*SkillLocaleBuilder) WithName

func (l *SkillLocaleBuilder) WithName(name string) *SkillLocaleBuilder

WithName sets the lookup key for the skill name.

func (*SkillLocaleBuilder) WithPrivacyURL

func (l *SkillLocaleBuilder) WithPrivacyURL(privacy string) *SkillLocaleBuilder

WithPrivacyURL sets the lookup key for the privacy URL.

func (*SkillLocaleBuilder) WithSmallIcon

func (l *SkillLocaleBuilder) WithSmallIcon(smallicon string) *SkillLocaleBuilder

WithSmallIcon sets the lookup key for the skill small icon URL.

func (*SkillLocaleBuilder) WithSummary

func (l *SkillLocaleBuilder) WithSummary(summary string) *SkillLocaleBuilder

WithSummary sets the lookup key for the skill summary (shown with the skill overview).

func (*SkillLocaleBuilder) WithTermsURL

func (l *SkillLocaleBuilder) WithTermsURL(terms string) *SkillLocaleBuilder

WithTermsURL sets the lookup key for the terms URL.

type SlotPrompts

type SlotPrompts struct {
	Elicitation  string `json:"elicitation,omitempty"`
	Confirmation string `json:"confirmation,omitempty"`
}

SlotPrompts defines a collection of prompts for a slot.

type SlotValidation

type SlotValidation struct {
	Type   string   `json:"type"`
	Prompt string   `json:"prompt"` //
	Values []string `json:"values,omitempty"`
}

SlotValidation defines a validation rule for a prompt.

see https://developer.amazon.com/docs/custom-skills/validate-slot-values.html#validation-rules

type TypeValue

type TypeValue struct {
	ID   string    `json:"id,omitempty"`
	Name NameValue `json:"name"`
}

TypeValue defines a representative value for a custom slot type.

type UpdateFrequency

type UpdateFrequency string

UpdateFrequency is an enum for flashBriefing feed update frequency.

const (
	// UpdateFrequencyDaily is DAILY.
	UpdateFrequencyDaily UpdateFrequency = "DAILY"
	// UpdateFrequencyHourly is HOURLY.
	UpdateFrequencyHourly UpdateFrequency = "HOURLY"
	// UpdateFrequencyWeekly is WEEKLY.
	UpdateFrequencyWeekly UpdateFrequency = "WEEKLY"
)

Jump to

Keyboard shortcuts

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