@sixb/azure-ai-foundry 0.2.4 → 0.2.6
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 +187 -2
- package/dist/decision.d.ts +18 -0
- package/dist/decision.d.ts.map +1 -0
- package/dist/discovery.d.ts +3 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/embedding.d.ts +1 -1
- package/dist/embedding.d.ts.map +1 -1
- package/dist/image.d.ts +20 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1178 -71
- package/dist/index.js.map +15 -9
- package/dist/kinds.d.ts +13 -0
- package/dist/kinds.d.ts.map +1 -0
- package/dist/provider.d.ts +15 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/request.d.ts.map +1 -1
- package/dist/reranking.d.ts +18 -0
- package/dist/reranking.d.ts.map +1 -0
- package/dist/speech.d.ts +20 -0
- package/dist/speech.d.ts.map +1 -0
- package/dist/transcription.d.ts +20 -0
- package/dist/transcription.d.ts.map +1 -0
- package/dist/transport.d.ts +10 -2
- package/dist/transport.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/decision.ts +211 -0
- package/src/discovery.ts +18 -0
- package/src/embedding.ts +15 -36
- package/src/image.ts +457 -0
- package/src/index.ts +8 -0
- package/src/kinds.ts +100 -0
- package/src/provider.ts +73 -12
- package/src/request.ts +2 -1
- package/src/reranking.ts +264 -0
- package/src/speech.ts +390 -0
- package/src/transcription.ts +322 -0
- package/src/transport.ts +90 -11
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Azure AI Foundry models for Sixb. A project URL and API key resolve Azure deployments into
|
|
4
4
|
model capabilities, limits, reasoning controls, and reference prices from [models.dev](https://models.dev).
|
|
5
|
+
Language, embedding, decision, transcription, reranking, speech and image models are supported.
|
|
5
6
|
|
|
6
7
|
## Install
|
|
7
8
|
|
|
@@ -82,6 +83,185 @@ pricing. Missing pricing remains unknown and blocks cost-limited calls before in
|
|
|
82
83
|
|
|
83
84
|
See [embedding internals](./docs/embeddings.md) for resolution, transport, and failure handling.
|
|
84
85
|
|
|
86
|
+
## Decision models
|
|
87
|
+
|
|
88
|
+
Deploy `Microsoft-Decision-1` in the project and register the deployment under `models.decision`.
|
|
89
|
+
Azure rejects deployment names that contain "Microsoft", so pass your own name, such as
|
|
90
|
+
`decision-1`:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
export const decision = foundry.decision("decision-1")
|
|
94
|
+
|
|
95
|
+
// In your createSixb() options:
|
|
96
|
+
const models = { decision: [decision] }
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Use it with `sixb.models.decision.evaluate()`, see
|
|
100
|
+
[decision models](../../docs/models/configuration.md#decision-models). With language model tiers, it
|
|
101
|
+
also picks the tier of each chat message on Auto; Azure answers in about 150–450 ms, within
|
|
102
|
+
Sixb's 2-second limit.
|
|
103
|
+
|
|
104
|
+
| Behavior | Rule |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| Deployment | Must run a decision model (`Microsoft-Decision-*`); others are rejected, and `foundry.chat()` rejects decision deployments |
|
|
107
|
+
| Inference | `POST /providers/microsoft/v1/systemone` on the resource origin, with the project's API key |
|
|
108
|
+
| Questions | Choice with 2–255 options, score with 2–10 levels, probability; Azure rejects a one-option choice |
|
|
109
|
+
| Context | 32,768 tokens for the input and the longest question; Azure's rejection is surfaced as is |
|
|
110
|
+
| `timeoutMs` | 30 seconds per evaluation, response included |
|
|
111
|
+
| Retries | None: errors carry `retryable` and `retryAfterMs`; quota is metered in requests per minute |
|
|
112
|
+
| Response model | Must be the deployment's model; answers from another are rejected, their usage kept |
|
|
113
|
+
| Price | `Microsoft-Decision-1` version 1: USD 0.042 per million input tokens, output free |
|
|
114
|
+
|
|
115
|
+
The price is Azure's retail meter "Microsoft Decision 1 1M Tokens", the same in every region
|
|
116
|
+
(verified 2026-11-13 against the [Azure Retail Prices API](https://prices.azure.com/api/retail/prices?$filter=productName%20eq%20%27Microsoft%20Decision%20Models%27)).
|
|
117
|
+
Other decision models have unknown cost, not zero: pass `rateCard` or `costEstimator` for them. Connected deployments from another resource are rejected;
|
|
118
|
+
configure that resource's project URL and API key.
|
|
119
|
+
|
|
120
|
+
## Transcription
|
|
121
|
+
|
|
122
|
+
Deploy a transcription model in the project and register the deployment under
|
|
123
|
+
`models.audio.transcription`:
|
|
124
|
+
|
|
125
|
+
```ts
|
|
126
|
+
export const transcriber = foundry.transcription("transcribe", { language: "en" })
|
|
127
|
+
|
|
128
|
+
// In your createSixb() options:
|
|
129
|
+
const models = { audio: { transcription: [transcriber] } }
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Use it with `sixb.models.audio.transcribe()`, see
|
|
133
|
+
[audio transcription](../../docs/models/configuration.md#audio-transcription).
|
|
134
|
+
|
|
135
|
+
| Deployed model | Billed by | Price (GlobalStandard) |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| `gpt-4o-transcribe` | Audio input and text output tokens | USD 6 and 10 per million |
|
|
138
|
+
| `gpt-4o-mini-transcribe` | Audio input and text output tokens | USD 3 and 5 per million |
|
|
139
|
+
| `gpt-4o-transcribe-diarize` | Tokens | Unknown: Azure publishes no retail meter |
|
|
140
|
+
| `gpt-transcribe` | Audio duration, in whole seconds | USD 0.27 per hour |
|
|
141
|
+
| `whisper` | Audio duration | USD 0.36 per hour (Standard: 0.396) |
|
|
142
|
+
|
|
143
|
+
| Behavior | Rule |
|
|
144
|
+
| --- | --- |
|
|
145
|
+
| Deployment | Must run one of the models above; others are rejected, and `foundry.chat()` rejects transcription deployments |
|
|
146
|
+
| Inference | `POST /openai/deployments/<deployment>/audio/transcriptions?api-version=2024-10-21` on the resource origin, with the project's API key; the v1 API does not route audio deployments |
|
|
147
|
+
| Audio | Up to 25 MiB of FLAC, MP3, MP4/M4A, Ogg, WAV or WebM, sent as is; Sixb rejects other media types before the upload |
|
|
148
|
+
| `language` | ISO-639-1 code of the spoken language; omitted, the model detects it |
|
|
149
|
+
| Speakers | `gpt-4o-transcribe-diarize` returns the text only: Sixb's transcription result has no speaker segments yet ([#1142](https://github.com/sixb-ai/sixb/issues/1142)) |
|
|
150
|
+
| `timeoutMs` | 120 seconds per transcription, upload and response included |
|
|
151
|
+
| Retries | None: errors carry `retryable` and `retryAfterMs` |
|
|
152
|
+
| Price | Azure Retail Prices for the deployment's model version and SKU: GlobalStandard, DataZoneStandard and Standard (verified 2026-11-13) |
|
|
153
|
+
|
|
154
|
+
A deployment without a published price, such as `gpt-4o-transcribe-diarize` or a provisioned
|
|
155
|
+
SKU, has unknown cost, not zero: pass `rateCard` or `costEstimator`. A reservation is never
|
|
156
|
+
estimated, because neither tokens nor duration are known before Azure decodes the file, so a
|
|
157
|
+
[cost limit](../../docs/models/usage-and-limits.md#set-a-monthly-limit) blocks these calls.
|
|
158
|
+
Connected deployments from another resource are rejected.
|
|
159
|
+
|
|
160
|
+
## Reranking
|
|
161
|
+
|
|
162
|
+
Deploy a Cohere rerank model in the project and register the deployment under `models.reranking`:
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
export const reranker = foundry.reranking("rerank")
|
|
166
|
+
|
|
167
|
+
// In your createSixb() options:
|
|
168
|
+
const models = { embedding: [productEmbedding], reranking: [reranker] }
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
A query then names it with `.rerank({ model: reranker })`, see
|
|
172
|
+
[rerank search results](../../docs/objects/querying.md#rerank-search-results).
|
|
173
|
+
|
|
174
|
+
| Deployed model | Billed by | Price (GlobalStandard) |
|
|
175
|
+
| --- | --- | --- |
|
|
176
|
+
| `Cohere-rerank-v5-fast` | Input tokens | USD 0.02 per million |
|
|
177
|
+
| `Cohere-rerank-v5-pro` | Input tokens | USD 0.05 per million |
|
|
178
|
+
| `Cohere-rerank-v4.0-fast` | Searches | Unknown: USD 2 per 1,000 searches, a unit Sixb cannot price yet ([#1145](https://github.com/sixb-ai/sixb/issues/1145)) |
|
|
179
|
+
| `Cohere-rerank-v4.0-pro` | Searches | Unknown: USD 2.50 per 1,000 searches |
|
|
180
|
+
|
|
181
|
+
| Behavior | Rule |
|
|
182
|
+
| --- | --- |
|
|
183
|
+
| Deployment | Must run a `Cohere-rerank-*` model; others are rejected. Discovery reports `chat_completion` for Rerank v4.0, but `foundry.chat()` rejects it and catalog listings leave it out |
|
|
184
|
+
| Inference | `POST /providers/cohere/v2/rerank` on the resource origin, with the project's API key; every document is scored |
|
|
185
|
+
| `timeoutMs` | 30 seconds per call, response included; Sixb's query runtime also stops at 30 seconds |
|
|
186
|
+
| Retries | None: errors carry `retryable` and `retryAfterMs` |
|
|
187
|
+
| Price | Azure Retail Prices for Rerank v5 version 1 on GlobalStandard and DataZoneStandard (verified 2026-11-13); other v5 deployments take a `rateCard`, and Rerank v4.0 only a `costEstimator` that reads `usage.raw.search_units` |
|
|
188
|
+
|
|
189
|
+
Capacity sets the rate limit: Azure's rate-limit headers report one request and 1,000 tokens per
|
|
190
|
+
minute for each unit of a deployment's capacity. Connected deployments from another resource are
|
|
191
|
+
rejected.
|
|
192
|
+
|
|
193
|
+
## Speech
|
|
194
|
+
|
|
195
|
+
Deploy `gpt-4o-mini-tts` in the project and register the deployment under `models.audio.speech`:
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
export const voice = foundry.speech("tts", { voice: "coral" })
|
|
199
|
+
|
|
200
|
+
// In your createSixb() options:
|
|
201
|
+
const models = { audio: { speech: [voice] } }
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Use it with `sixb.models.audio.speak()`, see
|
|
205
|
+
[speech generation](../../docs/models/configuration.md#speech-generation).
|
|
206
|
+
|
|
207
|
+
| Behavior | Rule |
|
|
208
|
+
| --- | --- |
|
|
209
|
+
| Deployment | Must run `gpt-4o-mini-tts`; others are rejected, `tts` and `tts-hd` because they stream no usage. `foundry.chat()` rejects speech deployments |
|
|
210
|
+
| Inference | `POST /openai/v1/audio/speech` on the resource origin, with the project's API key and `stream_format: "sse"`: only the event stream reports token usage |
|
|
211
|
+
| Formats | `audio/mpeg` (default), `audio/ogg` (Opus), `audio/aac` (ADTS), `audio/flac` and `audio/wav`; a reply in another format fails. A streamed WAV's header sizes are written once the file is complete |
|
|
212
|
+
| Stream | Complete only at its `speech.audio.done` event, which carries the usage: a stream cut off before it, or ending in an `error` event, fails with the usage it reported. Up to 128 MiB of audio |
|
|
213
|
+
| `voice` | Used when a request names none; default `alloy`. Azure rejects voices it does not have, listing those it does |
|
|
214
|
+
| Text | Up to 4,096 characters; `instructions` and `speed` are passed on (speed changes the length, not the tokens billed). `language` is not: the model reads the text in its own language, and the result warns |
|
|
215
|
+
| `timeoutMs` | 120 seconds per call, response included |
|
|
216
|
+
| Retries | None: errors carry `retryable` and `retryAfterMs` |
|
|
217
|
+
| Price | USD 0.60 per million text input tokens and USD 12 per million audio output tokens on GlobalStandard; DataZoneStandard and Standard are 10% more (Azure Retail Prices, versions 2025-03-20 and 2025-12-15, verified 2026-11-13) |
|
|
218
|
+
|
|
219
|
+
Other versions and SKUs have unknown cost, not zero: pass `rateCard` or `costEstimator`. The
|
|
220
|
+
audio's length, so its token count, is unknown before the call, so no reservation is estimated
|
|
221
|
+
and a [cost limit](../../docs/models/usage-and-limits.md#image-and-speech-generation) blocks these
|
|
222
|
+
calls. Connected deployments from another resource are rejected.
|
|
223
|
+
|
|
224
|
+
## Images
|
|
225
|
+
|
|
226
|
+
Deploy a GPT Image or FLUX model in the project and register the deployment under `models.image`:
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
export const images = foundry.image("image", { description: "Product shots and edits" })
|
|
230
|
+
|
|
231
|
+
// In your createSixb() options:
|
|
232
|
+
const models = { image: [images] }
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Use it with `sixb.models.image.generate()`, see
|
|
236
|
+
[image generation](../../docs/models/configuration.md#image-generation).
|
|
237
|
+
|
|
238
|
+
| Deployed model | Per call | Reference images | Price (GlobalStandard) |
|
|
239
|
+
| --- | --- | --- | --- |
|
|
240
|
+
| `gpt-image-1` | Up to 10 | Up to 16 | USD 5 per million text input tokens, 40 per million image output tokens |
|
|
241
|
+
| `gpt-image-1-mini` | Up to 10 | Up to 16 | USD 2 and 8 per million |
|
|
242
|
+
| `gpt-image-1.5` | Up to 10 | Up to 16 | USD 5 per million text input, 10 per million text output, 32 per million image output tokens |
|
|
243
|
+
| `gpt-image-2` | Up to 10 | Up to 16 | USD 5 and 30 per million; text output, if any, is unpriced |
|
|
244
|
+
| `FLUX.1-Kontext-pro` | 1 | 1 | USD 0.04 per image |
|
|
245
|
+
| `FLUX-1.1-pro` | 1 | None | USD 0.04 per image |
|
|
246
|
+
|
|
247
|
+
| Behavior | Rule |
|
|
248
|
+
| --- | --- |
|
|
249
|
+
| Deployment | Must run one of the models above; others are rejected, and `foundry.chat()` rejects image deployments. FLUX.2 [pro] and [flex] are refused: they answer only Black Forest Labs' own route, with their own request and a per-megapixel price |
|
|
250
|
+
| Inference | `POST /openai/deployments/<deployment>/images/generations` or, with reference images, `/images/edits`, with `api-version=2025-04-01-preview` on the resource origin and the project's API key. The v1 API does not route FLUX.1 Kontext edits |
|
|
251
|
+
| Options | `size` and `quality` (GPT Image; sizes listed for gpt-image-1, -1-mini and -1.5) are passed on. `seed`, `style` and `aspectRatio` have no API field and come back as warnings, like `quality` for FLUX |
|
|
252
|
+
| Reference images | PNG, JPEG or WebP. Until a binding resolves it accepts up to 16; resolution narrows that to the deployment's limit |
|
|
253
|
+
| `timeoutMs` | 180 seconds per call, response included |
|
|
254
|
+
| Retries | None: errors carry `retryable` and `retryAfterMs` |
|
|
255
|
+
| Price | Azure Retail Prices for the deployment's model version on GlobalStandard and DataZoneStandard, and Standard for FLUX (verified 2026-11-13). Without a text output price, every output token bills at the image rate: gpt-image-1 reports no split |
|
|
256
|
+
|
|
257
|
+
A GPT Image edit has unknown cost: Azure bills its image input tokens at a rate Sixb's rate cards
|
|
258
|
+
cannot hold yet ([#1149](https://github.com/sixb-ai/sixb/issues/1149)). Other versions and SKUs
|
|
259
|
+
are unknown too, not zero: pass `rateCard` or `costEstimator`. FLUX's per-image price is reserved
|
|
260
|
+
before the call; GPT Image's tokens are not known before it, so a
|
|
261
|
+
[cost limit](../../docs/models/usage-and-limits.md#image-and-speech-generation) blocks those calls.
|
|
262
|
+
gpt-image-1, gpt-image-2 and FLUX1.1 [pro] are covered by fixtures only. Connected deployments from
|
|
263
|
+
another resource are rejected.
|
|
264
|
+
|
|
85
265
|
## Stream a response
|
|
86
266
|
|
|
87
267
|
```ts
|
|
@@ -121,7 +301,7 @@ const cached = await model.resolve({ offline: true })
|
|
|
121
301
|
|
|
122
302
|
| Behavior | Rule |
|
|
123
303
|
| --- | --- |
|
|
124
|
-
| Catalog listings | Supported language deployments |
|
|
304
|
+
| Catalog listings | Supported language deployments; embedding, decision, transcription, reranking, speech and image deployments are left out |
|
|
125
305
|
| Azure matching | Unique case-insensitive model ID match |
|
|
126
306
|
| `FW-` fallback | Unique normalized match in the models.dev Fireworks catalog |
|
|
127
307
|
| Fireworks normalization | Removes namespace/`FW-`; normalizes casing and numeric `5p3` → `5.3` |
|
|
@@ -234,7 +414,7 @@ direct-Fireworks reference prices. Supply your own rates for effective Azure pri
|
|
|
234
414
|
| Discovery bounds | 100 pages, 10,000 records, 4 MiB |
|
|
235
415
|
| Public catalog bound | 32 MiB; receives no Azure credentials or custom headers |
|
|
236
416
|
| Custom transport | `fetch`, `headers` shared by discovery and inference; `catalog.fetch` for the public catalog |
|
|
237
|
-
| Retries | Transient
|
|
417
|
+
| Retries | Transient language-model HTTP failures; no replay after stream acceptance or ambiguous network failure; none for embeddings, decisions, transcriptions, reranking, speech and images |
|
|
238
418
|
| Cancellation | Bounds waits; early stream return cancels and releases the reader |
|
|
239
419
|
| Diagnostics | Redacts acquired credentials/custom header values; preserves status, codes and retry timing |
|
|
240
420
|
|
|
@@ -260,5 +440,10 @@ SIXB_FOUNDRY_E2E=1 \
|
|
|
260
440
|
| `profiles.e2e.ts` | Discovered deployment profiles | 8 / 4,096 |
|
|
261
441
|
| `contracts.e2e.ts` | Tools, images, durable replay, strict JSON and accounting | 16 / 16,384 |
|
|
262
442
|
| `provider.e2e.ts` | Protocol controls, tools, media, cancellation and errors | 40 / 16,000 |
|
|
443
|
+
| `decision.e2e.ts` | Decision questions, accounting, errors and chat tier routing | 16 decisions / — |
|
|
444
|
+
| `transcription.e2e.ts` | Each transcription deployment, accounting and errors | 8 transcriptions / — |
|
|
445
|
+
| `reranking.e2e.ts` | Rerank v5 and v4 ranking, usage, pricing and errors, as direct calls | 8 rerank calls / — |
|
|
446
|
+
| `speech.e2e.ts` | Every format, MP3 and WAV through Sixb with accounting, a transcription round trip and errors | 9 speech calls / — |
|
|
447
|
+
| `image.e2e.ts` | gpt-image-1.5, gpt-image-1-mini and FLUX.1 Kontext through Sixb with accounting, an edit and errors | 6 image calls / — |
|
|
263
448
|
|
|
264
449
|
Native Messages has fixture coverage; live verification requires a deployed Claude model.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type DecisionModel, type ModelCostEstimator, type ModelRateCard } from "@sixb/core/models";
|
|
2
|
+
import { type FoundryDeployments } from "./discovery";
|
|
3
|
+
import type { AzureAIFoundryModelMetadata } from "./provider";
|
|
4
|
+
import { type FoundryTransport } from "./transport";
|
|
5
|
+
export interface AzureAIFoundryDecisionOptions {
|
|
6
|
+
/** Deadline for one evaluation, body included. Default: 30,000 ms. */
|
|
7
|
+
readonly timeoutMs?: number;
|
|
8
|
+
readonly rateCard?: ModelRateCard;
|
|
9
|
+
readonly costEstimator?: ModelCostEstimator;
|
|
10
|
+
}
|
|
11
|
+
export interface AzureAIFoundryDecisionModel extends DecisionModel {
|
|
12
|
+
readonly metadata: AzureAIFoundryModelMetadata;
|
|
13
|
+
resolve(options?: {
|
|
14
|
+
readonly offline?: boolean;
|
|
15
|
+
}): Promise<AzureAIFoundryDecisionModel>;
|
|
16
|
+
}
|
|
17
|
+
export declare function createFoundryDecision(providerId: string, modelId: string, options: AzureAIFoundryDecisionOptions, transport: FoundryTransport, deployments: FoundryDeployments): AzureAIFoundryDecisionModel;
|
|
18
|
+
//# sourceMappingURL=decision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../src/decision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAKlB,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EACnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAE7D,OAAO,EAAa,KAAK,gBAAgB,EAAuB,MAAM,aAAa,CAAA;AAGnF,MAAM,WAAW,6BAA6B;IAC5C,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;CAC5C;AAED,MAAM,WAAW,2BAA4B,SAAQ,aAAa;IAChE,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAA;IAC9C,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;CACxF;AAiCD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,6BAA6B,EACtC,SAAS,EAAE,gBAAgB,EAC3B,WAAW,EAAE,kBAAkB,GAC9B,2BAA2B,CAe7B"}
|
package/dist/discovery.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type LanguageModelDefinition, type LanguageModelDefinitionCatalog } from "@sixb/core/models";
|
|
2
|
+
import type { AzureAIFoundryModelMetadata } from "./provider";
|
|
2
3
|
import type { FoundryProtocol } from "./transport";
|
|
3
4
|
import { type FoundryTransport } from "./transport";
|
|
4
5
|
export interface AzureAIFoundryDiscoveryOptions {
|
|
@@ -42,6 +43,8 @@ export interface ResolvedDeployment {
|
|
|
42
43
|
readonly deployment: AzureAIFoundryDeployment;
|
|
43
44
|
readonly discoveredAt: string;
|
|
44
45
|
}
|
|
46
|
+
/** What a resolved binding reports about its deployment; empty before resolution. */
|
|
47
|
+
export declare function deploymentMetadata(resolution?: ResolvedDeployment): AzureAIFoundryModelMetadata;
|
|
45
48
|
export declare class FoundryDeployments {
|
|
46
49
|
private readonly providerId;
|
|
47
50
|
private readonly transport;
|
package/dist/discovery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EAGpC,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAa,KAAK,gBAAgB,EAAa,MAAM,aAAa,CAAA;AAGzE,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC,iEAAiE;IACjE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,YAAY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E,CAAC,CAAA;CAC5D;AAQD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAA;IAC7C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,kBAAkB,GAAG,2BAA2B,CAc/F;AAWD,qBAAa,kBAAkB;IAO3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAP5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,MAAM,CAAC,CAAU;IACzB,OAAO,CAAC,SAAS,CAAI;IACrB,OAAO,CAAC,OAAO,CAAC,CAAmB;gBAGhB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,gBAAgB,EAC5C,SAAS,GAAE,8BAAmC;IAoB1C,IAAI,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,SAAS,wBAAwB,EAAE,CAAC;IAInE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAa1E,OAAO,CAAC,IAAI;YAoBE,aAAa;IAoE3B,OAAO,CAAC,OAAO;YA0BD,SAAS;YAoCT,QAAQ;IA8BtB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,WAAW;CAKpB"}
|
package/dist/embedding.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EmbeddingModel, type ModelCostEstimator, type ModelRateCard } from "@sixb/core/models";
|
|
2
2
|
import type { RemoteModelsDevCatalog } from "./catalog";
|
|
3
|
-
import type
|
|
3
|
+
import { type FoundryDeployments, type ResolvedDeployment } from "./discovery";
|
|
4
4
|
import type { AzureAIFoundryModelMetadata } from "./provider";
|
|
5
5
|
import { type FoundryTransport, type TransportOptions } from "./transport";
|
|
6
6
|
export type AzureAIFoundryEmbeddingTransportOptions = Pick<TransportOptions, "endpoint" | "apiKey" | "headers" | "fetch">;
|
package/dist/embedding.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../src/embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAQnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAC9E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../src/embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAQnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAC9E,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,EAEL,KAAK,gBAAgB,EAGrB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAA;AAGpB,MAAM,MAAM,uCAAuC,GAAG,IAAI,CACxD,gBAAgB,EAChB,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAC5C,CAAA;AAED,MAAM,WAAW,8BAA8B;IAC7C,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;IACnE,4FAA4F;IAC5F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;CAC5C;AAED,MAAM,WAAW,4BAA6B,SAAQ,cAAc;IAClE,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAA;IAC9C,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;CACzF;AAED,UAAU,mBAAoB,SAAQ,kBAAkB;IACtD,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAA;IAC1C,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAA;CACzC;AAED,+FAA+F;AAC/F,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,8BAA8B,EACvC,SAAS,EAAE,gBAAgB,EAC3B,WAAW,EAAE,kBAAkB,EAC/B,OAAO,EAAE,sBAAsB,EAC/B,UAAU,CAAC,EAAE,mBAAmB,GAC/B,4BAA4B,CAmJ9B"}
|
package/dist/image.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ImageCostEstimator, type ImageModel, type ModelRateCard } from "@sixb/core/models";
|
|
2
|
+
import { type FoundryDeployments } from "./discovery";
|
|
3
|
+
import type { AzureAIFoundryModelMetadata } from "./provider";
|
|
4
|
+
import { type FoundryTransport } from "./transport";
|
|
5
|
+
export interface AzureAIFoundryImageOptions {
|
|
6
|
+
/** When to pick this model, for people and the agent. */
|
|
7
|
+
readonly description?: string;
|
|
8
|
+
/** Deadline for one generation, response included. Default: 180,000 ms. */
|
|
9
|
+
readonly timeoutMs?: number;
|
|
10
|
+
readonly rateCard?: ModelRateCard;
|
|
11
|
+
readonly costEstimator?: ImageCostEstimator;
|
|
12
|
+
}
|
|
13
|
+
export interface AzureAIFoundryImageModel extends ImageModel {
|
|
14
|
+
readonly metadata: AzureAIFoundryModelMetadata;
|
|
15
|
+
resolve(options?: {
|
|
16
|
+
readonly offline?: boolean;
|
|
17
|
+
}): Promise<AzureAIFoundryImageModel>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createFoundryImage(providerId: string, modelId: string, options: AzureAIFoundryImageOptions, transport: FoundryTransport, deployments: FoundryDeployments): AzureAIFoundryImageModel;
|
|
20
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EAOf,KAAK,aAAa,EAInB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAA;AAE7D,OAAO,EAAa,KAAK,gBAAgB,EAAuB,MAAM,aAAa,CAAA;AAGnF,MAAM,WAAW,0BAA0B;IACzC,yDAAyD;IACzD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAA;CAC5C;AAED,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,QAAQ,CAAC,QAAQ,EAAE,2BAA2B,CAAA;IAC9C,OAAO,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;CACrF;AAoJD,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,0BAA0B,EACnC,SAAS,EAAE,gBAAgB,EAC3B,WAAW,EAAE,kBAAkB,GAC9B,wBAAwB,CAqB1B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export type { AzureAIFoundryCatalogOptions } from "./catalog";
|
|
2
|
+
export type { AzureAIFoundryDecisionModel, AzureAIFoundryDecisionOptions } from "./decision";
|
|
2
3
|
export type { AzureAIFoundryCatalog, AzureAIFoundryDeployment, AzureAIFoundryDiscoveryOptions, } from "./discovery";
|
|
3
4
|
export type { AzureAIFoundryEmbeddingModel, AzureAIFoundryEmbeddingOptions, AzureAIFoundryEmbeddingTransportOptions, } from "./embedding";
|
|
5
|
+
export type { AzureAIFoundryImageModel, AzureAIFoundryImageOptions } from "./image";
|
|
4
6
|
export type { AzureAIFoundryChatOptions, AzureAIFoundryMessagesOptions, AzureAIFoundryModel, AzureAIFoundryModelMetadata, AzureAIFoundryModelOptions, AzureAIFoundryOptions, AzureAIFoundryProvider, } from "./provider";
|
|
5
7
|
export { createAzureAIFoundry } from "./provider";
|
|
8
|
+
export type { AzureAIFoundryRerankingModel, AzureAIFoundryRerankingOptions } from "./reranking";
|
|
9
|
+
export type { AzureAIFoundrySpeechModel, AzureAIFoundrySpeechOptions } from "./speech";
|
|
10
|
+
export type { AzureAIFoundryTranscriptionModel, AzureAIFoundryTranscriptionOptions, } from "./transcription";
|
|
6
11
|
export type { FoundryProtocol } from "./transport";
|
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAA;AAC7D,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,4BAA4B,EAC5B,8BAA8B,EAC9B,uCAAuC,GACxC,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,yBAAyB,EACzB,6BAA6B,E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