@broberg/ai-sdk 0.69.2 → 0.69.3
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/dist/chunk-NDLYPW3M.js +460 -0
- package/dist/chunk-NDLYPW3M.js.map +1 -0
- package/dist/index.d.ts +12 -4
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/dist/pricing.js +1 -1
- package/dist/{registry-BpwItJ4i.d.ts → registry-rn-6k7Zt.d.ts} +1 -1
- package/dist/registry.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-GVWOYEKX.js +0 -460
- package/dist/chunk-GVWOYEKX.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CostSink, T as Tier, U as Usage, a as ChatResult, b as ChatStreamEvent, c as TranslateResult, I as ImageResult, A as AnimateResult, d as TrainStyleResult, E as EmbeddingResult, e as TranscribeResult, O as OcrResult, M as ModerationResult, J as JudgeResult, P as PodcastResult, B as BatchRequestItem, f as TierSpec, g as BatchJob, h as BatchResultItem, i as ProviderAdapter, j as ToolCall, k as Tool, l as Transport, m as Capability, R as Region, n as BudgetConfig, o as BudgetStore } from './registry-
|
|
2
|
-
export { p as AlignedWordTimings, q as AvailabilitySource, r as AvailabilityStatus, s as AzureWordBoundary, t as CallOptions, u as ChatRequest, v as ContentPart, D as DialogueRequest, w as DialogueTurn, x as EmbeddingRequest, y as ImageRequest, z as JudgeAnswer, F as JudgeChoiceAnswer, G as JudgeNoulAnswer, H as JudgeQuestion, K as JudgeScoreAnswer, L as LoraWeight, N as Message, Q as ModelStatus, S as ModelUnavailableError, V as ModerationItem, W as ModerationRequest, X as OcrPage, Y as OcrRequest, Z as ResolveOptions, _ as ResolveResult, $ as Role, a0 as TierDescription, a1 as TrainStyleRequest, a2 as TranscribeRequest, a3 as TtsRequest, a4 as WordTiming, a5 as alignWordTimings, a6 as classifyRegionName, a7 as describeTier, a8 as listModels, a9 as regionOfHost, aa as regionOfProvider, ab as resolveModel } from './registry-
|
|
1
|
+
import { C as CostSink, T as Tier, U as Usage, a as ChatResult, b as ChatStreamEvent, c as TranslateResult, I as ImageResult, A as AnimateResult, d as TrainStyleResult, E as EmbeddingResult, e as TranscribeResult, O as OcrResult, M as ModerationResult, J as JudgeResult, P as PodcastResult, B as BatchRequestItem, f as TierSpec, g as BatchJob, h as BatchResultItem, i as ProviderAdapter, j as ToolCall, k as Tool, l as Transport, m as Capability, R as Region, n as BudgetConfig, o as BudgetStore } from './registry-rn-6k7Zt.js';
|
|
2
|
+
export { p as AlignedWordTimings, q as AvailabilitySource, r as AvailabilityStatus, s as AzureWordBoundary, t as CallOptions, u as ChatRequest, v as ContentPart, D as DialogueRequest, w as DialogueTurn, x as EmbeddingRequest, y as ImageRequest, z as JudgeAnswer, F as JudgeChoiceAnswer, G as JudgeNoulAnswer, H as JudgeQuestion, K as JudgeScoreAnswer, L as LoraWeight, N as Message, Q as ModelStatus, S as ModelUnavailableError, V as ModerationItem, W as ModerationRequest, X as OcrPage, Y as OcrRequest, Z as ResolveOptions, _ as ResolveResult, $ as Role, a0 as TierDescription, a1 as TrainStyleRequest, a2 as TranscribeRequest, a3 as TtsRequest, a4 as WordTiming, a5 as alignWordTimings, a6 as classifyRegionName, a7 as describeTier, a8 as listModels, a9 as regionOfHost, aa as regionOfProvider, ab as resolveModel } from './registry-rn-6k7Zt.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export { CheapestQuery, CheapestResult, CheapestRow, DEFAULT_CLIP_SEC, MEDIA_PRICING_CHECKED_AT, MediaPrice, MediaUnit, PRICING_STALE_AFTER_DAYS, PriceKind, PricingFreshness, UnitFreshness, UpstreamStatus, cheapestModels, classifyKind, getMediaPrice, listMediaPrices, pricingFreshness, pricingGeneratedAt } from './pricing.js';
|
|
5
5
|
|
|
@@ -385,6 +385,8 @@ declare const chatInputSchema: z.ZodObject<{
|
|
|
385
385
|
temperature: z.ZodOptional<z.ZodNumber>;
|
|
386
386
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
387
387
|
none: "none";
|
|
388
|
+
low: "low";
|
|
389
|
+
medium: "medium";
|
|
388
390
|
high: "high";
|
|
389
391
|
}>>;
|
|
390
392
|
responseFormat: z.ZodOptional<z.ZodEnum<{
|
|
@@ -433,6 +435,12 @@ declare const visionInputSchema: z.ZodObject<{
|
|
|
433
435
|
prompt: z.ZodString;
|
|
434
436
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
435
437
|
system: z.ZodOptional<z.ZodString>;
|
|
438
|
+
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
439
|
+
none: "none";
|
|
440
|
+
low: "low";
|
|
441
|
+
medium: "medium";
|
|
442
|
+
high: "high";
|
|
443
|
+
}>>;
|
|
436
444
|
}, z.core.$strip>;
|
|
437
445
|
declare const videoInputSchema: z.ZodObject<{
|
|
438
446
|
tier: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1437,8 +1445,8 @@ declare const falStubAdapter: ProviderAdapter;
|
|
|
1437
1445
|
* wires the live adapters. */
|
|
1438
1446
|
declare const stubProviders: Record<string, ProviderAdapter>;
|
|
1439
1447
|
|
|
1440
|
-
declare const VERSION: "0.69.
|
|
1441
|
-
declare const SDK_TAG: "@broberg/ai-sdk@0.69.
|
|
1448
|
+
declare const VERSION: "0.69.3";
|
|
1449
|
+
declare const SDK_TAG: "@broberg/ai-sdk@0.69.3";
|
|
1442
1450
|
|
|
1443
1451
|
/** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
|
|
1444
1452
|
* per-call override.
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
listMediaPrices,
|
|
24
24
|
pricingFreshness,
|
|
25
25
|
pricingGeneratedAt
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-NDLYPW3M.js";
|
|
27
27
|
import {
|
|
28
28
|
PRICING,
|
|
29
29
|
getPrice
|
|
@@ -1141,7 +1141,7 @@ function buildChatBody(req, config) {
|
|
|
1141
1141
|
if (req.reasoningEffort !== void 0 && !config.supportsReasoningEffort) {
|
|
1142
1142
|
throw new Error(`${config.name} adapter: reasoningEffort is a Mistral option and is not supported here`);
|
|
1143
1143
|
}
|
|
1144
|
-
const effort = req.reasoningEffort ?? (config.supportsReasoningEffort && REASONS_BY_DEFAULT.has(req.spec.model) ? "
|
|
1144
|
+
const effort = req.reasoningEffort ?? (config.supportsReasoningEffort && REASONS_BY_DEFAULT.has(req.spec.model) ? "low" : void 0);
|
|
1145
1145
|
if (effort !== void 0) body.reasoning_effort = effort;
|
|
1146
1146
|
if (config.supportsPromptCacheKey && req.promptCache !== false) {
|
|
1147
1147
|
const k = req.promptCacheKey ?? autoCacheKey(req.messages);
|
|
@@ -3972,9 +3972,11 @@ var chatInputSchema = z.object({
|
|
|
3972
3972
|
tools: z.array(toolSchema).max(L.tools).optional(),
|
|
3973
3973
|
maxTokens: z.number().int().positive().optional(),
|
|
3974
3974
|
temperature: z.number().min(0).max(2).optional(),
|
|
3975
|
-
/** F074.3 — Mistral reasoning ("thinking") before the answer. Large 4 thinks
|
|
3976
|
-
* default; the SDK sends "
|
|
3977
|
-
|
|
3975
|
+
/** F074.3 / F085.5 — Mistral reasoning ("thinking") before the answer. Large 4 thinks
|
|
3976
|
+
* hard by default; the SDK sends "low" for it unless you ask. Since the 2026-10-29
|
|
3977
|
+
* Large 4 release Mistral REFUSES "none" for it (low/medium/high only — measured
|
|
3978
|
+
* 2026-10-31). Mistral only. */
|
|
3979
|
+
reasoningEffort: z.enum(["none", "low", "medium", "high"]).optional(),
|
|
3978
3980
|
/** "json" requests JSON-object output (OpenAI-compatible response_format). */
|
|
3979
3981
|
responseFormat: z.enum(["json", "text"]).optional(),
|
|
3980
3982
|
...callOptions
|
|
@@ -3986,6 +3988,8 @@ var visionInputSchema = z.object({
|
|
|
3986
3988
|
/** System instruction — drives instruction-following far better than stuffing
|
|
3987
3989
|
* rules into `prompt` for instruction-heavy vision tasks (e.g. a JSON critic). */
|
|
3988
3990
|
system: z.string().optional(),
|
|
3991
|
+
/** F085.5 — as on chat: Mistral reasoning effort (Large 4). Mistral only. */
|
|
3992
|
+
reasoningEffort: z.enum(["none", "low", "medium", "high"]).optional(),
|
|
3989
3993
|
...callOptions
|
|
3990
3994
|
});
|
|
3991
3995
|
var videoInputSchema = z.object({
|
|
@@ -4199,8 +4203,8 @@ var aiConfigSchema = z.object({
|
|
|
4199
4203
|
import { randomUUID } from "crypto";
|
|
4200
4204
|
|
|
4201
4205
|
// src/version.ts
|
|
4202
|
-
var VERSION = "0.69.
|
|
4203
|
-
var SDK_TAG = "@broberg/ai-sdk@0.69.
|
|
4206
|
+
var VERSION = "0.69.3";
|
|
4207
|
+
var SDK_TAG = "@broberg/ai-sdk@0.69.3";
|
|
4204
4208
|
|
|
4205
4209
|
// src/cost/sinks/upmetrics.ts
|
|
4206
4210
|
function isRetryableStatus(status) {
|
|
@@ -4835,7 +4839,7 @@ function createAI(config = {}) {
|
|
|
4835
4839
|
invoke: async (spec) => {
|
|
4836
4840
|
const adapter = pickProvider(spec.provider);
|
|
4837
4841
|
if (!adapter.vision) throw new Error(`createAI: provider "${spec.provider}" does not support vision`);
|
|
4838
|
-
return adapter.vision({ messages, spec });
|
|
4842
|
+
return adapter.vision({ messages, spec, reasoningEffort: input.reasoningEffort });
|
|
4839
4843
|
}
|
|
4840
4844
|
});
|
|
4841
4845
|
},
|