-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor, added documentation and TTS
- Loading branch information
Showing
25 changed files
with
366 additions
and
741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Release Go project | ||
name: Goreleaser | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,118 @@ | ||
# Dialgflow CX tester Tool | ||
Dialogflow utility to test your Dialogflow CX Project | ||
# CXTester | ||
Dialogflow utility to test your Dialogflow CX Project | ||
|
||
## Installation | ||
|
||
You can download the latest release from [here](https://github.com/xavidop/dialogflow-cx-test-runner/releases) | ||
|
||
### Homebrew | ||
|
||
If you use the package manager Homebrew, you can install this utility following these steps: | ||
|
||
1. Add my Hombre tab: | ||
```bash | ||
brew tap xavidop/tap [email protected]:xavidop/homebrew-tap.git | ||
brew update | ||
``` | ||
1. Install the CLI: | ||
```bash | ||
brew install cxtester | ||
``` | ||
# Usage | ||
|
||
```bash | ||
Usage: | ||
cxtester [flags] | ||
cxtester [command] | ||
|
||
Available Commands: | ||
cicd Actions on CICD testings | ||
completion Generate the autocompletion script for the specified shell | ||
help Help about any command | ||
profile-nlu Actions on testing | ||
tts Actions on text-to-speech commands | ||
version Get cxtester version | ||
|
||
Flags: | ||
-c, --credentials string verbose error output (with stack trace) | ||
-h, --help help for cxtester | ||
-o, --output string Output Format (default text) | ||
-u, --skip-update-check Skip the check for updates check run before every command | ||
-v, --verbose verbose error output (with stack trace) | ||
``` | ||
|
||
## Profile NLU Test Suites | ||
|
||
To run test suites, you can execute the following command | ||
|
||
```bash | ||
Usage: | ||
cxtester profile-nlu execute [suite-file] [flags] | ||
|
||
Aliases: | ||
execute, execute, e, exe, exec | ||
|
||
Flags: | ||
-h, --help help for execute | ||
|
||
Global Flags: | ||
-c, --credentials string verbose error output (with stack trace) | ||
-o, --output string Output Format (default "text") | ||
-u, --skip-update-check Skip the check for updates check run before every command | ||
-v, --verbose verbose error output (with stack trace) | ||
``` | ||
|
||
Example: `cxtester profile-nlu execute "examples/suite.yaml" --credentials credentials.json` | ||
|
||
You can find a suite example [here](/examples/) | ||
|
||
## CICD for your Dialogflow CX environments | ||
|
||
To execute a CICD pipeline you can execute the following command | ||
|
||
```bash | ||
Usage: | ||
cxtester cicd execute [environment] [flags] | ||
|
||
Aliases: | ||
execute, execute, e, exe, exec | ||
|
||
Flags: | ||
-a, --agent-name string Dialogflow CX Agent Name | ||
-h, --help help for execute | ||
-l, --location-id string Dialogflow CX Location ID of the Project | ||
-p, --project-id string Dialogflow CX Project ID | ||
|
||
Global Flags: | ||
-c, --credentials string verbose error output (with stack trace) | ||
-o, --output string Output Format (default text) | ||
-u, --skip-update-check Skip the check for updates check run before every command | ||
-v, --verbose verbose error output (with stack trace) | ||
``` | ||
|
||
Example: `cxtester cicd execute "<your-env>" --project-id <your-project-id> --location-id <your-location-id> --agent-name <your-agent-name> --credentials, credentials.json` | ||
|
||
## Text-to-Speech | ||
|
||
To transform your text to speech, you can execute the following command: | ||
|
||
```bash | ||
Usage: | ||
cxtester tts synthesize [input] [flags] | ||
|
||
Aliases: | ||
synthesize, synth, s | ||
|
||
Flags: | ||
-h, --help help for synthesize | ||
-i, --input string Input text to synthesize | ||
-l, --locale string Input locale | ||
-o, --output string Output file name (default "output.mp3") | ||
|
||
Global Flags: | ||
-c, --credentials string verbose error output (with stack trace) | ||
-u, --skip-update-check Skip the check for updates check run before every command | ||
-v, --verbose verbose error output (with stack trace) | ||
``` | ||
|
||
Example: `cxtester tts synthesize "hi" -l en-US -o output.mp3 --credentials credentials.json` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package tts | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/xavidop/dialogflow-cx-test-runner/cmd/cmdutils" | ||
"github.com/xavidop/dialogflow-cx-test-runner/internal/global" | ||
"github.com/xavidop/dialogflow-cx-test-runner/pkg/tts" | ||
) | ||
|
||
// synthesizeCmd represents the execute synthesis command | ||
var synthesizeCmd = &cobra.Command{ | ||
Use: "synthesize [input]", | ||
Aliases: []string{"synth", "s"}, | ||
Short: "Executes a CICD pipeline for a specific environment", | ||
Args: cobra.MinimumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
// Get the information | ||
locale, _ := cmd.Flags().GetString("locale") | ||
input := strings.Join(args, " ") | ||
output, _ := cmd.Flags().GetString("output") | ||
|
||
if err := tts.Synthesize(input, locale, output); err != nil { | ||
global.Log.Errorf(err.Error()) | ||
os.Exit(1) | ||
} | ||
}, | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
cmdutils.PreRun(cmd.Name()) | ||
}, | ||
PersistentPostRun: func(cmd *cobra.Command, args []string) { | ||
}, | ||
} | ||
|
||
func init() { | ||
ttsCmd.AddCommand(synthesizeCmd) | ||
|
||
synthesizeCmd.Flags().StringP("locale", "l", "", "Input locale") | ||
synthesizeCmd.Flags().StringP("input", "i", "", "Input text to synthesize") | ||
synthesizeCmd.Flags().StringP("output", "o", "output.mp3", "Output file name") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package tts | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/xavidop/dialogflow-cx-test-runner/cmd/cmdutils" | ||
) | ||
|
||
// ttsCmd represents the tts root command | ||
var ttsCmd = &cobra.Command{ | ||
Use: "tts", | ||
Aliases: []string{"tts", "text-to-speech", "cd"}, | ||
Short: "Actions on text-to-speech commands", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
cmd.Help() | ||
os.Exit(0) | ||
}, | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { | ||
cmdutils.PreRun(cmd.Name()) | ||
}, | ||
PersistentPostRun: func(cmd *cobra.Command, args []string) { | ||
}, | ||
} | ||
|
||
func Register(rootCmd *cobra.Command) { | ||
rootCmd.AddCommand(ttsCmd) | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.