Documentation ¶
Overview ¶
Package df Package bot establishes a client session with a Dialog Flow agent or bot associated with GCP project. The bot will respond to user questions as they type the questions.
Index ¶
Constants ¶
View Source
const ( // GCPProjectID GCP project ID in use GCPProjectID = "your-gcp-project-id" // DefaultLanguage of the bot DefaultLanguage = "en" // ENUSLanguage US English ENUSLanguage = "en-US" // DefaultTimeZone where user is in DefaultTimeZone = "PST" // DefaultTimeout for API timeout DefaultTimeout = 10 * time.Second // SampleConvo a conversation asking question at a time SampleConvo = "hello\ni like to cancel\ntaking too long" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentSession ¶
type AgentSession struct {
// contains filtered or unexported fields
}
AgentSession for a particular call on a path
func NewAgentSession ¶
func NewAgentSession(env Environment, gcpProjectName string) (s *AgentSession)
NewAgentSession creates a new session with a specific environment.
type Bot ¶
type Bot interface {
Converse(s *AgentSession, q string) ([]string, error)
}
Bot interface defines methods available for BotClient Generate the mock interface for this. mockgen -destination=mocks/df/mock_converse.go -package=mocks -source=clients/df/converse.go Bot
type Environment ¶
type Environment string
Environment is Dialogflow bot environments
const ( Draft Environment = "DRAFT" // DRAFT environment Staging Environment = "STAGING" Prod Environment = "PROD" )
Dialog flow environmental names
Click to show internal directories.
Click to hide internal directories.