@broberg/ai-sdk 0.36.3 → 0.36.4
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/index.d.ts +14 -3
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,17 @@ export { AvailabilitySource, AvailabilityStatus, ModelStatus, ModelUnavailableEr
|
|
|
15
15
|
* it passes every OpenRouter call. Only `region === "eu"` may be treated as EU-resident.
|
|
16
16
|
*/
|
|
17
17
|
type Region = "eu" | "us" | "cn" | "unknown";
|
|
18
|
+
/** Region of the endpoint a call will actually hit. Never throws — a residency
|
|
19
|
+
* reading must not be able to break a call that already succeeded. */
|
|
20
|
+
declare function regionOfHost(url: string | undefined): Region;
|
|
21
|
+
/** Classify a provider REGION STRING — a Vertex/GCP location like `europe-west1`, or
|
|
22
|
+
* an Azure region like `westeurope`. Anything unrecognised is `"unknown"`: a region
|
|
23
|
+
* name we have never seen is exactly the case where guessing is most tempting and
|
|
24
|
+
* least defensible. Never throws — a residency reading must not be able to break a
|
|
25
|
+
* call that already succeeded. */
|
|
26
|
+
declare function classifyRegionName(name: string | undefined): Region;
|
|
27
|
+
/** Region for an adapter whose endpoint is fixed. Unknown provider → `"unknown"`. */
|
|
28
|
+
declare function regionOfProvider(provider: string): Region;
|
|
18
29
|
|
|
19
30
|
/** How a call reaches the model. `http` = provider REST API; `subprocess` = local
|
|
20
31
|
* `claude -p` CLI (Max plan, costUsd 0). */
|
|
@@ -2178,8 +2189,8 @@ declare const falStubAdapter: ProviderAdapter;
|
|
|
2178
2189
|
* wires the live adapters. */
|
|
2179
2190
|
declare const stubProviders: Record<string, ProviderAdapter>;
|
|
2180
2191
|
|
|
2181
|
-
declare const VERSION: "0.36.
|
|
2182
|
-
declare const SDK_TAG: "@broberg/ai-sdk@0.36.
|
|
2192
|
+
declare const VERSION: "0.36.4";
|
|
2193
|
+
declare const SDK_TAG: "@broberg/ai-sdk@0.36.4";
|
|
2183
2194
|
|
|
2184
2195
|
/** Built-in defaults. Every entry is overridable via AiConfig.defaults or a
|
|
2185
2196
|
* per-call override.
|
|
@@ -2590,4 +2601,4 @@ interface StreamTransportRequest extends TransportRequest {
|
|
|
2590
2601
|
*/
|
|
2591
2602
|
declare function streamTransport(req: StreamTransportRequest): AsyncIterable<string>;
|
|
2592
2603
|
|
|
2593
|
-
export { AZURE_DANISH_VOICES, AZURE_DANISH_VOICE_LIST, type AiClient, type AiConfig, type AzureVoiceInfo, type BatchJob, type BatchRequestItem, type BatchResultItem, type BflAdapterConfig, type BflCredits, type BudgetConfig, BudgetExceededError, BudgetGuard, type BudgetStore, type CallOptions, type Capability, type ChatInput, type ChatRequest, type ChatResult, type ChatStreamEvent, type CheckVoiceOptions, type ClassifyInput, type ClassifyResult, type ContentPart, type Contracts, type CostQuery, type CostSink, type CostSummary, type CostSummaryQuery, type CostTimeseriesQuery, DEFAULT_TIER_MAP, type DesignInput, type DesignResult, type DialogueRequest, type DialogueTurn, type DiscordSinkConfig, ELEVENLABS_DANISH_VOICES, type EmbeddingInput, type EmbeddingRequest, type EmbeddingResult, type ExtractInput, type ExtractResult, type FalAdapterConfig, type HttpResponse, type ImageInput, type ImageRequest, type ImageResult, type LoraWeight, type Message, type MockupInput, type MockupResult, type ModerationInput, type ModerationItem, type ModerationRequest, type ModerationResult, type OcrInput, type OcrPage, type OcrRequest, type OcrResult, type OpenAICompatibleConfig, type PodcastInput, type PodcastResult, type PricingEntry, type ProviderAdapter, type RefreshOptions, type RefreshResult, type RerankInput, type RerankResult, type Role, SDK_TAG, type SqliteBudgetStoreConfig, type SqliteSinkConfig, StreamHttpError, type SubprocessResponse, type Tier, type TierSpec, type Tool, type ToolCall, type TrainStyleInput, type TrainStyleRequest, type TrainStyleResult, type TranscribeInput, type TranscribeRequest, type TranscribeResult, type TranslateInput, type TranslateResult, type Transport, type TransportRequest, type TransportResponse, type TtsInput, type TtsRequest, type UpmetricsCostClientConfig, UpmetricsCostError, type UpmetricsCostRow, type UpmetricsCostSummary, type UpmetricsCostTimeseries, type UpmetricsSinkConfig, type Usage, VERSION, type VideoInput, type VisionInput, type VoiceInfo, type VoiceProvider, type VoiceResolveResult, type VoiceStatus, VoiceUnavailableError, aiConfigSchema, anthropicAdapter, anthropicApiAdapter, anthropicSubprocessAdapter, azureAdapter, bflAdapter, bflCredits, chatInputSchema, checkVoice, computeCost, createAI, deepinfraAdapter, deeplAdapter, deepseekAdapter, defaultProviders, discordSink, elevenlabsAdapter, embeddingInputSchema, falAdapter, falStubAdapter, freshUsage, fromProviderToolCall, geminiAdapter, getCostSummary, getPrice, httpTransport, imageInputSchema, listAzureDanishVoices, listVoices, makeContracts, makeOpenAICompatibleAdapter, messageSchema, mistralAdapter, mistralStubAdapter, multiSink, noopSink, openaiAdapter, openaiStubAdapter, openrouterAdapter, parseClaudeCliJson, parseJsonLoose, refreshAvailability, requestyAdapter, resetRefreshState, resetRegistry, resolveAzureVoice, resolveTier, resolveVoice, sqliteBudgetStore, sqliteSink, streamTransport, stubProviders, subprocessTransport, tierSpecSchema, toProviderTools, toolSchema, translateInputSchema, upmetricsCostClient, upmetricsSink, usdFromMicro, vertexAdapter, visionInputSchema };
|
|
2604
|
+
export { AZURE_DANISH_VOICES, AZURE_DANISH_VOICE_LIST, type AiClient, type AiConfig, type AzureVoiceInfo, type BatchJob, type BatchRequestItem, type BatchResultItem, type BflAdapterConfig, type BflCredits, type BudgetConfig, BudgetExceededError, BudgetGuard, type BudgetStore, type CallOptions, type Capability, type ChatInput, type ChatRequest, type ChatResult, type ChatStreamEvent, type CheckVoiceOptions, type ClassifyInput, type ClassifyResult, type ContentPart, type Contracts, type CostQuery, type CostSink, type CostSummary, type CostSummaryQuery, type CostTimeseriesQuery, DEFAULT_TIER_MAP, type DesignInput, type DesignResult, type DialogueRequest, type DialogueTurn, type DiscordSinkConfig, ELEVENLABS_DANISH_VOICES, type EmbeddingInput, type EmbeddingRequest, type EmbeddingResult, type ExtractInput, type ExtractResult, type FalAdapterConfig, type HttpResponse, type ImageInput, type ImageRequest, type ImageResult, type LoraWeight, type Message, type MockupInput, type MockupResult, type ModerationInput, type ModerationItem, type ModerationRequest, type ModerationResult, type OcrInput, type OcrPage, type OcrRequest, type OcrResult, type OpenAICompatibleConfig, type PodcastInput, type PodcastResult, type PricingEntry, type ProviderAdapter, type RefreshOptions, type RefreshResult, type Region, type RerankInput, type RerankResult, type Role, SDK_TAG, type SqliteBudgetStoreConfig, type SqliteSinkConfig, StreamHttpError, type SubprocessResponse, type Tier, type TierSpec, type Tool, type ToolCall, type TrainStyleInput, type TrainStyleRequest, type TrainStyleResult, type TranscribeInput, type TranscribeRequest, type TranscribeResult, type TranslateInput, type TranslateResult, type Transport, type TransportRequest, type TransportResponse, type TtsInput, type TtsRequest, type UpmetricsCostClientConfig, UpmetricsCostError, type UpmetricsCostRow, type UpmetricsCostSummary, type UpmetricsCostTimeseries, type UpmetricsSinkConfig, type Usage, VERSION, type VideoInput, type VisionInput, type VoiceInfo, type VoiceProvider, type VoiceResolveResult, type VoiceStatus, VoiceUnavailableError, aiConfigSchema, anthropicAdapter, anthropicApiAdapter, anthropicSubprocessAdapter, azureAdapter, bflAdapter, bflCredits, chatInputSchema, checkVoice, classifyRegionName, computeCost, createAI, deepinfraAdapter, deeplAdapter, deepseekAdapter, defaultProviders, discordSink, elevenlabsAdapter, embeddingInputSchema, falAdapter, falStubAdapter, freshUsage, fromProviderToolCall, geminiAdapter, getCostSummary, getPrice, httpTransport, imageInputSchema, listAzureDanishVoices, listVoices, makeContracts, makeOpenAICompatibleAdapter, messageSchema, mistralAdapter, mistralStubAdapter, multiSink, noopSink, openaiAdapter, openaiStubAdapter, openrouterAdapter, parseClaudeCliJson, parseJsonLoose, refreshAvailability, regionOfHost, regionOfProvider, requestyAdapter, resetRefreshState, resetRegistry, resolveAzureVoice, resolveTier, resolveVoice, sqliteBudgetStore, sqliteSink, streamTransport, stubProviders, subprocessTransport, tierSpecSchema, toProviderTools, toolSchema, translateInputSchema, upmetricsCostClient, upmetricsSink, usdFromMicro, vertexAdapter, visionInputSchema };
|
package/dist/index.js
CHANGED
|
@@ -2986,8 +2986,8 @@ var aiConfigSchema = z.object({
|
|
|
2986
2986
|
});
|
|
2987
2987
|
|
|
2988
2988
|
// src/version.ts
|
|
2989
|
-
var VERSION = "0.36.
|
|
2990
|
-
var SDK_TAG = "@broberg/ai-sdk@0.36.
|
|
2989
|
+
var VERSION = "0.36.4";
|
|
2990
|
+
var SDK_TAG = "@broberg/ai-sdk@0.36.4";
|
|
2991
2991
|
|
|
2992
2992
|
// src/cost/sinks/upmetrics.ts
|
|
2993
2993
|
function upmetricsSink(config) {
|
|
@@ -3991,6 +3991,7 @@ export {
|
|
|
3991
3991
|
bflCredits,
|
|
3992
3992
|
chatInputSchema,
|
|
3993
3993
|
checkVoice,
|
|
3994
|
+
classifyRegionName,
|
|
3994
3995
|
computeCost,
|
|
3995
3996
|
createAI,
|
|
3996
3997
|
deepinfraAdapter,
|
|
@@ -4025,6 +4026,8 @@ export {
|
|
|
4025
4026
|
parseClaudeCliJson,
|
|
4026
4027
|
parseJsonLoose,
|
|
4027
4028
|
refreshAvailability,
|
|
4029
|
+
regionOfHost,
|
|
4030
|
+
regionOfProvider,
|
|
4028
4031
|
requestyAdapter,
|
|
4029
4032
|
resetRefreshState,
|
|
4030
4033
|
resetRegistry,
|