@forwardimpact/libharness 0.1.13 → 0.1.14
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 +10 -0
- package/package.json +1 -1
- package/src/mock/resource-index.js +3 -18
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -34,31 +34,16 @@ export function createMockResourceIndex(options = {}) {
|
|
|
34
34
|
/**
|
|
35
35
|
* Sets up default test resources
|
|
36
36
|
* @param {object} setupOptions - Setup options
|
|
37
|
-
* @param {string[]} [setupOptions.tools] - Tool names
|
|
37
|
+
* @param {string[]} [setupOptions.tools] - Tool names to seed
|
|
38
38
|
* @param {string} [setupOptions.conversationId] - Conversation ID
|
|
39
|
-
* @param {string} [setupOptions.agentId] - Agent ID
|
|
40
39
|
*/
|
|
41
40
|
setupDefaults(setupOptions = {}) {
|
|
42
|
-
const {
|
|
43
|
-
tools = [],
|
|
44
|
-
conversationId = "test-conversation",
|
|
45
|
-
agentId = "test-agent",
|
|
46
|
-
} = setupOptions;
|
|
41
|
+
const { tools = [], conversationId = "test-conversation" } = setupOptions;
|
|
47
42
|
|
|
48
43
|
resources.set(
|
|
49
44
|
conversationId,
|
|
50
45
|
common.Conversation.fromObject({
|
|
51
46
|
id: { name: conversationId },
|
|
52
|
-
agent_id: `common.Agent.${agentId}`,
|
|
53
|
-
}),
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
resources.set(
|
|
57
|
-
`common.Agent.${agentId}`,
|
|
58
|
-
common.Agent.fromObject({
|
|
59
|
-
id: { name: agentId, tokens: 50 },
|
|
60
|
-
tools,
|
|
61
|
-
content: "You are a test agent.",
|
|
62
47
|
}),
|
|
63
48
|
);
|
|
64
49
|
|
|
@@ -102,7 +87,7 @@ export function createMockResourceIndex(options = {}) {
|
|
|
102
87
|
},
|
|
103
88
|
};
|
|
104
89
|
|
|
105
|
-
if (options.tools || options.conversationId
|
|
90
|
+
if (options.tools || options.conversationId) {
|
|
106
91
|
index.setupDefaults(options);
|
|
107
92
|
}
|
|
108
93
|
|