Repository navigation
Conversation
The profile import's schema has 32 nullable fields, more than Anthropic's
structured outputs can compile. The Messages API answers with a 400
("The compiled grammar is too large"), which Dossier shows as "The AI
provider ran into a problem", so importing a resume with Anthropic always
failed.
On that 400, send the request again without output_config.format, with
the schema spelled out in the system prompt (withJsonSchema). The answer
is still validated against the schema as before. Other 400s fail as they
did.
Fixes AienTech#24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
Owner
|
Thanks for this, @Jchinonso, and for trying it by hand! The same fix came in with #16. It matches the "too complex" refusals by their wording, so other 400s still fail fast, and it remembers the fallback per model and schema. It's out in 1.10.0, so I'm closing this one. |
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.
Fixes #24.
The profile import's
extracted_profileschema has 32 nullable fields, more than Anthropic's structured outputs can compile. The Messages API answers with400 invalid_request_error: The compiled grammar is too large…, which Dossier shows as "The AI provider ran into a problem", so importing a resume with Anthropic always fails.Change (
src/lib/ai/providers/anthropic.ts): on that 400, and only that one, send the request once more withoutoutput_config.format, with the schema spelled out in the system prompt throughwithJsonSchema. The answer is still validated against the schema byBaseProvider, as before. Every other 400 fails as it did.Tests (
src/lib/ai/providers.test.ts):output_config, with the schema in the system prompt, and the answer parses;yarn vitest run src/lib/ai/providers.test.ts: 44 passed. Lint and type-check are clean. Tried by hand with Dossier 1.9.2 built from source andclaude-sonnet-5: importing a PDF resume failed before and works with this change.