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,951 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.6.1
5
+ // protoc unknown
6
+ // source: weaveapi/llmx/v1/pricing.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PricingItem = exports.TokenBand = exports.Pricing_MetadataEntry = exports.Pricing = exports.PriceUnit = exports.Operation = exports.PricingTier = exports.PricingCategory = exports.protobufPackage = void 0;
9
+ exports.pricingCategoryFromJSON = pricingCategoryFromJSON;
10
+ exports.pricingCategoryToJSON = pricingCategoryToJSON;
11
+ exports.pricingTierFromJSON = pricingTierFromJSON;
12
+ exports.pricingTierToJSON = pricingTierToJSON;
13
+ exports.operationFromJSON = operationFromJSON;
14
+ exports.operationToJSON = operationToJSON;
15
+ exports.priceUnitFromJSON = priceUnitFromJSON;
16
+ exports.priceUnitToJSON = priceUnitToJSON;
17
+ /* eslint-disable */
18
+ const wire_1 = require("@bufbuild/protobuf/wire");
19
+ exports.protobufPackage = "weaveapi.llmx.v1";
20
+ /** PricingCategory defines the type of AI capability being priced. */
21
+ var PricingCategory;
22
+ (function (PricingCategory) {
23
+ /** PRICING_CATEGORY_UNSPECIFIED - Default/unknown category */
24
+ PricingCategory[PricingCategory["PRICING_CATEGORY_UNSPECIFIED"] = 0] = "PRICING_CATEGORY_UNSPECIFIED";
25
+ /**
26
+ * PRICING_CATEGORY_TEXT - Text generation models (GPT-4, Claude, etc.)
27
+ * Example: GPT-4o, GPT-4o-mini for chat/completion
28
+ */
29
+ PricingCategory[PricingCategory["PRICING_CATEGORY_TEXT"] = 1] = "PRICING_CATEGORY_TEXT";
30
+ /**
31
+ * PRICING_CATEGORY_IMAGE - Image understanding/analysis models
32
+ * Example: GPT-4-vision analyzing uploaded images
33
+ */
34
+ PricingCategory[PricingCategory["PRICING_CATEGORY_IMAGE"] = 2] = "PRICING_CATEGORY_IMAGE";
35
+ /**
36
+ * PRICING_CATEGORY_AUDIO - Audio models for speech-to-text and text-to-speech
37
+ * Example: Whisper for transcription, TTS models for voice synthesis
38
+ */
39
+ PricingCategory[PricingCategory["PRICING_CATEGORY_AUDIO"] = 3] = "PRICING_CATEGORY_AUDIO";
40
+ /**
41
+ * PRICING_CATEGORY_EMBEDDING - Embedding/vector models
42
+ * Example: text-embedding-3-large for semantic search
43
+ */
44
+ PricingCategory[PricingCategory["PRICING_CATEGORY_EMBEDDING"] = 4] = "PRICING_CATEGORY_EMBEDDING";
45
+ /**
46
+ * PRICING_CATEGORY_FINE_TUNING - Fine-tuning costs for training custom models
47
+ * Example: Training GPT-4o-mini-2024-07-18 on custom data
48
+ */
49
+ PricingCategory[PricingCategory["PRICING_CATEGORY_FINE_TUNING"] = 5] = "PRICING_CATEGORY_FINE_TUNING";
50
+ /**
51
+ * PRICING_CATEGORY_TOOL - Built-in or add-on tools and capabilities
52
+ * Example: Web Search ($2/1k calls), Code Interpreter ($0.03/container)
53
+ */
54
+ PricingCategory[PricingCategory["PRICING_CATEGORY_TOOL"] = 6] = "PRICING_CATEGORY_TOOL";
55
+ /**
56
+ * PRICING_CATEGORY_REALTIME - Realtime/streaming API pricing
57
+ * Example: WebSocket-based continuous interaction models
58
+ */
59
+ PricingCategory[PricingCategory["PRICING_CATEGORY_REALTIME"] = 7] = "PRICING_CATEGORY_REALTIME";
60
+ /**
61
+ * PRICING_CATEGORY_MODERATION - Content moderation models
62
+ * Example: OpenAI moderation endpoint for content filtering
63
+ */
64
+ PricingCategory[PricingCategory["PRICING_CATEGORY_MODERATION"] = 8] = "PRICING_CATEGORY_MODERATION";
65
+ /**
66
+ * PRICING_CATEGORY_LEGACY - Deprecated/legacy models with special pricing
67
+ * Example: GPT-3.5-turbo-0301 (older version)
68
+ */
69
+ PricingCategory[PricingCategory["PRICING_CATEGORY_LEGACY"] = 9] = "PRICING_CATEGORY_LEGACY";
70
+ PricingCategory[PricingCategory["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
71
+ })(PricingCategory || (exports.PricingCategory = PricingCategory = {}));
72
+ function pricingCategoryFromJSON(object) {
73
+ switch (object) {
74
+ case 0:
75
+ case "PRICING_CATEGORY_UNSPECIFIED":
76
+ return PricingCategory.PRICING_CATEGORY_UNSPECIFIED;
77
+ case 1:
78
+ case "PRICING_CATEGORY_TEXT":
79
+ return PricingCategory.PRICING_CATEGORY_TEXT;
80
+ case 2:
81
+ case "PRICING_CATEGORY_IMAGE":
82
+ return PricingCategory.PRICING_CATEGORY_IMAGE;
83
+ case 3:
84
+ case "PRICING_CATEGORY_AUDIO":
85
+ return PricingCategory.PRICING_CATEGORY_AUDIO;
86
+ case 4:
87
+ case "PRICING_CATEGORY_EMBEDDING":
88
+ return PricingCategory.PRICING_CATEGORY_EMBEDDING;
89
+ case 5:
90
+ case "PRICING_CATEGORY_FINE_TUNING":
91
+ return PricingCategory.PRICING_CATEGORY_FINE_TUNING;
92
+ case 6:
93
+ case "PRICING_CATEGORY_TOOL":
94
+ return PricingCategory.PRICING_CATEGORY_TOOL;
95
+ case 7:
96
+ case "PRICING_CATEGORY_REALTIME":
97
+ return PricingCategory.PRICING_CATEGORY_REALTIME;
98
+ case 8:
99
+ case "PRICING_CATEGORY_MODERATION":
100
+ return PricingCategory.PRICING_CATEGORY_MODERATION;
101
+ case 9:
102
+ case "PRICING_CATEGORY_LEGACY":
103
+ return PricingCategory.PRICING_CATEGORY_LEGACY;
104
+ case -1:
105
+ case "UNRECOGNIZED":
106
+ default:
107
+ return PricingCategory.UNRECOGNIZED;
108
+ }
109
+ }
110
+ function pricingCategoryToJSON(object) {
111
+ switch (object) {
112
+ case PricingCategory.PRICING_CATEGORY_UNSPECIFIED:
113
+ return "PRICING_CATEGORY_UNSPECIFIED";
114
+ case PricingCategory.PRICING_CATEGORY_TEXT:
115
+ return "PRICING_CATEGORY_TEXT";
116
+ case PricingCategory.PRICING_CATEGORY_IMAGE:
117
+ return "PRICING_CATEGORY_IMAGE";
118
+ case PricingCategory.PRICING_CATEGORY_AUDIO:
119
+ return "PRICING_CATEGORY_AUDIO";
120
+ case PricingCategory.PRICING_CATEGORY_EMBEDDING:
121
+ return "PRICING_CATEGORY_EMBEDDING";
122
+ case PricingCategory.PRICING_CATEGORY_FINE_TUNING:
123
+ return "PRICING_CATEGORY_FINE_TUNING";
124
+ case PricingCategory.PRICING_CATEGORY_TOOL:
125
+ return "PRICING_CATEGORY_TOOL";
126
+ case PricingCategory.PRICING_CATEGORY_REALTIME:
127
+ return "PRICING_CATEGORY_REALTIME";
128
+ case PricingCategory.PRICING_CATEGORY_MODERATION:
129
+ return "PRICING_CATEGORY_MODERATION";
130
+ case PricingCategory.PRICING_CATEGORY_LEGACY:
131
+ return "PRICING_CATEGORY_LEGACY";
132
+ case PricingCategory.UNRECOGNIZED:
133
+ default:
134
+ return "UNRECOGNIZED";
135
+ }
136
+ }
137
+ /** PricingTier represents different service levels with varying costs and SLAs. */
138
+ var PricingTier;
139
+ (function (PricingTier) {
140
+ /** PRICING_TIER_UNSPECIFIED - Default/unknown tier */
141
+ PricingTier[PricingTier["PRICING_TIER_UNSPECIFIED"] = 0] = "PRICING_TIER_UNSPECIFIED";
142
+ /**
143
+ * PRICING_TIER_FREE - Free tier with usage limits
144
+ * Example: Free API credits for new users
145
+ */
146
+ PricingTier[PricingTier["PRICING_TIER_FREE"] = 1] = "PRICING_TIER_FREE";
147
+ /**
148
+ * PRICING_TIER_BATCH - Batch processing with 50% discount, 24-hour turnaround
149
+ * Example: GPT-4o batch API at $1.25/1M input tokens (vs $2.50 standard)
150
+ */
151
+ PricingTier[PricingTier["PRICING_TIER_BATCH"] = 2] = "PRICING_TIER_BATCH";
152
+ /**
153
+ * PRICING_TIER_FLEX - Flexible/on-demand tier (between batch and standard)
154
+ * Example: Variable pricing based on system load
155
+ */
156
+ PricingTier[PricingTier["PRICING_TIER_FLEX"] = 3] = "PRICING_TIER_FLEX";
157
+ /**
158
+ * PRICING_TIER_STANDARD - Standard/regular pricing tier
159
+ * Example: GPT-4o at $2.50/1M input tokens for real-time API
160
+ */
161
+ PricingTier[PricingTier["PRICING_TIER_STANDARD"] = 4] = "PRICING_TIER_STANDARD";
162
+ /**
163
+ * PRICING_TIER_PRIORITY - Priority access with higher costs but guaranteed availability
164
+ * Example: Reserved capacity with SLA guarantees
165
+ */
166
+ PricingTier[PricingTier["PRICING_TIER_PRIORITY"] = 5] = "PRICING_TIER_PRIORITY";
167
+ /**
168
+ * PRICING_TIER_ENTERPRISE - Enterprise/custom pricing with negotiated rates
169
+ * Example: Volume discounts for large organizations
170
+ */
171
+ PricingTier[PricingTier["PRICING_TIER_ENTERPRISE"] = 6] = "PRICING_TIER_ENTERPRISE";
172
+ PricingTier[PricingTier["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
173
+ })(PricingTier || (exports.PricingTier = PricingTier = {}));
174
+ function pricingTierFromJSON(object) {
175
+ switch (object) {
176
+ case 0:
177
+ case "PRICING_TIER_UNSPECIFIED":
178
+ return PricingTier.PRICING_TIER_UNSPECIFIED;
179
+ case 1:
180
+ case "PRICING_TIER_FREE":
181
+ return PricingTier.PRICING_TIER_FREE;
182
+ case 2:
183
+ case "PRICING_TIER_BATCH":
184
+ return PricingTier.PRICING_TIER_BATCH;
185
+ case 3:
186
+ case "PRICING_TIER_FLEX":
187
+ return PricingTier.PRICING_TIER_FLEX;
188
+ case 4:
189
+ case "PRICING_TIER_STANDARD":
190
+ return PricingTier.PRICING_TIER_STANDARD;
191
+ case 5:
192
+ case "PRICING_TIER_PRIORITY":
193
+ return PricingTier.PRICING_TIER_PRIORITY;
194
+ case 6:
195
+ case "PRICING_TIER_ENTERPRISE":
196
+ return PricingTier.PRICING_TIER_ENTERPRISE;
197
+ case -1:
198
+ case "UNRECOGNIZED":
199
+ default:
200
+ return PricingTier.UNRECOGNIZED;
201
+ }
202
+ }
203
+ function pricingTierToJSON(object) {
204
+ switch (object) {
205
+ case PricingTier.PRICING_TIER_UNSPECIFIED:
206
+ return "PRICING_TIER_UNSPECIFIED";
207
+ case PricingTier.PRICING_TIER_FREE:
208
+ return "PRICING_TIER_FREE";
209
+ case PricingTier.PRICING_TIER_BATCH:
210
+ return "PRICING_TIER_BATCH";
211
+ case PricingTier.PRICING_TIER_FLEX:
212
+ return "PRICING_TIER_FLEX";
213
+ case PricingTier.PRICING_TIER_STANDARD:
214
+ return "PRICING_TIER_STANDARD";
215
+ case PricingTier.PRICING_TIER_PRIORITY:
216
+ return "PRICING_TIER_PRIORITY";
217
+ case PricingTier.PRICING_TIER_ENTERPRISE:
218
+ return "PRICING_TIER_ENTERPRISE";
219
+ case PricingTier.UNRECOGNIZED:
220
+ default:
221
+ return "UNRECOGNIZED";
222
+ }
223
+ }
224
+ /** Operation defines the specific type of usage being priced. */
225
+ var Operation;
226
+ (function (Operation) {
227
+ /** OPERATION_UNSPECIFIED - Default/unknown operation */
228
+ Operation[Operation["OPERATION_UNSPECIFIED"] = 0] = "OPERATION_UNSPECIFIED";
229
+ /**
230
+ * OPERATION_INPUT - Input/prompt tokens sent to the model
231
+ * Example: User message in chat, $2.50/1M tokens for GPT-4o
232
+ */
233
+ Operation[Operation["OPERATION_INPUT"] = 1] = "OPERATION_INPUT";
234
+ /**
235
+ * OPERATION_OUTPUT - Output/completion tokens generated by the model
236
+ * Example: Model response, $10.00/1M tokens for GPT-4o
237
+ */
238
+ Operation[Operation["OPERATION_OUTPUT"] = 2] = "OPERATION_OUTPUT";
239
+ /**
240
+ * OPERATION_CACHED_INPUT - Cached input tokens (discounted rate for repeated context)
241
+ * Example: $1.25/1M tokens for GPT-4o cached prompt (50% discount)
242
+ */
243
+ Operation[Operation["OPERATION_CACHED_INPUT"] = 3] = "OPERATION_CACHED_INPUT";
244
+ /**
245
+ * OPERATION_CACHE_READ - Reading from cache (if priced separately from cached input)
246
+ * Example: Anthropic Claude cache read operations
247
+ */
248
+ Operation[Operation["OPERATION_CACHE_READ"] = 4] = "OPERATION_CACHE_READ";
249
+ /**
250
+ * OPERATION_CACHE_WRITE - Writing to cache (creating cached context)
251
+ * Example: Anthropic Claude cache creation fee
252
+ */
253
+ Operation[Operation["OPERATION_CACHE_WRITE"] = 5] = "OPERATION_CACHE_WRITE";
254
+ /**
255
+ * OPERATION_TRAINING - Fine-tuning training cost (per token or per hour)
256
+ * Example: $25.00/1M tokens or $3.00/hour for GPT-4o-mini training
257
+ */
258
+ Operation[Operation["OPERATION_TRAINING"] = 6] = "OPERATION_TRAINING";
259
+ /**
260
+ * OPERATION_STORAGE - General storage costs
261
+ * Example: Vector database storage for embeddings
262
+ */
263
+ Operation[Operation["OPERATION_STORAGE"] = 7] = "OPERATION_STORAGE";
264
+ /**
265
+ * OPERATION_CONTEXT_CACHE_STORAGE - Context cache storage charged per time unit
266
+ * Example: $0.10/GB/hour for maintaining cached contexts
267
+ */
268
+ Operation[Operation["OPERATION_CONTEXT_CACHE_STORAGE"] = 8] = "OPERATION_CONTEXT_CACHE_STORAGE";
269
+ /**
270
+ * OPERATION_PER_CALL - Fixed price per API call regardless of tokens
271
+ * Example: $0.00255/call for file search tool
272
+ */
273
+ Operation[Operation["OPERATION_PER_CALL"] = 9] = "OPERATION_PER_CALL";
274
+ /**
275
+ * OPERATION_PER_CONTAINER - Per container/session pricing for isolated environments
276
+ * Example: $0.03/container for Code Interpreter execution
277
+ */
278
+ Operation[Operation["OPERATION_PER_CONTAINER"] = 10] = "OPERATION_PER_CONTAINER";
279
+ Operation[Operation["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
280
+ })(Operation || (exports.Operation = Operation = {}));
281
+ function operationFromJSON(object) {
282
+ switch (object) {
283
+ case 0:
284
+ case "OPERATION_UNSPECIFIED":
285
+ return Operation.OPERATION_UNSPECIFIED;
286
+ case 1:
287
+ case "OPERATION_INPUT":
288
+ return Operation.OPERATION_INPUT;
289
+ case 2:
290
+ case "OPERATION_OUTPUT":
291
+ return Operation.OPERATION_OUTPUT;
292
+ case 3:
293
+ case "OPERATION_CACHED_INPUT":
294
+ return Operation.OPERATION_CACHED_INPUT;
295
+ case 4:
296
+ case "OPERATION_CACHE_READ":
297
+ return Operation.OPERATION_CACHE_READ;
298
+ case 5:
299
+ case "OPERATION_CACHE_WRITE":
300
+ return Operation.OPERATION_CACHE_WRITE;
301
+ case 6:
302
+ case "OPERATION_TRAINING":
303
+ return Operation.OPERATION_TRAINING;
304
+ case 7:
305
+ case "OPERATION_STORAGE":
306
+ return Operation.OPERATION_STORAGE;
307
+ case 8:
308
+ case "OPERATION_CONTEXT_CACHE_STORAGE":
309
+ return Operation.OPERATION_CONTEXT_CACHE_STORAGE;
310
+ case 9:
311
+ case "OPERATION_PER_CALL":
312
+ return Operation.OPERATION_PER_CALL;
313
+ case 10:
314
+ case "OPERATION_PER_CONTAINER":
315
+ return Operation.OPERATION_PER_CONTAINER;
316
+ case -1:
317
+ case "UNRECOGNIZED":
318
+ default:
319
+ return Operation.UNRECOGNIZED;
320
+ }
321
+ }
322
+ function operationToJSON(object) {
323
+ switch (object) {
324
+ case Operation.OPERATION_UNSPECIFIED:
325
+ return "OPERATION_UNSPECIFIED";
326
+ case Operation.OPERATION_INPUT:
327
+ return "OPERATION_INPUT";
328
+ case Operation.OPERATION_OUTPUT:
329
+ return "OPERATION_OUTPUT";
330
+ case Operation.OPERATION_CACHED_INPUT:
331
+ return "OPERATION_CACHED_INPUT";
332
+ case Operation.OPERATION_CACHE_READ:
333
+ return "OPERATION_CACHE_READ";
334
+ case Operation.OPERATION_CACHE_WRITE:
335
+ return "OPERATION_CACHE_WRITE";
336
+ case Operation.OPERATION_TRAINING:
337
+ return "OPERATION_TRAINING";
338
+ case Operation.OPERATION_STORAGE:
339
+ return "OPERATION_STORAGE";
340
+ case Operation.OPERATION_CONTEXT_CACHE_STORAGE:
341
+ return "OPERATION_CONTEXT_CACHE_STORAGE";
342
+ case Operation.OPERATION_PER_CALL:
343
+ return "OPERATION_PER_CALL";
344
+ case Operation.OPERATION_PER_CONTAINER:
345
+ return "OPERATION_PER_CONTAINER";
346
+ case Operation.UNRECOGNIZED:
347
+ default:
348
+ return "UNRECOGNIZED";
349
+ }
350
+ }
351
+ /** PriceUnit specifies how the price is measured/charged. */
352
+ var PriceUnit;
353
+ (function (PriceUnit) {
354
+ /** PRICE_UNIT_UNSPECIFIED - Default/unknown unit */
355
+ PriceUnit[PriceUnit["PRICE_UNIT_UNSPECIFIED"] = 0] = "PRICE_UNIT_UNSPECIFIED";
356
+ /**
357
+ * PRICE_UNIT_PER_1M_TOKENS - Price per million tokens (most common for LLMs)
358
+ * Example: $2.50 per 1M input tokens
359
+ */
360
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_1M_TOKENS"] = 1] = "PRICE_UNIT_PER_1M_TOKENS";
361
+ /**
362
+ * PRICE_UNIT_PER_IMAGE - Price per generated image
363
+ * Example: DALL-E 3 at $0.040 per 1024x1024 image
364
+ */
365
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_IMAGE"] = 2] = "PRICE_UNIT_PER_IMAGE";
366
+ /**
367
+ * PRICE_UNIT_PER_MINUTE - Price per minute of processing
368
+ * Example: Whisper at $0.006 per minute of audio
369
+ */
370
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_MINUTE"] = 3] = "PRICE_UNIT_PER_MINUTE";
371
+ /**
372
+ * PRICE_UNIT_PER_1M_CHARACTERS - Price per million characters (for text not tokenized)
373
+ * Example: Some translation APIs charge per character
374
+ */
375
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_1M_CHARACTERS"] = 4] = "PRICE_UNIT_PER_1M_CHARACTERS";
376
+ /**
377
+ * PRICE_UNIT_PER_CALL - Fixed price per API call
378
+ * Example: Moderation at $0.001 per call
379
+ */
380
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_CALL"] = 5] = "PRICE_UNIT_PER_CALL";
381
+ /**
382
+ * PRICE_UNIT_PER_GB_DAY - Storage price per GB per day
383
+ * Example: File search storage at $0.20/GB/day
384
+ */
385
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_GB_DAY"] = 6] = "PRICE_UNIT_PER_GB_DAY";
386
+ /**
387
+ * PRICE_UNIT_PER_HOUR - Price per hour (training or runtime)
388
+ * Example: Fine-tuning at $3.00/hour for small models
389
+ */
390
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_HOUR"] = 7] = "PRICE_UNIT_PER_HOUR";
391
+ /**
392
+ * PRICE_UNIT_PER_1K_CALLS - Price per thousand API calls
393
+ * Example: Web search at $2.00 per 1k searches
394
+ */
395
+ PriceUnit[PriceUnit["PRICE_UNIT_PER_1K_CALLS"] = 8] = "PRICE_UNIT_PER_1K_CALLS";
396
+ PriceUnit[PriceUnit["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
397
+ })(PriceUnit || (exports.PriceUnit = PriceUnit = {}));
398
+ function priceUnitFromJSON(object) {
399
+ switch (object) {
400
+ case 0:
401
+ case "PRICE_UNIT_UNSPECIFIED":
402
+ return PriceUnit.PRICE_UNIT_UNSPECIFIED;
403
+ case 1:
404
+ case "PRICE_UNIT_PER_1M_TOKENS":
405
+ return PriceUnit.PRICE_UNIT_PER_1M_TOKENS;
406
+ case 2:
407
+ case "PRICE_UNIT_PER_IMAGE":
408
+ return PriceUnit.PRICE_UNIT_PER_IMAGE;
409
+ case 3:
410
+ case "PRICE_UNIT_PER_MINUTE":
411
+ return PriceUnit.PRICE_UNIT_PER_MINUTE;
412
+ case 4:
413
+ case "PRICE_UNIT_PER_1M_CHARACTERS":
414
+ return PriceUnit.PRICE_UNIT_PER_1M_CHARACTERS;
415
+ case 5:
416
+ case "PRICE_UNIT_PER_CALL":
417
+ return PriceUnit.PRICE_UNIT_PER_CALL;
418
+ case 6:
419
+ case "PRICE_UNIT_PER_GB_DAY":
420
+ return PriceUnit.PRICE_UNIT_PER_GB_DAY;
421
+ case 7:
422
+ case "PRICE_UNIT_PER_HOUR":
423
+ return PriceUnit.PRICE_UNIT_PER_HOUR;
424
+ case 8:
425
+ case "PRICE_UNIT_PER_1K_CALLS":
426
+ return PriceUnit.PRICE_UNIT_PER_1K_CALLS;
427
+ case -1:
428
+ case "UNRECOGNIZED":
429
+ default:
430
+ return PriceUnit.UNRECOGNIZED;
431
+ }
432
+ }
433
+ function priceUnitToJSON(object) {
434
+ switch (object) {
435
+ case PriceUnit.PRICE_UNIT_UNSPECIFIED:
436
+ return "PRICE_UNIT_UNSPECIFIED";
437
+ case PriceUnit.PRICE_UNIT_PER_1M_TOKENS:
438
+ return "PRICE_UNIT_PER_1M_TOKENS";
439
+ case PriceUnit.PRICE_UNIT_PER_IMAGE:
440
+ return "PRICE_UNIT_PER_IMAGE";
441
+ case PriceUnit.PRICE_UNIT_PER_MINUTE:
442
+ return "PRICE_UNIT_PER_MINUTE";
443
+ case PriceUnit.PRICE_UNIT_PER_1M_CHARACTERS:
444
+ return "PRICE_UNIT_PER_1M_CHARACTERS";
445
+ case PriceUnit.PRICE_UNIT_PER_CALL:
446
+ return "PRICE_UNIT_PER_CALL";
447
+ case PriceUnit.PRICE_UNIT_PER_GB_DAY:
448
+ return "PRICE_UNIT_PER_GB_DAY";
449
+ case PriceUnit.PRICE_UNIT_PER_HOUR:
450
+ return "PRICE_UNIT_PER_HOUR";
451
+ case PriceUnit.PRICE_UNIT_PER_1K_CALLS:
452
+ return "PRICE_UNIT_PER_1K_CALLS";
453
+ case PriceUnit.UNRECOGNIZED:
454
+ default:
455
+ return "UNRECOGNIZED";
456
+ }
457
+ }
458
+ function createBasePricing() {
459
+ return { currency: "", items: [], metadata: {} };
460
+ }
461
+ exports.Pricing = {
462
+ encode(message, writer = new wire_1.BinaryWriter()) {
463
+ if (message.currency !== "") {
464
+ writer.uint32(10).string(message.currency);
465
+ }
466
+ for (const v of message.items) {
467
+ exports.PricingItem.encode(v, writer.uint32(18).fork()).join();
468
+ }
469
+ Object.entries(message.metadata).forEach(([key, value]) => {
470
+ exports.Pricing_MetadataEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
471
+ });
472
+ return writer;
473
+ },
474
+ decode(input, length) {
475
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
476
+ let end = length === undefined ? reader.len : reader.pos + length;
477
+ const message = createBasePricing();
478
+ while (reader.pos < end) {
479
+ const tag = reader.uint32();
480
+ switch (tag >>> 3) {
481
+ case 1: {
482
+ if (tag !== 10) {
483
+ break;
484
+ }
485
+ message.currency = reader.string();
486
+ continue;
487
+ }
488
+ case 2: {
489
+ if (tag !== 18) {
490
+ break;
491
+ }
492
+ message.items.push(exports.PricingItem.decode(reader, reader.uint32()));
493
+ continue;
494
+ }
495
+ case 3: {
496
+ if (tag !== 26) {
497
+ break;
498
+ }
499
+ const entry3 = exports.Pricing_MetadataEntry.decode(reader, reader.uint32());
500
+ if (entry3.value !== undefined) {
501
+ message.metadata[entry3.key] = entry3.value;
502
+ }
503
+ continue;
504
+ }
505
+ }
506
+ if ((tag & 7) === 4 || tag === 0) {
507
+ break;
508
+ }
509
+ reader.skip(tag & 7);
510
+ }
511
+ return message;
512
+ },
513
+ fromJSON(object) {
514
+ return {
515
+ currency: isSet(object.currency) ? globalThis.String(object.currency) : "",
516
+ items: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.items) ? object.items.map((e) => exports.PricingItem.fromJSON(e)) : [],
517
+ metadata: isObject(object.metadata)
518
+ ? Object.entries(object.metadata).reduce((acc, [key, value]) => {
519
+ acc[key] = String(value);
520
+ return acc;
521
+ }, {})
522
+ : {},
523
+ };
524
+ },
525
+ toJSON(message) {
526
+ var _a;
527
+ const obj = {};
528
+ if (message.currency !== "") {
529
+ obj.currency = message.currency;
530
+ }
531
+ if ((_a = message.items) === null || _a === void 0 ? void 0 : _a.length) {
532
+ obj.items = message.items.map((e) => exports.PricingItem.toJSON(e));
533
+ }
534
+ if (message.metadata) {
535
+ const entries = Object.entries(message.metadata);
536
+ if (entries.length > 0) {
537
+ obj.metadata = {};
538
+ entries.forEach(([k, v]) => {
539
+ obj.metadata[k] = v;
540
+ });
541
+ }
542
+ }
543
+ return obj;
544
+ },
545
+ create(base) {
546
+ return exports.Pricing.fromPartial(base !== null && base !== void 0 ? base : {});
547
+ },
548
+ fromPartial(object) {
549
+ var _a, _b, _c;
550
+ const message = createBasePricing();
551
+ message.currency = (_a = object.currency) !== null && _a !== void 0 ? _a : "";
552
+ message.items = ((_b = object.items) === null || _b === void 0 ? void 0 : _b.map((e) => exports.PricingItem.fromPartial(e))) || [];
553
+ message.metadata = Object.entries((_c = object.metadata) !== null && _c !== void 0 ? _c : {}).reduce((acc, [key, value]) => {
554
+ if (value !== undefined) {
555
+ acc[key] = globalThis.String(value);
556
+ }
557
+ return acc;
558
+ }, {});
559
+ return message;
560
+ },
561
+ };
562
+ function createBasePricing_MetadataEntry() {
563
+ return { key: "", value: "" };
564
+ }
565
+ exports.Pricing_MetadataEntry = {
566
+ encode(message, writer = new wire_1.BinaryWriter()) {
567
+ if (message.key !== "") {
568
+ writer.uint32(10).string(message.key);
569
+ }
570
+ if (message.value !== "") {
571
+ writer.uint32(18).string(message.value);
572
+ }
573
+ return writer;
574
+ },
575
+ decode(input, length) {
576
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
577
+ let end = length === undefined ? reader.len : reader.pos + length;
578
+ const message = createBasePricing_MetadataEntry();
579
+ while (reader.pos < end) {
580
+ const tag = reader.uint32();
581
+ switch (tag >>> 3) {
582
+ case 1: {
583
+ if (tag !== 10) {
584
+ break;
585
+ }
586
+ message.key = reader.string();
587
+ continue;
588
+ }
589
+ case 2: {
590
+ if (tag !== 18) {
591
+ break;
592
+ }
593
+ message.value = reader.string();
594
+ continue;
595
+ }
596
+ }
597
+ if ((tag & 7) === 4 || tag === 0) {
598
+ break;
599
+ }
600
+ reader.skip(tag & 7);
601
+ }
602
+ return message;
603
+ },
604
+ fromJSON(object) {
605
+ return {
606
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
607
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
608
+ };
609
+ },
610
+ toJSON(message) {
611
+ const obj = {};
612
+ if (message.key !== "") {
613
+ obj.key = message.key;
614
+ }
615
+ if (message.value !== "") {
616
+ obj.value = message.value;
617
+ }
618
+ return obj;
619
+ },
620
+ create(base) {
621
+ return exports.Pricing_MetadataEntry.fromPartial(base !== null && base !== void 0 ? base : {});
622
+ },
623
+ fromPartial(object) {
624
+ var _a, _b;
625
+ const message = createBasePricing_MetadataEntry();
626
+ message.key = (_a = object.key) !== null && _a !== void 0 ? _a : "";
627
+ message.value = (_b = object.value) !== null && _b !== void 0 ? _b : "";
628
+ return message;
629
+ },
630
+ };
631
+ function createBaseTokenBand() {
632
+ return { minPromptTokens: 0, maxPromptTokens: 0 };
633
+ }
634
+ exports.TokenBand = {
635
+ encode(message, writer = new wire_1.BinaryWriter()) {
636
+ if (message.minPromptTokens !== 0) {
637
+ writer.uint32(8).int64(message.minPromptTokens);
638
+ }
639
+ if (message.maxPromptTokens !== 0) {
640
+ writer.uint32(16).int64(message.maxPromptTokens);
641
+ }
642
+ return writer;
643
+ },
644
+ decode(input, length) {
645
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
646
+ let end = length === undefined ? reader.len : reader.pos + length;
647
+ const message = createBaseTokenBand();
648
+ while (reader.pos < end) {
649
+ const tag = reader.uint32();
650
+ switch (tag >>> 3) {
651
+ case 1: {
652
+ if (tag !== 8) {
653
+ break;
654
+ }
655
+ message.minPromptTokens = longToNumber(reader.int64());
656
+ continue;
657
+ }
658
+ case 2: {
659
+ if (tag !== 16) {
660
+ break;
661
+ }
662
+ message.maxPromptTokens = longToNumber(reader.int64());
663
+ continue;
664
+ }
665
+ }
666
+ if ((tag & 7) === 4 || tag === 0) {
667
+ break;
668
+ }
669
+ reader.skip(tag & 7);
670
+ }
671
+ return message;
672
+ },
673
+ fromJSON(object) {
674
+ return {
675
+ minPromptTokens: isSet(object.minPromptTokens) ? globalThis.Number(object.minPromptTokens) : 0,
676
+ maxPromptTokens: isSet(object.maxPromptTokens) ? globalThis.Number(object.maxPromptTokens) : 0,
677
+ };
678
+ },
679
+ toJSON(message) {
680
+ const obj = {};
681
+ if (message.minPromptTokens !== 0) {
682
+ obj.minPromptTokens = Math.round(message.minPromptTokens);
683
+ }
684
+ if (message.maxPromptTokens !== 0) {
685
+ obj.maxPromptTokens = Math.round(message.maxPromptTokens);
686
+ }
687
+ return obj;
688
+ },
689
+ create(base) {
690
+ return exports.TokenBand.fromPartial(base !== null && base !== void 0 ? base : {});
691
+ },
692
+ fromPartial(object) {
693
+ var _a, _b;
694
+ const message = createBaseTokenBand();
695
+ message.minPromptTokens = (_a = object.minPromptTokens) !== null && _a !== void 0 ? _a : 0;
696
+ message.maxPromptTokens = (_b = object.maxPromptTokens) !== null && _b !== void 0 ? _b : 0;
697
+ return message;
698
+ },
699
+ };
700
+ function createBasePricingItem() {
701
+ return {
702
+ category: 0,
703
+ tier: 0,
704
+ operation: 0,
705
+ price: 0,
706
+ unit: 0,
707
+ quality: "",
708
+ resolution: "",
709
+ tokenBand: undefined,
710
+ includesThinkingTokens: false,
711
+ toolName: "",
712
+ tokenType: "",
713
+ notes: "",
714
+ };
715
+ }
716
+ exports.PricingItem = {
717
+ encode(message, writer = new wire_1.BinaryWriter()) {
718
+ if (message.category !== 0) {
719
+ writer.uint32(8).int32(message.category);
720
+ }
721
+ if (message.tier !== 0) {
722
+ writer.uint32(16).int32(message.tier);
723
+ }
724
+ if (message.operation !== 0) {
725
+ writer.uint32(24).int32(message.operation);
726
+ }
727
+ if (message.price !== 0) {
728
+ writer.uint32(33).double(message.price);
729
+ }
730
+ if (message.unit !== 0) {
731
+ writer.uint32(40).int32(message.unit);
732
+ }
733
+ if (message.quality !== "") {
734
+ writer.uint32(50).string(message.quality);
735
+ }
736
+ if (message.resolution !== "") {
737
+ writer.uint32(58).string(message.resolution);
738
+ }
739
+ if (message.tokenBand !== undefined) {
740
+ exports.TokenBand.encode(message.tokenBand, writer.uint32(66).fork()).join();
741
+ }
742
+ if (message.includesThinkingTokens !== false) {
743
+ writer.uint32(72).bool(message.includesThinkingTokens);
744
+ }
745
+ if (message.toolName !== "") {
746
+ writer.uint32(82).string(message.toolName);
747
+ }
748
+ if (message.tokenType !== "") {
749
+ writer.uint32(90).string(message.tokenType);
750
+ }
751
+ if (message.notes !== "") {
752
+ writer.uint32(98).string(message.notes);
753
+ }
754
+ return writer;
755
+ },
756
+ decode(input, length) {
757
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
758
+ let end = length === undefined ? reader.len : reader.pos + length;
759
+ const message = createBasePricingItem();
760
+ while (reader.pos < end) {
761
+ const tag = reader.uint32();
762
+ switch (tag >>> 3) {
763
+ case 1: {
764
+ if (tag !== 8) {
765
+ break;
766
+ }
767
+ message.category = reader.int32();
768
+ continue;
769
+ }
770
+ case 2: {
771
+ if (tag !== 16) {
772
+ break;
773
+ }
774
+ message.tier = reader.int32();
775
+ continue;
776
+ }
777
+ case 3: {
778
+ if (tag !== 24) {
779
+ break;
780
+ }
781
+ message.operation = reader.int32();
782
+ continue;
783
+ }
784
+ case 4: {
785
+ if (tag !== 33) {
786
+ break;
787
+ }
788
+ message.price = reader.double();
789
+ continue;
790
+ }
791
+ case 5: {
792
+ if (tag !== 40) {
793
+ break;
794
+ }
795
+ message.unit = reader.int32();
796
+ continue;
797
+ }
798
+ case 6: {
799
+ if (tag !== 50) {
800
+ break;
801
+ }
802
+ message.quality = reader.string();
803
+ continue;
804
+ }
805
+ case 7: {
806
+ if (tag !== 58) {
807
+ break;
808
+ }
809
+ message.resolution = reader.string();
810
+ continue;
811
+ }
812
+ case 8: {
813
+ if (tag !== 66) {
814
+ break;
815
+ }
816
+ message.tokenBand = exports.TokenBand.decode(reader, reader.uint32());
817
+ continue;
818
+ }
819
+ case 9: {
820
+ if (tag !== 72) {
821
+ break;
822
+ }
823
+ message.includesThinkingTokens = reader.bool();
824
+ continue;
825
+ }
826
+ case 10: {
827
+ if (tag !== 82) {
828
+ break;
829
+ }
830
+ message.toolName = reader.string();
831
+ continue;
832
+ }
833
+ case 11: {
834
+ if (tag !== 90) {
835
+ break;
836
+ }
837
+ message.tokenType = reader.string();
838
+ continue;
839
+ }
840
+ case 12: {
841
+ if (tag !== 98) {
842
+ break;
843
+ }
844
+ message.notes = reader.string();
845
+ continue;
846
+ }
847
+ }
848
+ if ((tag & 7) === 4 || tag === 0) {
849
+ break;
850
+ }
851
+ reader.skip(tag & 7);
852
+ }
853
+ return message;
854
+ },
855
+ fromJSON(object) {
856
+ return {
857
+ category: isSet(object.category) ? pricingCategoryFromJSON(object.category) : 0,
858
+ tier: isSet(object.tier) ? pricingTierFromJSON(object.tier) : 0,
859
+ operation: isSet(object.operation) ? operationFromJSON(object.operation) : 0,
860
+ price: isSet(object.price) ? globalThis.Number(object.price) : 0,
861
+ unit: isSet(object.unit) ? priceUnitFromJSON(object.unit) : 0,
862
+ quality: isSet(object.quality) ? globalThis.String(object.quality) : "",
863
+ resolution: isSet(object.resolution) ? globalThis.String(object.resolution) : "",
864
+ tokenBand: isSet(object.tokenBand) ? exports.TokenBand.fromJSON(object.tokenBand) : undefined,
865
+ includesThinkingTokens: isSet(object.includesThinkingTokens)
866
+ ? globalThis.Boolean(object.includesThinkingTokens)
867
+ : false,
868
+ toolName: isSet(object.toolName) ? globalThis.String(object.toolName) : "",
869
+ tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "",
870
+ notes: isSet(object.notes) ? globalThis.String(object.notes) : "",
871
+ };
872
+ },
873
+ toJSON(message) {
874
+ const obj = {};
875
+ if (message.category !== 0) {
876
+ obj.category = pricingCategoryToJSON(message.category);
877
+ }
878
+ if (message.tier !== 0) {
879
+ obj.tier = pricingTierToJSON(message.tier);
880
+ }
881
+ if (message.operation !== 0) {
882
+ obj.operation = operationToJSON(message.operation);
883
+ }
884
+ if (message.price !== 0) {
885
+ obj.price = message.price;
886
+ }
887
+ if (message.unit !== 0) {
888
+ obj.unit = priceUnitToJSON(message.unit);
889
+ }
890
+ if (message.quality !== "") {
891
+ obj.quality = message.quality;
892
+ }
893
+ if (message.resolution !== "") {
894
+ obj.resolution = message.resolution;
895
+ }
896
+ if (message.tokenBand !== undefined) {
897
+ obj.tokenBand = exports.TokenBand.toJSON(message.tokenBand);
898
+ }
899
+ if (message.includesThinkingTokens !== false) {
900
+ obj.includesThinkingTokens = message.includesThinkingTokens;
901
+ }
902
+ if (message.toolName !== "") {
903
+ obj.toolName = message.toolName;
904
+ }
905
+ if (message.tokenType !== "") {
906
+ obj.tokenType = message.tokenType;
907
+ }
908
+ if (message.notes !== "") {
909
+ obj.notes = message.notes;
910
+ }
911
+ return obj;
912
+ },
913
+ create(base) {
914
+ return exports.PricingItem.fromPartial(base !== null && base !== void 0 ? base : {});
915
+ },
916
+ fromPartial(object) {
917
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
918
+ const message = createBasePricingItem();
919
+ message.category = (_a = object.category) !== null && _a !== void 0 ? _a : 0;
920
+ message.tier = (_b = object.tier) !== null && _b !== void 0 ? _b : 0;
921
+ message.operation = (_c = object.operation) !== null && _c !== void 0 ? _c : 0;
922
+ message.price = (_d = object.price) !== null && _d !== void 0 ? _d : 0;
923
+ message.unit = (_e = object.unit) !== null && _e !== void 0 ? _e : 0;
924
+ message.quality = (_f = object.quality) !== null && _f !== void 0 ? _f : "";
925
+ message.resolution = (_g = object.resolution) !== null && _g !== void 0 ? _g : "";
926
+ message.tokenBand = (object.tokenBand !== undefined && object.tokenBand !== null)
927
+ ? exports.TokenBand.fromPartial(object.tokenBand)
928
+ : undefined;
929
+ message.includesThinkingTokens = (_h = object.includesThinkingTokens) !== null && _h !== void 0 ? _h : false;
930
+ message.toolName = (_j = object.toolName) !== null && _j !== void 0 ? _j : "";
931
+ message.tokenType = (_k = object.tokenType) !== null && _k !== void 0 ? _k : "";
932
+ message.notes = (_l = object.notes) !== null && _l !== void 0 ? _l : "";
933
+ return message;
934
+ },
935
+ };
936
+ function longToNumber(int64) {
937
+ const num = globalThis.Number(int64.toString());
938
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
939
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
940
+ }
941
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
942
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
943
+ }
944
+ return num;
945
+ }
946
+ function isObject(value) {
947
+ return typeof value === "object" && value !== null;
948
+ }
949
+ function isSet(value) {
950
+ return value !== null && value !== undefined;
951
+ }