@hilbras/sdk 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://img.shields.io/badge/version-0.
|
|
2
|
+
<img src="https://img.shields.io/badge/version-0.21.0-blue" alt="version">
|
|
3
3
|
<img src="https://img.shields.io/badge/license-MIT-green" alt="license">
|
|
4
4
|
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen" alt="node">
|
|
5
5
|
<img src="https://img.shields.io/badge/types-strict-blueviolet" alt="types">
|
|
6
|
-
<img src="https://img.shields.io/badge/tests-
|
|
6
|
+
<img src="https://img.shields.io/badge/tests-1278%20passing-brightgreen" alt="tests">
|
|
7
7
|
<img src="https://img.shields.io/badge/runtime%20deps-zero-brightgreen" alt="zero deps">
|
|
8
8
|
</p>
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
13
13
|
<strong>Provider-agnostic AI execution engine for TypeScript.</strong><br>
|
|
14
|
-
Streaming, tool calling, structured output, circuit breaker, retry, reasoning normalization, cost enforcement, and SSRF-safe provider registration — for OpenAI, Anthropic, Gemini, Azure, Groq, and
|
|
14
|
+
Streaming, tool calling, structured output, circuit breaker, retry, reasoning normalization, cost enforcement, and SSRF-safe provider registration — for OpenAI, Anthropic, Gemini, Azure, Groq, Ollama, Bedrock, Vertex AI, HuggingFace, Deepgram, ElevenLabs, Voyage AI, and Cohere Rerank. Zero runtime dependencies.
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
---
|
|
@@ -97,10 +97,10 @@ const reply = await client.complete({
|
|
|
97
97
|
|
|
98
98
|
| Feature | Summary | Docs |
|
|
99
99
|
|---|---|---|
|
|
100
|
-
| **Provider abstraction** |
|
|
100
|
+
| **Provider abstraction** | 23 adapters (OpenAI, Anthropic, Gemini, Azure, Groq, Ollama, Bedrock, Vertex AI, HuggingFace, Deepgram, ElevenLabs, Voyage AI, Cohere Rerank) | [Providers](docs/providers.md) |
|
|
101
101
|
| **Streaming** | Async iteration over text/reasoning/tool-call/usage/finish chunks | [Getting Started](docs/getting-started.md#streaming) |
|
|
102
102
|
| **Tool calling** | Native function calling + text-embedded `<tool_call>` markup | [Getting Started](docs/getting-started.md#tool-calling) |
|
|
103
|
-
| **Structured output** |
|
|
103
|
+
| **Structured output** | Schema validation with automatic JSON repair | [API Reference](docs/api-reference.md) |
|
|
104
104
|
| **Model routing** | Pick the best model across providers by task, cost, capabilities | [API Reference](docs/api-reference.md#model-router) |
|
|
105
105
|
| **Circuit breaker** | Per-provider failure isolation with half-open recovery | [API Reference](docs/api-reference.md#reliability) |
|
|
106
106
|
| **Retry & backoff** | Exponential backoff with jitter for 429/5xx/network errors | [API Reference](docs/api-reference.md#reliability) |
|
|
@@ -109,6 +109,14 @@ const reply = await client.complete({
|
|
|
109
109
|
| **SSRF safety** | Default-reject `http://`, block AWS metadata, opt-in for local Ollama | [Security](docs/security.md) |
|
|
110
110
|
| **Error redaction** | API keys auto-redacted from provider error bodies | [Security](docs/security.md#error-redaction-in-provider-responses) |
|
|
111
111
|
| **Reasoning normalization** | Detect & normalize `<thinking>` / `<reasoning>` tags and native fields | [API Reference](docs/api-reference.md) |
|
|
112
|
+
| **Agent framework** | ToolLoopAgent, ReActAgent, PlanAndExecuteAgent with approval, budget, cost tracking | [Agent](docs/agent.md) |
|
|
113
|
+
| **Evaluation** | LLM output evaluation with built-in metrics (exact_match, similarity, toxicity) | [Eval](docs/eval.md) |
|
|
114
|
+
| **Framework hooks** | React, Vue, Svelte, Solid, Angular signal-based hooks | [Frameworks](docs/frameworks.md) |
|
|
115
|
+
| **RAG primitives** | VectorStore, Retriever, RAGPipeline, chunking | [RAG](docs/rag.md) |
|
|
116
|
+
| **Provider catalog** | Runtime provider/model discovery with search | [Catalog](docs/catalog.md) |
|
|
117
|
+
| **CLI** | `hilbras` CLI for init, provider management, model listing, cost estimation | [CLI](docs/cli.md) |
|
|
118
|
+
| **Migration** | Guide from Vercel AI SDK | [Migration](docs/migration-from-vercel-ai-sdk.md) |
|
|
119
|
+
| **Fine-tuning** | Export training data in 6 formats, data splitting, quality validation | [Fine-tune](docs/fine-tune.md) |
|
|
112
120
|
| **Zero runtime deps** | Pure TypeScript, no transitive dependencies | — |
|
|
113
121
|
|
|
114
122
|
---
|
|
@@ -121,6 +129,14 @@ const reply = await client.complete({
|
|
|
121
129
|
- **[Security](docs/security.md)** — SSRF protection, opt-in flags, error redaction
|
|
122
130
|
- **[Observability](docs/observability.md)** — lifecycle events
|
|
123
131
|
- **[API Reference](docs/api-reference.md)** — complete type and function reference
|
|
132
|
+
- **[Agent Framework](docs/agent.md)** — multi-step agent tools
|
|
133
|
+
- **[Evaluation](docs/eval.md)** — LLM output testing
|
|
134
|
+
- **[RAG](docs/rag.md)** — retrieval-augmented generation
|
|
135
|
+
- **[Frameworks](docs/frameworks.md)** — React, Vue, Svelte, Solid, Angular hooks
|
|
136
|
+
- **[Catalog](docs/catalog.md)** — provider/model discovery
|
|
137
|
+
- **[CLI](docs/cli.md)** — command-line tools
|
|
138
|
+
- **[Migration](docs/migration-from-vercel-ai-sdk.md)** — from Vercel AI SDK
|
|
139
|
+
- **[Fine-tuning](docs/fine-tune.md)** — training data export and validation
|
|
124
140
|
- **[CHANGELOG](CHANGELOG.md)** — version history
|
|
125
141
|
|
|
126
142
|
## Subpath imports
|
|
@@ -133,6 +149,17 @@ import { estimateTokens } from "@hilbras/sdk/tokens"; // Token utiliti
|
|
|
133
149
|
import { loadConfig } from "@hilbras/sdk/config"; // Config
|
|
134
150
|
import { FetchTransport } from "@hilbras/sdk/transport/fetch"; // Transport
|
|
135
151
|
import { validateBaseUrl } from "@hilbras/sdk"; // SSRF guard
|
|
152
|
+
|
|
153
|
+
// Packages
|
|
154
|
+
import { useChat } from "@hilbras/react"; // React hooks
|
|
155
|
+
import { useChat } from "@hilbras/vue"; // Vue composables
|
|
156
|
+
import { useChat } from "@hilbras/svelte"; // Svelte stores
|
|
157
|
+
import { useChat } from "@hilbras/solid"; // Solid signals
|
|
158
|
+
import { useChat } from "@hilbras/angular"; // Angular signals
|
|
159
|
+
import { ToolLoopAgent } from "@hilbras/agent"; // Agent framework
|
|
160
|
+
import { evaluate } from "@hilbras/eval"; // Evaluation
|
|
161
|
+
import { RAGPipeline } from "@hilbras/rag"; // RAG
|
|
162
|
+
import { exportTrainingData } from "@hilbras/fine-tune"; // Fine-tuning
|
|
136
163
|
```
|
|
137
164
|
|
|
138
165
|
## Development
|
|
@@ -140,7 +167,7 @@ import { validateBaseUrl } from "@hilbras/sdk"; // SSRF guard
|
|
|
140
167
|
```bash
|
|
141
168
|
npm install
|
|
142
169
|
npm run build # Compile TypeScript
|
|
143
|
-
npm test # Run
|
|
170
|
+
npm test # Run 1278 tests
|
|
144
171
|
npm run test:watch # Watch mode
|
|
145
172
|
npm run lint # Lint with oxlint
|
|
146
173
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hilbras/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Provider-agnostic LLM client SDK — streaming, tool calling, embeddings, image generation, speech synthesis, transcription, reranking, circuit breaker, retry, reasoning normalization, cost enforcement, structured output with schema validation, type-safe tool builder, and SSRF-safe provider registration. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|