@lotics/app-sdk 0.74.0 → 0.75.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/docs/ai.md +11 -0
- package/package.json +1 -1
package/docs/ai.md
CHANGED
|
@@ -216,6 +216,17 @@ Sessions are scoped to the authenticated member who ran them: two members using
|
|
|
216
216
|
|
|
217
217
|
Every file in a `multi` input is materialized — nothing is collapsed to the first. Get the ids from [`useFileUpload` / `useAttachments`](./files.md).
|
|
218
218
|
|
|
219
|
+
**So do not dispatch on the file type.** Every tier above reads, which means the format tells you
|
|
220
|
+
nothing about what a document IS — the same claim form arrives as `.xlsx` from a laptop, as a PDF
|
|
221
|
+
through a chat app, and as a photo of a printout; an invoice arrives as PDF, as the XML beside it,
|
|
222
|
+
or as a screenshot. An intake that routes on the extension is reading the envelope, and it fails
|
|
223
|
+
SILENTLY: the wrong extractor runs, returns something correctly shaped, and the user is handed a
|
|
224
|
+
confident wrong answer. Let one agent read the drop and say what each document is, keyed on what
|
|
225
|
+
only the content carries. Prefer separate output slots (`don_hang`, `hoa_don`, plus a named
|
|
226
|
+
`bo_qua` for what fits neither) over a `loai` discriminator beside a payload — which slot a
|
|
227
|
+
document lands in IS the classification, so there is no second field free to disagree with it, and
|
|
228
|
+
nothing disappears quietly.
|
|
229
|
+
|
|
219
230
|
**Why no tool:** the content ends up in the agent's context either way, so making it fetch what the server already holds costs a model round-trip and buys nothing. It also keeps the capability boundary tight — an agent that reads its own input never gains the ability to read *other* files in the workspace.
|
|
220
231
|
|
|
221
232
|
**When to add a tool anyway.** Only to reach *past* what was inlined. A spreadsheet is materialized at 100 rows × 50 columns per sheet and a Word file at 1,000 elements; overflow is reported, never silent. If the agent must read row 4,000 of a large sheet, add `excel_get_range` / `excel_find_cells` (or `view_files` for an ad-hoc second look at a different file).
|