@mindstudio-ai/agent 0.1.150 → 0.1.151
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 +2 -2
- package/dist/cli.js +25 -15
- package/dist/index.d.ts +106 -17
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +25 -15
- package/llms.txt +33 -14
- package/package.json +1 -1
package/llms.txt
CHANGED
|
@@ -395,6 +395,27 @@ Generate or enhance a video generation prompt using a language model. Optionally
|
|
|
395
395
|
- Input: `{ initialPrompt: string, includeNegativePrompt: boolean, negativePromptDestinationVariableName?: string, systemPrompt: string, modelOverride?: unknown }`
|
|
396
396
|
- Output: `{ prompt: string, negativePrompt?: string }`
|
|
397
397
|
|
|
398
|
+
#### evaluateDecision
|
|
399
|
+
Ask structured questions about text, JSON, or images and get calibrated answers from a decision model. The model returns a probability, a selected option, or a score. It does not write a reply. Each question is a noul (yes or no, as a probability from 0 to 1), a choice (one option from a set you define, with a probability for each), or a score (a rating against ordered levels). Put every question in the same call. The question id is yours: answers come back under the same ids. The model defaults to Jev (jev-latest).
|
|
400
|
+
- state is the content to judge: a string, or a JSON object or array (a record, a chat log, application state).
|
|
401
|
+
- questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.
|
|
402
|
+
- A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.
|
|
403
|
+
- A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.
|
|
404
|
+
- A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.
|
|
405
|
+
- An answer of type refusal means the model declined that question (GPT-6 Luna Decisions can).
|
|
406
|
+
- instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.
|
|
407
|
+
- Send every question you need in one call. The model reads the state once and answers them together.
|
|
408
|
+
- Probabilities from different models are not comparable: tune a threshold against the model, and the version, it will run on.
|
|
409
|
+
- decisionModelOverride.model picks the model:
|
|
410
|
+
- jev-latest (the default) is TypeSafe's current stable release, text only, up to 64k tokens. jev-preview tracks TypeSafe's newest release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version.
|
|
411
|
+
- clef and clef-flash run Cloudflare Clef, which also reads up to 4 PNG, JPEG, or WebP images, each at most 4 MiB and 8 MiB together, and takes at most 64 questions, each id using only letters, digits, underscore, dot, and hyphen, up to 100 characters. clef is the larger model, clef-flash the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two.
|
|
412
|
+
- gpt-6-luna-decisions runs OpenAI's Decisions API (in beta), which reads up to 922k tokens and PNG, JPEG, WebP, or GIF images of up to 20 MB each. It takes up to 200 questions, and a choice needs at least 2 options. gpt-6-luna names it too.
|
|
413
|
+
- images is for a model that reads them. Pass URLs or data URLs. A model that reads none refuses the call.
|
|
414
|
+
- The response model field is the version that answered.
|
|
415
|
+
- Billed per input token. Output tokens are free. Each model has its own rate, and GPT-6 Luna Decisions bills a prompt over 272k tokens at twice its rate.
|
|
416
|
+
- Input: `{ state: string | object | unknown[], questions: object, images?: string[], decisionModelOverride?: { model: string, config?: object } }`
|
|
417
|
+
- Output: `{ model: string, answers: object, usage: { input_tokens: number, output_tokens: number } }`
|
|
418
|
+
|
|
398
419
|
#### extractAudioFromVideo
|
|
399
420
|
Extract audio MP3 from a video file
|
|
400
421
|
- Input: `{ videoUrl: string }`
|
|
@@ -404,12 +425,19 @@ Extract audio MP3 from a video file
|
|
|
404
425
|
Download a file from a URL and extract its text content. Supports PDFs (including scanned/image-based PDFs via OCR), plain text files, and other document formats.
|
|
405
426
|
- Best suited for PDFs and raw text/document files. For web pages, use the scrapeUrl step instead.
|
|
406
427
|
- Handles both text-layer PDFs and image-based/scanned PDFs (e.g. Figma/Canva exports, scanned documents). Image-based PDFs are processed with OCR automatically — there is no need to convert PDF pages to images first.
|
|
428
|
+
- Plain text, code, HTML, spreadsheets and Office documents (docx, pptx, odt, rtf, epub) are read without a model and cost nothing. PDFs and images go to the extraction model, billed per page.
|
|
407
429
|
- Accepts a single URL, a comma-separated list of URLs, or a JSON array of URLs.
|
|
408
430
|
- Nothing is published. One of the app's own files — including a private one, or a share link — is read where it sits; any other URL is downloaded and staged privately for the extraction model, then discarded when extraction finishes.
|
|
409
|
-
-
|
|
431
|
+
- `text` is each document's text: a string for one URL, an array for several. `documents` has each document page by page, with its page numbers and the pages billed. Set `includeBlocks` to add each page's typed blocks (title, text, table, image, header, footer…) with their bounding boxes, and the page's size.
|
|
432
|
+
- A file that can't be read (unreachable, an unsupported type, past the model's limits, or refused by the model) fails the step with the reason.
|
|
433
|
+
- `extractionModelOverride.model` picks the model; omit it to use the workspace's default:
|
|
434
|
+
- `mistral-ocr-4.1` (the default): PDFs and images up to 50 MB and 1,000 pages, with typed blocks.
|
|
435
|
+
- `mistral-document-ai-2512`: Mistral Document AI on Microsoft Foundry, up to 30 MB and 30 pages, with typed blocks.
|
|
436
|
+
- `llamaparse`: LlamaParse's agentic mode, up to 100 MB and 1,000 pages, markdown without blocks.
|
|
437
|
+
- `google-document-ai`: Google Document AI OCR, up to 500 pages, where the deployment has set it up.
|
|
410
438
|
- Maximum file size is 50MB per URL.
|
|
411
|
-
- Input: `{ url: string | string[], model?: string }`
|
|
412
|
-
- Output: `{ text: string | string[] }`
|
|
439
|
+
- Input: `{ url: string | string[], extractionModelOverride?: { model: string, config?: object }, model?: string, includeBlocks?: boolean }`
|
|
440
|
+
- Output: `{ text: string | string[], documents: { url: string, text: string, pages: { pageNumber: number, markdown: string, blocks?: unknown[], dimensions?: { width: number, height: number, dpi?: number } }[], pagesProcessed: number }[] }`
|
|
413
441
|
|
|
414
442
|
#### fetchDataSourceDocument
|
|
415
443
|
Legacy v1 data sources. v2 apps should use `dataSources.defineDataSource()` from @mindstudio-ai/agent instead, which owns parsing, chunking, embedding and citations. Fetch the full extracted text contents of a document in a data source.
|
|
@@ -1432,17 +1460,8 @@ Call any QuickBooks Online Accounting API route using a connected company.
|
|
|
1432
1460
|
### TypeSafe
|
|
1433
1461
|
|
|
1434
1462
|
#### typesafeEvaluate
|
|
1435
|
-
|
|
1436
|
-
-
|
|
1437
|
-
- images is for Clef and Clef Flash. Pass up to 4 PNG, JPEG, or WebP images as URLs. Each file is at most 4 MiB, and 8 MiB together. A call on Jev that includes images is rejected.
|
|
1438
|
-
- questions is a map. The key is an id you choose. It is not shown to the model. The answer comes back under the same id.
|
|
1439
|
-
- A noul asks a yes/no question and returns noul, a probability from 0 (no) to 1 (yes). Optional criteria.true and criteria.false say what a yes and a no mean.
|
|
1440
|
-
- A choice picks one option. criteria is a map of option id to a short description (or null). At most 255 options. The answer includes the winning choice, a probability for every option, and confidence.
|
|
1441
|
-
- A score rates the state on an ordered rubric. criteria is 2 to 10 level descriptions, low to high. The answer's score can land between levels, and includes a probability per level plus confidence.
|
|
1442
|
-
- instructions may be a string, or an object that keeps the question in one field and reference data in the others. Refer to those fields by name in backticks.
|
|
1443
|
-
- Send every question you need in one call. The model reads the state once and answers them together.
|
|
1444
|
-
- model defaults to jev-latest, the current stable TypeSafe release. jev-preview tracks the newest TypeSafe release. Pin a version such as jev-1.13.0 when a threshold was tuned against that version. clef and clef-flash run Cloudflare Clef on the same questions and answers. clef is the larger model. clef-flash is the faster one. @cf/cloudflare/clef and @cf/cloudflare/clef-flash name the same two. Clef accepts at most 64 questions, and a question id may use only letters, digits, underscore, dot, and hyphen, up to 100 characters. The response model field is the version that answered.
|
|
1445
|
-
- Billed per input token. Output tokens are free. Clef and Clef-flash have their own rates.
|
|
1463
|
+
Use evaluateDecision: the same questions, answers and models, with decisionModelOverride in place of model. evaluateDecision's earlier name, which still runs: ask structured questions about text, JSON, or images and get calibrated answers from a decision model.
|
|
1464
|
+
- Runs exactly as evaluateDecision does, with the same questions, answers, models and limits (see its notes), and model in place of decisionModelOverride.model.
|
|
1446
1465
|
- Input: `{ state: string | object | unknown[], questions: object, model?: string, images?: string[] }`
|
|
1447
1466
|
- Output: `{ model: string, answers: object, usage: { input_tokens: number, output_tokens: number } }`
|
|
1448
1467
|
|