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

feat: improvements to generate testset|definition #50

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
98 changes: 49 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ sf plugins
<!-- commands -->

- [`sf agent create`](#sf-agent-create)
- [`sf agent generate definition`](#sf-agent-generate-definition)
- [`sf agent generate spec`](#sf-agent-generate-spec)
- [`sf agent generate testset`](#sf-agent-generate-testset)
- [`sf agent generate test-cases`](#sf-agent-generate-test-cases)
- [`sf agent generate test-definition`](#sf-agent-generate-test-definition)
- [`sf agent preview`](#sf-agent-preview)
- [`sf agent test cancel`](#sf-agent-test-cancel)
- [`sf agent test results`](#sf-agent-test-results)
Expand Down Expand Up @@ -111,32 +111,7 @@ EXAMPLES
$ sf agent create --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
```

_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/create.ts)_

## `sf agent generate definition`

Interactively generate a new AiEvaluationDefinition.

```
USAGE
$ sf agent generate definition [--flags-dir <value>]

GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.

DESCRIPTION
Interactively generate a new AiEvaluationDefinition.

This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will
be saved to the `aiEvaluationDefinitions` directory in the project.

You must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.

EXAMPLES
$ sf agent generate definition
```

_See code: [src/commands/agent/generate/definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/generate/definition.ts)_
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/create.ts)_

## `sf agent generate spec`

Expand Down Expand Up @@ -197,30 +172,55 @@ EXAMPLES
$ sf agent generate spec --output-dir specs --target-org my-org
```

_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/generate/spec.ts)_
_See code: [src/commands/agent/generate/spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/generate/spec.ts)_

## `sf agent generate testset`
## `sf agent generate test-cases`

Interactively generate an AiEvaluationTestSet.
Interactively generate a new Set of AI Evaluation test cases.

```
USAGE
$ sf agent generate testset [--flags-dir <value>]
$ sf agent generate test-cases [--flags-dir <value>]

GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.

DESCRIPTION
Interactively generate an AiEvaluationTestSet.
Interactively generate a new Set of AI Evaluation test cases.

Answer the prompts to generate an AiEvaluationTestSet that will be written to a file. You can then run "sf agent
generate definition" to generate the AiEvaluationDefinition that can be used to evaluate the test set.

EXAMPLES
$ sf agent generate testset
$ sf agent generate test-cases
```

_See code: [src/commands/agent/generate/test-cases.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/generate/test-cases.ts)_

## `sf agent generate test-definition`

Interactively generate a new AI Evaluation Test Definition.

```
USAGE
$ sf agent generate test-definition [--flags-dir <value>]

GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.

DESCRIPTION
Interactively generate a new AI Evaluation Test Definition.

This command will prompt you for the necessary information to create a new AiEvaluationDefinition. The definition will
be saved to the `aiEvaluationDefinitions` directory in the project.

You must have the `Bots` and `AiEvaluationTestSets` metadata types present in your project to use this command.

EXAMPLES
$ sf agent generate test-definition
```

_See code: [src/commands/agent/generate/testset.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/generate/testset.ts)_
_See code: [src/commands/agent/generate/test-definition.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/generate/test-definition.ts)_

## `sf agent preview`

Expand Down Expand Up @@ -255,7 +255,7 @@ FLAG DESCRIPTIONS
the API name of the agent? (TBD based on agents library)
```

_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/preview.ts)_
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/preview.ts)_

## `sf agent test cancel`

Expand Down Expand Up @@ -292,7 +292,7 @@ EXAMPLES
$ sf agent test cancel --job-id 4KBfake0000003F4AQ --target-org my-org
```

_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/test/cancel.ts)_
_See code: [src/commands/agent/test/cancel.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/test/cancel.ts)_

## `sf agent test results`

Expand All @@ -301,10 +301,10 @@ Get the results of a completed agent test run.
```
USAGE
$ sf agent test results -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--result-format
json|human|junit|tap] [-f <value>]
json|human|junit|tap] [-d <value>]

FLAGS
-f, --output-dir=<value> Directory to write the agent test results into.
-d, --output-dir=<value> Directory to write the agent test results into.
-i, --job-id=<value> (required) Job ID of the completed agent test run.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
Expand Down Expand Up @@ -342,13 +342,13 @@ EXAMPLES
$ sf agent test results --use-most-recent --output-dir ./test-results --result-format json

FLAG DESCRIPTIONS
-f, --output-dir=<value> Directory to write the agent test results into.
-d, --output-dir=<value> Directory to write the agent test results into.

If the agent test run completes, write the results to the specified directory. If the test is still running, the
test results aren't written.
```

_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/test/results.ts)_
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/test/results.ts)_

## `sf agent test resume`

Expand All @@ -357,10 +357,10 @@ Resume an agent test that you previously started in your org so you can view the
```
USAGE
$ sf agent test resume -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-i <value>] [-r] [-w
<value>] [--result-format json|human|junit|tap] [-f <value>]
<value>] [--result-format json|human|junit|tap] [-d <value>]

FLAGS
-f, --output-dir=<value> Directory to write the agent test results into.
-d, --output-dir=<value> Directory to write the agent test results into.
-i, --job-id=<value> Job ID of the original agent test run.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
Expand Down Expand Up @@ -405,13 +405,13 @@ EXAMPLES
$ sf agent test resume --use-most-recent --output-dir ./test-results --result-format json

FLAG DESCRIPTIONS
-f, --output-dir=<value> Directory to write the agent test results into.
-d, --output-dir=<value> Directory to write the agent test results into.

If the agent test run completes, write the results to the specified directory. If the test is still running, the
test results aren't written.
```

_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/test/resume.ts)_
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/test/resume.ts)_

## `sf agent test run`

Expand All @@ -420,10 +420,10 @@ Start an agent test in your org.
```
USAGE
$ sf agent test run -o <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>] [-w <value>]
[--result-format json|human|junit|tap] [-f <value>]
[--result-format json|human|junit|tap] [-d <value>]

FLAGS
-f, --output-dir=<value> Directory to write the agent test results into.
-d, --output-dir=<value> Directory to write the agent test results into.
-n, --name=<value> (required) Name of the agent test to start.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
Expand Down Expand Up @@ -468,12 +468,12 @@ EXAMPLES
$ sf agent test run --name MyAgentTest --wait 10 --output-dir ./test-results --result-format json

FLAG DESCRIPTIONS
-f, --output-dir=<value> Directory to write the agent test results into.
-d, --output-dir=<value> Directory to write the agent test results into.

If the agent test run completes, write the results to the specified directory. If the test is still running, the
test results aren't written.
```

_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.2/src/commands/agent/test/run.ts)_
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.7.3-dev.3/src/commands/agent/test/run.ts)_

<!-- commandsstop -->
24 changes: 12 additions & 12 deletions command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@
"flags": ["api-version", "flags-dir", "json", "name", "spec", "target-org"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:generate:definition",
"flagAliases": [],
"flagChars": [],
"flags": ["flags-dir"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:generate:spec",
Expand All @@ -37,7 +29,15 @@
},
{
"alias": [],
"command": "agent:generate:testset",
"command": "agent:generate:test-cases",
"flagAliases": [],
"flagChars": [],
"flags": ["flags-dir"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:generate:test-definition",
"flagAliases": [],
"flagChars": [],
"flags": ["flags-dir"],
Expand All @@ -63,15 +63,15 @@
"alias": [],
"command": "agent:test:results",
"flagAliases": [],
"flagChars": ["f", "i", "o"],
"flagChars": ["d", "i", "o"],
"flags": ["api-version", "flags-dir", "job-id", "json", "output-dir", "result-format", "target-org"],
"plugin": "@salesforce/plugin-agent"
},
{
"alias": [],
"command": "agent:test:resume",
"flagAliases": [],
"flagChars": ["f", "i", "o", "r", "w"],
"flagChars": ["d", "i", "o", "r", "w"],
"flags": [
"api-version",
"flags-dir",
Expand All @@ -89,7 +89,7 @@
"alias": [],
"command": "agent:test:run",
"flagAliases": [],
"flagChars": ["f", "n", "o", "w"],
"flagChars": ["d", "n", "o", "w"],
"flags": ["api-version", "flags-dir", "json", "name", "output-dir", "result-format", "target-org", "wait"],
"plugin": "@salesforce/plugin-agent"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# summary

Interactively generate an AiEvaluationTestSet.
Interactively generate a new Set of AI Evaluation test cases.

# description

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# summary

Interactively generate a new AiEvaluationDefinition.
Interactively generate a new AI Evaluation Test Definition.

# description

Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"name": "@salesforce/plugin-agent",
"description": "Commands to interact with Salesforce agents",
"version": "1.7.2",
"version": "1.7.3-dev.3",
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@inquirer/confirm": "^5.1.0",
"@inquirer/figures": "^1.0.7",
"@inquirer/input": "^4.0.1",
"@inquirer/select": "^4.0.1",
"@inquirer/prompts": "^7.2.0",
"@oclif/core": "^4",
"@oclif/multi-stage-output": "^0.7.12",
"@salesforce/agents": "^0.5.2",
"@salesforce/agents": "^0.5.3",
"@salesforce/core": "^8.8.0",
"@salesforce/kit": "^3.2.1",
"@salesforce/sf-plugins-core": "^12.1.0",
"ansis": "^3.3.2",
"fast-xml-parser": "^4.5.1",
"ink": "^5.0.1",
"ink-text-input": "^6.0.0",
"react": "^18.3.1"
Expand Down
3 changes: 1 addition & 2 deletions src/commands/agent/generate/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages, SfProject } from '@salesforce/core';
import { Interfaces } from '@oclif/core';
import ansis from 'ansis';
import select from '@inquirer/select';
import inquirerInput from '@inquirer/input';
import { select, input as inquirerInput } from '@inquirer/prompts';
import figures from '@inquirer/figures';
import { Agent, AgentCreateConfig, SfAgent } from '@salesforce/agents';
import { theme } from '../../../inquirer-theme.js';
Expand Down
Loading
Loading