Repository navigation
Conversation
Cover public create variants and generated callables with per-call hooks, preserve lazy stream lifetimes, and require privacy-safe core telemetry. Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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.
What does this PR do?
Repairs Instructor request tracing while retaining
InstructorInstrumentorand the existing application APIs. Keep the package; do not release the unchanged implementation.instructor.patch()construction and remove SDK-client/object introspection. Generated extraction callables are traced instead.CHAINextraction span.create_with_completion, and retain lazy stream lifetime through consumption/error/close/cancellation. Stream output retains only the latest parsed item.fi-instrumentation-otel>=1.2.2so hidden content also hides exception events/status details. The targeted Poetry lock update changes only this core package.from_openai, provider composition, and privacy defaults.Why?
On the starting dev head
d6a9966dd4d5d5fb344f7f5ab11b7483c2c2a6bc, offline tests reproduced a constructor span containing a synthetic client key, no extraction span for the documentedpatch()route, nocreate_with_completionspan, TOOL labeling, and double-encoded model output. Initial regressions failed 10 tests on Instructor 1.17.0 and 9 on 1.0.0.Design references, independently implemented rather than copied:
How was it tested?
All local test executions used an OS sandbox denying outbound networking except localhost. SDK HTTP traffic used in-process synthetic transports; no vendor/model API was called and no real credentials were used.
All use released core 1.2.2. Tests run:
python/frameworks/instructor/testsandpython/tests/test_framework_instructor.py. Coverage includes real SDK sync/async routes, streaming, retries, concurrent hook isolation, cache hits, positional arguments/hooks, suppression, return identity, wrapper ownership, cancellation, and serialized OTLP protobuf privacy/output-shape checks.traceAI-openai==0.1.11: exactly one model-call child under one Instructor span, with content hidden on the OTLP wire.git diff --checkpassed.E2E coverage
Not applicable (no e2e/ harness); real framework/provider contracts use offline HTTP transports.
Compatibility and rollout
dev, as requested for this repair; no manual package-version or CHANGELOG bump.create_modelkeyword incompatibility). Tests prove the same native exception is preserved and traced; this repair does not claim to fix that upstream incompatibility. Upgrade Instructor for partial streaming.Review
Self-reviewed against internal minimal-code, typing, failure-mode, review, and scenario standards. No unresolved blocking finding in the final diff; independent human review remains required. No unrelated package changes or overlapping Instructor PR were found before implementation. The repository template references
docs/VOCABULARY.md, which is absent in this checkout.🤖 Generated with Claude Code