@salesforce/agents 0.13.7 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/agent.d.ts +38 -14
- package/lib/agent.js +69 -32
- package/lib/agent.js.map +1 -1
- package/lib/agentPreview.d.ts +48 -59
- package/lib/agentPreview.js +47 -1
- package/lib/agentPreview.js.map +1 -1
- package/lib/agentTester.d.ts +39 -69
- package/lib/agentTester.js +43 -13
- package/lib/agentTester.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js.map +1 -1
- package/lib/types.d.ts +149 -0
- package/package.json +2 -2
package/README.md
CHANGED
package/lib/agent.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Connection, SfProject } from '@salesforce/core';
|
|
2
|
-
import { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig } from './types.js';
|
|
2
|
+
import { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig, type AgentOptions } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Events emitted during Agent.create() for consumers to listen to and keep track of progress
|
|
5
5
|
*
|
|
@@ -11,38 +11,62 @@ export declare const AgentCreateLifecycleStages: {
|
|
|
11
11
|
Retrieving: string;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* A client side representation of an agent within an org. Also provides utilities
|
|
15
|
+
* such as creating agents, listing agents, and creating agent specs.
|
|
16
|
+
*
|
|
17
|
+
* **Examples**
|
|
18
|
+
*
|
|
19
|
+
* Create a new instance and get the ID (uses the `Bot` ID):
|
|
20
|
+
*
|
|
21
|
+
* `const id = new Agent({connection, name}).getId();`
|
|
22
|
+
*
|
|
23
|
+
* Create a new agent in the org:
|
|
24
|
+
*
|
|
25
|
+
* `const myAgent = await Agent.create(connection, project, options);`
|
|
26
|
+
*
|
|
27
|
+
* List all agents in the local project:
|
|
28
|
+
*
|
|
29
|
+
* `const agentList = await Agent.list(project);`
|
|
15
30
|
*/
|
|
16
31
|
export declare class Agent {
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private maybeMock;
|
|
20
|
-
private readonly connection;
|
|
32
|
+
private options;
|
|
33
|
+
private id?;
|
|
21
34
|
/**
|
|
22
|
-
* Create an
|
|
35
|
+
* Create an instance of an agent in an org. Must provide a connection to an org
|
|
36
|
+
* and the agent (Bot) API name as part of `AgentOptions`.
|
|
23
37
|
*
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {SfProject} project
|
|
38
|
+
* @param {options} AgentOptions
|
|
26
39
|
*/
|
|
27
|
-
constructor(
|
|
40
|
+
constructor(options: AgentOptions);
|
|
28
41
|
/**
|
|
29
42
|
* List all agents in the current project.
|
|
43
|
+
*
|
|
44
|
+
* @param project a `SfProject` for a local DX project.
|
|
30
45
|
*/
|
|
31
46
|
static list(project: SfProject): Promise<string[]>;
|
|
32
47
|
/**
|
|
33
48
|
* Creates an agent from a configuration, optionally saving the agent in an org.
|
|
34
49
|
*
|
|
35
|
-
* @param
|
|
50
|
+
* @param connection a `Connection` to an org.
|
|
51
|
+
* @param project a `SfProject` for a local DX project.
|
|
52
|
+
* @param config a configuration for creating or previewing an agent.
|
|
36
53
|
* @returns the agent definition
|
|
37
54
|
*/
|
|
38
|
-
create(config: AgentCreateConfig): Promise<AgentCreateResponse>;
|
|
55
|
+
static create(connection: Connection, project: SfProject, config: AgentCreateConfig): Promise<AgentCreateResponse>;
|
|
39
56
|
/**
|
|
40
57
|
* Create an agent spec from provided data.
|
|
41
58
|
*
|
|
59
|
+
* @param connection a `Connection` to an org.
|
|
42
60
|
* @param config The configuration used to generate an agent spec.
|
|
61
|
+
* @returns the agent job spec
|
|
62
|
+
*/
|
|
63
|
+
static createSpec(connection: Connection, config: AgentJobSpecCreateConfig): Promise<AgentJobSpec>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the ID for this agent.
|
|
66
|
+
*
|
|
67
|
+
* @returns The ID of the agent (The `Bot` ID).
|
|
43
68
|
*/
|
|
44
|
-
|
|
45
|
-
private verifyAgentSpecConfig;
|
|
69
|
+
getId(): Promise<string>;
|
|
46
70
|
}
|
|
47
71
|
/**
|
|
48
72
|
* Generate an API name from an agent name. Matches what the UI does.
|
package/lib/agent.js
CHANGED
|
@@ -50,6 +50,13 @@ const maybe_mock_1 = require("./maybe-mock");
|
|
|
50
50
|
const utils_1 = require("./utils");
|
|
51
51
|
;
|
|
52
52
|
const messages = new core_1.Messages('@salesforce/agents', 'agents', new Map([["invalidAgentSpecConfig", "Missing one or more of the required agent spec arguments: type, role, companyName, companyDescription"], ["missingAgentName", "The \"agentName\" configuration property is required when saving an agent."], ["agentRetrievalError", "Unable to retrieve newly created Agent metadata. Due to: %s"], ["agentRetrievalErrorActions", "Retrieve the agent metadata using the \"project retrieve start\" command."]]));
|
|
53
|
+
let logger;
|
|
54
|
+
const getLogger = () => {
|
|
55
|
+
if (!logger) {
|
|
56
|
+
logger = core_1.Logger.childFromRoot('Agent');
|
|
57
|
+
}
|
|
58
|
+
return logger;
|
|
59
|
+
};
|
|
53
60
|
/**
|
|
54
61
|
* Events emitted during Agent.create() for consumers to listen to and keep track of progress
|
|
55
62
|
*
|
|
@@ -61,27 +68,39 @@ exports.AgentCreateLifecycleStages = {
|
|
|
61
68
|
Retrieving: 'retrievingAgent',
|
|
62
69
|
};
|
|
63
70
|
/**
|
|
64
|
-
*
|
|
71
|
+
* A client side representation of an agent within an org. Also provides utilities
|
|
72
|
+
* such as creating agents, listing agents, and creating agent specs.
|
|
73
|
+
*
|
|
74
|
+
* **Examples**
|
|
75
|
+
*
|
|
76
|
+
* Create a new instance and get the ID (uses the `Bot` ID):
|
|
77
|
+
*
|
|
78
|
+
* `const id = new Agent({connection, name}).getId();`
|
|
79
|
+
*
|
|
80
|
+
* Create a new agent in the org:
|
|
81
|
+
*
|
|
82
|
+
* `const myAgent = await Agent.create(connection, project, options);`
|
|
83
|
+
*
|
|
84
|
+
* List all agents in the local project:
|
|
85
|
+
*
|
|
86
|
+
* `const agentList = await Agent.list(project);`
|
|
65
87
|
*/
|
|
66
88
|
class Agent {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
maybeMock;
|
|
70
|
-
connection;
|
|
89
|
+
options;
|
|
90
|
+
id;
|
|
71
91
|
/**
|
|
72
|
-
* Create an
|
|
92
|
+
* Create an instance of an agent in an org. Must provide a connection to an org
|
|
93
|
+
* and the agent (Bot) API name as part of `AgentOptions`.
|
|
73
94
|
*
|
|
74
|
-
* @param {
|
|
75
|
-
* @param {SfProject} project
|
|
95
|
+
* @param {options} AgentOptions
|
|
76
96
|
*/
|
|
77
|
-
constructor(
|
|
78
|
-
this.
|
|
79
|
-
this.logger = core_1.Logger.childFromRoot(this.constructor.name);
|
|
80
|
-
this.maybeMock = new maybe_mock_1.MaybeMock(connection);
|
|
81
|
-
this.connection = connection;
|
|
97
|
+
constructor(options) {
|
|
98
|
+
this.options = options;
|
|
82
99
|
}
|
|
83
100
|
/**
|
|
84
101
|
* List all agents in the current project.
|
|
102
|
+
*
|
|
103
|
+
* @param project a `SfProject` for a local DX project.
|
|
85
104
|
*/
|
|
86
105
|
static async list(project) {
|
|
87
106
|
const projectDirs = project.getPackageDirectories();
|
|
@@ -109,31 +128,34 @@ class Agent {
|
|
|
109
128
|
/**
|
|
110
129
|
* Creates an agent from a configuration, optionally saving the agent in an org.
|
|
111
130
|
*
|
|
112
|
-
* @param
|
|
131
|
+
* @param connection a `Connection` to an org.
|
|
132
|
+
* @param project a `SfProject` for a local DX project.
|
|
133
|
+
* @param config a configuration for creating or previewing an agent.
|
|
113
134
|
* @returns the agent definition
|
|
114
135
|
*/
|
|
115
|
-
async create(config) {
|
|
136
|
+
static async create(connection, project, config) {
|
|
116
137
|
const url = '/connect/ai-assist/create-agent';
|
|
138
|
+
const maybeMock = new maybe_mock_1.MaybeMock(connection);
|
|
117
139
|
// When previewing agent creation just return the response.
|
|
118
140
|
if (!config.saveAgent) {
|
|
119
|
-
|
|
141
|
+
getLogger().debug(`Previewing agent creation using config: ${(0, node_util_1.inspect)(config)} in project: ${project.getPath()}`);
|
|
120
142
|
await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.Previewing, {});
|
|
121
|
-
const response = await
|
|
143
|
+
const response = await maybeMock.request('POST', url, config);
|
|
122
144
|
return decodeResponse(response);
|
|
123
145
|
}
|
|
124
146
|
if (!config.agentSettings?.agentName) {
|
|
125
147
|
throw messages.createError('missingAgentName');
|
|
126
148
|
}
|
|
127
|
-
|
|
149
|
+
getLogger().debug(`Creating agent using config: ${(0, node_util_1.inspect)(config)} in project: ${project.getPath()}`);
|
|
128
150
|
await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.Creating, {});
|
|
129
151
|
if (!config.agentSettings.agentApiName) {
|
|
130
152
|
config.agentSettings.agentApiName = (0, exports.generateAgentApiName)(config.agentSettings?.agentName);
|
|
131
153
|
}
|
|
132
|
-
const response = await
|
|
154
|
+
const response = await maybeMock.request('POST', url, config);
|
|
133
155
|
// When saving agent creation we need to retrieve the created metadata.
|
|
134
156
|
if (response.isSuccess) {
|
|
135
157
|
await core_1.Lifecycle.getInstance().emit(exports.AgentCreateLifecycleStages.Retrieving, {});
|
|
136
|
-
const defaultPackagePath =
|
|
158
|
+
const defaultPackagePath = project.getDefaultPackage().path ?? 'force-app';
|
|
137
159
|
try {
|
|
138
160
|
const cs = await source_deploy_retrieve_1.ComponentSetBuilder.build({
|
|
139
161
|
metadata: {
|
|
@@ -141,12 +163,12 @@ class Agent {
|
|
|
141
163
|
directoryPaths: [defaultPackagePath],
|
|
142
164
|
},
|
|
143
165
|
org: {
|
|
144
|
-
username:
|
|
166
|
+
username: connection.getUsername(),
|
|
145
167
|
exclude: [],
|
|
146
168
|
},
|
|
147
169
|
});
|
|
148
170
|
const retrieve = await cs.retrieve({
|
|
149
|
-
usernameOrConnection:
|
|
171
|
+
usernameOrConnection: connection,
|
|
150
172
|
merge: true,
|
|
151
173
|
format: 'source',
|
|
152
174
|
output: defaultPackagePath,
|
|
@@ -180,10 +202,13 @@ class Agent {
|
|
|
180
202
|
/**
|
|
181
203
|
* Create an agent spec from provided data.
|
|
182
204
|
*
|
|
205
|
+
* @param connection a `Connection` to an org.
|
|
183
206
|
* @param config The configuration used to generate an agent spec.
|
|
207
|
+
* @returns the agent job spec
|
|
184
208
|
*/
|
|
185
|
-
async createSpec(config) {
|
|
186
|
-
|
|
209
|
+
static async createSpec(connection, config) {
|
|
210
|
+
const maybeMock = new maybe_mock_1.MaybeMock(connection);
|
|
211
|
+
verifyAgentSpecConfig(config);
|
|
187
212
|
const url = '/connect/ai-assist/draft-agent-topics';
|
|
188
213
|
const body = {
|
|
189
214
|
agentType: config.agentType,
|
|
@@ -207,7 +232,7 @@ class Agent {
|
|
|
207
232
|
body.generationInfo.customizedInfo.groundingContext = config.groundingContext;
|
|
208
233
|
}
|
|
209
234
|
}
|
|
210
|
-
const response = await
|
|
235
|
+
const response = await maybeMock.request('POST', url, body);
|
|
211
236
|
const htmlDecodedResponse = decodeResponse(response);
|
|
212
237
|
if (htmlDecodedResponse.isSuccess) {
|
|
213
238
|
return { ...config, topics: htmlDecodedResponse.topicDrafts };
|
|
@@ -220,15 +245,27 @@ class Agent {
|
|
|
220
245
|
});
|
|
221
246
|
}
|
|
222
247
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
248
|
+
/**
|
|
249
|
+
* Returns the ID for this agent.
|
|
250
|
+
*
|
|
251
|
+
* @returns The ID of the agent (The `Bot` ID).
|
|
252
|
+
*/
|
|
253
|
+
async getId() {
|
|
254
|
+
if (!this.id) {
|
|
255
|
+
const query = `SELECT Id FROM BotDefinition WHERE DeveloperName = '${this.options.name}'`;
|
|
256
|
+
this.id = (await this.options.connection.singleRecordQuery(query)).Id;
|
|
228
257
|
}
|
|
258
|
+
return this.id;
|
|
229
259
|
}
|
|
230
260
|
}
|
|
231
261
|
exports.Agent = Agent;
|
|
262
|
+
// private function used by Agent.createSpec()
|
|
263
|
+
const verifyAgentSpecConfig = (config) => {
|
|
264
|
+
const { agentType, role, companyName, companyDescription } = config;
|
|
265
|
+
if (!agentType || !role || !companyName || !companyDescription) {
|
|
266
|
+
throw messages.createError('invalidAgentSpecConfig');
|
|
267
|
+
}
|
|
268
|
+
};
|
|
232
269
|
/**
|
|
233
270
|
* Generate an API name from an agent name. Matches what the UI does.
|
|
234
271
|
*/
|
|
@@ -243,8 +280,8 @@ const generateAgentApiName = (agentName) => {
|
|
|
243
280
|
.replace(/(^\d+)/, 'X$1')
|
|
244
281
|
.slice(0, maxLength)
|
|
245
282
|
.replace(/_$/, '');
|
|
246
|
-
const
|
|
247
|
-
|
|
283
|
+
const genLogger = core_1.Logger.childFromRoot('Agent-GenApiName');
|
|
284
|
+
genLogger.debug(`Generated Agent API name: [${apiName}] from Agent name: [${agentName}]`);
|
|
248
285
|
return apiName;
|
|
249
286
|
};
|
|
250
287
|
exports.generateAgentApiName = generateAgentApiName;
|
package/lib/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoC;AACpC,gDAAkC;AAClC,+CAAiD;AACjD,2CAA+F;AAC/F,+EAAyE;AACzE,yCAA2C;
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yCAAoC;AACpC,gDAAkC;AAClC,+CAAiD;AACjD,2CAA+F;AAC/F,+EAAyE;AACzE,yCAA2C;AAU3C,6CAAyC;AACzC,mCAA6C;;AAG7C,MAAM,QAAQ,OAAG,eAAQ,CAAc,oBAAoB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,SAAS,GAAG,CAAC,CAAC;IAC1F,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAdW,QAAA,oBAAoB,wBAc/B;AAEF,wDAAwD;AACxD,MAAM,cAAc,GAAG,CAAmB,QAAW,EAAK,EAAE,CAC1D,IAAI,CAAC,KAAK,CAAC,IAAA,0BAAkB,EAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAM,CAAC"}
|
package/lib/agentPreview.d.ts
CHANGED
|
@@ -1,70 +1,59 @@
|
|
|
1
1
|
import { Connection } from '@salesforce/core';
|
|
2
|
-
type ApiStatus
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
id: string;
|
|
26
|
-
feedbackId: string;
|
|
27
|
-
planId: string;
|
|
28
|
-
isContentSafe: boolean;
|
|
29
|
-
message: string;
|
|
30
|
-
result: {
|
|
31
|
-
type: string;
|
|
32
|
-
property: string;
|
|
33
|
-
value: any;
|
|
34
|
-
};
|
|
35
|
-
citedReferences: {
|
|
36
|
-
type: string;
|
|
37
|
-
value: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
export type AgentPreviewStartResponse = {
|
|
41
|
-
sessionId: string;
|
|
42
|
-
_links: AgentPreviewMessageLinks;
|
|
43
|
-
messages: AgentPreviewMessage[];
|
|
44
|
-
};
|
|
45
|
-
export type AgentPreviewSendResponse = {
|
|
46
|
-
messages: AgentPreviewMessage[];
|
|
47
|
-
_links: AgentPreviewMessageLinks;
|
|
48
|
-
};
|
|
49
|
-
export type AgentPreviewEndMessage = {
|
|
50
|
-
type: string;
|
|
51
|
-
id: string;
|
|
52
|
-
reason: string;
|
|
53
|
-
feedbackId: string;
|
|
54
|
-
};
|
|
55
|
-
export type AgentPreviewEndResponse = {
|
|
56
|
-
messages: AgentPreviewEndMessage[];
|
|
57
|
-
_links: AgentPreviewMessageLinks;
|
|
58
|
-
};
|
|
59
|
-
type EndReason = 'UserRequest' | 'Transfer' | 'Expiration' | 'Error' | 'Other';
|
|
2
|
+
import { type AgentPreviewEndResponse, type AgentPreviewStartResponse, type AgentPreviewSendResponse, type ApiStatus, type EndReason } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* A service to interact with an agent. Start an interactive session,
|
|
5
|
+
* send messages to the agent, and end the session.
|
|
6
|
+
*
|
|
7
|
+
* **Examples**
|
|
8
|
+
*
|
|
9
|
+
* Create an instance of the service:
|
|
10
|
+
*
|
|
11
|
+
* `const agentPreview = new AgentPreview(connection);`
|
|
12
|
+
*
|
|
13
|
+
* Start an interactive session:
|
|
14
|
+
*
|
|
15
|
+
* `const { sessionId } = await agentPreview.start(botId);`
|
|
16
|
+
*
|
|
17
|
+
* Send a message to the agent using the session ID from the startResponse:
|
|
18
|
+
*
|
|
19
|
+
* `const sendResponse = await agentPreview.send(sessionId, message);`
|
|
20
|
+
*
|
|
21
|
+
* End an interactive session:
|
|
22
|
+
*
|
|
23
|
+
* `await agentPreview.end(sessionId, 'UserRequest');`
|
|
24
|
+
*/
|
|
60
25
|
export declare class AgentPreview {
|
|
61
26
|
private apiBase;
|
|
62
27
|
private instanceUrl;
|
|
63
28
|
private maybeMock;
|
|
64
29
|
constructor(connection: Connection);
|
|
30
|
+
/**
|
|
31
|
+
* Start an interactive session with the provided agent.
|
|
32
|
+
*
|
|
33
|
+
* @param botId The ID of the agent (`Bot` ID).
|
|
34
|
+
* @returns `AgentPreviewStartResponse`, which includes a session ID needed for other actions.
|
|
35
|
+
*/
|
|
65
36
|
start(botId: string): Promise<AgentPreviewStartResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Send a message to the agent using the session ID obtained by calling `start()`.
|
|
39
|
+
*
|
|
40
|
+
* @param sessionId A session ID provided by first calling `agentPreview.start()`.
|
|
41
|
+
* @param message A message to send to the agent.
|
|
42
|
+
* @returns `AgentPreviewSendResponse`
|
|
43
|
+
*/
|
|
66
44
|
send(sessionId: string, message: string): Promise<AgentPreviewSendResponse>;
|
|
45
|
+
/**
|
|
46
|
+
* Ends an interactive session with the agent.
|
|
47
|
+
*
|
|
48
|
+
* @param sessionId A session ID provided by first calling `agentPreview.start()`.
|
|
49
|
+
* @param reason A reason why the interactive session was ended.
|
|
50
|
+
* @returns `AgentPreviewEndResponse`
|
|
51
|
+
*/
|
|
67
52
|
end(sessionId: string, reason: EndReason): Promise<AgentPreviewEndResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Get the status of the Agent API (UP | DOWN).
|
|
55
|
+
*
|
|
56
|
+
* @returns `ApiStatus`
|
|
57
|
+
*/
|
|
68
58
|
status(): Promise<ApiStatus>;
|
|
69
59
|
}
|
|
70
|
-
export {};
|
package/lib/agentPreview.js
CHANGED
|
@@ -10,6 +10,28 @@ exports.AgentPreview = void 0;
|
|
|
10
10
|
const node_crypto_1 = require("node:crypto");
|
|
11
11
|
const core_1 = require("@salesforce/core");
|
|
12
12
|
const maybe_mock_1 = require("./maybe-mock");
|
|
13
|
+
/**
|
|
14
|
+
* A service to interact with an agent. Start an interactive session,
|
|
15
|
+
* send messages to the agent, and end the session.
|
|
16
|
+
*
|
|
17
|
+
* **Examples**
|
|
18
|
+
*
|
|
19
|
+
* Create an instance of the service:
|
|
20
|
+
*
|
|
21
|
+
* `const agentPreview = new AgentPreview(connection);`
|
|
22
|
+
*
|
|
23
|
+
* Start an interactive session:
|
|
24
|
+
*
|
|
25
|
+
* `const { sessionId } = await agentPreview.start(botId);`
|
|
26
|
+
*
|
|
27
|
+
* Send a message to the agent using the session ID from the startResponse:
|
|
28
|
+
*
|
|
29
|
+
* `const sendResponse = await agentPreview.send(sessionId, message);`
|
|
30
|
+
*
|
|
31
|
+
* End an interactive session:
|
|
32
|
+
*
|
|
33
|
+
* `await agentPreview.end(sessionId, 'UserRequest');`
|
|
34
|
+
*/
|
|
13
35
|
class AgentPreview {
|
|
14
36
|
apiBase;
|
|
15
37
|
instanceUrl;
|
|
@@ -19,6 +41,12 @@ class AgentPreview {
|
|
|
19
41
|
this.instanceUrl = connection.instanceUrl;
|
|
20
42
|
this.maybeMock = new maybe_mock_1.MaybeMock(connection);
|
|
21
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Start an interactive session with the provided agent.
|
|
46
|
+
*
|
|
47
|
+
* @param botId The ID of the agent (`Bot` ID).
|
|
48
|
+
* @returns `AgentPreviewStartResponse`, which includes a session ID needed for other actions.
|
|
49
|
+
*/
|
|
22
50
|
async start(botId) {
|
|
23
51
|
const url = `${this.apiBase}/agents/${botId}/sessions`;
|
|
24
52
|
const body = {
|
|
@@ -38,6 +66,13 @@ class AgentPreview {
|
|
|
38
66
|
throw core_1.SfError.wrap(err);
|
|
39
67
|
}
|
|
40
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Send a message to the agent using the session ID obtained by calling `start()`.
|
|
71
|
+
*
|
|
72
|
+
* @param sessionId A session ID provided by first calling `agentPreview.start()`.
|
|
73
|
+
* @param message A message to send to the agent.
|
|
74
|
+
* @returns `AgentPreviewSendResponse`
|
|
75
|
+
*/
|
|
41
76
|
async send(sessionId, message) {
|
|
42
77
|
const url = `${this.apiBase}/sessions/${sessionId}/messages`;
|
|
43
78
|
const body = {
|
|
@@ -57,6 +92,13 @@ class AgentPreview {
|
|
|
57
92
|
throw core_1.SfError.wrap(err);
|
|
58
93
|
}
|
|
59
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Ends an interactive session with the agent.
|
|
97
|
+
*
|
|
98
|
+
* @param sessionId A session ID provided by first calling `agentPreview.start()`.
|
|
99
|
+
* @param reason A reason why the interactive session was ended.
|
|
100
|
+
* @returns `AgentPreviewEndResponse`
|
|
101
|
+
*/
|
|
60
102
|
async end(sessionId, reason) {
|
|
61
103
|
const url = `${this.apiBase}/sessions/${sessionId}`;
|
|
62
104
|
try {
|
|
@@ -69,7 +111,11 @@ class AgentPreview {
|
|
|
69
111
|
throw core_1.SfError.wrap(err);
|
|
70
112
|
}
|
|
71
113
|
}
|
|
72
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Get the status of the Agent API (UP | DOWN).
|
|
116
|
+
*
|
|
117
|
+
* @returns `ApiStatus`
|
|
118
|
+
*/
|
|
73
119
|
async status() {
|
|
74
120
|
const base = 'https://test.api.salesforce.com';
|
|
75
121
|
const url = `${base}/einstein/ai-agent/v1/status`;
|
package/lib/agentPreview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentPreview.js","sourceRoot":"","sources":["../src/agentPreview.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6CAAyC;AACzC,2CAA2C;AAE3C,6CAAyC;
|
|
1
|
+
{"version":3,"file":"agentPreview.js","sourceRoot":"","sources":["../src/agentPreview.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,6CAAyC;AACzC,2CAA2C;AAE3C,6CAAyC;AASzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,YAAY;IACf,OAAO,CAAS;IAChB,WAAW,CAAS;IACpB,SAAS,CAAY;IAE7B,YAAmB,UAAsB;QACvC,IAAI,CAAC,OAAO,GAAG,iDAAiD,CAAC;QACjE,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,KAAK,CAAC,KAAa;QAC9B,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,WAAW,KAAK,WAAW,CAAC;QAEvD,MAAM,IAAI,GAAG;YACX,kBAAkB,EAAE,IAAA,wBAAU,GAAE;YAChC,cAA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sBAAsB,EAAE,MAAM;aAC/B,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,cAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,MAAM;QACjB,MAAM,IAAI,GAAG,iCAAiC,CAAC;QAC/C,MAAM,GAAG,GAAG,GAAG,IAAI,8BAA8B,CAAC;QAElD,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAY,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,cAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;CACF;AApGD,oCAoGC"}
|
package/lib/agentTester.d.ts
CHANGED
|
@@ -1,68 +1,10 @@
|
|
|
1
1
|
import { Connection } from '@salesforce/core';
|
|
2
2
|
import { Duration } from '@salesforce/kit';
|
|
3
|
-
import { DeployResult
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
export type AgentTestStatusResponse = {
|
|
10
|
-
status: TestStatus;
|
|
11
|
-
startTime: string;
|
|
12
|
-
endTime?: string;
|
|
13
|
-
errorMessage?: string;
|
|
14
|
-
};
|
|
15
|
-
export type TestCaseResult = {
|
|
16
|
-
status: TestStatus;
|
|
17
|
-
startTime: string;
|
|
18
|
-
endTime?: string;
|
|
19
|
-
inputs: {
|
|
20
|
-
utterance: string;
|
|
21
|
-
};
|
|
22
|
-
generatedData: {
|
|
23
|
-
actionsSequence: string[];
|
|
24
|
-
outcome: string;
|
|
25
|
-
topic: string;
|
|
26
|
-
};
|
|
27
|
-
testResults: Array<{
|
|
28
|
-
name: string;
|
|
29
|
-
actualValue: string;
|
|
30
|
-
expectedValue: string;
|
|
31
|
-
score: number;
|
|
32
|
-
result: null | 'PASS' | 'FAILURE';
|
|
33
|
-
metricLabel: 'Accuracy' | 'Precision';
|
|
34
|
-
metricExplainability: string;
|
|
35
|
-
status: TestStatus;
|
|
36
|
-
startTime: string;
|
|
37
|
-
endTime?: string;
|
|
38
|
-
errorCode?: string;
|
|
39
|
-
errorMessage?: string;
|
|
40
|
-
}>;
|
|
41
|
-
testNumber: number;
|
|
42
|
-
};
|
|
43
|
-
export type AgentTestResultsResponse = {
|
|
44
|
-
status: TestStatus;
|
|
45
|
-
startTime: string;
|
|
46
|
-
endTime?: string;
|
|
47
|
-
errorMessage?: string;
|
|
48
|
-
subjectName: string;
|
|
49
|
-
testCases: TestCaseResult[];
|
|
50
|
-
};
|
|
51
|
-
export type AvailableDefinition = Omit<FileProperties, 'manageableState' | 'namespacePrefix'>;
|
|
52
|
-
export type TestCase = {
|
|
53
|
-
utterance: string;
|
|
54
|
-
expectedActions: string[] | undefined;
|
|
55
|
-
expectedOutcome: string | undefined;
|
|
56
|
-
expectedTopic: string | undefined;
|
|
57
|
-
};
|
|
58
|
-
export type TestSpec = {
|
|
59
|
-
name: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
subjectType: string;
|
|
62
|
-
subjectName: string;
|
|
63
|
-
subjectVersion?: string;
|
|
64
|
-
testCases: TestCase[];
|
|
65
|
-
};
|
|
3
|
+
import { DeployResult } from '@salesforce/source-deploy-retrieve';
|
|
4
|
+
import { type AvailableDefinition, type AgentTestStartResponse, type AgentTestStatusResponse, type AgentTestResultsResponse, type TestSpec } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Events emitted during agent test creation for consumers to listen to and keep track of progress.
|
|
7
|
+
*/
|
|
66
8
|
export declare const AgentTestCreateLifecycleStages: {
|
|
67
9
|
CreatingLocalMetadata: string;
|
|
68
10
|
Waiting: string;
|
|
@@ -70,7 +12,26 @@ export declare const AgentTestCreateLifecycleStages: {
|
|
|
70
12
|
Done: string;
|
|
71
13
|
};
|
|
72
14
|
/**
|
|
73
|
-
*
|
|
15
|
+
* A service for testing agents using `AiEvaluationDefinition` metadata. Start asynchronous
|
|
16
|
+
* test runs, get or poll for test status, and get detailed test results.
|
|
17
|
+
*
|
|
18
|
+
* **Examples**
|
|
19
|
+
*
|
|
20
|
+
* Create an instance of the service:
|
|
21
|
+
*
|
|
22
|
+
* `const agentTester = new AgentTester(connection);`
|
|
23
|
+
*
|
|
24
|
+
* Start a test run:
|
|
25
|
+
*
|
|
26
|
+
* `const startResponse = await agentTester.start(aiEvalDef);`
|
|
27
|
+
*
|
|
28
|
+
* Get the status for a test run:
|
|
29
|
+
*
|
|
30
|
+
* `const status = await agentTester.status(startResponse.runId);`
|
|
31
|
+
*
|
|
32
|
+
* Get detailed results for a test run:
|
|
33
|
+
*
|
|
34
|
+
* `const results = await agentTester.results(startResponse.runId);`
|
|
74
35
|
*/
|
|
75
36
|
export declare class AgentTester {
|
|
76
37
|
private connection;
|
|
@@ -81,21 +42,21 @@ export declare class AgentTester {
|
|
|
81
42
|
*/
|
|
82
43
|
list(): Promise<AvailableDefinition[]>;
|
|
83
44
|
/**
|
|
84
|
-
* Initiates
|
|
45
|
+
* Initiates a test run (i.e., AI evaluation).
|
|
85
46
|
*
|
|
86
47
|
* @param aiEvalDefName - The name of the AI evaluation definition to run.
|
|
87
48
|
* @returns Promise that resolves with the response from starting the test.
|
|
88
49
|
*/
|
|
89
50
|
start(aiEvalDefName: string): Promise<AgentTestStartResponse>;
|
|
90
51
|
/**
|
|
91
|
-
* Get the status of a test run
|
|
52
|
+
* Get the status of a test run.
|
|
92
53
|
*
|
|
93
54
|
* @param {string} jobId
|
|
94
55
|
* @returns {Promise<AgentTestStatusResponse>}
|
|
95
56
|
*/
|
|
96
57
|
status(jobId: string): Promise<AgentTestStatusResponse>;
|
|
97
58
|
/**
|
|
98
|
-
* Poll
|
|
59
|
+
* Poll the status of a test run until the tests are complete or the timeout is reached.
|
|
99
60
|
*
|
|
100
61
|
* @param {string} jobId
|
|
101
62
|
* @param {Duration} timeout
|
|
@@ -105,14 +66,14 @@ export declare class AgentTester {
|
|
|
105
66
|
timeout?: Duration;
|
|
106
67
|
}): Promise<AgentTestResultsResponse>;
|
|
107
68
|
/**
|
|
108
|
-
*
|
|
69
|
+
* Get detailed test run results.
|
|
109
70
|
*
|
|
110
71
|
* @param {string} jobId
|
|
111
72
|
* @returns {Promise<AgentTestResultsResponse>}
|
|
112
73
|
*/
|
|
113
74
|
results(jobId: string): Promise<AgentTestResultsResponse>;
|
|
114
75
|
/**
|
|
115
|
-
* Cancel an in-progress test run
|
|
76
|
+
* Cancel an in-progress test run.
|
|
116
77
|
*
|
|
117
78
|
* @param {string} jobId
|
|
118
79
|
* @returns {Promise<{success: boolean}>}
|
|
@@ -145,6 +106,13 @@ export declare class AgentTester {
|
|
|
145
106
|
deployResult?: DeployResult;
|
|
146
107
|
}>;
|
|
147
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Convert the raw, detailed test results to another format.
|
|
111
|
+
*
|
|
112
|
+
* @param results The detailed results from a test run.
|
|
113
|
+
* @param format The desired format. One of: json, junit, or tap.
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
148
116
|
export declare function convertTestResultsToFormat(results: AgentTestResultsResponse, format: 'json' | 'junit' | 'tap'): Promise<string>;
|
|
149
117
|
/**
|
|
150
118
|
* Normalizes test results by decoding HTML entities in utterances and test result values.
|
|
@@ -153,6 +121,7 @@ export declare function convertTestResultsToFormat(results: AgentTestResultsResp
|
|
|
153
121
|
* @returns A new AgentTestResultsResponse with decoded HTML entities
|
|
154
122
|
*
|
|
155
123
|
* @example
|
|
124
|
+
* ```
|
|
156
125
|
* const results = {
|
|
157
126
|
* testCases: [{
|
|
158
127
|
* inputs: { utterance: ""hello"" },
|
|
@@ -163,6 +132,7 @@ export declare function convertTestResultsToFormat(results: AgentTestResultsResp
|
|
|
163
132
|
* }]
|
|
164
133
|
* };
|
|
165
134
|
* const normalized = normalizeResults(results);
|
|
135
|
+
* ```
|
|
166
136
|
*/
|
|
167
137
|
export declare function normalizeResults(results: AgentTestResultsResponse): AgentTestResultsResponse;
|
|
168
138
|
export declare function humanFriendlyName(name: string): string;
|
package/lib/agentTester.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Licensed under the BSD 3-Clause license.
|
|
6
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
7
|
+
*/
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.AgentTester = exports.AgentTestCreateLifecycleStages = void 0;
|
|
4
10
|
exports.convertTestResultsToFormat = convertTestResultsToFormat;
|
|
@@ -6,13 +12,6 @@ exports.normalizeResults = normalizeResults;
|
|
|
6
12
|
exports.humanFriendlyName = humanFriendlyName;
|
|
7
13
|
exports.writeTestSpec = writeTestSpec;
|
|
8
14
|
exports.generateTestSpecFromAiEvalDefinition = generateTestSpecFromAiEvalDefinition;
|
|
9
|
-
/*
|
|
10
|
-
* Copyright (c) 2024, salesforce.com, inc.
|
|
11
|
-
* All rights reserved.
|
|
12
|
-
* Licensed under the BSD 3-Clause license.
|
|
13
|
-
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
14
|
-
*/
|
|
15
|
-
/* eslint-disable jsdoc/check-indentation */
|
|
16
15
|
const promises_1 = require("node:fs/promises");
|
|
17
16
|
const node_path_1 = require("node:path");
|
|
18
17
|
const core_1 = require("@salesforce/core");
|
|
@@ -22,6 +21,9 @@ const yaml_1 = require("yaml");
|
|
|
22
21
|
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
23
22
|
const maybe_mock_1 = require("./maybe-mock");
|
|
24
23
|
const utils_1 = require("./utils");
|
|
24
|
+
/**
|
|
25
|
+
* Events emitted during agent test creation for consumers to listen to and keep track of progress.
|
|
26
|
+
*/
|
|
25
27
|
exports.AgentTestCreateLifecycleStages = {
|
|
26
28
|
CreatingLocalMetadata: 'Creating Local Metadata',
|
|
27
29
|
Waiting: 'Waiting for the org to respond',
|
|
@@ -29,7 +31,26 @@ exports.AgentTestCreateLifecycleStages = {
|
|
|
29
31
|
Done: 'Done',
|
|
30
32
|
};
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
34
|
+
* A service for testing agents using `AiEvaluationDefinition` metadata. Start asynchronous
|
|
35
|
+
* test runs, get or poll for test status, and get detailed test results.
|
|
36
|
+
*
|
|
37
|
+
* **Examples**
|
|
38
|
+
*
|
|
39
|
+
* Create an instance of the service:
|
|
40
|
+
*
|
|
41
|
+
* `const agentTester = new AgentTester(connection);`
|
|
42
|
+
*
|
|
43
|
+
* Start a test run:
|
|
44
|
+
*
|
|
45
|
+
* `const startResponse = await agentTester.start(aiEvalDef);`
|
|
46
|
+
*
|
|
47
|
+
* Get the status for a test run:
|
|
48
|
+
*
|
|
49
|
+
* `const status = await agentTester.status(startResponse.runId);`
|
|
50
|
+
*
|
|
51
|
+
* Get detailed results for a test run:
|
|
52
|
+
*
|
|
53
|
+
* `const results = await agentTester.results(startResponse.runId);`
|
|
33
54
|
*/
|
|
34
55
|
class AgentTester {
|
|
35
56
|
connection;
|
|
@@ -45,7 +66,7 @@ class AgentTester {
|
|
|
45
66
|
return this.connection.metadata.list({ type: 'AiEvaluationDefinition' });
|
|
46
67
|
}
|
|
47
68
|
/**
|
|
48
|
-
* Initiates
|
|
69
|
+
* Initiates a test run (i.e., AI evaluation).
|
|
49
70
|
*
|
|
50
71
|
* @param aiEvalDefName - The name of the AI evaluation definition to run.
|
|
51
72
|
* @returns Promise that resolves with the response from starting the test.
|
|
@@ -57,7 +78,7 @@ class AgentTester {
|
|
|
57
78
|
});
|
|
58
79
|
}
|
|
59
80
|
/**
|
|
60
|
-
* Get the status of a test run
|
|
81
|
+
* Get the status of a test run.
|
|
61
82
|
*
|
|
62
83
|
* @param {string} jobId
|
|
63
84
|
* @returns {Promise<AgentTestStatusResponse>}
|
|
@@ -67,7 +88,7 @@ class AgentTester {
|
|
|
67
88
|
return this.maybeMock.request('GET', url);
|
|
68
89
|
}
|
|
69
90
|
/**
|
|
70
|
-
* Poll
|
|
91
|
+
* Poll the status of a test run until the tests are complete or the timeout is reached.
|
|
71
92
|
*
|
|
72
93
|
* @param {string} jobId
|
|
73
94
|
* @param {Duration} timeout
|
|
@@ -113,7 +134,7 @@ class AgentTester {
|
|
|
113
134
|
return client.subscribe();
|
|
114
135
|
}
|
|
115
136
|
/**
|
|
116
|
-
*
|
|
137
|
+
* Get detailed test run results.
|
|
117
138
|
*
|
|
118
139
|
* @param {string} jobId
|
|
119
140
|
* @returns {Promise<AgentTestResultsResponse>}
|
|
@@ -124,7 +145,7 @@ class AgentTester {
|
|
|
124
145
|
return normalizeResults(results);
|
|
125
146
|
}
|
|
126
147
|
/**
|
|
127
|
-
* Cancel an in-progress test run
|
|
148
|
+
* Cancel an in-progress test run.
|
|
128
149
|
*
|
|
129
150
|
* @param {string} jobId
|
|
130
151
|
* @returns {Promise<{success: boolean}>}
|
|
@@ -228,6 +249,13 @@ class AgentTester {
|
|
|
228
249
|
}
|
|
229
250
|
}
|
|
230
251
|
exports.AgentTester = AgentTester;
|
|
252
|
+
/**
|
|
253
|
+
* Convert the raw, detailed test results to another format.
|
|
254
|
+
*
|
|
255
|
+
* @param results The detailed results from a test run.
|
|
256
|
+
* @param format The desired format. One of: json, junit, or tap.
|
|
257
|
+
* @returns
|
|
258
|
+
*/
|
|
231
259
|
async function convertTestResultsToFormat(results, format) {
|
|
232
260
|
switch (format) {
|
|
233
261
|
case 'json':
|
|
@@ -247,6 +275,7 @@ async function convertTestResultsToFormat(results, format) {
|
|
|
247
275
|
* @returns A new AgentTestResultsResponse with decoded HTML entities
|
|
248
276
|
*
|
|
249
277
|
* @example
|
|
278
|
+
* ```
|
|
250
279
|
* const results = {
|
|
251
280
|
* testCases: [{
|
|
252
281
|
* inputs: { utterance: ""hello"" },
|
|
@@ -257,6 +286,7 @@ async function convertTestResultsToFormat(results, format) {
|
|
|
257
286
|
* }]
|
|
258
287
|
* };
|
|
259
288
|
* const normalized = normalizeResults(results);
|
|
289
|
+
* ```
|
|
260
290
|
*/
|
|
261
291
|
function normalizeResults(results) {
|
|
262
292
|
return {
|
package/lib/agentTester.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentTester.js","sourceRoot":"","sources":["../src/agentTester.ts"],"names":[],"mappings":";;;AA4VA,gEAcC;AAoBD,4CAeC;AA4DD,8CAgBC;AAiDD,sCAaC;AAWD,oFAyBC;AA3jBD;;;;;GAKG;AACH,4CAA4C;AAC5C,+CAA8D;AAC9D,yCAA0C;AAC1C,2CAA+F;AAC/F,yCAAgD;AAChD,+EAAsH;AACtH,+BAAwC;AACxC,qDAAwD;AACxD,6CAAyC;AACzC,mCAA6C;AA2FhC,QAAA,8BAA8B,GAAG;IAC5C,qBAAqB,EAAE,yBAAyB;IAChD,OAAO,EAAE,gCAAgC;IACzC,iBAAiB,EAAE,oBAAoB;IACvC,IAAI,EAAE,MAAM;CACb,CAAC;AAEF;;GAEG;AACH,MAAa,WAAW;IAEK;IADnB,SAAS,CAAY;IAC7B,YAA2B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAC/C,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,KAAK,CAAC,aAAqB;QACtC,MAAM,GAAG,GAAG,+BAA+B,CAAC;QAE5C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAyB,MAAM,EAAE,GAAG,EAAE;YACjE,0BAA0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C,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,qBAAqB,IAAI,CAAC,CAAC,IAAI,KAAK,mBAAmB,CAAC;oBAC3G,EAAE,aAAa;aAClB,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACJ,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig, type AgentTone, type AgentType, type DraftAgentTopics, type DraftAgentTopicsBody, type DraftAgentTopicsResponse, } from './types';
|
|
1
|
+
export { type AgentCreateConfig, type AgentCreateResponse, type AgentJobSpec, type AgentJobSpecCreateConfig, type AgentOptions, type AgentTone, type AgentType, type AgentPreviewMessageLinks, type AgentPreviewMessage, type AgentPreviewStartResponse, type AgentPreviewSendResponse, type AgentPreviewEndResponse, type DraftAgentTopics, type DraftAgentTopicsBody, type DraftAgentTopicsResponse, type AvailableDefinition, type AgentTestResultsResponse, type AgentTestStartResponse, type AgentTestStatusResponse, type TestCaseResult, type TestStatus, } from './types';
|
|
2
2
|
export { Agent, AgentCreateLifecycleStages, generateAgentApiName } from './agent';
|
|
3
|
-
export { AgentTester, AgentTestCreateLifecycleStages, convertTestResultsToFormat, writeTestSpec, generateTestSpecFromAiEvalDefinition, humanFriendlyName,
|
|
4
|
-
export { AgentPreview
|
|
3
|
+
export { AgentTester, AgentTestCreateLifecycleStages, convertTestResultsToFormat, writeTestSpec, generateTestSpecFromAiEvalDefinition, humanFriendlyName, } from './agentTester';
|
|
4
|
+
export { AgentPreview } from './agentPreview';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAyBH,iCAAkF;AAAzE,8FAAA,KAAK,OAAA;AAAE,mHAAA,0BAA0B,OAAA;AAAE,6GAAA,oBAAoB,OAAA;AAChE,6CAOuB;AANrB,0GAAA,WAAW,OAAA;AACX,6HAAA,8BAA8B,OAAA;AAC9B,yHAAA,0BAA0B,OAAA;AAC1B,4GAAA,aAAa,OAAA;AACb,mIAAA,oCAAoC,OAAA;AACpC,gHAAA,iBAAiB,OAAA;AAEnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { Connection, SfProject } from '@salesforce/core';
|
|
2
|
+
import { FileProperties } from '@salesforce/source-deploy-retrieve';
|
|
3
|
+
/**
|
|
4
|
+
* Options for creating instances of agents from an org.
|
|
5
|
+
*/
|
|
6
|
+
export type AgentOptions = {
|
|
7
|
+
connection: Connection;
|
|
8
|
+
project?: SfProject;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
1
11
|
/**
|
|
2
12
|
* An agent job spec is a list of job titles and descriptions
|
|
3
13
|
* to be performed by the agent.
|
|
@@ -179,3 +189,142 @@ export type DraftAgentTopicsResponse = {
|
|
|
179
189
|
errorMessage?: string;
|
|
180
190
|
topicDrafts: DraftAgentTopics;
|
|
181
191
|
};
|
|
192
|
+
export type TestStatus = 'NEW' | 'IN_PROGRESS' | 'COMPLETED' | 'ERROR' | 'TERMINATED';
|
|
193
|
+
export type AgentTestStartResponse = {
|
|
194
|
+
runId: string;
|
|
195
|
+
status: TestStatus;
|
|
196
|
+
};
|
|
197
|
+
export type AgentTestStatusResponse = {
|
|
198
|
+
status: TestStatus;
|
|
199
|
+
startTime: string;
|
|
200
|
+
endTime?: string;
|
|
201
|
+
errorMessage?: string;
|
|
202
|
+
};
|
|
203
|
+
export type TestCaseResult = {
|
|
204
|
+
status: TestStatus;
|
|
205
|
+
startTime: string;
|
|
206
|
+
endTime?: string;
|
|
207
|
+
inputs: {
|
|
208
|
+
utterance: string;
|
|
209
|
+
};
|
|
210
|
+
generatedData: {
|
|
211
|
+
actionsSequence: string[];
|
|
212
|
+
outcome: string;
|
|
213
|
+
topic: string;
|
|
214
|
+
};
|
|
215
|
+
testResults: Array<{
|
|
216
|
+
name: string;
|
|
217
|
+
actualValue: string;
|
|
218
|
+
expectedValue: string;
|
|
219
|
+
score: number;
|
|
220
|
+
result: null | 'PASS' | 'FAILURE';
|
|
221
|
+
metricLabel: 'Accuracy' | 'Precision';
|
|
222
|
+
metricExplainability: string;
|
|
223
|
+
status: TestStatus;
|
|
224
|
+
startTime: string;
|
|
225
|
+
endTime?: string;
|
|
226
|
+
errorCode?: string;
|
|
227
|
+
errorMessage?: string;
|
|
228
|
+
}>;
|
|
229
|
+
testNumber: number;
|
|
230
|
+
};
|
|
231
|
+
export type AgentTestResultsResponse = {
|
|
232
|
+
status: TestStatus;
|
|
233
|
+
startTime: string;
|
|
234
|
+
endTime?: string;
|
|
235
|
+
errorMessage?: string;
|
|
236
|
+
subjectName: string;
|
|
237
|
+
testCases: TestCaseResult[];
|
|
238
|
+
};
|
|
239
|
+
export type AvailableDefinition = Omit<FileProperties, 'manageableState' | 'namespacePrefix'>;
|
|
240
|
+
export type TestCase = {
|
|
241
|
+
utterance: string;
|
|
242
|
+
expectedActions: string[] | undefined;
|
|
243
|
+
expectedOutcome: string | undefined;
|
|
244
|
+
expectedTopic: string | undefined;
|
|
245
|
+
};
|
|
246
|
+
export type TestSpec = {
|
|
247
|
+
name: string;
|
|
248
|
+
description?: string;
|
|
249
|
+
subjectType: string;
|
|
250
|
+
subjectName: string;
|
|
251
|
+
subjectVersion?: string;
|
|
252
|
+
testCases: TestCase[];
|
|
253
|
+
};
|
|
254
|
+
export type AiEvaluationDefinition = {
|
|
255
|
+
AiEvaluationDefinition: {
|
|
256
|
+
description?: string;
|
|
257
|
+
name: string;
|
|
258
|
+
subjectType: 'AGENT';
|
|
259
|
+
subjectName: string;
|
|
260
|
+
subjectVersion?: string;
|
|
261
|
+
testCase: Array<{
|
|
262
|
+
expectation: Array<{
|
|
263
|
+
name: string;
|
|
264
|
+
expectedValue: string;
|
|
265
|
+
}>;
|
|
266
|
+
inputs: {
|
|
267
|
+
utterance: string;
|
|
268
|
+
};
|
|
269
|
+
}>;
|
|
270
|
+
};
|
|
271
|
+
};
|
|
272
|
+
export type ApiStatus = {
|
|
273
|
+
status: 'UP' | 'DOWN';
|
|
274
|
+
};
|
|
275
|
+
type Href = {
|
|
276
|
+
href: string;
|
|
277
|
+
};
|
|
278
|
+
export type AgentPreviewError = {
|
|
279
|
+
status: number;
|
|
280
|
+
path: string;
|
|
281
|
+
requestId: string;
|
|
282
|
+
error: string;
|
|
283
|
+
message: string;
|
|
284
|
+
timestamp: number;
|
|
285
|
+
};
|
|
286
|
+
export type AgentPreviewMessageLinks = {
|
|
287
|
+
self: Href | null;
|
|
288
|
+
messages: Href | null;
|
|
289
|
+
session: Href | null;
|
|
290
|
+
end: Href | null;
|
|
291
|
+
};
|
|
292
|
+
export type MessageType = 'Inform' | 'TextChunk' | 'ProgressIndicator' | 'Inquire' | 'Confirm' | 'Failure' | 'Escalate' | 'SessionEnded' | 'EndOfTurn' | 'Error';
|
|
293
|
+
export type AgentPreviewMessage = {
|
|
294
|
+
type: MessageType;
|
|
295
|
+
id: string;
|
|
296
|
+
feedbackId: string;
|
|
297
|
+
planId: string;
|
|
298
|
+
isContentSafe: boolean;
|
|
299
|
+
message: string;
|
|
300
|
+
result: {
|
|
301
|
+
type: string;
|
|
302
|
+
property: string;
|
|
303
|
+
value: any;
|
|
304
|
+
};
|
|
305
|
+
citedReferences: {
|
|
306
|
+
type: string;
|
|
307
|
+
value: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
export type AgentPreviewStartResponse = {
|
|
311
|
+
sessionId: string;
|
|
312
|
+
_links: AgentPreviewMessageLinks;
|
|
313
|
+
messages: AgentPreviewMessage[];
|
|
314
|
+
};
|
|
315
|
+
export type AgentPreviewSendResponse = {
|
|
316
|
+
messages: AgentPreviewMessage[];
|
|
317
|
+
_links: AgentPreviewMessageLinks;
|
|
318
|
+
};
|
|
319
|
+
export type AgentPreviewEndMessage = {
|
|
320
|
+
type: string;
|
|
321
|
+
id: string;
|
|
322
|
+
reason: string;
|
|
323
|
+
feedbackId: string;
|
|
324
|
+
};
|
|
325
|
+
export type AgentPreviewEndResponse = {
|
|
326
|
+
messages: AgentPreviewEndMessage[];
|
|
327
|
+
_links: AgentPreviewMessageLinks;
|
|
328
|
+
};
|
|
329
|
+
export type EndReason = 'UserRequest' | 'Transfer' | 'Expiration' | 'Error' | 'Other';
|
|
330
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/agents",
|
|
3
3
|
"description": "Client side APIs for working with Salesforce agents",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"author": "Salesforce",
|
|
7
7
|
"main": "lib/index",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@salesforce/source-deploy-retrieve": "^12.18.2",
|
|
17
17
|
"fast-xml-parser": "^4.5.3",
|
|
18
18
|
"nock": "^13.5.6",
|
|
19
|
-
"yaml": "^2.7.
|
|
19
|
+
"yaml": "^2.7.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@salesforce/cli-plugins-testkit": "^5.3.39",
|