weave-typescript 0.8.0 → 0.10.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.
@@ -0,0 +1,340 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "weaveapi.llmx.v1";
3
+ /** PricingCategory defines the type of AI capability being priced. */
4
+ export declare enum PricingCategory {
5
+ /** PRICING_CATEGORY_UNSPECIFIED - Default/unknown category */
6
+ PRICING_CATEGORY_UNSPECIFIED = 0,
7
+ /**
8
+ * PRICING_CATEGORY_TEXT - Text generation models (GPT-4, Claude, etc.)
9
+ * Example: GPT-4o, GPT-4o-mini for chat/completion
10
+ */
11
+ PRICING_CATEGORY_TEXT = 1,
12
+ /**
13
+ * PRICING_CATEGORY_IMAGE - Image understanding/analysis models
14
+ * Example: GPT-4-vision analyzing uploaded images
15
+ */
16
+ PRICING_CATEGORY_IMAGE = 2,
17
+ /**
18
+ * PRICING_CATEGORY_AUDIO - Audio models for speech-to-text and text-to-speech
19
+ * Example: Whisper for transcription, TTS models for voice synthesis
20
+ */
21
+ PRICING_CATEGORY_AUDIO = 3,
22
+ /**
23
+ * PRICING_CATEGORY_EMBEDDING - Embedding/vector models
24
+ * Example: text-embedding-3-large for semantic search
25
+ */
26
+ PRICING_CATEGORY_EMBEDDING = 4,
27
+ /**
28
+ * PRICING_CATEGORY_FINE_TUNING - Fine-tuning costs for training custom models
29
+ * Example: Training GPT-4o-mini-2024-07-18 on custom data
30
+ */
31
+ PRICING_CATEGORY_FINE_TUNING = 5,
32
+ /**
33
+ * PRICING_CATEGORY_TOOL - Built-in or add-on tools and capabilities
34
+ * Example: Web Search ($2/1k calls), Code Interpreter ($0.03/container)
35
+ */
36
+ PRICING_CATEGORY_TOOL = 6,
37
+ /**
38
+ * PRICING_CATEGORY_REALTIME - Realtime/streaming API pricing
39
+ * Example: WebSocket-based continuous interaction models
40
+ */
41
+ PRICING_CATEGORY_REALTIME = 7,
42
+ /**
43
+ * PRICING_CATEGORY_MODERATION - Content moderation models
44
+ * Example: OpenAI moderation endpoint for content filtering
45
+ */
46
+ PRICING_CATEGORY_MODERATION = 8,
47
+ /**
48
+ * PRICING_CATEGORY_LEGACY - Deprecated/legacy models with special pricing
49
+ * Example: GPT-3.5-turbo-0301 (older version)
50
+ */
51
+ PRICING_CATEGORY_LEGACY = 9,
52
+ UNRECOGNIZED = -1
53
+ }
54
+ export declare function pricingCategoryFromJSON(object: any): PricingCategory;
55
+ export declare function pricingCategoryToJSON(object: PricingCategory): string;
56
+ /** PricingTier represents different service levels with varying costs and SLAs. */
57
+ export declare enum PricingTier {
58
+ /** PRICING_TIER_UNSPECIFIED - Default/unknown tier */
59
+ PRICING_TIER_UNSPECIFIED = 0,
60
+ /**
61
+ * PRICING_TIER_FREE - Free tier with usage limits
62
+ * Example: Free API credits for new users
63
+ */
64
+ PRICING_TIER_FREE = 1,
65
+ /**
66
+ * PRICING_TIER_BATCH - Batch processing with 50% discount, 24-hour turnaround
67
+ * Example: GPT-4o batch API at $1.25/1M input tokens (vs $2.50 standard)
68
+ */
69
+ PRICING_TIER_BATCH = 2,
70
+ /**
71
+ * PRICING_TIER_FLEX - Flexible/on-demand tier (between batch and standard)
72
+ * Example: Variable pricing based on system load
73
+ */
74
+ PRICING_TIER_FLEX = 3,
75
+ /**
76
+ * PRICING_TIER_STANDARD - Standard/regular pricing tier
77
+ * Example: GPT-4o at $2.50/1M input tokens for real-time API
78
+ */
79
+ PRICING_TIER_STANDARD = 4,
80
+ /**
81
+ * PRICING_TIER_PRIORITY - Priority access with higher costs but guaranteed availability
82
+ * Example: Reserved capacity with SLA guarantees
83
+ */
84
+ PRICING_TIER_PRIORITY = 5,
85
+ /**
86
+ * PRICING_TIER_ENTERPRISE - Enterprise/custom pricing with negotiated rates
87
+ * Example: Volume discounts for large organizations
88
+ */
89
+ PRICING_TIER_ENTERPRISE = 6,
90
+ UNRECOGNIZED = -1
91
+ }
92
+ export declare function pricingTierFromJSON(object: any): PricingTier;
93
+ export declare function pricingTierToJSON(object: PricingTier): string;
94
+ /** Operation defines the specific type of usage being priced. */
95
+ export declare enum Operation {
96
+ /** OPERATION_UNSPECIFIED - Default/unknown operation */
97
+ OPERATION_UNSPECIFIED = 0,
98
+ /**
99
+ * OPERATION_INPUT - Input/prompt tokens sent to the model
100
+ * Example: User message in chat, $2.50/1M tokens for GPT-4o
101
+ */
102
+ OPERATION_INPUT = 1,
103
+ /**
104
+ * OPERATION_OUTPUT - Output/completion tokens generated by the model
105
+ * Example: Model response, $10.00/1M tokens for GPT-4o
106
+ */
107
+ OPERATION_OUTPUT = 2,
108
+ /**
109
+ * OPERATION_CACHED_INPUT - Cached input tokens (discounted rate for repeated context)
110
+ * Example: $1.25/1M tokens for GPT-4o cached prompt (50% discount)
111
+ */
112
+ OPERATION_CACHED_INPUT = 3,
113
+ /**
114
+ * OPERATION_CACHE_READ - Reading from cache (if priced separately from cached input)
115
+ * Example: Anthropic Claude cache read operations
116
+ */
117
+ OPERATION_CACHE_READ = 4,
118
+ /**
119
+ * OPERATION_CACHE_WRITE - Writing to cache (creating cached context)
120
+ * Example: Anthropic Claude cache creation fee
121
+ */
122
+ OPERATION_CACHE_WRITE = 5,
123
+ /**
124
+ * OPERATION_TRAINING - Fine-tuning training cost (per token or per hour)
125
+ * Example: $25.00/1M tokens or $3.00/hour for GPT-4o-mini training
126
+ */
127
+ OPERATION_TRAINING = 6,
128
+ /**
129
+ * OPERATION_STORAGE - General storage costs
130
+ * Example: Vector database storage for embeddings
131
+ */
132
+ OPERATION_STORAGE = 7,
133
+ /**
134
+ * OPERATION_CONTEXT_CACHE_STORAGE - Context cache storage charged per time unit
135
+ * Example: $0.10/GB/hour for maintaining cached contexts
136
+ */
137
+ OPERATION_CONTEXT_CACHE_STORAGE = 8,
138
+ /**
139
+ * OPERATION_PER_CALL - Fixed price per API call regardless of tokens
140
+ * Example: $0.00255/call for file search tool
141
+ */
142
+ OPERATION_PER_CALL = 9,
143
+ /**
144
+ * OPERATION_PER_CONTAINER - Per container/session pricing for isolated environments
145
+ * Example: $0.03/container for Code Interpreter execution
146
+ */
147
+ OPERATION_PER_CONTAINER = 10,
148
+ UNRECOGNIZED = -1
149
+ }
150
+ export declare function operationFromJSON(object: any): Operation;
151
+ export declare function operationToJSON(object: Operation): string;
152
+ /** PriceUnit specifies how the price is measured/charged. */
153
+ export declare enum PriceUnit {
154
+ /** PRICE_UNIT_UNSPECIFIED - Default/unknown unit */
155
+ PRICE_UNIT_UNSPECIFIED = 0,
156
+ /**
157
+ * PRICE_UNIT_PER_1M_TOKENS - Price per million tokens (most common for LLMs)
158
+ * Example: $2.50 per 1M input tokens
159
+ */
160
+ PRICE_UNIT_PER_1M_TOKENS = 1,
161
+ /**
162
+ * PRICE_UNIT_PER_IMAGE - Price per generated image
163
+ * Example: DALL-E 3 at $0.040 per 1024x1024 image
164
+ */
165
+ PRICE_UNIT_PER_IMAGE = 2,
166
+ /**
167
+ * PRICE_UNIT_PER_MINUTE - Price per minute of processing
168
+ * Example: Whisper at $0.006 per minute of audio
169
+ */
170
+ PRICE_UNIT_PER_MINUTE = 3,
171
+ /**
172
+ * PRICE_UNIT_PER_1M_CHARACTERS - Price per million characters (for text not tokenized)
173
+ * Example: Some translation APIs charge per character
174
+ */
175
+ PRICE_UNIT_PER_1M_CHARACTERS = 4,
176
+ /**
177
+ * PRICE_UNIT_PER_CALL - Fixed price per API call
178
+ * Example: Moderation at $0.001 per call
179
+ */
180
+ PRICE_UNIT_PER_CALL = 5,
181
+ /**
182
+ * PRICE_UNIT_PER_GB_DAY - Storage price per GB per day
183
+ * Example: File search storage at $0.20/GB/day
184
+ */
185
+ PRICE_UNIT_PER_GB_DAY = 6,
186
+ /**
187
+ * PRICE_UNIT_PER_HOUR - Price per hour (training or runtime)
188
+ * Example: Fine-tuning at $3.00/hour for small models
189
+ */
190
+ PRICE_UNIT_PER_HOUR = 7,
191
+ /**
192
+ * PRICE_UNIT_PER_1K_CALLS - Price per thousand API calls
193
+ * Example: Web search at $2.00 per 1k searches
194
+ */
195
+ PRICE_UNIT_PER_1K_CALLS = 8,
196
+ UNRECOGNIZED = -1
197
+ }
198
+ export declare function priceUnitFromJSON(object: any): PriceUnit;
199
+ export declare function priceUnitToJSON(object: PriceUnit): string;
200
+ /**
201
+ * Pricing represents the complete pricing structure for a model or service.
202
+ * A single model may have multiple pricing items for different operations,
203
+ * tiers, and use cases.
204
+ */
205
+ export interface Pricing {
206
+ /**
207
+ * Currency code for all prices in this message.
208
+ * Examples: "USD", "EUR", "GBP"
209
+ */
210
+ currency: string;
211
+ /**
212
+ * List of all pricing entries for this model.
213
+ * Each item represents a specific price point for a particular
214
+ * operation/tier combination.
215
+ * Example: One item for standard input tokens, another for batch input tokens
216
+ */
217
+ items: PricingItem[];
218
+ /**
219
+ * Additional metadata as key-value pairs.
220
+ * Common keys:
221
+ * - "footnote": Additional pricing notes (e.g., "[1] Limited availability")
222
+ * - "estimated_cost": Estimated costs for transcription models
223
+ * - "source_url": URL where pricing was sourced from
224
+ * - "last_updated": ISO 8601 timestamp of last update
225
+ */
226
+ metadata: {
227
+ [key: string]: string;
228
+ };
229
+ }
230
+ export interface Pricing_MetadataEntry {
231
+ key: string;
232
+ value: string;
233
+ }
234
+ /**
235
+ * TokenBand represents tiered pricing based on token count thresholds.
236
+ * Some models have different rates based on cumulative token usage.
237
+ */
238
+ export interface TokenBand {
239
+ /**
240
+ * Minimum number of prompt tokens for this pricing tier (inclusive).
241
+ * Example: 0 for the first tier, 200001 for the "over 200k" tier
242
+ * Set to 0 if not applicable or for the lowest tier
243
+ */
244
+ minPromptTokens: number;
245
+ /**
246
+ * Maximum number of prompt tokens for this pricing tier (inclusive).
247
+ * Example: 200000 for "up to 200k tokens" tier
248
+ * Set to 0 if unlimited or not applicable
249
+ */
250
+ maxPromptTokens: number;
251
+ }
252
+ /**
253
+ * PricingItem represents a specific price point for a model/service.
254
+ * Each item captures one pricing scenario with all relevant qualifiers.
255
+ */
256
+ export interface PricingItem {
257
+ /**
258
+ * The type of AI capability this price applies to.
259
+ * Example: PRICING_CATEGORY_TEXT for GPT-4o chat completion
260
+ */
261
+ category: PricingCategory;
262
+ /**
263
+ * Service tier affecting price and SLA.
264
+ * Example: PRICING_TIER_BATCH for 50% discounted async processing
265
+ */
266
+ tier: PricingTier;
267
+ /**
268
+ * The specific operation being charged for.
269
+ * Example: OPERATION_INPUT for prompt tokens, OPERATION_OUTPUT for completions
270
+ */
271
+ operation: Operation;
272
+ /**
273
+ * The numeric cost amount.
274
+ * Example: 2.50 for "$2.50 per 1M tokens"
275
+ */
276
+ price: number;
277
+ /**
278
+ * The unit that the price applies to.
279
+ * Example: PRICE_UNIT_PER_1M_TOKENS for token-based pricing
280
+ */
281
+ unit: PriceUnit;
282
+ /**
283
+ * Quality level for image generation.
284
+ * Examples: "standard", "hd" for DALL-E, "low", "medium", "high" for others
285
+ */
286
+ quality: string;
287
+ /**
288
+ * Image resolution for image generation pricing.
289
+ * Examples: "1024x1024", "1792x1024", "1024x1792"
290
+ */
291
+ resolution: string;
292
+ /**
293
+ * Token count thresholds for tiered pricing.
294
+ * Example: Different rates for prompts over 200k tokens
295
+ */
296
+ tokenBand: TokenBand | undefined;
297
+ /**
298
+ * Whether output pricing includes hidden reasoning tokens.
299
+ * Example: true for o1-preview which charges for internal thinking
300
+ */
301
+ includesThinkingTokens: boolean;
302
+ /**
303
+ * Name of the tool for PRICING_CATEGORY_TOOL items.
304
+ * Examples: "Web Search", "File Search", "Code Interpreter"
305
+ */
306
+ toolName: string;
307
+ /**
308
+ * Token type for multi-modal pricing.
309
+ * Examples: "text" vs "audio" for Whisper transcription models
310
+ */
311
+ tokenType: string;
312
+ /**
313
+ * Additional human-readable notes about this pricing.
314
+ * Example: "Discounted pricing with data sharing enabled"
315
+ */
316
+ notes: string;
317
+ }
318
+ export declare const Pricing: MessageFns<Pricing>;
319
+ export declare const Pricing_MetadataEntry: MessageFns<Pricing_MetadataEntry>;
320
+ export declare const TokenBand: MessageFns<TokenBand>;
321
+ export declare const PricingItem: MessageFns<PricingItem>;
322
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
323
+ export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
324
+ [K in keyof T]?: DeepPartial<T[K]>;
325
+ } : Partial<T>;
326
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
327
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
328
+ [K in keyof P]: Exact<P[K], I[K]>;
329
+ } & {
330
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
331
+ };
332
+ export interface MessageFns<T> {
333
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
334
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
335
+ fromJSON(object: any): T;
336
+ toJSON(message: T): unknown;
337
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
338
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
339
+ }
340
+ export {};