Repository navigation
Send hard invoice PDFs directly to Claude Haiku - #4
Merged
Merged
Conversation
ANTHROPIC_API_KEY selects the Messages API (claude-haiku-5-5 by default) ahead of OpenRouter and local ppmlx. The PDF goes up as a base64 document, the 12-field schema stays the same, and llm_attempts stays per model with token counts when the response includes them. Co-authored-by: wydrox <wydrox@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
ANTHROPIC_API_KEYis set,jdg-cli syncsends hard invoice PDFs to Claude as the PDF itself (Messages API, base64documentblock, modelclaude-haiku-5-5, overrideJDG_ANTHROPIC_MODEL) and stores the same validated 12 fields as the OpenRouter path. No Poppler/OCR text is substituted.Provider order is Anthropic, then OpenRouter, then local ppmlx.
jdg-cli doctorandjdg-cli onboard --checkshow that the key is set and where it came from.jdg-cli onboardcan save it. The attempt ledger stays per model, so a rejected Gemini try does not block Haiku. Transient failures (connection errors, HTTP 429, 5xx including 529) are retried under the existing rules, andllm_attempts.jsonlrecordsinput_tokens/output_tokenswhen the response includes them.Test plan
cargo fmt --checkcargo test— 518 passedpytest scripts— 25 passed