Create an AgentTest based on one of:
AgentTestConfig
Get the metadata content for this agent test.
Returns the AiEvaluationDefinition metadata if already generated. Otherwise it will get it by:
Optionalconnection: Connection<Schema>Org connection to use if this AgentTest only has an AiEvaluationDefinition API name.
Promise
Get the specification for this agent test.
Returns the test spec data if already generated. Otherwise it will generate the spec by:
Optionalconnection: Connection<Schema>Org connection to use if this AgentTest only has an AiEvaluationDefinition API name.
Promise
Write AiEvaluationDefinition metadata file.
The file path where the metadata file should be written.
Write a test specification file in YAML format.
The file path where the YAML test spec should be written.
StaticcreateCreates and deploys an AiEvaluationDefinition from a specification file.
Connection to the org where the agent test will be created.
The API name of the AiEvaluationDefinition to create
The path to the specification file to create the definition from
Configuration options for creating the definition
The directory where the AiEvaluationDefinition file will be written
Optionalpreview?: booleanIf true, writes the AiEvaluationDefinition file to
Promise containing:
StaticlistList the AiEvaluationDefinitions available in the org.
A client side representation of an agent test (AiEvaluationDefinition) within an org. Also provides utilities such as creating and listing agent tests, and converting between agent test spec and AiEvaluationDefinition.
Examples
Create a new instance from an agent test spec:
const agentTest = new AgentTest({ specPath: path/to/specfile });Get the metadata content of an agent test:
const metadataContent = await agentTest.getMetadata();Write the metadata content to a file:
await agentTest.writeMetadata('path/to/metadataFile');