Verify the vision tool live against the DeepSeek API #264
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills#264
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Run the four live checks from the plan's §15 against the real DeepSeek API with a real
DEEPSEEK_API_KEYand real images, and record what actually happened. This is manually triggered and opt-in — it is never part of CI, because it needs the network, a paid key, and real image files.Background
Depends on: #257, #258, #260, #261
All the unit tests fake
fetch, so four behaviours have never been observed against the provider: whether DeepSeek accepts the explicit{"thinking":{"type":"disabled"}}toggle for vision requests, whether thinking mode plus a non-trivial image fits insideVISION_MAX_TOKENS, whether thedeepseek-flashmodel id is accepted as documented, and whether the computed cost is in the right ballpark. The plan's risks section names the first of these as a ship-blocker.The value of this step is honesty: if a check fails, the issue is not "done" until either the code is fixed or the divergence is documented in
extensions/vision/README.mdand on this issue.Do not run this in CI and do not commit a real API key. Use the project
.env(which is gitignored) or an exported env var.Documentation Required
A separate process downloads these into the listed folders before this issue is implemented. Check the folder for the actual reference material before starting.
docs/reference/deepseek-api/deepseek-flashmodel name, the supported formats/limits, and the token accounting for images (auto-resize, ~1024 tokens per image upper bound) used to sanity-check cost.reasoning_contentis returned alongsidecontent, and that reasoning tokens count toward the output cap.deepseek-flashrates and peak windows, to compare against a loggedusage.cost.total.Implementation Details
Prepare a real key (
DEEPSEEK_API_KEYin.envor the environment) and at least one real image — a screenshot with text is the most useful, since it exercises OCR and gives a falsifiable prompt.Run each check and record the exact command, the observed
finish_reason,content,usage, anddetails:thinking: false. Confirmcontentis populated andfinish_reason === "stop".thinkingwhen the caller's effective value isfalse, updatesrc/client.tsaccordingly, adjust its tests, and document the change here and inextensions/vision/README.md.VISION_MAX_TOKENSwith thinking enabled. Call withthinking: trueand a large image. Confirmfinish_reason !== "length"andcompletion_tokens_details.reasoning_tokens > 0. Iflengthis hit, raiseVISION_MAX_TOKENSand note the value that worked.deepseek-flashis accepted (the documented name; the retireddeepseek-v4-flash-vision-expalias also routes to it). If the id is rejected, capture the error body verbatim.usage.cost.totalfrom one request against DeepSeek's usage page / published rates for the same request's token counts. Note the peak/off-peak instant of the call and whether the off-peak half-rate matched.Also worth observing while live (not required): a multi-image call (2–3 images) returns a coherent comparison, and a 401 with a deliberately wrong key produces the auth hint rather than a stack trace.
Record the results in
extensions/vision/README.mdunder the development/verification section — or in a shortextensions/vision/findings.mdif the notes are too long for the README — and summarise them in a comment on this issue. State plainly which checks passed, which diverged, and what changed as a result.Acceptance Criteria
thinking: falsereturns populatedcontentandfinish_reason === "stop"— or, if the toggle is rejected,src/client.ts, its tests, and the README are updated to omitthinkingwhen false.thinking: trueand a large image returnsfinish_reason !== "length"andreasoning_tokens > 0— or the workingVISION_MAX_TOKENSvalue and the required documentation change are recorded.deepseek-flashis confirmed accepted, or the rejection error body is captured verbatim.usage.cost.totalis compared against the published rates for the call's token counts, with the peak/off-peak instant noted.extensions/vision/README.md(orfindings.md) and summarised on this issue.Test Plan
Expected: both calls return text; the
thinking: truecall reports non-zeroreasoningin the mapped usage; the printedfinish_reasonfor both isstop(notlength). Time it and note the peak/off-peak hour for the cost comparison.pi-loop opened and merged a pull request for this issue: #277