Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions webchat-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export CCAIP_DEFAULT_MENU_ID="1"
export CCAIP_DEFAULT_LANG="en"
export REDIS_ADDRESS="10.0.0.1:6379"
export API_KEY="your-api-key"

# (Optional) Export Dialogflow endpoint to use if you use a regional dialogflow
export DIALOGFLOW_ENDPOINT="dialogflow.googleapis.com:443"
```

## Running Locally
Expand Down
2 changes: 1 addition & 1 deletion webchat-proxy/cmd/webchat-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {
ctx := context.Background()

// Initialize Dialogflow Client
client, err := dialogflow.NewParticipantsClient(ctx, option.WithEndpoint("test-dialogflow.sandbox.googleapis.com:443"))
client, err := dialogflow.NewParticipantsClient(ctx, option.WithEndpoint(os.Getenv("DIALOGFLOW_ENDPOINT")))
if err != nil {
log.Fatalf("Failed to create ParticipantsClient: %v", err)
}
Expand Down
3 changes: 2 additions & 1 deletion webchat-proxy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fi
# Service Account to run the service
SA_NAME="webchat-proxy-sa"
SERVICE_ACCOUNT=${SERVICE_ACCOUNT:-"${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com"}
DIALOGFLOW_ENDPOINT=${DIALOGFLOW_ENDPOINT:-"dialogflow.googleapis.com:443"}

# CCaIP Configuration
CCAIP_SUBDOMAIN=${CCAIP_SUBDOMAIN:-"default-subdomain"}
Expand All @@ -33,7 +34,7 @@ gcloud run deploy "$SERVICE_NAME" \
--allow-unauthenticated \
--service-account "$SERVICE_ACCOUNT" \
--set-secrets="CCAIP_PASSWORD=ccaip-password:latest,CCAIP_PRIMARY_WEBHOOK_SECRET=ccaip-primary-webhook-secret:latest,CCAIP_SECONDARY_WEBHOOK_SECRET=ccaip-secondary-webhook-secret:latest,API_KEY=webchat-proxy-api-key:latest" \
--set-env-vars="CCAIP_SUBDOMAIN=${CCAIP_SUBDOMAIN},CCAIP_DEFAULT_MENU_ID=${CCAIP_DEFAULT_MENU_ID},CCAIP_DEFAULT_LANG=${CCAIP_DEFAULT_LANG},REDIS_ADDRESS=${REDIS_ADDRESS}" \
--set-env-vars="CCAIP_SUBDOMAIN=${CCAIP_SUBDOMAIN},CCAIP_DEFAULT_MENU_ID=${CCAIP_DEFAULT_MENU_ID},CCAIP_DEFAULT_LANG=${CCAIP_DEFAULT_LANG},REDIS_ADDRESS=${REDIS_ADDRESS},DIALOGFLOW_ENDPOINT=${DIALOGFLOW_ENDPOINT}" \
--min-instances 1 \
--max-instances 1 \
--platform managed
Expand Down