Repository navigation
Add Clairic extraction and Pydantic structured agents (v0.4.3) - #91
Merged
Merged
Conversation
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.
Add Clairic extraction and Pydantic structured output for native Workers AI models, including direct LangChain agent use, and prepare version 0.4.3.
Validation:
477 unit tests passed, 2 skipped locally on Python 3.11 and in CI on Python 3.10/3.12, including 14 new example/evidence regression cases. These use controlled native binding responses, not live model inference. Ruff, formatting, mypy, pre-commit, diff checks, and wheel/source builds passed.
Direct create_agent live tests: all 12 REST and 8 Python Worker cases passed, checking the actual Pydantic structured_response type and exact values. Coverage includes extraction-only, decisions, mixed schemas, explicit strategies, both image message encodings, batch, and abatch. REST uses LangChain 1.4.6/core 1.6.12; Workers retain the existing LangChain 1.0/core 1.1 stack.
Model-level structured-output live tests passed 6 REST and 3 Worker cases. Earlier native vision coverage passed 4 REST and 4 Worker tests using the existing chat vision PNG. The explicit combined announcement example passed 2 REST and 2 Worker cases.
The notebook's extraction, vision, combined, model-level Pydantic, and direct agent examples were executed with exact result assertions. Saved outputs are cleared. No generative-model fallback or output repair is used.
Current-head CI passed Python 3.10/3.12 unit tests and lint, pre-commit, build selection, dependency security check, Semgrep, and CI Success.
CI's non-blocking integration step lacks Cloudflare credentials and reports setup failures/errors; it is not successful live-integration evidence. The live REST/Worker results above are from prior validation. No live inference was repeated for this focused example/documentation update.
Two standalone Clairic fixtures remain expected failures: company-list extraction includes extra mentions, and full-sentence extraction returns a partial answer. The explicit combined Clairic/Clef example passes the announcement fixtures through REST and Python Workers. HTTP errors, malformed responses, and invalid spans still fail normally.