@frontera-sdk/workflow 1.52.30 → 1.52.31

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/definition.ts +20 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontera-sdk/workflow",
3
- "version": "1.52.30",
3
+ "version": "1.52.31",
4
4
  "description": "Typed headless client for starting, inspecting, waiting on and cancelling Frontera workflow runs from a script or backend.",
5
5
  "keywords": [
6
6
  "frontera",
@@ -38,8 +38,8 @@
38
38
  "typecheck": "bunx tsc --noEmit"
39
39
  },
40
40
  "dependencies": {
41
- "@frontera-sdk/core": "1.52.30",
42
- "@frontera-sdk/functions": "1.52.30"
41
+ "@frontera-sdk/core": "1.52.31",
42
+ "@frontera-sdk/functions": "1.52.31"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/bun": "^1.3.14",
package/src/definition.ts CHANGED
@@ -244,14 +244,24 @@ export interface LlmParams {
244
244
  temperature?: number
245
245
  maxTokens?: number
246
246
  }
247
+ /** One option of a choice: its name and what it means. */
248
+ export interface DecideChoiceOption {
249
+ option: string
250
+ meaning: string
251
+ }
247
252
  /**
248
253
  * One question for the decisions model. `choice` picks one option from
249
- * `criteria` (option name to what it means), `score` places the state on an
250
- * ordered scale (`criteria` lists the levels, lowest first) and `noul` answers
251
- * yes or no as a probability (`criteria` may say what yes and no mean).
254
+ * `criteria`: a list of options, or a map of option name to what it means.
255
+ * Either way it is stored as the list, in the order written, which is the
256
+ * order the model reads them in. A list keeps option names that are numbers
257
+ * in the order written too; a map puts them first, in ascending order, so
258
+ * write those as the list. `score` places the
259
+ * state on an ordered scale (`criteria` lists the levels, lowest first) and
260
+ * `noul` answers yes or no as a probability (`criteria` may say what yes and
261
+ * no mean).
252
262
  */
253
263
  export type DecideQuestion =
254
- | { type: 'choice'; instructions: string; criteria: Record<string, string> }
264
+ | { type: 'choice'; instructions: string; criteria: DecideChoiceOption[] | Record<string, string> }
255
265
  | { type: 'score'; instructions: string; criteria: string[] }
256
266
  | { type: 'noul'; instructions: string; criteria?: { true?: string; false?: string } }
257
267
  export interface DecideParams {
@@ -259,6 +269,12 @@ export interface DecideParams {
259
269
  model: string
260
270
  /** The facts the questions are about. */
261
271
  state: DataInput
272
+ /**
273
+ * Images the questions are about, as file references (`$input.photo`), at
274
+ * most 8, each 20 MB or less. JPEG, PNG, WebP, GIF or BMP up to 64 megapixels; larger images are
275
+ * scaled down to 1568 px a side.
276
+ */
277
+ files?: DataInput
262
278
  /** Question id to question; each id is a key of the result's `answers`. */
263
279
  questions: Record<string, DecideQuestion>
264
280
  }