Skip to content

Commit

Permalink
feat: similarity check in test suites
Browse files Browse the repository at this point in the history
  • Loading branch information
xavidop committed Jan 24, 2025
1 parent 3a3ba4b commit 3d24a03
Show file tree
Hide file tree
Showing 37 changed files with 321 additions and 34 deletions.
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func init() {
// Add the subcommands
rootCmd.PersistentFlags().BoolVarP(&global.Verbose, "verbose", "v", false, "verbose error output (with stack trace) (optional)")
rootCmd.PersistentFlags().StringVarP(&global.VoiceflowAPIKey, "voiceflow-api-key", "x", "", "Voiceflow API Key (optional)")
rootCmd.PersistentFlags().StringVarP(&global.OpenAIAPIKey, "open-api-key", "z", "", "Open API Key (optional)")
rootCmd.PersistentFlags().StringVarP(&global.VoiceflowSubdomain, "voiceflow-subdomain", "b", "", "Voiceflow Base URL (optional). Default: empty")
rootCmd.PersistentFlags().BoolVarP(&global.SkipUpdate, "skip-update-check", "u", false, "Skip the check for updates check run before every command (optional)")
rootCmd.PersistentFlags().StringVarP(&global.Output, "output-format", "o", "text", "Output Format. Options: text, json. Default: text (optional)")
Expand Down
2 changes: 2 additions & 0 deletions cmd/test/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra"
"github.com/xavidop/voiceflow-cli/cmd/cmdutils"
"github.com/xavidop/voiceflow-cli/internal/global"
"github.com/xavidop/voiceflow-cli/internal/openai"
"github.com/xavidop/voiceflow-cli/internal/voiceflow"
"github.com/xavidop/voiceflow-cli/pkg/test"
)
Expand All @@ -20,6 +21,7 @@ var executeCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
suite := args[0]
voiceflow.SetVoiceflowAPIKey()
openai.SetOpenAIAPIKey()
if err := test.ExecuteSuite(suite); err != nil {
global.Log.Errorf("%s", err.Error())
os.Exit(1)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ voiceflow [flags]

```
-h, --help help for voiceflow
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow agent [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_agent_export.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ voiceflow agent export [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow analytics [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_analytics_fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ voiceflow analytics fetch [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ See each sub-command's help for details on how to use the generated script.
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ voiceflow completion bash
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_completion_fish.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ voiceflow completion fish [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_completion_powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ voiceflow completion powershell [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ voiceflow completion zsh [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_document.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow document [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_document_upload-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ voiceflow document upload-file [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_document_upload-url.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ voiceflow document upload-url [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_jsonschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ voiceflow jsonschema [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_kb.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow kb [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_kb_query.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ voiceflow kb query [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow test [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_test_execute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow test execute [suite-path] [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_transcript.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow transcript [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_transcript_fetch-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ voiceflow transcript fetch-all [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_transcript_fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ voiceflow transcript fetch [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_transcript_to-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ voiceflow transcript to-test [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/cmd/voiceflow_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ voiceflow version [flags]
## Options inherited from parent commands

```
-z, --open-api-key string Open API Key (optional)
-o, --output-format string Output Format. Options: text, json. Default: text (optional) (default "text")
-u, --skip-update-check Skip the check for updates check run before every command (optional)
-v, --verbose verbose error output (with stack trace) (optional)
Expand Down
8 changes: 7 additions & 1 deletion docs/docs/overview/authentication.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Authentication

## Voiceflow API Key

`voiceflow-cli` uses Voiceflow APIs. To interact with your Vocieflow projects you will need a [Voiceflow API Key](https://docs.voiceflow.com/reference/authentication). You can get your API Key in your Voiceflow project > Integration page. You can pass the API Key to the CLI using the `--voiceflow-api-key` flag or by setting the `VF_API_KEY` environment variable. `voiceflow-cli` also works with `.env` files. You can create a `.env` file in the root of your project and add the `VF_API_KEY` variable to it.

The `voiceflow-cli` source code is open source, you can check it out [here](https://github.com/xavidop/voiceflow-cli) to learn more about the actions the tool performs.

## Base URL

The base URL for the Voiceflow API is `https://<api>.<subdomain>.voiceflow.com`. The default value is without subdomain: `https://<api>.voiceflow.com`. If you are using a different Voiceflow environment, you can pass the subdomain using the `--voiceflow-subdomain` flag.
The base URL for the Voiceflow API is `https://<api>.<subdomain>.voiceflow.com`. The default value is without subdomain: `https://<api>.voiceflow.com`. If you are using a different Voiceflow environment, you can pass the subdomain using the `--voiceflow-subdomain` flag.

## Open AI PI Key

`voiceflow-cli` uses Open AI APIs. To interact with Open AI you will need an API Key. You can get your API Key in your Open AI account. You can pass the API Key to the CLI using the `--openai-api-key` flag or by setting the `OPENAI_API_KEY` environment variable. `voiceflow-cli` also works with `.env` files. You can create a `.env` file in the root of your project and add the `OPENAI_API_KEY` variable to it.
41 changes: 41 additions & 0 deletions docs/docs/static/conversationsuite.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,38 @@
"agent"
]
},
"SimilarityConfig": {
"properties": {
"provider": {
"type": "string"
},
"model": {
"type": "string"
},
"temperature": {
"type": "number"
},
"similarityThreshold": {
"type": "number"
},
"top_k": {
"type": "integer"
},
"top_p": {
"type": "number"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"provider",
"model",
"temperature",
"similarityThreshold",
"top_k",
"top_p"
]
},
"Test": {
"properties": {
"name": {
Expand Down Expand Up @@ -132,6 +164,15 @@
},
"value": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array"
},
"similarityConfig": {
"$ref": "#/$defs/SimilarityConfig"
}
},
"additionalProperties": false,
Expand Down
41 changes: 41 additions & 0 deletions docs/docs/static/conversationtest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,38 @@
"agent"
]
},
"SimilarityConfig": {
"properties": {
"provider": {
"type": "string"
},
"model": {
"type": "string"
},
"temperature": {
"type": "number"
},
"similarityThreshold": {
"type": "number"
},
"top_k": {
"type": "integer"
},
"top_p": {
"type": "number"
}
},
"additionalProperties": false,
"type": "object",
"required": [
"provider",
"model",
"temperature",
"similarityThreshold",
"top_k",
"top_p"
]
},
"Test": {
"properties": {
"name": {
Expand Down Expand Up @@ -86,6 +118,15 @@
},
"value": {
"type": "string"
},
"values": {
"items": {
"type": "string"
},
"type": "array"
},
"similarityConfig": {
"$ref": "#/$defs/SimilarityConfig"
}
},
"additionalProperties": false,
Expand Down
Loading

0 comments on commit 3d24a03

Please sign in to comment.