docs: refresh anthropic stream helper refs

This commit is contained in:
Peter Steinberger
2026-04-04 12:49:53 +01:00
parent 0166fd426e
commit e5b48ea2b4
3 changed files with 27 additions and 4 deletions

View File

@@ -711,10 +711,18 @@ api.registerProvider({
- Anthropic uses `resolveDynamicModel`, `capabilities`, `buildAuthDoctorHint`,
`resolveUsageAuth`, `fetchUsageSnapshot`, `isCacheTtlEligible`,
`resolveDefaultThinkingLevel`, `applyConfigDefaults`, and `isModernModelRef`
because it owns Claude 4.6 forward-compat, provider-family hints, auth
repair guidance, usage endpoint integration, prompt-cache eligibility,
auth-aware config defaults, and Claude default/adaptive thinking policy.
`resolveDefaultThinkingLevel`, `applyConfigDefaults`, `isModernModelRef`,
and `wrapStreamFn` because it owns Claude 4.6 forward-compat,
provider-family hints, auth repair guidance, usage endpoint integration,
prompt-cache eligibility, auth-aware config defaults, Claude
default/adaptive thinking policy, and Anthropic-specific stream shaping for
beta headers, `/fast` / `serviceTier`, and `context1m`.
- Anthropic's Claude-specific stream helpers stay in the bundled plugin's own
public `api.ts` / `contract-api.ts` seam for now. That package surface
exports `wrapAnthropicProviderStream`, `resolveAnthropicBetas`,
`resolveAnthropicFastMode`, `resolveAnthropicServiceTier`, and the lower-level
Anthropic wrapper builders instead of widening the generic SDK around one
provider's beta-header rules.
- OpenAI uses `resolveDynamicModel`, `normalizeResolvedModel`, and
`capabilities` plus `buildMissingAuthMessage`, `suppressBuiltInModel`,
`augmentModelCatalog`, `supportsXHighThinking`, and `isModernModelRef`

View File

@@ -294,6 +294,13 @@ Facade-loaded bundled plugin public surfaces (`api.ts`, `runtime-api.ts`,
active runtime config snapshot when OpenClaw is already running. If no runtime
snapshot exists yet, they fall back to the resolved config file on disk.
Provider plugins can also expose a narrow plugin-local contract barrel when a
helper is intentionally provider-specific and does not belong in a generic SDK
subpath yet. Current bundled example: the Anthropic provider keeps its Claude
stream helpers in its own public `api.ts` / `contract-api.ts` seam instead of
promoting Anthropic beta-header and `service_tier` logic into a generic
`plugin-sdk/*` contract.
<Warning>
Extension production code should also avoid `openclaw/plugin-sdk/<other-plugin>`
imports. If a helper is truly shared, promote it to a neutral SDK subpath

View File

@@ -309,6 +309,14 @@ API key auth, and dynamic model resolution.
- `openrouter`: `openrouter-thinking`
- `zai`: `tool-stream-default-on`
Some stream helpers stay provider-local on purpose. Current bundled
example: `@openclaw/anthropic-provider` exports
`wrapAnthropicProviderStream`, `resolveAnthropicBetas`,
`resolveAnthropicFastMode`, `resolveAnthropicServiceTier`, and the
lower-level Anthropic wrapper builders from its public `api.ts` /
`contract-api.ts` seam. Those helpers remain Anthropic-specific because
they also encode Claude OAuth beta handling and `context1m` gating.
<Tabs>
<Tab title="Token exchange">
For providers that need a token exchange before each inference call: