-
Notifications
You must be signed in to change notification settings - Fork 3
/
constants.go
54 lines (47 loc) · 1.17 KB
/
constants.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package df
import (
"context"
"log"
"time"
dialogflow "cloud.google.com/go/dialogflow/apiv2"
"github.com/google/uuid"
)
// Environment is Dialogflow bot environments
type Environment string
// Dialog flow environmental names
const (
Draft Environment = "DRAFT" // DRAFT environment
Staging Environment = "STAGING"
Prod Environment = "PROD"
)
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"
)
// esClient encapsulates Dialog Flow ES Client
type esClient struct {
gcpProjectID string
authFilePath string
language string
timeZone string
log *log.Logger
ctx context.Context
df *dialogflow.SessionsClient
}
// AgentSession for a particular call on a path
type AgentSession struct {
env Environment
sID uuid.UUID
uID uuid.UUID
path string
}