@emseepea/create-tool-server 0.0.5 → 0.0.7
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.
|
@@ -1,20 +1,40 @@
|
|
|
1
|
-
import
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import {
|
|
3
|
+
assertResponseContains,
|
|
4
|
+
assertResponseMeaning,
|
|
5
|
+
assertToolCalls,
|
|
6
|
+
createConversation,
|
|
7
|
+
} from "@emseepea/testing/semantic";
|
|
2
8
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
test("looks up pea varieties and compares a follow-up", async (t) => {
|
|
10
|
+
const chat = await createConversation(t, {
|
|
11
|
+
server: new URL("../dist/server.js", import.meta.url),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// The first turn's flexible prose needs the one model judge. The follow-up's
|
|
15
|
+
// exact call and returned name add context coverage without another judge.
|
|
16
|
+
const highland = await chat.send(
|
|
17
|
+
"Describe the pea type, growth habit, maturity time, and traits of Highland Snap.",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
assertToolCalls(highland, [{
|
|
21
|
+
name: "get-pea-variety",
|
|
22
|
+
arguments: { name: "Highland Snap" },
|
|
23
|
+
}]);
|
|
24
|
+
assertResponseContains(highland, "Highland Snap");
|
|
25
|
+
await assertResponseMeaning(highland, {
|
|
26
|
+
expected:
|
|
27
|
+
"Highland Snap is a climbing snap pea that matures in 70 days, has edible " +
|
|
28
|
+
"pods, and needs support. Pea type, growth habit, maturity time, and traits " +
|
|
29
|
+
"remain distinct.",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const comparison = await chat.send(
|
|
33
|
+
"Compare that with Harbour Gem. Include its pea type, growth habit, and maturity time.",
|
|
34
|
+
);
|
|
35
|
+
assertToolCalls(comparison, [{
|
|
36
|
+
name: "get-pea-variety",
|
|
37
|
+
arguments: { name: "Harbour Gem" },
|
|
38
|
+
}]);
|
|
39
|
+
assertResponseContains(comparison, "Harbour Gem");
|
|
20
40
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emseepea/create-tool-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Create an Em See Pea server with one public tool.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@emseepea/server": "0.3.0",
|
|
22
22
|
"zod": "4.4.3",
|
|
23
|
-
"@emseepea/testing": "0.
|
|
23
|
+
"@emseepea/testing": "0.3.0",
|
|
24
24
|
"@types/node": "24.13.3",
|
|
25
25
|
"typescript": "6.0.3",
|
|
26
26
|
"oxlint": "1.80.0"
|