cli: sift extract uploads a local PDF; README and skill
`sift extract <file.pdf>` stats the file (refusing over 100 MiB before the upload), streams it as the POST body with Content-Type application/pdf and the ContentLength set, and prints the /v1/extract answer exactly as `sift fetch` prints a PDF URL — same content output, same errors and exitFor codes. parseExtractOpts reuses splitAroundPositional; extractURL sends only the set options with mode=digest when a question is given. main.go gains the case and a help line; README and skill document the command. Co-Authored-By: ornith-1.5-35b-a3b <ornith-1.5-35b-a3b@llama.cpp.invalid>
This commit is contained in:
@@ -60,6 +60,9 @@ for blocked pages), `--json` (full envelope: content, source, context, sizes, wa
|
||||
PDFs work: `sift fetch` extracts them and returns the text. A short one comes back whole; a
|
||||
long one comes back as a map — an outline with page numbers, then the first pages. Then:
|
||||
|
||||
- A PDF on disk (an attachment, a download): `sift extract <file.pdf>` uploads it to `/v1/extract`
|
||||
and prints the answer as `sift fetch` does, with the same `--pages`/`--grep`/`--question`.
|
||||
Never run `pdftotext` yourself.
|
||||
- `sift fetch URL --pages 41-60` for a page range, `--grep 'pattern'` for matching lines, or
|
||||
`--question "…"` for a digest that cites each fact as `(p. N)`; `--question` works on long
|
||||
PDFs, and the first answer may be `bm25` (lexical) — ask again later for a sharper one.
|
||||
|
||||
Reference in New Issue
Block a user