mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-23 19:08:22 -06:00
b4e27f8b3d
* refactor(ai): invert plugin coupling behind the transport host port * fix(ai): queue custom transport registrations until the host is configured * refactor(ai): remove relocated transport sources from src/agents * fix(ai): source core stream types from canonical packages and fix tarball fixtures * fix(ai): invert plugin transport host wiring * fix(ai): harden managed transport projection * test(ai): register synchronous stream in transport mock * fix(ai): lazily install transport runtime host * fix(ai): preserve completion compat detection
30 lines
1.3 KiB
Markdown
30 lines
1.3 KiB
Markdown
# `@openclaw/ai`
|
|
|
|
Reusable model API contracts, provider adapters, and streaming primitives from
|
|
OpenClaw. The package supports isolated runtime instances; importing it does not
|
|
register providers globally.
|
|
|
|
```ts
|
|
import { createLlmRuntime } from "@openclaw/ai";
|
|
import { registerBuiltInApiProviders } from "@openclaw/ai/providers";
|
|
|
|
const runtime = createLlmRuntime();
|
|
registerBuiltInApiProviders(runtime.registry);
|
|
```
|
|
|
|
Provider-neutral contracts, validation, diagnostics, and event streams are
|
|
available from the package root and focused subpaths such as
|
|
`@openclaw/ai/event-stream`, `@openclaw/ai/transports`, and
|
|
`@openclaw/ai/validation`. No second OpenClaw runtime package is required.
|
|
|
|
Provider ids, credentials, model catalogs, retries, and failover remain
|
|
application concerns. OpenClaw supplies those policies around this package.
|
|
Host policy (request fetch guarding, secret redaction, strict-tool defaults,
|
|
provider plugin hooks, and diagnostics logging) can be injected with
|
|
`configureAiTransportHost`; the defaults are inert.
|
|
|
|
The explicit `@openclaw/ai/internal/anthropic`, `openai`, `retry-after`,
|
|
`runtime`, and `shared` subpaths exist for the OpenClaw application itself.
|
|
They carry no semver guarantee and can change or disappear in any release; do
|
|
not depend on them outside OpenClaw.
|