Model Client
Path:
loom-sprint-scaffold/loom/src/execution/model-client.tsRelative: loom/src/execution/model-client.tsSubproject: loom-sprint-scaffoldCategory: otherLines: 93Bytes: 2,958Imports: 4Exports: 2
Content Preview
- /**
- * H3.0 — Fetch-based Anthropic Messages API client.
- * workerd-compatible: plain fetch, NO node SDK, no node:* imports.
- * Exports a factory that returns a ModelCaller wrapped with withRetry.
- */
- import { withRetry } from "../lib/retry";
- import { createLogger } from "../lib/logger";
- import { ModelError } from "../types/errors";
- import type {
- AnthropicRequest,
- AnthropicResponse,
- ModelCaller,
- } from "../types/execution";
- const DEFAULT_MAX_TOKENS = 4096;
- const ANTHROPIC_VERSION = "2023