jevais 0.1.0 → 0.2.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 CHANGED
@@ -110,6 +110,28 @@ if (await changedMeaning(oldConfig, newConfig, 'deployment requirements changed'
110
110
  Like `partitionMeaning`, it accepts `threshold` through the options object
111
111
  (default `0.85`).
112
112
 
113
+ ## askNoul / askScore
114
+
115
+ The raw JEV primitives behind the functions above. `askNoul` resolves the
116
+ probability itself (P(yes) in [0, 1]); `askScore` resolves the full Score
117
+ answer (`score`, `confidence`, `legend`, `probabilities`). Use these when you
118
+ need the number, not just the threshold decision.
119
+
120
+ ```ts
121
+ import { askNoul, askScore } from 'jevais';
122
+
123
+ const p = await askNoul('Is this a bug?', 'I think this is an error');
124
+ if (p >= 0.4) {
125
+ // probable
126
+ }
127
+
128
+ const answer = await askScore('Rate this item.', ['low', 'high'], feedbackText);
129
+ console.log(answer.score, answer.probabilities);
130
+ ```
131
+
132
+ `askNoul`/`askScore` take the same per-call options as `ifjev` (`apiKey`,
133
+ `model`, `timeoutMs`, `retries`).
134
+
113
135
  ## Errors
114
136
 
115
137
  All failures throw `JevError`, which carries the HTTP `status` (when the failure
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { JevError, configure } from './client.js';
1
+ export { JevError, askNoul, askScore, configure } from './client.js';
2
2
  export { changedMeaning, findMeaning, ifjev, partitionMeaning, rankMeaning } from './meaning.js';
3
3
  export type { PartitionResult } from './meaning.js';
4
4
  export type { JevAnswer, JevQuestion, JevResponse, JevUsage, JevaisOptions, MeaningOptions, NoulAnswer, NoulQuestion, RankOptions, ScoreAnswer, ScoreQuestion, } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,QAAQ,EACR,aAAa,EACb,cAAc,EACd,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { JevError, configure } from './client.js';
1
+ export { JevError, askNoul, askScore, configure } from './client.js';
2
2
  export { changedMeaning, findMeaning, ifjev, partitionMeaning, rankMeaning } from './meaning.js';
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jevais",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Small semantic functions on top of the TypeSafe Jev API: ifjev, findMeaning, partitionMeaning, rankMeaning, changedMeaning.",
5
5
  "keywords": [
6
6
  "jev",
@@ -50,9 +50,12 @@
50
50
  },
51
51
  "devDependencies": {
52
52
  "@eslint/js": "^9.17.0",
53
+ "@semantic-release/changelog": "^7.0.0",
54
+ "@semantic-release/git": "^11.0.1",
53
55
  "@types/node": "^20.11.0",
54
56
  "eslint": "^9.17.0",
55
57
  "prettier": "^3.4.2",
58
+ "semantic-release": "^25.0.9",
56
59
  "typescript": "^5.6.3",
57
60
  "typescript-eslint": "^8.18.0",
58
61
  "vitest": "^2.1.9"