docs(usage): document the raw provider usage snapshot opt-in - #4318
Closed
LeSingh1 wants to merge 1 commit into
Closed
docs(usage): document the raw provider usage snapshot opt-in#4318LeSingh1 wants to merge 1 commit into
LeSingh1 wants to merge 1 commit into
Conversation
preserve_raw_usage and ModelResponse.raw_usage shipped in openai#4279 with no docs. Their whole point is distinguishing a usage field the provider omitted from one it reported as zero, which the normalized Usage cannot express, so the target audience needs a documented entry point and the boundaries of the snapshot.
Contributor
Author
|
Closing as a duplicate — #4280 already covers this, and I missed it before filing. Sorry for the noise. |
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.
ModelSettings.preserve_raw_usageandModelResponse.raw_usageshipped in #4279 with no prose docs. The feature exists specifically to distinguish a usage field the provider omitted from one it reported as zero — a distinctionUsagecannot express — so its target audience needs both an entry point and the boundaries of the snapshot.Adds a subsection to
docs/usage.mdunder third-party adapter usage, plus two API reference links. Covers: how to enable and read it, that omitted keys stay absent while explicit zeros stay present, and the four boundaries (one snapshot perModelResponseon streamed and non-streamed calls, never aggregated; does not request usage from the provider;Nonewhen no usage reaches the adapter; not persisted byRunState).Verified the snippet and every claim against the current implementation on both the streamed and non-streamed Chat Completions paths.
make build-docsis clean; only the English source is touched.Refs #4270