Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(dialogflow): delete unused region tag "import_libraries" #5148

Merged
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
10 changes: 3 additions & 7 deletions dialogflow/detect_intent/detect_intent.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

package detect

// [START import_libraries]
import (
"context"
"errors"
"fmt"
"io"
"log"
Expand All @@ -27,8 +25,6 @@ import (
"cloud.google.com/go/dialogflow/apiv2/dialogflowpb"
)

// [END import_libraries]

// [START dialogflow_detect_intent_text]
func DetectIntentText(projectID, sessionID, text, languageCode string) (string, error) {
ctx := context.Background()
Expand All @@ -40,7 +36,7 @@ func DetectIntentText(projectID, sessionID, text, languageCode string) (string,
defer sessionClient.Close()

if projectID == "" || sessionID == "" {
return "", errors.New(fmt.Sprintf("Received empty project (%s) or session (%s)", projectID, sessionID))
return "", fmt.Errorf("detect.DetectIntentText received empty project (%s) or session (%s)", projectID, sessionID)
}

sessionPath := fmt.Sprintf("projects/%s/agent/sessions/%s", projectID, sessionID)
Expand Down Expand Up @@ -72,7 +68,7 @@ func DetectIntentAudio(projectID, sessionID, audioFile, languageCode string) (st
defer sessionClient.Close()

if projectID == "" || sessionID == "" {
return "", errors.New(fmt.Sprintf("Received empty project (%s) or session (%s)", projectID, sessionID))
return "", fmt.Errorf("detect.DetectIntentAudio empty project (%s) or session (%s)", projectID, sessionID)
}

sessionPath := fmt.Sprintf("projects/%s/agent/sessions/%s", projectID, sessionID)
Expand Down Expand Up @@ -113,7 +109,7 @@ func DetectIntentStream(projectID, sessionID, audioFile, languageCode string) (s
defer sessionClient.Close()

if projectID == "" || sessionID == "" {
return "", errors.New(fmt.Sprintf("Received empty project (%s) or session (%s)", projectID, sessionID))
return "", fmt.Errorf("detect.DetectIntentStream empty project (%s) or session (%s)", projectID, sessionID)
}

sessionPath := fmt.Sprintf("projects/%s/agent/sessions/%s", projectID, sessionID)
Expand Down
Loading