@axlsdk/axl 0.20.0 → 0.21.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 +7 -0
- package/dist/index.cjs +1452 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +131 -66
- package/dist/index.d.ts +131 -66
- package/dist/index.js +1452 -312
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -112,6 +112,8 @@ type StreamChunk = {
|
|
|
112
112
|
total_tokens: number;
|
|
113
113
|
reasoning_tokens?: number;
|
|
114
114
|
cached_tokens?: number;
|
|
115
|
+
/** Tokens written to a provider prompt cache during this call, when reported. */
|
|
116
|
+
cache_write_tokens?: number;
|
|
115
117
|
};
|
|
116
118
|
/** Estimated cost in USD for this call, computed the same way as ProviderResponse.cost. */
|
|
117
119
|
cost?: number;
|
|
@@ -859,6 +861,8 @@ type AxlEventBase = {
|
|
|
859
861
|
input?: number;
|
|
860
862
|
output?: number;
|
|
861
863
|
reasoning?: number;
|
|
864
|
+
cached?: number;
|
|
865
|
+
cacheWrite?: number;
|
|
862
866
|
};
|
|
863
867
|
/** Duration in ms (set on `_end` variants and a few single-point events). */
|
|
864
868
|
duration?: number;
|
|
@@ -944,6 +948,8 @@ type LegacyAxlEventPayloadV1 = (AxlEventBase & {
|
|
|
944
948
|
input?: number;
|
|
945
949
|
output?: number;
|
|
946
950
|
reasoning?: number;
|
|
951
|
+
cached?: number;
|
|
952
|
+
cacheWrite?: number;
|
|
947
953
|
};
|
|
948
954
|
/** Response-side payload — response text, thinking. */
|
|
949
955
|
data: AgentCallEndData;
|
|
@@ -1296,6 +1302,8 @@ type ProviderResponse = {
|
|
|
1296
1302
|
total_tokens: number;
|
|
1297
1303
|
reasoning_tokens?: number;
|
|
1298
1304
|
cached_tokens?: number;
|
|
1305
|
+
/** Tokens written to a provider prompt cache during this call, when reported. */
|
|
1306
|
+
cache_write_tokens?: number;
|
|
1299
1307
|
};
|
|
1300
1308
|
cost?: number;
|
|
1301
1309
|
/** Provider-specific opaque metadata that needs to round-trip through conversation history. */
|
|
@@ -1949,6 +1957,8 @@ type PricingTable = Record<string, [number, number, number]>;
|
|
|
1949
1957
|
type PricingSource = {
|
|
1950
1958
|
kind: 'table';
|
|
1951
1959
|
table: PricingTable;
|
|
1960
|
+
/** Exact matching prevents a future sibling from inheriting a base price. */
|
|
1961
|
+
match?: 'prefix' | 'exact';
|
|
1952
1962
|
}
|
|
1953
1963
|
/** Provider reports per-call cost in `usage.cost` (OpenRouter credits ≈ USD). */
|
|
1954
1964
|
| {
|
|
@@ -2075,7 +2085,7 @@ type ProviderProfile = {
|
|
|
2075
2085
|
* versioned snapshots like `gpt-4o-2024-05-13`). Returns `undefined` on a miss —
|
|
2076
2086
|
* callers MUST treat that as "unknown cost", never as free.
|
|
2077
2087
|
*/
|
|
2078
|
-
declare function priceFromTable(table: PricingTable, model: string, promptTokens: number, completionTokens: number, cachedTokens?: number): number | undefined;
|
|
2088
|
+
declare function priceFromTable(table: PricingTable, model: string, promptTokens: number, completionTokens: number, cachedTokens?: number, match?: 'prefix' | 'exact'): number | undefined;
|
|
2079
2089
|
/**
|
|
2080
2090
|
* Incremental scanner that separates streamed content into visible text and
|
|
2081
2091
|
* `<think>…</think>` reasoning, tolerating tags split across chunks.
|
|
@@ -2117,6 +2127,8 @@ type OpenAICompatibleOptions = {
|
|
|
2117
2127
|
/** API key or a per-request resolver (expiring tokens). See {@link ApiKeySource}. */
|
|
2118
2128
|
apiKey?: ApiKeySource;
|
|
2119
2129
|
baseUrl?: string;
|
|
2130
|
+
/** Permit a non-loopback HTTP endpoint for this provider instance. */
|
|
2131
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
2120
2132
|
/** Override the profile's auth header shape (e.g. Azure Entra bearer tokens). */
|
|
2121
2133
|
authHeader?: AuthHeader;
|
|
2122
2134
|
rateLimit?: RateLimitConfig;
|
|
@@ -2147,11 +2159,21 @@ declare class OpenAICompatibleProvider implements Provider {
|
|
|
2147
2159
|
protected buildRequestBody(messages: ChatMessage[], options: ChatOptions, stream: boolean): Record<string, unknown>;
|
|
2148
2160
|
protected formatMessage(msg: ChatMessage, model: string): Record<string, unknown>;
|
|
2149
2161
|
protected extractErrorMessage(body: string, status: number): string;
|
|
2162
|
+
private requestModel;
|
|
2150
2163
|
private toUsage;
|
|
2151
|
-
private
|
|
2152
|
-
|
|
2164
|
+
private reportedCost;
|
|
2165
|
+
/**
|
|
2166
|
+
* The generic profile path stays flat and public. Native subclasses may
|
|
2167
|
+
* override this protected seam to use a provider-internal estimator without
|
|
2168
|
+
* widening `PricingSource` or `ProviderProfile`.
|
|
2169
|
+
*/
|
|
2170
|
+
protected computeCost(model: string, usage: ProviderResponse['usage'], reportedCost: number | undefined, context?: {
|
|
2171
|
+
request?: Record<string, unknown>;
|
|
2172
|
+
response?: OpenAIModelResponse;
|
|
2173
|
+
}): number | undefined;
|
|
2174
|
+
protected parseResponse(json: OpenAIChatResponse, model: string, request?: Record<string, unknown>): ProviderResponse;
|
|
2153
2175
|
private roundTripMetadata;
|
|
2154
|
-
protected parseSSEStream(body: ReadableStream<Uint8Array>, model: string): AsyncGenerator<StreamChunk>;
|
|
2176
|
+
protected parseSSEStream(body: ReadableStream<Uint8Array>, model: string, request?: Record<string, unknown>): AsyncGenerator<StreamChunk>;
|
|
2155
2177
|
}
|
|
2156
2178
|
type OpenAIUsage = {
|
|
2157
2179
|
prompt_tokens: number;
|
|
@@ -2162,9 +2184,15 @@ type OpenAIUsage = {
|
|
|
2162
2184
|
};
|
|
2163
2185
|
prompt_tokens_details?: {
|
|
2164
2186
|
cached_tokens?: number;
|
|
2187
|
+
cache_write_tokens?: number;
|
|
2165
2188
|
};
|
|
2166
2189
|
/** OpenRouter / Vercel Gateway: per-call cost in USD. */
|
|
2167
2190
|
cost?: number;
|
|
2191
|
+
/** xAI: exact billed USD cost in ten-billionths of a dollar. */
|
|
2192
|
+
cost_in_usd_ticks?: number;
|
|
2193
|
+
/** DeepSeek: normalized cache hit/miss split for table pricing. */
|
|
2194
|
+
prompt_cache_hit_tokens?: number;
|
|
2195
|
+
prompt_cache_miss_tokens?: number;
|
|
2168
2196
|
};
|
|
2169
2197
|
type OpenAIChatMessage = {
|
|
2170
2198
|
content: string | null | Array<string | {
|
|
@@ -2189,6 +2217,55 @@ type OpenAIChatResponse = {
|
|
|
2189
2217
|
finish_reason: string;
|
|
2190
2218
|
}>;
|
|
2191
2219
|
usage?: OpenAIUsage;
|
|
2220
|
+
} & OpenAIModelResponse;
|
|
2221
|
+
type OpenAIModelResponse = {
|
|
2222
|
+
model?: string;
|
|
2223
|
+
service_tier?: unknown;
|
|
2224
|
+
serviceTier?: unknown;
|
|
2225
|
+
usage?: OpenAIUsage;
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
/**
|
|
2229
|
+
* MCP (Model Context Protocol) types for tool discovery and execution.
|
|
2230
|
+
*/
|
|
2231
|
+
/** A tool definition discovered from an MCP server. */
|
|
2232
|
+
type McpToolDefinition = {
|
|
2233
|
+
name: string;
|
|
2234
|
+
description: string;
|
|
2235
|
+
inputSchema: unknown;
|
|
2236
|
+
};
|
|
2237
|
+
/** Configuration for connecting to an MCP server. */
|
|
2238
|
+
type McpServerConfig = {
|
|
2239
|
+
name: string;
|
|
2240
|
+
/** Command to spawn for stdio transport (e.g. "npx -y @modelcontextprotocol/server-fs") */
|
|
2241
|
+
command?: string;
|
|
2242
|
+
/** Arguments for the command */
|
|
2243
|
+
args?: string[];
|
|
2244
|
+
/** HTTP/SSE endpoint URI for HTTP transport */
|
|
2245
|
+
uri?: string;
|
|
2246
|
+
/** Allow this MCP server to use non-loopback HTTP. Prefer HTTPS. */
|
|
2247
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
2248
|
+
/** Environment variables to pass to the spawned process */
|
|
2249
|
+
env?: Record<string, string>;
|
|
2250
|
+
};
|
|
2251
|
+
/** Result from calling an MCP tool. */
|
|
2252
|
+
type McpToolResult = {
|
|
2253
|
+
content: Array<{
|
|
2254
|
+
type: 'text';
|
|
2255
|
+
text: string;
|
|
2256
|
+
} | {
|
|
2257
|
+
type: 'image';
|
|
2258
|
+
data: string;
|
|
2259
|
+
mimeType: string;
|
|
2260
|
+
}>;
|
|
2261
|
+
isError?: boolean;
|
|
2262
|
+
};
|
|
2263
|
+
/** A connected MCP server with its discovered tools. */
|
|
2264
|
+
type McpServer = {
|
|
2265
|
+
name: string;
|
|
2266
|
+
tools: McpToolDefinition[];
|
|
2267
|
+
callTool(toolName: string, args: unknown): Promise<McpToolResult>;
|
|
2268
|
+
close(): Promise<void>;
|
|
2192
2269
|
};
|
|
2193
2270
|
|
|
2194
2271
|
/** A pending human decision awaiting resolution. */
|
|
@@ -2438,6 +2515,11 @@ type ProviderConfig = {
|
|
|
2438
2515
|
* the common case. See {@link ApiKeySource}. */
|
|
2439
2516
|
apiKey?: ApiKeySource;
|
|
2440
2517
|
baseUrl?: string;
|
|
2518
|
+
/**
|
|
2519
|
+
* Allow a non-loopback HTTP endpoint for this provider. HTTP can expose
|
|
2520
|
+
* prompts and credentials in transit; prefer HTTPS whenever possible.
|
|
2521
|
+
*/
|
|
2522
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
2441
2523
|
/** OpenAI-compatible presets only: override the profile auth header shape. */
|
|
2442
2524
|
authHeader?: AuthHeader;
|
|
2443
2525
|
/**
|
|
@@ -2450,13 +2532,6 @@ type ProviderConfig = {
|
|
|
2450
2532
|
*/
|
|
2451
2533
|
rateLimit?: RateLimitConfig;
|
|
2452
2534
|
};
|
|
2453
|
-
/** MCP server configuration */
|
|
2454
|
-
type McpServerConfig$1 = {
|
|
2455
|
-
name: string;
|
|
2456
|
-
command?: string;
|
|
2457
|
-
uri?: string;
|
|
2458
|
-
env?: Record<string, string>;
|
|
2459
|
-
};
|
|
2460
2535
|
/** Trace configuration */
|
|
2461
2536
|
type TraceConfig = {
|
|
2462
2537
|
enabled?: boolean;
|
|
@@ -2568,7 +2643,7 @@ type AxlConfig = {
|
|
|
2568
2643
|
defaultProvider?: string;
|
|
2569
2644
|
defaultModel?: string;
|
|
2570
2645
|
mcp?: {
|
|
2571
|
-
servers?: McpServerConfig
|
|
2646
|
+
servers?: McpServerConfig[];
|
|
2572
2647
|
};
|
|
2573
2648
|
state?: StateConfig;
|
|
2574
2649
|
trace?: TraceConfig;
|
|
@@ -2661,47 +2736,6 @@ declare class ProviderRegistry {
|
|
|
2661
2736
|
clearFactories(): void;
|
|
2662
2737
|
}
|
|
2663
2738
|
|
|
2664
|
-
/**
|
|
2665
|
-
* MCP (Model Context Protocol) types for tool discovery and execution.
|
|
2666
|
-
*/
|
|
2667
|
-
/** A tool definition discovered from an MCP server. */
|
|
2668
|
-
type McpToolDefinition = {
|
|
2669
|
-
name: string;
|
|
2670
|
-
description: string;
|
|
2671
|
-
inputSchema: unknown;
|
|
2672
|
-
};
|
|
2673
|
-
/** Configuration for connecting to an MCP server. */
|
|
2674
|
-
type McpServerConfig = {
|
|
2675
|
-
name: string;
|
|
2676
|
-
/** Command to spawn for stdio transport (e.g. "npx -y @modelcontextprotocol/server-fs") */
|
|
2677
|
-
command?: string;
|
|
2678
|
-
/** Arguments for the command */
|
|
2679
|
-
args?: string[];
|
|
2680
|
-
/** HTTP/SSE endpoint URI for HTTP transport */
|
|
2681
|
-
uri?: string;
|
|
2682
|
-
/** Environment variables to pass to the spawned process */
|
|
2683
|
-
env?: Record<string, string>;
|
|
2684
|
-
};
|
|
2685
|
-
/** Result from calling an MCP tool. */
|
|
2686
|
-
type McpToolResult = {
|
|
2687
|
-
content: Array<{
|
|
2688
|
-
type: 'text';
|
|
2689
|
-
text: string;
|
|
2690
|
-
} | {
|
|
2691
|
-
type: 'image';
|
|
2692
|
-
data: string;
|
|
2693
|
-
mimeType: string;
|
|
2694
|
-
}>;
|
|
2695
|
-
isError?: boolean;
|
|
2696
|
-
};
|
|
2697
|
-
/** A connected MCP server with its discovered tools. */
|
|
2698
|
-
type McpServer = {
|
|
2699
|
-
name: string;
|
|
2700
|
-
tools: McpToolDefinition[];
|
|
2701
|
-
callTool(toolName: string, args: unknown): Promise<McpToolResult>;
|
|
2702
|
-
close(): Promise<void>;
|
|
2703
|
-
};
|
|
2704
|
-
|
|
2705
2739
|
/**
|
|
2706
2740
|
* Manages connections to multiple MCP servers.
|
|
2707
2741
|
* Discovers tools, filters by agent config, and routes tool calls.
|
|
@@ -4402,7 +4436,14 @@ declare function registerConditions(conditions: string[]): Promise<void>;
|
|
|
4402
4436
|
* attempt-N text never leaks into attempt-N+1).
|
|
4403
4437
|
* - `ask_end` clears the per-ask accumulator (memory hygiene).
|
|
4404
4438
|
*
|
|
4405
|
-
*
|
|
4439
|
+
* SECURITY: "browser-safe" here means this module has no Node runtime
|
|
4440
|
+
* dependency. It does not redact or authorize the raw `AxlEvent` source.
|
|
4441
|
+
* Prompts, system messages, tool data, and traces should remain on the trusted
|
|
4442
|
+
* backend; public applications should relay an output-only DTO produced from a
|
|
4443
|
+
* server-side curated view. Use this helper only when the browser is authorized
|
|
4444
|
+
* to receive the underlying event stream.
|
|
4445
|
+
*
|
|
4446
|
+
* Example (trusted operator browser, consuming an authorized Studio WS firehose):
|
|
4406
4447
|
*
|
|
4407
4448
|
* ```ts
|
|
4408
4449
|
* import { stringStreamFromEvents } from '@axlsdk/axl';
|
|
@@ -4461,6 +4502,8 @@ declare function hasPositiveTokens(event: {
|
|
|
4461
4502
|
input?: number;
|
|
4462
4503
|
output?: number;
|
|
4463
4504
|
reasoning?: number;
|
|
4505
|
+
cached?: number;
|
|
4506
|
+
cacheWrite?: number;
|
|
4464
4507
|
} | null;
|
|
4465
4508
|
}): boolean;
|
|
4466
4509
|
/**
|
|
@@ -4524,6 +4567,8 @@ declare function isUnpricedLeaf(event: {
|
|
|
4524
4567
|
input?: number;
|
|
4525
4568
|
output?: number;
|
|
4526
4569
|
reasoning?: number;
|
|
4570
|
+
cached?: number;
|
|
4571
|
+
cacheWrite?: number;
|
|
4527
4572
|
} | null;
|
|
4528
4573
|
}): boolean;
|
|
4529
4574
|
/**
|
|
@@ -4739,6 +4784,15 @@ declare class ProviderError extends AxlError {
|
|
|
4739
4784
|
declare function isRetryableStatus(status: number): boolean;
|
|
4740
4785
|
|
|
4741
4786
|
declare const OPENAI_PRICING: PricingTable;
|
|
4787
|
+
type DirectOpenAIPricingContext = {
|
|
4788
|
+
/** Only the canonical direct API endpoint has a usable catalog. */
|
|
4789
|
+
baseUrl?: string;
|
|
4790
|
+
request?: Record<string, unknown>;
|
|
4791
|
+
response?: {
|
|
4792
|
+
service_tier?: unknown;
|
|
4793
|
+
serviceTier?: unknown;
|
|
4794
|
+
};
|
|
4795
|
+
};
|
|
4742
4796
|
/**
|
|
4743
4797
|
* Estimate OpenAI call cost from token usage. Exact match first, then
|
|
4744
4798
|
* longest-prefix match for versioned models (e.g. `gpt-4o-2024-05-13`).
|
|
@@ -4768,8 +4822,10 @@ declare class OpenAIProvider extends OpenAICompatibleProvider {
|
|
|
4768
4822
|
constructor(options?: {
|
|
4769
4823
|
apiKey?: ApiKeySource;
|
|
4770
4824
|
baseUrl?: string;
|
|
4825
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
4771
4826
|
rateLimit?: RateLimitConfig;
|
|
4772
4827
|
});
|
|
4828
|
+
protected computeCost(model: string, usage: ProviderResponse['usage'], _reportedCost: number | undefined, context?: DirectOpenAIPricingContext): number | undefined;
|
|
4773
4829
|
}
|
|
4774
4830
|
|
|
4775
4831
|
/**
|
|
@@ -4789,6 +4845,7 @@ declare class OpenAIResponsesProvider implements Provider {
|
|
|
4789
4845
|
constructor(options?: {
|
|
4790
4846
|
apiKey?: ApiKeySource;
|
|
4791
4847
|
baseUrl?: string;
|
|
4848
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
4792
4849
|
rateLimit?: RateLimitConfig;
|
|
4793
4850
|
});
|
|
4794
4851
|
/** Resolve the API key for one request (supports an expiring-token callback). */
|
|
@@ -4798,6 +4855,7 @@ declare class OpenAIResponsesProvider implements Provider {
|
|
|
4798
4855
|
chat(messages: ChatMessage[], options: ChatOptions): Promise<ProviderResponse>;
|
|
4799
4856
|
stream(messages: ChatMessage[], options: ChatOptions): AsyncGenerator<StreamChunk>;
|
|
4800
4857
|
private buildRequestBody;
|
|
4858
|
+
private requestModel;
|
|
4801
4859
|
private buildInput;
|
|
4802
4860
|
/**
|
|
4803
4861
|
* The Responses API uses `text.format` instead of `response_format`.
|
|
@@ -4838,6 +4896,7 @@ declare class AnthropicProvider implements Provider {
|
|
|
4838
4896
|
constructor(options?: {
|
|
4839
4897
|
apiKey?: ApiKeySource;
|
|
4840
4898
|
baseUrl?: string;
|
|
4899
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
4841
4900
|
rateLimit?: RateLimitConfig;
|
|
4842
4901
|
});
|
|
4843
4902
|
/** Resolve the API key for one request (supports an expiring-token callback). */
|
|
@@ -4856,6 +4915,7 @@ declare class AnthropicProvider implements Provider {
|
|
|
4856
4915
|
* - tool messages (tool results) -> user messages with tool_result content blocks
|
|
4857
4916
|
*/
|
|
4858
4917
|
private mapMessages;
|
|
4918
|
+
private getReplayedThinkingBlocks;
|
|
4859
4919
|
/**
|
|
4860
4920
|
* Merge consecutive messages with the same role into a single message.
|
|
4861
4921
|
* This handles cases where multiple tool_result blocks need to be in one user message.
|
|
@@ -4908,6 +4968,7 @@ declare class GeminiProvider implements Provider {
|
|
|
4908
4968
|
constructor(options?: {
|
|
4909
4969
|
apiKey?: ApiKeySource;
|
|
4910
4970
|
baseUrl?: string;
|
|
4971
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
4911
4972
|
rateLimit?: RateLimitConfig;
|
|
4912
4973
|
});
|
|
4913
4974
|
/** Resolve the API key for one request (supports an expiring-token callback). */
|
|
@@ -4916,6 +4977,11 @@ declare class GeminiProvider implements Provider {
|
|
|
4916
4977
|
stream(messages: ChatMessage[], options: ChatOptions): AsyncGenerator<StreamChunk>;
|
|
4917
4978
|
private buildHeaders;
|
|
4918
4979
|
private extractErrorMessage;
|
|
4980
|
+
private pricingContext;
|
|
4981
|
+
private requestModel;
|
|
4982
|
+
private assertSafeGemini3Continuation;
|
|
4983
|
+
private isTextOnlyClientRequest;
|
|
4984
|
+
private isNonTextGeminiPart;
|
|
4919
4985
|
private buildRequestBody;
|
|
4920
4986
|
/**
|
|
4921
4987
|
* Map OpenAI-format ChatMessages to Gemini content format.
|
|
@@ -4945,6 +5011,7 @@ declare class GeminiProvider implements Provider {
|
|
|
4945
5011
|
private mapToolChoice;
|
|
4946
5012
|
private mapToolDefinition;
|
|
4947
5013
|
private parseResponse;
|
|
5014
|
+
private isTextOnlyGeminiResponse;
|
|
4948
5015
|
private parseSSEStream;
|
|
4949
5016
|
}
|
|
4950
5017
|
|
|
@@ -4954,9 +5021,9 @@ declare class GeminiProvider implements Provider {
|
|
|
4954
5021
|
* - Reasoning is the unified `reasoning` object (`{ effort }` XOR `{ max_tokens }`,
|
|
4955
5022
|
* or `{ enabled: false }`); reasoning text comes back in `message.reasoning`
|
|
4956
5023
|
* with a structured `reasoning_details[]` we round-trip on tool-call turns.
|
|
4957
|
-
* - Cost is provider-reported
|
|
4958
|
-
*
|
|
4959
|
-
*
|
|
5024
|
+
* - Cost is provider-reported in `usage.cost` (USD), so Axl keeps
|
|
5025
|
+
* cost-as-a-primitive working across the whole catalog where a static table
|
|
5026
|
+
* never could. OpenRouter now returns it automatically; no request opt-in.
|
|
4960
5027
|
* - Model ids are `vendor/model` slugs (e.g. `anthropic/claude-opus-4.7`); the
|
|
4961
5028
|
* registry's first-colon split keeps `openrouter:anthropic/claude-…` intact.
|
|
4962
5029
|
*
|
|
@@ -4978,20 +5045,17 @@ declare const OPENROUTER_PROFILE: ProviderProfile;
|
|
|
4978
5045
|
* Entra/AAD bearer-token auth uses the async key callback plus an `authHeader:
|
|
4979
5046
|
* 'bearer'` override.
|
|
4980
5047
|
*
|
|
4981
|
-
* Azure
|
|
4982
|
-
*
|
|
4983
|
-
* detection and pricing only fire when the deployment is named after the model;
|
|
4984
|
-
* otherwise effort is a no-op and cost is `undefined` (honest, not a fake $0).
|
|
5048
|
+
* Azure can share OpenAI's wire reasoning behavior, but never its direct-API
|
|
5049
|
+
* price catalog: model meters, deployment types, regions, and agreements vary.
|
|
4985
5050
|
*/
|
|
4986
5051
|
declare const AZURE_PROFILE: ProviderProfile;
|
|
4987
5052
|
|
|
4988
5053
|
/**
|
|
4989
|
-
* xAI (Grok)
|
|
5054
|
+
* xAI (Grok) Chat Completions at `https://api.x.ai/v1`.
|
|
4990
5055
|
*
|
|
4991
|
-
*
|
|
4992
|
-
*
|
|
4993
|
-
* -
|
|
4994
|
-
* Penalties aren't engine-computed, so they only matter if a user adds them.
|
|
5056
|
+
* Pricing is the exact response total in `usage.cost_in_usd_ticks`; it already
|
|
5057
|
+
* includes cache, service-tier, and server-side-tool charges. Grok 4.20
|
|
5058
|
+
* multi-agent is Responses-only, so it deliberately has no Chat descriptor.
|
|
4995
5059
|
*/
|
|
4996
5060
|
declare const XAI_PROFILE: ProviderProfile;
|
|
4997
5061
|
|
|
@@ -5458,6 +5522,7 @@ declare class OpenAIEmbedder implements Embedder {
|
|
|
5458
5522
|
apiKey?: string;
|
|
5459
5523
|
model?: string;
|
|
5460
5524
|
baseUrl?: string;
|
|
5525
|
+
dangerouslyAllowInsecureHttp?: boolean;
|
|
5461
5526
|
dimensions?: number;
|
|
5462
5527
|
});
|
|
5463
5528
|
embed(texts: string[], signal?: AbortSignal): Promise<EmbedResult>;
|