@aeye/ai 0.3.9 → 0.7.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 +898 -798
- package/aeye-ai.md +237 -219
- package/dist/ai.d.ts +7 -1
- package/dist/ai.d.ts.map +1 -1
- package/dist/ai.js +50 -77
- package/dist/ai.js.map +1 -1
- package/dist/apis/batch.d.ts +74 -0
- package/dist/apis/batch.d.ts.map +1 -0
- package/dist/apis/batch.js +127 -0
- package/dist/apis/batch.js.map +1 -0
- package/dist/apis/chat.d.ts.map +1 -1
- package/dist/apis/chat.js +55 -35
- package/dist/apis/chat.js.map +1 -1
- package/dist/apis/decide.d.ts +33 -0
- package/dist/apis/decide.d.ts.map +1 -0
- package/dist/apis/decide.js +52 -0
- package/dist/apis/decide.js.map +1 -0
- package/dist/apis/embed.d.ts +4 -11
- package/dist/apis/embed.d.ts.map +1 -1
- package/dist/apis/embed.js +5 -32
- package/dist/apis/embed.js.map +1 -1
- package/dist/apis/get.d.ts +18 -0
- package/dist/apis/get.d.ts.map +1 -0
- package/dist/apis/get.js +30 -0
- package/dist/apis/get.js.map +1 -0
- package/dist/apis/image.d.ts +2 -2
- package/dist/apis/image.d.ts.map +1 -1
- package/dist/apis/image.js +45 -40
- package/dist/apis/image.js.map +1 -1
- package/dist/apis/rerank.d.ts +24 -0
- package/dist/apis/rerank.d.ts.map +1 -0
- package/dist/apis/rerank.js +40 -0
- package/dist/apis/rerank.js.map +1 -0
- package/dist/apis/schema-fallback.d.ts +9 -14
- package/dist/apis/schema-fallback.d.ts.map +1 -1
- package/dist/apis/schema-fallback.js +15 -64
- package/dist/apis/schema-fallback.js.map +1 -1
- package/dist/common.d.ts +20 -2
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +36 -0
- package/dist/common.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/registry.d.ts +30 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +61 -1
- package/dist/registry.js.map +1 -1
- package/dist/types.d.ts +198 -55
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/aeye-ai.md
CHANGED
|
@@ -1,219 +1,237 @@
|
|
|
1
|
-
# @aeye/ai
|
|
2
|
-
|
|
3
|
-
> Multi-provider AI library: a single typed instance that selects models, runs chat/image/speech/transcribe/embed requests, tracks cost, and binds tools/prompts/agents — built on `@aeye/core`.
|
|
4
|
-
|
|
5
|
-
## When to use it
|
|
6
|
-
|
|
7
|
-
Use `@aeye/ai` as the main entry point of an aeye application. You create one `AI` instance, register one or more provider packages (`@aeye/openai`, `@aeye/aws`, `@aeye/openrouter`, `@aeye/replicate`, or a custom `Provider`), and then call typed APIs. The instance handles automatic model selection by capability/cost/speed, per-call context + metadata injection, lifecycle hooks (budgets, logging), and cost estimation.
|
|
8
|
-
|
|
9
|
-
- Use `@aeye/ai` for: provider-agnostic chat/embeddings/images/speech, model selection, cost tracking, and AI-bound `tool`/`prompt`/`agent` components.
|
|
10
|
-
- Use `@aeye/core` directly for: the underlying `Tool`/`Prompt`/`Agent` classes, `Request`/`Response`/`Chunk`/`Message` types, and strict-mode descriptors (`@aeye/ai` re-exports the request/response types you need).
|
|
11
|
-
|
|
12
|
-
## Installation & import
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install @aeye/ai @aeye/core
|
|
16
|
-
npm install @aeye/openai openai # or @aeye/aws, @aeye/openrouter, @aeye/replicate
|
|
17
|
-
npm install @aeye/models # optional: curated model table + strict overrides
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
There is **one** export path. Everything is imported from the package root — there are no subpath exports.
|
|
21
|
-
|
|
22
|
-
```typescript
|
|
23
|
-
import {
|
|
24
|
-
AI, ModelRegistry, getProviderCapabilities, resolveStrictFormat,
|
|
25
|
-
isModelInfo, detectTier,
|
|
26
|
-
// types:
|
|
27
|
-
type Provider, type ModelInfo, type ModelOverride, type ModelSource,
|
|
28
|
-
type ModelHandler, type AIConfig, type AIHooks, type ModelCapability,
|
|
29
|
-
} from '@aeye/ai';
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Core concepts
|
|
33
|
-
|
|
34
|
-
- **AI instance** (`AI<T>`): central object. Holds `config`, `registry`, the API surfaces, `providers`, `components`, and `hooks`.
|
|
35
|
-
- **Providers**: objects implementing the `Provider<TConfig>` interface. Each implements only the methods for the capabilities it supports (`createExecutor`/`createStreamer` for chat, `embed`, `speech`, `transcribe`, `generateImage`, etc.). Capabilities are auto-detected from which methods exist.
|
|
36
|
-
- **Context** (`TContext`): your app data threaded through every call. Resolved by merging `defaultContext` → `providedContext(ctx)` → per-call required context → `{ ai }`. Fields satisfied by defaults/provided are not required at call time.
|
|
37
|
-
- **Metadata** (`TMetadata` + `AIBaseMetadata`): controls model selection (`model`, `required`/`optional` capabilities, `requiredParameters`, `providers.allow/deny`, `pricing`/`contextWindow`/`outputTokens`/`metrics` constraints, `weights`, `weightProfile`, `tier`) plus your custom fields. Merged like context.
|
|
38
|
-
- **Registry** (`ModelRegistry`): stores `ModelInfo` records keyed by both `id` and `provider/id`, applies overrides, scores and selects models.
|
|
39
|
-
- **APIs**: `chat`, `image.{generate,edit,analyze}`, `speech`, `transcribe`, `embed`, `models`. Each request API has `get()` (await) and `stream()` (async iterable); **`embed`
|
|
40
|
-
- **Components**: `ai.tool()`, `ai.prompt()`, `ai.agent()` wrap the `@aeye/core` classes and auto-inject the executor/streamer/context.
|
|
41
|
-
|
|
42
|
-
## Creating an instance
|
|
43
|
-
|
|
44
|
-
`AI.with<TContext, TMetadata>().providers(providers).create(config)` — a 3-step fluent builder that infers the full type container `T`. Both generics default to `{}`.
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
import { AI } from '@aeye/ai';
|
|
48
|
-
import { OpenAIProvider } from '@aeye/openai';
|
|
49
|
-
|
|
50
|
-
interface AppContext { userId: string; user?: User }
|
|
51
|
-
|
|
52
|
-
const openai = new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! });
|
|
53
|
-
|
|
54
|
-
const ai = AI.with<AppContext>()
|
|
55
|
-
.providers({ openai }) // keys become provider identifiers ('openai')
|
|
56
|
-
.create({
|
|
57
|
-
providedContext: async (ctx) => ({ user: await getUser(ctx.userId) }),
|
|
58
|
-
defaultWeights: { cost: 0.5, speed: 0.3, accuracy: 0.2 },
|
|
59
|
-
});
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Constructing `new AI(config)` directly is also valid but loses inference; prefer the builder.
|
|
63
|
-
|
|
64
|
-
### Key `AIConfig` fields
|
|
65
|
-
|
|
66
|
-
| Field | Purpose |
|
|
67
|
-
|-------|---------|
|
|
68
|
-
| `providers` | Required. `Record<string, Provider>`. |
|
|
69
|
-
| `defaultContext` / `providedContext` | Static + async-resolved context. |
|
|
70
|
-
| `defaultMetadata` / `providedMetadata` | Static + async-resolved metadata. |
|
|
71
|
-
| `models` | `ModelInfo[]` registered up front (e.g. from `@aeye/models`). |
|
|
72
|
-
| `modelOverrides` | `ModelOverride[]` patched onto matching models (by `provider`/`modelId`/`modelPattern`). |
|
|
73
|
-
| `modelHandlers` | Per-model custom implementations (`ModelHandler`). |
|
|
74
|
-
| `modelSources` | External `ModelSource[]` fetched on `models.refresh()`. |
|
|
75
|
-
| `defaultWeights` / `weightProfiles` | Default and named scoring weights. |
|
|
76
|
-
| `defaultCostPerMillionTokens` | Fallback price for unknown models (default `5.0`). |
|
|
77
|
-
| `tokens` | Token-estimation divisors per content type. |
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
await ai.image.
|
|
108
|
-
|
|
109
|
-
//
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
ai.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
##
|
|
131
|
-
|
|
132
|
-
`
|
|
133
|
-
|
|
134
|
-
```typescript
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
```typescript
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
##
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
1
|
+
# @aeye/ai
|
|
2
|
+
|
|
3
|
+
> Multi-provider AI library: a single typed instance that selects models, runs chat/image/speech/transcribe/embed/rerank/decide requests and provider batches, tracks cost, and binds tools/prompts/agents — built on `@aeye/core`.
|
|
4
|
+
|
|
5
|
+
## When to use it
|
|
6
|
+
|
|
7
|
+
Use `@aeye/ai` as the main entry point of an aeye application. You create one `AI` instance, register one or more provider packages (`@aeye/openai`, `@aeye/aws`, `@aeye/openrouter`, `@aeye/replicate`, or a custom `Provider`), and then call typed APIs. The instance handles automatic model selection by capability/cost/speed, per-call context + metadata injection, lifecycle hooks (budgets, logging), and cost estimation.
|
|
8
|
+
|
|
9
|
+
- Use `@aeye/ai` for: provider-agnostic chat/embeddings/images/speech, model selection, cost tracking, and AI-bound `tool`/`prompt`/`agent` components.
|
|
10
|
+
- Use `@aeye/core` directly for: the underlying `Tool`/`Prompt`/`Agent` classes, `Request`/`Response`/`Chunk`/`Message` types, and strict-mode descriptors (`@aeye/ai` re-exports the request/response types you need).
|
|
11
|
+
|
|
12
|
+
## Installation & import
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @aeye/ai @aeye/core
|
|
16
|
+
npm install @aeye/openai openai # or @aeye/aws, @aeye/openrouter, @aeye/replicate
|
|
17
|
+
npm install @aeye/models # optional: curated model table + strict overrides
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
There is **one** export path. Everything is imported from the package root — there are no subpath exports.
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import {
|
|
24
|
+
AI, ModelRegistry, getProviderCapabilities, resolveStrictFormat,
|
|
25
|
+
isModelInfo, detectTier,
|
|
26
|
+
// types:
|
|
27
|
+
type Provider, type ModelInfo, type ModelOverride, type ModelSource,
|
|
28
|
+
type ModelHandler, type AIConfig, type AIHooks, type ModelCapability,
|
|
29
|
+
} from '@aeye/ai';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Core concepts
|
|
33
|
+
|
|
34
|
+
- **AI instance** (`AI<T>`): central object. Holds `config`, `registry`, the API surfaces, `providers`, `components`, and `hooks`.
|
|
35
|
+
- **Providers**: objects implementing the `Provider<TConfig>` interface. Each implements only the methods for the capabilities it supports (`createExecutor`/`createStreamer` for chat, `embed`, `speech`, `transcribe`, `generateImage`, etc.). Capabilities are auto-detected from which methods exist.
|
|
36
|
+
- **Context** (`TContext`): your app data threaded through every call. Resolved by merging `defaultContext` → `providedContext(ctx)` → per-call required context → `{ ai }`. Fields satisfied by defaults/provided are not required at call time.
|
|
37
|
+
- **Metadata** (`TMetadata` + `AIBaseMetadata`): controls model selection (`model`, `required`/`optional` capabilities, `requiredParameters`, `providers.allow/deny`, `pricing`/`contextWindow`/`outputTokens`/`metrics` constraints, `weights`, `weightProfile`, `tier`) plus your custom fields. Merged like context.
|
|
38
|
+
- **Registry** (`ModelRegistry`): stores `ModelInfo` records keyed by both `id` and `provider/id`, applies overrides, scores and selects models.
|
|
39
|
+
- **APIs**: `chat`, `image.{generate,edit,analyze}`, `speech`, `transcribe`, `embed`, `rerank`, `decide`, `batch`, `models`. Each request API has `get()` (await) and `stream()` (async iterable); **`embed`, `rerank` and `decide` have only `get()`**, and `batch` has `submit()`, `get()` and `wait()`. Selection/hooks/cost logic is shared via `BaseAPI`.
|
|
40
|
+
- **Components**: `ai.tool()`, `ai.prompt()`, `ai.agent()` wrap the `@aeye/core` classes and auto-inject the executor/streamer/context.
|
|
41
|
+
|
|
42
|
+
## Creating an instance
|
|
43
|
+
|
|
44
|
+
`AI.with<TContext, TMetadata>().providers(providers).create(config)` — a 3-step fluent builder that infers the full type container `T`. Both generics default to `{}`.
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { AI } from '@aeye/ai';
|
|
48
|
+
import { OpenAIProvider } from '@aeye/openai';
|
|
49
|
+
|
|
50
|
+
interface AppContext { userId: string; user?: User }
|
|
51
|
+
|
|
52
|
+
const openai = new OpenAIProvider({ apiKey: process.env.OPENAI_API_KEY! });
|
|
53
|
+
|
|
54
|
+
const ai = AI.with<AppContext>()
|
|
55
|
+
.providers({ openai }) // keys become provider identifiers ('openai')
|
|
56
|
+
.create({
|
|
57
|
+
providedContext: async (ctx) => ({ user: await getUser(ctx.userId) }),
|
|
58
|
+
defaultWeights: { cost: 0.5, speed: 0.3, accuracy: 0.2 },
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Constructing `new AI(config)` directly is also valid but loses inference; prefer the builder.
|
|
63
|
+
|
|
64
|
+
### Key `AIConfig` fields
|
|
65
|
+
|
|
66
|
+
| Field | Purpose |
|
|
67
|
+
|-------|---------|
|
|
68
|
+
| `providers` | Required. `Record<string, Provider>`. |
|
|
69
|
+
| `defaultContext` / `providedContext` | Static + async-resolved context. |
|
|
70
|
+
| `defaultMetadata` / `providedMetadata` | Static + async-resolved metadata. |
|
|
71
|
+
| `models` | `ModelInfo[]` registered up front (e.g. from `@aeye/models`). |
|
|
72
|
+
| `modelOverrides` | `ModelOverride[]` patched onto matching models (by `provider`/`modelId`/`modelPattern`). |
|
|
73
|
+
| `modelHandlers` | Per-model custom implementations (`ModelHandler`). |
|
|
74
|
+
| `modelSources` | External `ModelSource[]` fetched on `models.refresh()`. |
|
|
75
|
+
| `defaultWeights` / `weightProfiles` | Default and named scoring weights. |
|
|
76
|
+
| `defaultCostPerMillionTokens` | Fallback price for unknown models (default `5.0`). |
|
|
77
|
+
| `tokens` | Token-estimation divisors per content type. |
|
|
78
|
+
|
|
79
|
+
Hooks are not a config field: attach them with `ai.withHooks(...)`. Callbacks in the config (e.g. `providedContext`) are typed from `TContext`/`TMetadata`.
|
|
80
|
+
|
|
81
|
+
## Using the request APIs
|
|
82
|
+
|
|
83
|
+
All request APIs follow `api.get(request, ctx?)` / `api.stream(request, ctx?)`. The second arg is the **required context** (only the fields not satisfied by defaults/provided), and may carry `metadata` and `signal`.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
// Chat (await)
|
|
87
|
+
const res = await ai.chat.get(
|
|
88
|
+
{ messages: [{ role: 'user', content: 'What is TypeScript?' }], temperature: 0.7, maxTokens: 512 },
|
|
89
|
+
{ userId: 'u1' }
|
|
90
|
+
);
|
|
91
|
+
console.log(res.content, res.usage?.cost, res.finishReason);
|
|
92
|
+
|
|
93
|
+
// Chat (stream)
|
|
94
|
+
for await (const chunk of ai.chat.stream({ messages: [{ role: 'user', content: 'Count to 5' }] }, { userId: 'u1' })) {
|
|
95
|
+
if (chunk.content) process.stdout.write(chunk.content);
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Vision/audio capabilities are auto-required from message content (an `image` part adds `'vision'`, an `audio` part adds `'hearing'`); `reason`, `responseFormat`, and `tools` add the matching capabilities/parameters during selection.
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// Embeddings (get only)
|
|
103
|
+
const e = await ai.embed.get({ texts: ['hello', 'world'], dimensions: 1536 });
|
|
104
|
+
e.embeddings.forEach(({ embedding, index }) => console.log(index, embedding.length));
|
|
105
|
+
|
|
106
|
+
// Images
|
|
107
|
+
await ai.image.generate.get({ prompt: 'a cat astronaut', n: 1, size: '1024x1024', quality: 'high' });
|
|
108
|
+
await ai.image.edit.get({ prompt: 'add a sunset', image: buf, mask: maskBuf, size: '1024x1024' });
|
|
109
|
+
await ai.image.analyze.get({ prompt: 'describe this', images: ['https://...jpg'] }); // routes through a vision chat model
|
|
110
|
+
|
|
111
|
+
// Speech / Transcription
|
|
112
|
+
const speech = await ai.speech.get({ text: 'Hello there', voice: 'alloy', speed: 1.0 });
|
|
113
|
+
const text = await ai.transcribe.get({ audio: audioBuf, language: 'en' });
|
|
114
|
+
|
|
115
|
+
// Rerank (OpenRouter) / Decisions (OpenAI, OpenRouter)
|
|
116
|
+
const { results } = await ai.rerank.get({ query: 'capital of France', documents, topN: 1 });
|
|
117
|
+
const { answers } = await ai.decide.get({ input: text, questions: { spam: { type: 'predicate', instructions: 'Is this spam?' } } });
|
|
118
|
+
|
|
119
|
+
// Batches (OpenAI, OpenRouter): about half price, results within a day
|
|
120
|
+
const job = await ai.batch.submit([{ messages }, { messages: other }], {});
|
|
121
|
+
const done = await ai.batch.wait(job, {}); // done.results in request order
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Reasoning
|
|
125
|
+
|
|
126
|
+
`reason: { effort }` is clamped to the model's `reasoningEfforts` with `clampReasoningEffort(effort, accepted)`: nearest accepted, lower on a tie, and `none` only when asked for or alone accepted (`low` on `[none, high, xhigh]` sends `high`). Keep `message.reasoning` when sending a conversation back: `Reasoning.provider` names who produced it, and a provider replays only its own or unnamed reasoning (`replaysTo` in core).
|
|
127
|
+
|
|
128
|
+
Request/response shapes are exported types: `Request`/`Response`/`Chunk`/`Message` (re-exported from core), plus `EmbeddingRequest`/`EmbeddingResponse`, `ImageGenerationRequest`/`ImageEditRequest`/`ImageGenerationResponse`/`ImageGenerationChunk`, `ImageAnalyzeRequest`, `SpeechRequest`/`SpeechResponse`, `TranscriptionRequest`/`TranscriptionResponse`/`TranscriptionChunk`.
|
|
129
|
+
|
|
130
|
+
## Model selection & the Models API
|
|
131
|
+
|
|
132
|
+
When `request.model` / `metadata.model` is set, that model is used directly. Otherwise the registry scores **applicable** models (those passing required capabilities, provider allow/deny, and range constraints) using weighted `cost`/`speed`/`accuracy`/`contextWindow` (weights resolve as `metadata.weights` → `metadata.weightProfile` → config `defaultWeights` → `{ cost:0.5, speed:0.3, accuracy:0.2 }`). Optional capabilities/parameters act as preference multipliers, not filters.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
ai.models.list(providedOnly?) // all (or only provider-backed) ModelInfo[]
|
|
136
|
+
ai.models.get('gpt-4o' | 'openai/gpt-4o') // ModelInfo | undefined
|
|
137
|
+
ai.models.search({ required: ['chat','structured'], weights: { cost: 0.6, speed: 0.4 } }) // ScoredModel[]
|
|
138
|
+
ai.models.select(criteria) // SelectedModel | undefined
|
|
139
|
+
await ai.models.refresh() // re-fetch from providers + modelSources
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
`ModelCapability` = `'chat' | 'tools' | 'vision' | 'files' | 'videoInput' | 'json' | 'structured' | 'streaming' | 'reasoning' | 'image' | 'audio' | 'hearing' | 'embedding' | 'rerank' | 'decision' | 'zdr' | 'toolsStrict'`. `ModelTier` = `'flagship' | 'efficient' | 'legacy' | 'experimental'`.
|
|
143
|
+
|
|
144
|
+
## Tools, prompts & agents
|
|
145
|
+
|
|
146
|
+
`ai.tool()`, `ai.prompt()`, `ai.agent()` return enhanced `@aeye/core` `Tool`/`Prompt`/`Agent` instances with the AI executor/streamer/context auto-wired (you don't pass `types`). Every created component is pushed to `ai.components`.
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import z from 'zod';
|
|
150
|
+
|
|
151
|
+
const searchKnowledge = ai.tool({
|
|
152
|
+
name: 'searchKnowledge',
|
|
153
|
+
description: 'Search the knowledge base',
|
|
154
|
+
schema: z.object({ query: z.string(), limit: z.number().optional() }),
|
|
155
|
+
call: async ({ query, limit = 5 }, _refs, ctx) => ({ results: await search(query, limit) }),
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const assistant = ai.prompt({
|
|
159
|
+
name: 'assistant',
|
|
160
|
+
description: 'Answers using the knowledge base',
|
|
161
|
+
content: 'Use searchKnowledge then answer.\n\nQuestion: {{question}}',
|
|
162
|
+
input: (i: { question: string }) => ({ question: i.question }),
|
|
163
|
+
tools: [searchKnowledge],
|
|
164
|
+
schema: z.object({ answer: z.string(), sources: z.array(z.string()) }),
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const result = await assistant.get('result', { question: 'How does X work?' }, { userId: 'u1' });
|
|
168
|
+
for await (const t of assistant.get('streamContent', { question: '...' })) process.stdout.write(t);
|
|
169
|
+
|
|
170
|
+
// Or run any component with context injected:
|
|
171
|
+
const out = await ai.run(assistant, { question: '...' }, { userId: 'u1' });
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Every callback given to `ai.prompt` (`input`, `schema`, `config`, `reconfig`, `retool`, `parse`, `validate`, `review`, `onToolIntercept`, `applicable`, `metadataFn`) receives the full AI context. Prompts also take `review` / `reviewRetries` (check valid output, send feedback for another round), `schemaFallbacks` (steps taken when a provider rejects a schema; default `SCHEMA_FALLBACKS`, AI-wide via `defaultContext`), and `userTurn` (the user message added when run without a conversation, default `'Begin.'`). Errors carry `kind: 'model' | 'tool'` (`PromptError`, `ToolInputError`, `ToolExecutionError`, `OutputValidationError`, `ReviewRejectedError`, all from core).
|
|
175
|
+
|
|
176
|
+
`ai.agent({ name, description, refs, call })` composes other components; `call(input, [..refs], ctx)` receives the resolved refs tuple and the full AI context.
|
|
177
|
+
|
|
178
|
+
`ai.tool()` and `ai.prompt()` forward a trailing **`TDecoded`** generic to the underlying core `Tool`/`Prompt`, so a custom `parse` (which replaces Zod — see the [structured-output](../docs/guides/structured-output.md) / [tool-calling](../docs/guides/tool-calling.md) guides) has its **return type surface through the wrapper**: `call`/`validate` receive the decoded value, not the wire params/output. Absent a custom `parse`, `TDecoded` defaults to the wire type.
|
|
179
|
+
|
|
180
|
+
## Provider & core integration
|
|
181
|
+
|
|
182
|
+
- **Provider packages** export classes implementing the core `Provider` interface, e.g. `new OpenAIProvider({ apiKey })`, `new OpenRouterProvider({ apiKey })`, `new AWSProvider(...)`, `new ReplicateProvider(...)`. You map them under arbitrary keys in `.providers({ ... })`; the key is the provider identifier used in `metadata.providers.allow/deny`, model IDs (`provider/model`), and `ai.providers`.
|
|
183
|
+
- **`@aeye/models`** provides a curated `models` array and a `strictSupport` `ModelOverride[]`. Splat both so selection knows real pricing/capabilities and which models truly support strict tool/output mode:
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
import { models, strictSupport } from '@aeye/models';
|
|
187
|
+
const ai = AI.with().providers({ openai }).create({ models, modelOverrides: [...strictSupport] });
|
|
188
|
+
```
|
|
189
|
+
- **`@aeye/core`** supplies the building blocks `@aeye/ai` re-exports (`Request`, `Response`, `Chunk`, `Message`, `Usage`, `Executor`, `Streamer`, `ToolInput`, `PromptInput`, `AgentInput`, `Component*`). Strict-mode descriptor mechanics live in core; `@aeye/ai` only wires the `strict` flag into selection (`true` → required `toolsStrict`, numeric/omitted → optional preference). Custom format families are registered in core via `registerDescriptor`.
|
|
190
|
+
|
|
191
|
+
### Hooks
|
|
192
|
+
|
|
193
|
+
Attach with `.withHooks(...)` (returns `this`) or by assigning `ai.hooks`; `create(config)` has no hooks field. Hooks run around every request:
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
ai.withHooks({
|
|
197
|
+
beforeModelSelection: async (ctx, request, metadata) => metadata, // adjust criteria
|
|
198
|
+
onModelSelected: async (ctx, request, selected) => {/* return to override */},
|
|
199
|
+
beforeRequest: async (ctx, request, selected, estimatedUsage, estimatedCost) => {
|
|
200
|
+
if (ctx.user && estimatedCost > ctx.user.budget) throw new Error('over budget'); // throw to cancel
|
|
201
|
+
},
|
|
202
|
+
afterRequest: async (ctx, request, response, complete, selected, usage, cost) => {/* track */},
|
|
203
|
+
afterBatch: async (ctx, job, usage, cost) => {/* once per completed batch */},
|
|
204
|
+
onError: (type, message, error, ctx, request) => console.error(type, message),
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Extending instances
|
|
209
|
+
|
|
210
|
+
`ai.extend<TExtraContext, TExtraMetadata>(config?)` returns a new `AI` sharing providers/config, with merged defaults and additively-merged `models`/`modelOverrides`/`modelHandlers`. Useful for feature-scoped context.
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
const chatAI = ai.extend<{ chatId: string }>({ defaultContext: {} });
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Other exports
|
|
217
|
+
|
|
218
|
+
- `ModelRegistry` — the registry class (`getModel`, `registerModel(s)`, `listModels`, `providedModels`, `searchModels`, `selectModel`, `getProvider`, `getProviderCapabilities`, `getStrictFormat`, `refresh`). Accessible as `ai.registry`.
|
|
219
|
+
- `getProviderCapabilities(provider)` → `Set<ModelCapability>` inferred from provider methods.
|
|
220
|
+
- `resolveStrictFormat(model)` → strict dialect family or `undefined` (checks `strictFormat`, then `provider`, then `id` prefix).
|
|
221
|
+
- `clampReasoningEffort(effort, accepted?)` — the accepted reasoning effort nearest the one asked for (unchanged when `accepted` is unknown).
|
|
222
|
+
- `isModelInfo(input)` — type guard distinguishing a full `ModelInfo` from a model reference.
|
|
223
|
+
- `detectTier(name)`, `detectCapabilitiesFromModality(modality, id)`, `detectZDRFromModeration(isModerated)` — heuristics used as fallbacks during refresh.
|
|
224
|
+
- `ai.stats()` → `LibraryStats` (model counts, cumulative requests, average cost/latency).
|
|
225
|
+
|
|
226
|
+
## Gotchas
|
|
227
|
+
|
|
228
|
+
- **`embed` has no `stream()`** — only `embed.get()`. Image/speech "streaming" may fall back to a single chunk if the provider lacks a true streamer (the base API converts executor↔streamer automatically).
|
|
229
|
+
- **Capabilities are per-provider AND per-model.** A required capability must be supported by both the model (`ModelInfo.capabilities`) and the provider (auto-detected from its methods), or the model is filtered out. Missing the right provider method → "No compatible model found".
|
|
230
|
+
- **Models registered under two keys** (`id` and `provider/id`); colliding registrations are merged, not replaced. Use `provider/model` IDs to disambiguate across providers.
|
|
231
|
+
- **`refresh()` clears and re-fetches** all models. Models passed via `config.models` are preserved because they are also added as an internal `'config'` model source.
|
|
232
|
+
- **Pricing is per 1M tokens** (image output pricing is per-image by quality/size; `perRequest` is a flat add-on). `estimate*Usage` is heuristic (char-count divisors), not a real tokenizer — treat estimated cost as approximate.
|
|
233
|
+
- **Selection without registered models fails** — with no `models`/`modelSources`/provider `listModels`, only an explicit `metadata.model` will resolve. Call `models.refresh()` or pass `config.models` first.
|
|
234
|
+
- **`strict: true` is a hard filter**; numeric or omitted `strict` is only a scoring preference. Without `@aeye/models` `strictSupport` overrides (or explicit `strictFormat`), models default to lenient even if the API supports strict.
|
|
235
|
+
- **Builder generics carry no runtime data** — `AI.with<Ctx, Meta>()` only types the instance; actual defaults come from `.create(config)`.
|
|
236
|
+
</content>
|
|
237
|
+
</invoke>
|
package/dist/ai.d.ts
CHANGED
|
@@ -5,8 +5,11 @@
|
|
|
5
5
|
* Provides type-safe, scoped access to AI capabilities with hooks and context injection.
|
|
6
6
|
*/
|
|
7
7
|
import { Agent, Extend, Fn, MessageContentType, Prompt, RetoolResult, Tool, ToolCompatible, Tuple } from '@aeye/core';
|
|
8
|
+
import { BatchAPI } from './apis/batch';
|
|
8
9
|
import { ChatAPI } from './apis/chat';
|
|
9
10
|
import { EmbedAPI } from './apis/embed';
|
|
11
|
+
import { RerankAPI } from './apis/rerank';
|
|
12
|
+
import { DecideAPI } from './apis/decide';
|
|
10
13
|
import { ImageAPI } from './apis/image';
|
|
11
14
|
import { ModelsAPI } from './apis/models';
|
|
12
15
|
import { SpeechAPI } from './apis/speech';
|
|
@@ -52,6 +55,9 @@ export declare class AI<T extends AIBaseTypes> {
|
|
|
52
55
|
readonly speech: SpeechAPI<T>;
|
|
53
56
|
readonly transcribe: TranscribeAPI<T>;
|
|
54
57
|
readonly embed: EmbedAPI<T>;
|
|
58
|
+
readonly rerank: RerankAPI<T>;
|
|
59
|
+
readonly decide: DecideAPI<T>;
|
|
60
|
+
readonly batch: BatchAPI<T>;
|
|
55
61
|
readonly models: ModelsAPI<AIProviders<T>>;
|
|
56
62
|
readonly providers: AIProviders<T>;
|
|
57
63
|
readonly components: ComponentFor<T>[];
|
|
@@ -70,7 +76,7 @@ export declare class AI<T extends AIBaseTypes> {
|
|
|
70
76
|
*/
|
|
71
77
|
static with<TContext extends AIContextUser = {}, TMetadata extends AIMetadataUser = {}>(): {
|
|
72
78
|
providers: <TProviders extends Providers>(providers: TProviders) => {
|
|
73
|
-
create: <TConfig extends Omit<AIConfig<TContext, TMetadata, TProviders>, "providers">>(config
|
|
79
|
+
create: <TConfig extends Omit<AIConfig<TContext, TMetadata, TProviders>, "providers">>(config?: TConfig) => AI<AITypesInfer<TContext, TMetadata, TProviders, TConfig>>;
|
|
74
80
|
};
|
|
75
81
|
};
|
|
76
82
|
constructor(config: AIConfigOf<T>);
|
package/dist/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAmB,KAAK,EAAU,MAAM,EAAE,EAAE,EAAc,kBAAkB,EAAE,MAAM,EAAa,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACtK,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,OAAO,EACP,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,eAAe,EACf,OAAO,EAEP,YAAY,EACZ,OAAO,EACP,SA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