1.9 KiB
1.9 KiB
Provider usage compatibility matrix
This matrix freezes the replay contract used by UsageCaptureCallback. It records
the provider adapter identity before custom-compatible profiles are converted to
native LangChain adapters. The replay source is
fixtures/providers/compatibility.json and is executed by the Python contract
suite.
Locked SDK versions: langchain-core 1.4.8, langchain-openai 1.2.1, and
langchain-anthropic 1.4.8.
| Provider profile type | Adapter | Final usage location | Stream usage location | Request ID location | Missing/error result |
|---|---|---|---|---|---|
| OpenAI | openai |
AIMessage.usage_metadata |
final AIMessageChunk.usage_metadata |
response_metadata.request_id |
unknown |
| Anthropic | anthropic |
AIMessage.usage_metadata |
final AIMessageChunk.usage_metadata |
response_metadata.id |
unknown |
| Custom OpenAI-compatible | openai |
normalized AIMessage.usage_metadata |
normalized final chunk | response_metadata.x_request_id when supplied |
unknown |
| Custom Anthropic-compatible | anthropic |
normalized AIMessage.usage_metadata |
normalized final chunk | response_metadata.id when supplied |
unknown |
Every row replays non-stream success, stream usage followed by error, success
without usage, and model error without usage. Stream usage remains an in-memory
observation until the terminal callback. No request parameter is changed to
obtain usage; providers that omit it remain enumerable as unknown.