Expand description
LLM abstraction layer (packages/ai). Types + the Anthropic Messages API
streaming provider.
Re-exports§
pub use types::Api;pub use types::Message;pub use types::Model;pub use types::ThinkingLevel;pub use types::Usage;pub use types::UserMessage;
Modules§
- anthropic
- Anthropic Messages API provider — direct HTTP streaming with a hand-rolled
SSE decoder (no SDK dependency), mirroring
packages/ai/providers/anthropic.ts. - stream
- Streaming primitives: the SSE decoder, a tolerant streaming-JSON parser,
the fine-grained
AssistantMessageEventprotocol, and theAssistantStreamtype that providers return. - types
- Core type system for the LLM abstraction layer.
Constants§
- DEFAULT_
ANTHROPIC_ BASE_ URL - The default base URL for the Anthropic API.
Functions§
- builtin_
models - A curated model registry. A handful of Anthropic models with sensible defaults; resolved/overridden at runtime via env vars and CLI flags.
- now_ms
- Current wall-clock time in milliseconds since the Unix epoch.
- resolve_
model - Resolve a model by
provider/idpattern (supports justid). An optional:thinkingsuffix is tolerated and ignored here (thinking is set elsewhere).