@sixb/azure-ai-foundry 0.2.5 → 0.2.7
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 +66 -33
- package/dist/accounting.d.ts +5 -0
- package/dist/accounting.d.ts.map +1 -1
- package/dist/caching.d.ts +34 -0
- package/dist/caching.d.ts.map +1 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/chat-accounting.d.ts.map +1 -1
- package/dist/chat-request.d.ts +2 -1
- package/dist/chat-request.d.ts.map +1 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/embedding.d.ts +1 -3
- package/dist/embedding.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +255 -113
- package/dist/index.js.map +17 -16
- package/dist/kinds.d.ts.map +1 -1
- package/dist/messages-request.d.ts.map +1 -1
- package/dist/provider.d.ts +10 -5
- package/dist/provider.d.ts.map +1 -1
- package/dist/request.d.ts +6 -2
- package/dist/request.d.ts.map +1 -1
- package/dist/resolution.d.ts.map +1 -1
- package/dist/transport.d.ts +30 -3
- package/dist/transport.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/accounting.ts +33 -11
- package/src/caching.ts +80 -0
- package/src/catalog.ts +15 -4
- package/src/chat-accounting.ts +12 -9
- package/src/chat-request.ts +14 -3
- package/src/discovery.ts +6 -0
- package/src/embedding.ts +1 -13
- package/src/index.ts +2 -6
- package/src/kinds.ts +0 -9
- package/src/messages-accounting.ts +6 -1
- package/src/messages-request.ts +32 -24
- package/src/provider.ts +65 -50
- package/src/request.ts +56 -23
- package/src/resolution.ts +13 -14
- package/src/transport.ts +130 -31
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @sixb/azure-ai-foundry
|
|
2
2
|
|
|
3
|
-
Azure AI Foundry models for Sixb. A project URL and
|
|
4
|
-
model capabilities, limits, reasoning controls, and reference prices from
|
|
3
|
+
Azure AI Foundry models for Sixb. A project URL and its key, or an Entra ID credential, resolve
|
|
4
|
+
Azure deployments into model capabilities, limits, reasoning controls, and reference prices from
|
|
5
|
+
[models.dev](https://models.dev).
|
|
5
6
|
Language, embedding, decision, transcription, reranking, speech and image models are supported.
|
|
6
7
|
|
|
7
8
|
## Install
|
|
@@ -15,24 +16,39 @@ bun add @sixb/azure-ai-foundry
|
|
|
15
16
|
```ts
|
|
16
17
|
import { createAzureAIFoundry } from "@sixb/azure-ai-foundry"
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
// Reads AZURE_AI_FOUNDRY_ENDPOINT, the project endpoint from the Foundry portal
|
|
20
|
+
// (https://my-resource.services.ai.azure.com/api/projects/my-project),
|
|
21
|
+
// and AZURE_AI_FOUNDRY_API_KEY, its key.
|
|
22
|
+
const foundry = createAzureAIFoundry()
|
|
22
23
|
|
|
23
24
|
const model = foundry("production") // Your Azure deployment name.
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
Or pass them, or sign in with Entra ID instead of a key, such as a managed identity in production
|
|
28
|
+
and `az login` on your computer:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
createAzureAIFoundry({ endpoint: "https://my-resource.services.ai.azure.com/api/projects/my-project", apiKey })
|
|
32
|
+
|
|
33
|
+
import { DefaultAzureCredential } from "@azure/identity"
|
|
34
|
+
createAzureAIFoundry({ credential: new DefaultAzureCredential() })
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The project URL tells Sixb what is deployed; every model call goes to the resource that owns the
|
|
38
|
+
project, `https://my-resource.services.ai.azure.com`, with the same key or token.
|
|
39
|
+
|
|
40
|
+
| Option | Rule |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `endpoint` | The project URL. Default: `AZURE_AI_FOUNDRY_ENDPOINT` |
|
|
43
|
+
| `apiKey` | A string, or a function that receives an abort signal and runs for each Azure HTTP attempt. Default, without `credential`: `AZURE_AI_FOUNDRY_API_KEY`, read for each attempt |
|
|
44
|
+
| `credential` | Anything with `getToken()`, such as `@azure/identity`'s credentials. Sixb asks it for a `https://ai.azure.com` token, the one audience discovery and every model call accept, and reuses it. It renews the token in the background at the credential's refresh time or two minutes before expiry, as Azure's SDKs do; if a renewal fails, calls keep the current token until it expires. The identity needs the Foundry User role on the resource |
|
|
29
45
|
|
|
30
46
|
Language model resolution follows this sequence:
|
|
31
47
|
|
|
32
48
|
1. Find the deployment in the Azure project and read its model name, version, and publisher.
|
|
33
49
|
2. Look up the underlying model in models.dev.
|
|
34
50
|
3. Build the Sixb model definition and cost estimator, intersecting capabilities with adapter support.
|
|
35
|
-
4. Call
|
|
51
|
+
4. Call the project's resource using the deployment name.
|
|
36
52
|
|
|
37
53
|
Construction is network-free. `resolve()` returns a pinned model for worker admission and
|
|
38
54
|
execution. A direct `stream()` resolves and pins the handle before inference. Discovery failures
|
|
@@ -43,18 +59,9 @@ missing capabilities and prices remain unknown. Catalog listings and refresh rep
|
|
|
43
59
|
|
|
44
60
|
## Embeddings
|
|
45
61
|
|
|
46
|
-
|
|
62
|
+
Deploy an embedding model in the project and declare it with the model it runs:
|
|
47
63
|
|
|
48
64
|
```ts
|
|
49
|
-
const foundry = createAzureAIFoundry({
|
|
50
|
-
endpoint: "https://my-resource.services.ai.azure.com/api/projects/my-project",
|
|
51
|
-
apiKey: () => process.env.AZURE_AI_FOUNDRY_API_KEY,
|
|
52
|
-
embeddings: {
|
|
53
|
-
endpoint: "https://my-resource.openai.azure.com/openai/v1",
|
|
54
|
-
apiKey: () => process.env.AZURE_OPENAI_API_KEY,
|
|
55
|
-
},
|
|
56
|
-
})
|
|
57
|
-
|
|
58
65
|
export const productEmbedding = foundry.embedding("product-embedding", {
|
|
59
66
|
model: { name: "text-embedding-3-small", version: "1" },
|
|
60
67
|
dimensions: 1536,
|
|
@@ -64,8 +71,6 @@ export const productEmbedding = foundry.embedding("product-embedding", {
|
|
|
64
71
|
Register this binding under `models.embedding` and use it in an ObjectType's vector profile.
|
|
65
72
|
Set `model` to your deployment's actual model name and version. A mismatch blocks inference;
|
|
66
73
|
changing the declared model or version excludes previously stored vectors from search.
|
|
67
|
-
The deployment name must exist in the project and refer to the same deployment on the configured
|
|
68
|
-
resource. For connected deployments, supply the owning resource's endpoint and key.
|
|
69
74
|
|
|
70
75
|
| Deployed model | Dimensions |
|
|
71
76
|
| --- | --- |
|
|
@@ -318,16 +323,24 @@ Use `definition.publisher` to override the displayed author for an unrecognized
|
|
|
318
323
|
## Protocols and controls
|
|
319
324
|
|
|
320
325
|
```ts
|
|
321
|
-
foundry("production")
|
|
322
|
-
foundry
|
|
326
|
+
foundry("gpt-production") // Responses: Azure reports the publisher as OpenAI.
|
|
327
|
+
foundry("claude-production") // Messages: Azure reports Anthropic.
|
|
328
|
+
foundry("kimi-production") // Chat: every other publisher.
|
|
329
|
+
|
|
330
|
+
foundry.responses("production") // Choose the protocol yourself.
|
|
323
331
|
foundry.chat("production")
|
|
324
332
|
foundry.messages("claude-production")
|
|
325
333
|
```
|
|
326
334
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
335
|
+
The publisher decides because each protocol serves some models only in part: OpenAI models reason
|
|
336
|
+
with tools on Responses but not on Chat, Claude answers Messages but not Chat, and models such as
|
|
337
|
+
Kimi and DeepSeek take a reasoning effort on Chat but not on Responses. Azure's deployment records
|
|
338
|
+
cannot tell them apart: they report `chat_completion` for every chat model, Claude included.
|
|
339
|
+
|
|
340
|
+
Every protocol calls the project's resource: `/openai/v1/responses`, `/openai/v1/chat/completions`
|
|
341
|
+
and `/anthropic/v1/messages`. The project's own inference path is not used: it answers through
|
|
342
|
+
another service, which trails new models. A deployment from a project connection runs on another
|
|
343
|
+
resource and is rejected; configure a provider with that resource's project URL.
|
|
331
344
|
|
|
332
345
|
| Feature | Responses | Chat | Messages |
|
|
333
346
|
| --- | --- | --- | --- |
|
|
@@ -338,9 +351,11 @@ the provider with that resource's own project URL and API key.
|
|
|
338
351
|
| Exact reasoning budgets | — | — | Manual thinking |
|
|
339
352
|
|
|
340
353
|
Features require both model capability and adapter support. Unsupported controls fail locally.
|
|
341
|
-
Responses use full-history replay with `store: false` and encrypted reasoning.
|
|
342
|
-
the
|
|
343
|
-
|
|
354
|
+
Responses use full-history replay with `store: false` and encrypted reasoning. Reasoning and other
|
|
355
|
+
replay state go back only to the resource, deployment and protocol that produced them: when a
|
|
356
|
+
conversation switches models, the next one gets its text and tool calls without the previous
|
|
357
|
+
model's reasoning. Chat compatibility is selected with `profile`; DeepSeek reasoning replay uses
|
|
358
|
+
`reasoningReplay: "tool-continuation"`.
|
|
344
359
|
|
|
345
360
|
Every protocol accepts `reasoning`, the level Sixb applies when the model runs without an explicit
|
|
346
361
|
choice, such as `foundry.chat("production", { reasoning: "low" })`, and `name` and `description`,
|
|
@@ -396,14 +411,32 @@ direct-Fireworks reference prices. Supply your own rates for effective Azure pri
|
|
|
396
411
|
| Legacy pricing | `context_over_200k` must agree with the exact tier |
|
|
397
412
|
| Reservations | Conservative highest rates; same pinned card as completed estimates |
|
|
398
413
|
| Cache and reasoning | Partitions of totals; never counted twice |
|
|
399
|
-
|
|
|
400
|
-
| Messages cache TTLs |
|
|
414
|
+
| Cache writes | Priced at the write rate: GPT-5.6 and later report them in `cache_write_tokens`, apart from reads, on Responses and Chat. Zero writes need no price; positive writes without a rate stay unpriceable |
|
|
415
|
+
| Messages cache TTLs | Five-minute writes at models.dev's write rate; one-hour writes at twice the input rate, as Anthropic bills Claude (Azure publishes no Claude meter). Reservations hold the one-hour rate |
|
|
401
416
|
| Missing or ambiguous usage/prices | Explicitly unpriceable; missing counters are not zero |
|
|
402
417
|
| Unknown billing dimensions | Require a custom estimator |
|
|
403
418
|
| Response model mismatch | Not priced using the requested model's rates |
|
|
404
419
|
| Reasoning counts | Positive reports retained; zero trusted automatically only for OpenAI |
|
|
405
420
|
| `reasoningUsage` override | `"reported"` trusts reported zero; `"unknown"` omits reasoning partitions |
|
|
406
421
|
|
|
422
|
+
## Prompt caching
|
|
423
|
+
|
|
424
|
+
Sixb asks each protocol to cache what it will read again, from the caching intent the agent sends
|
|
425
|
+
with every request: a conversation's key, and a lifetime that outlasts a pause between turns.
|
|
426
|
+
|
|
427
|
+
| Deployment | Agent steps and conversation turns | One-shot requests (no tools, no earlier answer) |
|
|
428
|
+
| --- | --- | --- |
|
|
429
|
+
| Claude (Messages) | The last tool, the last system block and the conversation tail are marked: an hour for a conversation, five minutes otherwise | Nothing marked; Claude caches nothing unmarked |
|
|
430
|
+
| GPT-5.6 and later (Responses, Chat) | Azure's automatic caching for its default 30 minutes, with the conversation's `prompt_cache_key` | `prompt_cache_options: { mode: "explicit" }`, which writes nothing: a write costs 1.25 times input |
|
|
431
|
+
| Earlier OpenAI models | Automatic caching with `prompt_cache_key`, kept 24 hours for a conversation at no extra price | Automatic caching; writes are free |
|
|
432
|
+
| Other publishers (Chat) | Automatic caching with `prompt_cache_key` | Automatic caching |
|
|
433
|
+
|
|
434
|
+
GPT-5.6 and later keep 30 minutes for a conversation too: a 12-hour cache would double the price of
|
|
435
|
+
every write. `caching: "off"` marks and writes nothing. A binding's own `cache_control`,
|
|
436
|
+
`prompt_cache_key`, `prompt_cache_retention` or `prompt_cache_options` in `request` wins. A setting
|
|
437
|
+
Azure refuses for a deployment is dropped from that deployment's later requests instead of failing
|
|
438
|
+
them.
|
|
439
|
+
|
|
407
440
|
## Transport and caching
|
|
408
441
|
|
|
409
442
|
| Option / behavior | Default / contract |
|
package/dist/accounting.d.ts
CHANGED
|
@@ -6,4 +6,9 @@ export type PricedEstimator = ModelCostEstimator & {
|
|
|
6
6
|
};
|
|
7
7
|
export declare function foundryEstimator(card: ModelRateCard | undefined, request: JsonObject | undefined, modelName?: string, modelVersion?: string, aliases?: readonly string[]): PricedEstimator;
|
|
8
8
|
export declare function tokenEstimator(card: ModelRateCard | undefined, request: JsonObject | undefined, requestKeys: readonly string[], tokenMeters: (raw: JsonObject | undefined) => boolean, modelName?: string, modelVersion?: string, aliases?: readonly string[]): PricedEstimator;
|
|
9
|
+
/**
|
|
10
|
+
* Writes by cache lifetime, as GPT-5.6 and later report them. The catalog's write rate is the
|
|
11
|
+
* default 30 minutes'; a 12-hour write costs twice that, so any makes the call unpriceable.
|
|
12
|
+
*/
|
|
13
|
+
export declare function defaultLifetimeWrites(details: unknown): boolean;
|
|
9
14
|
//# sourceMappingURL=accounting.d.ts.map
|
package/dist/accounting.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounting.d.ts","sourceRoot":"","sources":["../src/accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEhB,MAAM,mBAAmB,CAAA;AAI1B,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,GAAG,SAAS,EAC3B,iBAAiB,EAAE,OAAO,GAAG,SAAS,GACrC,UAAU,
|
|
1
|
+
{"version":3,"file":"accounting.d.ts","sourceRoot":"","sources":["../src/accounting.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEhB,MAAM,mBAAmB,CAAA;AAI1B,wBAAgB,YAAY,CAC1B,GAAG,EAAE,UAAU,GAAG,SAAS,EAC3B,iBAAiB,EAAE,OAAO,GAAG,SAAS,GACrC,UAAU,CAgCZ;AAED,yFAAyF;AACzF,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;CAAE,CAAA;AAExF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,GAAG,SAAS,EAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,eAAe,CAWjB;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,GAAG,SAAS,EAC/B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,WAAW,EAAE,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,KAAK,OAAO,EACrD,SAAS,CAAC,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,eAAe,CAoBjB;AA6BD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAU/D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { JsonObject, ModelCaching, ModelMessage } from "@sixb/core/models";
|
|
2
|
+
import type { AzureAIFoundryDeployment } from "./discovery";
|
|
3
|
+
/**
|
|
4
|
+
* Responses and Chat cache a prompt of 1,024 tokens or more on their own, so these settings only
|
|
5
|
+
* say what Sixb knows about the request (measured on Azure, November 2026):
|
|
6
|
+
*
|
|
7
|
+
* - `prompt_cache_key`: the intent's key, such as a conversation's, which keeps its requests where
|
|
8
|
+
* their prefix is cached. Every model tried accepts it; Kimi hit the cache one call sooner.
|
|
9
|
+
* - A one-shot request (no tools and no earlier answer) on a model that bills cache writes
|
|
10
|
+
* (GPT-5.6 and later) asks for explicit caching with no breakpoints, which writes nothing:
|
|
11
|
+
* nothing reads its prefix again, and a write costs 1.25 times input. `caching: "off"` too.
|
|
12
|
+
* - A conversation's `"long"` lifetime keeps an earlier OpenAI model's cache for 24 hours instead
|
|
13
|
+
* of its 5 to 10 idle minutes, at the same price. GPT-5.6 and later keep their 30-minute default:
|
|
14
|
+
* twelve hours would double the price of every write to cover longer pauses.
|
|
15
|
+
*
|
|
16
|
+
* The binding's own `request` settings win, and so does a refusal.
|
|
17
|
+
*/
|
|
18
|
+
export declare function promptCaching(input: {
|
|
19
|
+
readonly caching: ModelCaching | undefined;
|
|
20
|
+
readonly messages: readonly ModelMessage[];
|
|
21
|
+
readonly localTools: number;
|
|
22
|
+
readonly deployment: AzureAIFoundryDeployment | undefined;
|
|
23
|
+
readonly request: JsonObject | undefined;
|
|
24
|
+
readonly scope: string;
|
|
25
|
+
}): JsonObject;
|
|
26
|
+
/**
|
|
27
|
+
* Remember a caching setting Sixb added to the sent body that Azure refused with a 400 naming it;
|
|
28
|
+
* whether there was one, so the request can go again without it. The binding's own are its call.
|
|
29
|
+
*/
|
|
30
|
+
export declare function refusedCaching(error: {
|
|
31
|
+
readonly status?: number;
|
|
32
|
+
readonly message: string;
|
|
33
|
+
}, body: JsonObject, request: JsonObject | undefined, scope: string): boolean;
|
|
34
|
+
//# sourceMappingURL=caching.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caching.d.ts","sourceRoot":"","sources":["../src/caching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAE/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAW3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,CAAA;IAC1C,QAAQ,CAAC,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,wBAAwB,GAAG,SAAS,CAAA;IACzD,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB,GAAG,UAAU,CAsBb;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAC7D,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,UAAU,GAAG,SAAS,EAC/B,KAAK,EAAE,MAAM,GACZ,OAAO,CAWT"}
|
package/dist/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAInB,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAInB,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAA;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAGlD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC1F;AACD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,eAAe,EAAE,OAAO,GAAG,cAAc,CAAA;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;IACnC,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAA;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,eAAe,EAAE,OAAO,GAAG,cAAc,CAAA;IAClD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAA;CAClC;AAID,6FAA6F;AAC7F,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAA8B;IAC9C,OAAO,CAAC,QAAQ,CAAI;IACpB,OAAO,CAAC,OAAO,CAAC,CAAkC;IAClD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;gBAC1C,OAAO,GAAE,4BAAiC;IAYtD,UAAU;IAGJ,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAGrE,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAU7F,oFAAoF;IAC9E,MAAM,CAAC,OAAO,UAAQ,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;IA2BlF,OAAO,CAAC,IAAI;YAcE,WAAW;CA0F1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-accounting.d.ts","sourceRoot":"","sources":["../src/chat-accounting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAsB,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAClG,OAAO,
|
|
1
|
+
{"version":3,"file":"chat-accounting.d.ts","sourceRoot":"","sources":["../src/chat-accounting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAsB,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAyB,KAAK,eAAe,EAAkB,MAAM,cAAc,CAAA;AAK1F,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,UAAU,GAAG,SAAS,EAC3B,iBAAiB,EAAE,OAAO,GAAG,SAAS,GACrC,UAAU,CA4BZ;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,UAAU,GAAG,SAAS,EAC/B,SAAS,CAAC,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,GAC1B,eAAe,CAmBjB"}
|
package/dist/chat-request.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JsonObject, type LanguageModelDefinition, type LanguageModelRequest } from "@sixb/core/models";
|
|
2
|
+
import type { AzureAIFoundryDeployment } from "./discovery";
|
|
2
3
|
export interface ChatRequestOptions {
|
|
3
4
|
readonly maxOutputTokens?: number;
|
|
4
5
|
readonly maxInputFileBytes?: number;
|
|
@@ -14,5 +15,5 @@ export interface ChatRequestOptions {
|
|
|
14
15
|
readonly reasoningReplay?: "omit" | "tool-continuation";
|
|
15
16
|
}
|
|
16
17
|
export declare function validateChatOptions(options: ChatRequestOptions): void;
|
|
17
|
-
export declare function foundryChatRequest(request: LanguageModelRequest, definition: LanguageModelDefinition, options: ChatRequestOptions, scope: string): JsonObject;
|
|
18
|
+
export declare function foundryChatRequest(request: LanguageModelRequest, definition: LanguageModelDefinition, options: ChatRequestOptions, scope: string, deployment?: AzureAIFoundryDeployment): JsonObject;
|
|
18
19
|
//# sourceMappingURL=chat-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-request.d.ts","sourceRoot":"","sources":["../src/chat-request.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAG1B,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"chat-request.d.ts","sourceRoot":"","sources":["../src/chat-request.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAG1B,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAK3D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,CAAA;IAC7B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC5C,wGAAwG;IACxG,QAAQ,CAAC,kBAAkB,CAAC,EAAE,uBAAuB,GAAG,YAAY,CAAA;IACpE,oGAAoG;IACpG,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAA;IAC/B,mGAAmG;IACnG,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAA;CACxD;AAwBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAiBrE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,uBAAuB,EACnC,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,wBAAwB,GACpC,UAAU,CA6FZ"}
|
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,
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],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AO,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkB1E,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
|
@@ -2,8 +2,7 @@ import { type EmbeddingModel, type ModelCostEstimator, type ModelRateCard } from
|
|
|
2
2
|
import type { RemoteModelsDevCatalog } from "./catalog";
|
|
3
3
|
import { type FoundryDeployments, type ResolvedDeployment } from "./discovery";
|
|
4
4
|
import type { AzureAIFoundryModelMetadata } from "./provider";
|
|
5
|
-
import { type FoundryTransport
|
|
6
|
-
export type AzureAIFoundryEmbeddingTransportOptions = Pick<TransportOptions, "endpoint" | "apiKey" | "headers" | "fetch">;
|
|
5
|
+
import { type FoundryTransport } from "./transport";
|
|
7
6
|
export interface AzureAIFoundryEmbeddingOptions {
|
|
8
7
|
/** Pin the actual model behind the deployment; discovery must match before inference. */
|
|
9
8
|
readonly model: {
|
|
@@ -25,7 +24,6 @@ interface EmbeddingResolution extends ResolvedDeployment {
|
|
|
25
24
|
readonly costEstimator: ModelCostEstimator;
|
|
26
25
|
readonly configurableDimensions: boolean;
|
|
27
26
|
}
|
|
28
|
-
/** Discovery uses project credentials; inference uses only the explicit resource transport. */
|
|
29
27
|
export declare function createFoundryEmbedding(providerId: string, modelId: string, options: AzureAIFoundryEmbeddingOptions, transport: FoundryTransport, deployments: FoundryDeployments, catalog: RemoteModelsDevCatalog, resolution?: EmbeddingResolution): AzureAIFoundryEmbeddingModel;
|
|
30
28
|
export {};
|
|
31
29
|
//# sourceMappingURL=embedding.d.ts.map
|
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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AAO,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,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/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export type { AzureAIFoundryCatalogOptions } from "./catalog";
|
|
2
2
|
export type { AzureAIFoundryDecisionModel, AzureAIFoundryDecisionOptions } from "./decision";
|
|
3
3
|
export type { AzureAIFoundryCatalog, AzureAIFoundryDeployment, AzureAIFoundryDiscoveryOptions, } from "./discovery";
|
|
4
|
-
export type { AzureAIFoundryEmbeddingModel, AzureAIFoundryEmbeddingOptions
|
|
4
|
+
export type { AzureAIFoundryEmbeddingModel, AzureAIFoundryEmbeddingOptions } from "./embedding";
|
|
5
5
|
export type { AzureAIFoundryImageModel, AzureAIFoundryImageOptions } from "./image";
|
|
6
6
|
export type { AzureAIFoundryChatOptions, AzureAIFoundryMessagesOptions, AzureAIFoundryModel, AzureAIFoundryModelMetadata, AzureAIFoundryModelOptions, AzureAIFoundryOptions, AzureAIFoundryProvider, } from "./provider";
|
|
7
7
|
export { createAzureAIFoundry } from "./provider";
|
|
8
8
|
export type { AzureAIFoundryRerankingModel, AzureAIFoundryRerankingOptions } from "./reranking";
|
|
9
9
|
export type { AzureAIFoundrySpeechModel, AzureAIFoundrySpeechOptions } from "./speech";
|
|
10
10
|
export type { AzureAIFoundryTranscriptionModel, AzureAIFoundryTranscriptionOptions, } from "./transcription";
|
|
11
|
-
export type { FoundryProtocol } from "./transport";
|
|
11
|
+
export type { AzureAIFoundryCredential, FoundryProtocol } from "./transport";
|
|
12
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,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC5F,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,aAAa,CAAA;AACpB,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAA;AAC7D,YAAY,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC5F,YAAY,EACV,qBAAqB,EACrB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAC/F,YAAY,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AACnF,YAAY,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,YAAY,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAC/F,YAAY,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtF,YAAY,EACV,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
|