@haatlabs-core/ai
v0.10.0
Published
Text from an OpenAI-compatible chat endpoint, with retries, a rate limit and zod-checked answers.
Readme
@haatlabs-core/ai
Text from an OpenAI-compatible chat endpoint: retries, a rate limit, and answers checked
against the caller's zod schema. It throws AI_PROVIDER_ERROR; a project spreads
AI_ERRORS into defineErrors.
const text = createTextProvider({ baseUrl, apiKey, model });temperature (0.2 by default) and reasoningEffort on TextAiConfig and on each request;
createEmbeddingProvider(config, { rateLimit }) embeds text and images, with retry and a turn
before each request; cosineSimilarity.
Install
pnpm add @haatlabs-core/aiIt leaves one package to your app, so the app holds one copy: zod.
