@emseepea/create-api-backed-server 0.0.5 → 0.0.6

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,23 +1,36 @@
1
- import { toolSelectionTest } from "@emseepea/testing/semantic";
1
+ import test from "node:test";
2
+ import {
3
+ assertNoToolCalls,
4
+ assertResponseContains,
5
+ assertResponseMeaning,
6
+ assertToolCalls,
7
+ createConversation,
8
+ } from "@emseepea/testing/semantic";
2
9
 
3
- toolSelectionTest("Taxon fields retain their documented meaning", {
4
- server: new URL("../test-support/llm-server.mjs", import.meta.url),
5
- question:
6
- "Search the public taxon catalogue for pea species. Give the scientific and " +
7
- "common names of each result, say which has more recorded observations, and " +
8
- "explain whether that count estimates the wild population.",
9
- criticalFacts: [
10
- "Pisum sativum",
11
- "Common Pea",
12
- "Lathyrus odoratus",
13
- "Sweet Pea",
14
- /8,?720/,
15
- /6,?240/
16
- ],
17
- criteria:
18
- "The answer reports Pisum sativum as Common Pea and Lathyrus odoratus as Sweet " +
19
- "Pea. It says Pisum sativum has more recorded observations, 8720 compared with " +
20
- "6240. It explains that observations_count is a count of recorded observations, " +
21
- "not an estimate of the wild population.",
22
- expectedTools: ["search-pea-taxa"],
10
+ test("searches once and remembers the common name for a follow-up", async (t) => {
11
+ const chat = await createConversation(t, {
12
+ server: new URL("../test-support/llm-server.mjs", import.meta.url),
13
+ });
14
+
15
+ const search = await chat.send(
16
+ 'Search the public taxon catalogue for "pea". ' +
17
+ "Which species has more recorded observations, how many does it have, " +
18
+ "and does that count estimate the wild population?",
19
+ );
20
+
21
+ assertToolCalls(search, [{
22
+ name: "search-pea-taxa",
23
+ arguments: { query: "pea" },
24
+ }]);
25
+ assertResponseContains(search, "Pisum sativum");
26
+ await assertResponseMeaning(search, {
27
+ expected:
28
+ "Pisum sativum has the most recorded observations, with 8,720. " +
29
+ "The response explains that recorded observations are not an estimate " +
30
+ "of the wild population.",
31
+ });
32
+
33
+ const followUp = await chat.send("What was its common name?");
34
+ assertNoToolCalls(followUp);
35
+ assertResponseContains(followUp, "Common Pea");
23
36
  });
@@ -14,7 +14,7 @@
14
14
  "lint": "oxlint src test eval test-support"
15
15
  },
16
16
  "devDependencies": {
17
- "@emseepea/testing": "0.2.2",
17
+ "@emseepea/testing": "0.3.0",
18
18
  "@modelcontextprotocol/client": "2.0.0",
19
19
  "@types/node": "24.13.3",
20
20
  "typescript": "6.0.3",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emseepea/create-api-backed-server",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Create an Em See Pea server backed by a public web API.",
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.2.2",
23
+ "@emseepea/testing": "0.3.0",
24
24
  "@modelcontextprotocol/client": "2.0.0",
25
25
  "@types/node": "24.13.3",
26
26
  "typescript": "6.0.3",