weave-python 0.27.0__py3-none-any.whl → 0.28.1__py3-none-any.whl

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.
Files changed (33) hide show
  1. weave/weaveapi/llmx/v1/architecture_pb2.py +74 -0
  2. weave/weaveapi/llmx/v1/architecture_pb2.pyi +1323 -0
  3. weave/weaveapi/llmx/v1/capabilities_pb2.py +88 -0
  4. weave/weaveapi/llmx/v1/capabilities_pb2.pyi +1613 -0
  5. weave/weaveapi/llmx/v1/model_pb2.py +54 -0
  6. weave/weaveapi/{modex → llmx}/v1/model_pb2.pyi +294 -189
  7. weave/weaveapi/llmx/v1/model_pb2_grpc.py +2 -0
  8. weave/weaveapi/llmx/v1/model_pb2_grpc.pyi +20 -0
  9. weave/weaveapi/llmx/v1/pricing_pb2.py +54 -0
  10. weave/weaveapi/llmx/v1/pricing_pb2.pyi +597 -0
  11. weave/weaveapi/llmx/v1/pricing_pb2_grpc.py +2 -0
  12. weave/weaveapi/llmx/v1/pricing_pb2_grpc.pyi +20 -0
  13. weave/weaveapi/llmx/v1/provider_pb2.py +38 -0
  14. weave/weaveapi/{modex → llmx}/v1/provider_pb2.pyi +31 -19
  15. weave/weaveapi/llmx/v1/provider_pb2_grpc.py +2 -0
  16. weave/weaveapi/llmx/v1/provider_pb2_grpc.pyi +20 -0
  17. weave/weaveapi/llmx/v1/service_pb2.py +180 -0
  18. weave/weaveapi/{modex → llmx}/v1/service_pb2.pyi +174 -44
  19. weave/weaveapi/{modex → llmx}/v1/service_pb2_grpc.py +103 -105
  20. weave/weaveapi/llmx/v1/service_pb2_grpc.pyi +266 -0
  21. {weave_python-0.27.0.dist-info → weave_python-0.28.1.dist-info}/METADATA +1 -1
  22. {weave_python-0.27.0.dist-info → weave_python-0.28.1.dist-info}/RECORD +27 -17
  23. weave/weaveapi/modex/v1/model_pb2.py +0 -58
  24. weave/weaveapi/modex/v1/provider_pb2.py +0 -38
  25. weave/weaveapi/modex/v1/service_pb2.py +0 -180
  26. weave/weaveapi/modex/v1/service_pb2_grpc.pyi +0 -268
  27. weave/weavesql/weavedb/models.py +0 -124
  28. weave/weavesql/weavedb/queries.py +0 -306
  29. /weave/weaveapi/{modex/v1/model_pb2_grpc.py → llmx/v1/architecture_pb2_grpc.py} +0 -0
  30. /weave/weaveapi/{modex/v1/model_pb2_grpc.pyi → llmx/v1/architecture_pb2_grpc.pyi} +0 -0
  31. /weave/weaveapi/{modex/v1/provider_pb2_grpc.py → llmx/v1/capabilities_pb2_grpc.py} +0 -0
  32. /weave/weaveapi/{modex/v1/provider_pb2_grpc.pyi → llmx/v1/capabilities_pb2_grpc.pyi} +0 -0
  33. {weave_python-0.27.0.dist-info → weave_python-0.28.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,2 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""
@@ -0,0 +1,20 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import abc
7
+ import collections.abc
8
+ import grpc
9
+ import grpc.aio
10
+ import typing
11
+
12
+ _T = typing.TypeVar("_T")
13
+
14
+ class _MaybeAsyncIterator(
15
+ collections.abc.AsyncIterator[_T],
16
+ collections.abc.Iterator[_T],
17
+ metaclass=abc.ABCMeta,
18
+ ): ...
19
+ class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
20
+ ...
@@ -0,0 +1,54 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: weaveapi/llmx/v1/pricing.proto
5
+ # Protobuf Python Version: 6.32.0
6
+ """Generated protocol buffer code."""
7
+
8
+ from google.protobuf import descriptor as _descriptor
9
+ from google.protobuf import descriptor_pool as _descriptor_pool
10
+ from google.protobuf import runtime_version as _runtime_version
11
+ from google.protobuf import symbol_database as _symbol_database
12
+ from google.protobuf.internal import builder as _builder
13
+
14
+ _runtime_version.ValidateProtobufRuntimeVersion(
15
+ _runtime_version.Domain.PUBLIC, 6, 32, 0, "", "weaveapi/llmx/v1/pricing.proto"
16
+ )
17
+ # @@protoc_insertion_point(imports)
18
+
19
+ _sym_db = _symbol_database.Default()
20
+
21
+
22
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
23
+ b'\n\x1eweaveapi/llmx/v1/pricing.proto\x12\x10weaveapi.llmx.v1"\xdc\x01\n\x07Pricing\x12\x1a\n\x08\x63urrency\x18\x01 \x01(\tR\x08\x63urrency\x12\x33\n\x05items\x18\x02 \x03(\x0b\x32\x1d.weaveapi.llmx.v1.PricingItemR\x05items\x12\x43\n\x08metadata\x18\x03 \x03(\x0b\x32\'.weaveapi.llmx.v1.Pricing.MetadataEntryR\x08metadata\x1a;\n\rMetadataEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01"c\n\tTokenBand\x12*\n\x11min_prompt_tokens\x18\x01 \x01(\x03R\x0fminPromptTokens\x12*\n\x11max_prompt_tokens\x18\x02 \x01(\x03R\x0fmaxPromptTokens"\x83\x04\n\x0bPricingItem\x12=\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32!.weaveapi.llmx.v1.PricingCategoryR\x08\x63\x61tegory\x12\x31\n\x04tier\x18\x02 \x01(\x0e\x32\x1d.weaveapi.llmx.v1.PricingTierR\x04tier\x12\x39\n\toperation\x18\x03 \x01(\x0e\x32\x1b.weaveapi.llmx.v1.OperationR\toperation\x12\x14\n\x05price\x18\x04 \x01(\x01R\x05price\x12/\n\x04unit\x18\x05 \x01(\x0e\x32\x1b.weaveapi.llmx.v1.PriceUnitR\x04unit\x12\x18\n\x07quality\x18\x06 \x01(\tR\x07quality\x12\x1e\n\nresolution\x18\x07 \x01(\tR\nresolution\x12:\n\ntoken_band\x18\x08 \x01(\x0b\x32\x1b.weaveapi.llmx.v1.TokenBandR\ttokenBand\x12\x38\n\x18includes_thinking_tokens\x18\t \x01(\x08R\x16includesThinkingTokens\x12\x1b\n\ttool_name\x18\n \x01(\tR\x08toolName\x12\x1d\n\ntoken_type\x18\x0b \x01(\tR\ttokenType\x12\x14\n\x05notes\x18\x0c \x01(\tR\x05notes*\xc0\x02\n\x0fPricingCategory\x12 \n\x1cPRICING_CATEGORY_UNSPECIFIED\x10\x00\x12\x19\n\x15PRICING_CATEGORY_TEXT\x10\x01\x12\x1a\n\x16PRICING_CATEGORY_IMAGE\x10\x02\x12\x1a\n\x16PRICING_CATEGORY_AUDIO\x10\x03\x12\x1e\n\x1aPRICING_CATEGORY_EMBEDDING\x10\x04\x12 \n\x1cPRICING_CATEGORY_FINE_TUNING\x10\x05\x12\x19\n\x15PRICING_CATEGORY_TOOL\x10\x06\x12\x1d\n\x19PRICING_CATEGORY_REALTIME\x10\x07\x12\x1f\n\x1bPRICING_CATEGORY_MODERATION\x10\x08\x12\x1b\n\x17PRICING_CATEGORY_LEGACY\x10\t*\xc4\x01\n\x0bPricingTier\x12\x1c\n\x18PRICING_TIER_UNSPECIFIED\x10\x00\x12\x15\n\x11PRICING_TIER_FREE\x10\x01\x12\x16\n\x12PRICING_TIER_BATCH\x10\x02\x12\x15\n\x11PRICING_TIER_FLEX\x10\x03\x12\x19\n\x15PRICING_TIER_STANDARD\x10\x04\x12\x19\n\x15PRICING_TIER_PRIORITY\x10\x05\x12\x1b\n\x17PRICING_TIER_ENTERPRISE\x10\x06*\xab\x02\n\tOperation\x12\x19\n\x15OPERATION_UNSPECIFIED\x10\x00\x12\x13\n\x0fOPERATION_INPUT\x10\x01\x12\x14\n\x10OPERATION_OUTPUT\x10\x02\x12\x1a\n\x16OPERATION_CACHED_INPUT\x10\x03\x12\x18\n\x14OPERATION_CACHE_READ\x10\x04\x12\x19\n\x15OPERATION_CACHE_WRITE\x10\x05\x12\x16\n\x12OPERATION_TRAINING\x10\x06\x12\x15\n\x11OPERATION_STORAGE\x10\x07\x12#\n\x1fOPERATION_CONTEXT_CACHE_STORAGE\x10\x08\x12\x16\n\x12OPERATION_PER_CALL\x10\t\x12\x1b\n\x17OPERATION_PER_CONTAINER\x10\n*\x86\x02\n\tPriceUnit\x12\x1a\n\x16PRICE_UNIT_UNSPECIFIED\x10\x00\x12\x1c\n\x18PRICE_UNIT_PER_1M_TOKENS\x10\x01\x12\x18\n\x14PRICE_UNIT_PER_IMAGE\x10\x02\x12\x19\n\x15PRICE_UNIT_PER_MINUTE\x10\x03\x12 \n\x1cPRICE_UNIT_PER_1M_CHARACTERS\x10\x04\x12\x17\n\x13PRICE_UNIT_PER_CALL\x10\x05\x12\x19\n\x15PRICE_UNIT_PER_GB_DAY\x10\x06\x12\x17\n\x13PRICE_UNIT_PER_HOUR\x10\x07\x12\x1b\n\x17PRICE_UNIT_PER_1K_CALLS\x10\x08\x42\xbc\x01\n\x14\x63om.weaveapi.llmx.v1B\x0cPricingProtoP\x01Z4github.com/weave-labs/weave-go/weaveapi/llmx/v1;llmx\xa2\x02\x03WLX\xaa\x02\x10Weaveapi.Llmx.V1\xca\x02\x10Weaveapi\\Llmx\\V1\xe2\x02\x1cWeaveapi\\Llmx\\V1\\GPBMetadata\xea\x02\x12Weaveapi::Llmx::V1b\x06proto3'
24
+ )
25
+
26
+ _globals = globals()
27
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
28
+ _builder.BuildTopDescriptorsAndMessages(
29
+ DESCRIPTOR, "weaveapi.llmx.v1.pricing_pb2", _globals
30
+ )
31
+ if not _descriptor._USE_C_DESCRIPTORS:
32
+ _globals["DESCRIPTOR"]._loaded_options = None
33
+ _globals[
34
+ "DESCRIPTOR"
35
+ ]._serialized_options = b"\n\024com.weaveapi.llmx.v1B\014PricingProtoP\001Z4github.com/weave-labs/weave-go/weaveapi/llmx/v1;llmx\242\002\003WLX\252\002\020Weaveapi.Llmx.V1\312\002\020Weaveapi\\Llmx\\V1\342\002\034Weaveapi\\Llmx\\V1\\GPBMetadata\352\002\022Weaveapi::Llmx::V1"
36
+ _globals["_PRICING_METADATAENTRY"]._loaded_options = None
37
+ _globals["_PRICING_METADATAENTRY"]._serialized_options = b"8\001"
38
+ _globals["_PRICINGCATEGORY"]._serialized_start = 895
39
+ _globals["_PRICINGCATEGORY"]._serialized_end = 1215
40
+ _globals["_PRICINGTIER"]._serialized_start = 1218
41
+ _globals["_PRICINGTIER"]._serialized_end = 1414
42
+ _globals["_OPERATION"]._serialized_start = 1417
43
+ _globals["_OPERATION"]._serialized_end = 1716
44
+ _globals["_PRICEUNIT"]._serialized_start = 1719
45
+ _globals["_PRICEUNIT"]._serialized_end = 1981
46
+ _globals["_PRICING"]._serialized_start = 53
47
+ _globals["_PRICING"]._serialized_end = 273
48
+ _globals["_PRICING_METADATAENTRY"]._serialized_start = 214
49
+ _globals["_PRICING_METADATAENTRY"]._serialized_end = 273
50
+ _globals["_TOKENBAND"]._serialized_start = 275
51
+ _globals["_TOKENBAND"]._serialized_end = 374
52
+ _globals["_PRICINGITEM"]._serialized_start = 377
53
+ _globals["_PRICINGITEM"]._serialized_end = 892
54
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,597 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ """
5
+
6
+ import builtins
7
+ import collections.abc
8
+ import google.protobuf.descriptor
9
+ import google.protobuf.internal.containers
10
+ import google.protobuf.internal.enum_type_wrapper
11
+ import google.protobuf.message
12
+ import sys
13
+ import typing
14
+
15
+ if sys.version_info >= (3, 10):
16
+ import typing as typing_extensions
17
+ else:
18
+ import typing_extensions
19
+
20
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
21
+
22
+ class _PricingCategory:
23
+ ValueType = typing.NewType("ValueType", builtins.int)
24
+ V: typing_extensions.TypeAlias = ValueType
25
+
26
+ class _PricingCategoryEnumTypeWrapper(
27
+ google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[
28
+ _PricingCategory.ValueType
29
+ ],
30
+ builtins.type,
31
+ ):
32
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
33
+ PRICING_CATEGORY_UNSPECIFIED: _PricingCategory.ValueType # 0
34
+ """Default/unknown category"""
35
+ PRICING_CATEGORY_TEXT: _PricingCategory.ValueType # 1
36
+ """Text generation models (GPT-4, Claude, etc.)
37
+ Example: GPT-4o, GPT-4o-mini for chat/completion
38
+ """
39
+ PRICING_CATEGORY_IMAGE: _PricingCategory.ValueType # 2
40
+ """Image understanding/analysis models
41
+ Example: GPT-4-vision analyzing uploaded images
42
+ """
43
+ PRICING_CATEGORY_AUDIO: _PricingCategory.ValueType # 3
44
+ """Audio models for speech-to-text and text-to-speech
45
+ Example: Whisper for transcription, TTS models for voice synthesis
46
+ """
47
+ PRICING_CATEGORY_EMBEDDING: _PricingCategory.ValueType # 4
48
+ """Embedding/vector models
49
+ Example: text-embedding-3-large for semantic search
50
+ """
51
+ PRICING_CATEGORY_FINE_TUNING: _PricingCategory.ValueType # 5
52
+ """Fine-tuning costs for training custom models
53
+ Example: Training GPT-4o-mini-2024-07-18 on custom data
54
+ """
55
+ PRICING_CATEGORY_TOOL: _PricingCategory.ValueType # 6
56
+ """Built-in or add-on tools and capabilities
57
+ Example: Web Search ($2/1k calls), Code Interpreter ($0.03/container)
58
+ """
59
+ PRICING_CATEGORY_REALTIME: _PricingCategory.ValueType # 7
60
+ """Realtime/streaming API pricing
61
+ Example: WebSocket-based continuous interaction models
62
+ """
63
+ PRICING_CATEGORY_MODERATION: _PricingCategory.ValueType # 8
64
+ """Content moderation models
65
+ Example: OpenAI moderation endpoint for content filtering
66
+ """
67
+ PRICING_CATEGORY_LEGACY: _PricingCategory.ValueType # 9
68
+ """Deprecated/legacy models with special pricing
69
+ Example: GPT-3.5-turbo-0301 (older version)
70
+ """
71
+
72
+ class PricingCategory(_PricingCategory, metaclass=_PricingCategoryEnumTypeWrapper):
73
+ """PricingCategory defines the type of AI capability being priced."""
74
+
75
+ PRICING_CATEGORY_UNSPECIFIED: PricingCategory.ValueType # 0
76
+ """Default/unknown category"""
77
+ PRICING_CATEGORY_TEXT: PricingCategory.ValueType # 1
78
+ """Text generation models (GPT-4, Claude, etc.)
79
+ Example: GPT-4o, GPT-4o-mini for chat/completion
80
+ """
81
+ PRICING_CATEGORY_IMAGE: PricingCategory.ValueType # 2
82
+ """Image understanding/analysis models
83
+ Example: GPT-4-vision analyzing uploaded images
84
+ """
85
+ PRICING_CATEGORY_AUDIO: PricingCategory.ValueType # 3
86
+ """Audio models for speech-to-text and text-to-speech
87
+ Example: Whisper for transcription, TTS models for voice synthesis
88
+ """
89
+ PRICING_CATEGORY_EMBEDDING: PricingCategory.ValueType # 4
90
+ """Embedding/vector models
91
+ Example: text-embedding-3-large for semantic search
92
+ """
93
+ PRICING_CATEGORY_FINE_TUNING: PricingCategory.ValueType # 5
94
+ """Fine-tuning costs for training custom models
95
+ Example: Training GPT-4o-mini-2024-07-18 on custom data
96
+ """
97
+ PRICING_CATEGORY_TOOL: PricingCategory.ValueType # 6
98
+ """Built-in or add-on tools and capabilities
99
+ Example: Web Search ($2/1k calls), Code Interpreter ($0.03/container)
100
+ """
101
+ PRICING_CATEGORY_REALTIME: PricingCategory.ValueType # 7
102
+ """Realtime/streaming API pricing
103
+ Example: WebSocket-based continuous interaction models
104
+ """
105
+ PRICING_CATEGORY_MODERATION: PricingCategory.ValueType # 8
106
+ """Content moderation models
107
+ Example: OpenAI moderation endpoint for content filtering
108
+ """
109
+ PRICING_CATEGORY_LEGACY: PricingCategory.ValueType # 9
110
+ """Deprecated/legacy models with special pricing
111
+ Example: GPT-3.5-turbo-0301 (older version)
112
+ """
113
+ global___PricingCategory = PricingCategory
114
+
115
+ class _PricingTier:
116
+ ValueType = typing.NewType("ValueType", builtins.int)
117
+ V: typing_extensions.TypeAlias = ValueType
118
+
119
+ class _PricingTierEnumTypeWrapper(
120
+ google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PricingTier.ValueType],
121
+ builtins.type,
122
+ ):
123
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
124
+ PRICING_TIER_UNSPECIFIED: _PricingTier.ValueType # 0
125
+ """Default/unknown tier"""
126
+ PRICING_TIER_FREE: _PricingTier.ValueType # 1
127
+ """Free tier with usage limits
128
+ Example: Free API credits for new users
129
+ """
130
+ PRICING_TIER_BATCH: _PricingTier.ValueType # 2
131
+ """Batch processing with 50% discount, 24-hour turnaround
132
+ Example: GPT-4o batch API at $1.25/1M input tokens (vs $2.50 standard)
133
+ """
134
+ PRICING_TIER_FLEX: _PricingTier.ValueType # 3
135
+ """Flexible/on-demand tier (between batch and standard)
136
+ Example: Variable pricing based on system load
137
+ """
138
+ PRICING_TIER_STANDARD: _PricingTier.ValueType # 4
139
+ """Standard/regular pricing tier
140
+ Example: GPT-4o at $2.50/1M input tokens for real-time API
141
+ """
142
+ PRICING_TIER_PRIORITY: _PricingTier.ValueType # 5
143
+ """Priority access with higher costs but guaranteed availability
144
+ Example: Reserved capacity with SLA guarantees
145
+ """
146
+ PRICING_TIER_ENTERPRISE: _PricingTier.ValueType # 6
147
+ """Enterprise/custom pricing with negotiated rates
148
+ Example: Volume discounts for large organizations
149
+ """
150
+
151
+ class PricingTier(_PricingTier, metaclass=_PricingTierEnumTypeWrapper):
152
+ """PricingTier represents different service levels with varying costs and SLAs."""
153
+
154
+ PRICING_TIER_UNSPECIFIED: PricingTier.ValueType # 0
155
+ """Default/unknown tier"""
156
+ PRICING_TIER_FREE: PricingTier.ValueType # 1
157
+ """Free tier with usage limits
158
+ Example: Free API credits for new users
159
+ """
160
+ PRICING_TIER_BATCH: PricingTier.ValueType # 2
161
+ """Batch processing with 50% discount, 24-hour turnaround
162
+ Example: GPT-4o batch API at $1.25/1M input tokens (vs $2.50 standard)
163
+ """
164
+ PRICING_TIER_FLEX: PricingTier.ValueType # 3
165
+ """Flexible/on-demand tier (between batch and standard)
166
+ Example: Variable pricing based on system load
167
+ """
168
+ PRICING_TIER_STANDARD: PricingTier.ValueType # 4
169
+ """Standard/regular pricing tier
170
+ Example: GPT-4o at $2.50/1M input tokens for real-time API
171
+ """
172
+ PRICING_TIER_PRIORITY: PricingTier.ValueType # 5
173
+ """Priority access with higher costs but guaranteed availability
174
+ Example: Reserved capacity with SLA guarantees
175
+ """
176
+ PRICING_TIER_ENTERPRISE: PricingTier.ValueType # 6
177
+ """Enterprise/custom pricing with negotiated rates
178
+ Example: Volume discounts for large organizations
179
+ """
180
+ global___PricingTier = PricingTier
181
+
182
+ class _Operation:
183
+ ValueType = typing.NewType("ValueType", builtins.int)
184
+ V: typing_extensions.TypeAlias = ValueType
185
+
186
+ class _OperationEnumTypeWrapper(
187
+ google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Operation.ValueType],
188
+ builtins.type,
189
+ ):
190
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
191
+ OPERATION_UNSPECIFIED: _Operation.ValueType # 0
192
+ """Default/unknown operation"""
193
+ OPERATION_INPUT: _Operation.ValueType # 1
194
+ """Input/prompt tokens sent to the model
195
+ Example: User message in chat, $2.50/1M tokens for GPT-4o
196
+ """
197
+ OPERATION_OUTPUT: _Operation.ValueType # 2
198
+ """Output/completion tokens generated by the model
199
+ Example: Model response, $10.00/1M tokens for GPT-4o
200
+ """
201
+ OPERATION_CACHED_INPUT: _Operation.ValueType # 3
202
+ """Cached input tokens (discounted rate for repeated context)
203
+ Example: $1.25/1M tokens for GPT-4o cached prompt (50% discount)
204
+ """
205
+ OPERATION_CACHE_READ: _Operation.ValueType # 4
206
+ """Reading from cache (if priced separately from cached input)
207
+ Example: Anthropic Claude cache read operations
208
+ """
209
+ OPERATION_CACHE_WRITE: _Operation.ValueType # 5
210
+ """Writing to cache (creating cached context)
211
+ Example: Anthropic Claude cache creation fee
212
+ """
213
+ OPERATION_TRAINING: _Operation.ValueType # 6
214
+ """Fine-tuning training cost (per token or per hour)
215
+ Example: $25.00/1M tokens or $3.00/hour for GPT-4o-mini training
216
+ """
217
+ OPERATION_STORAGE: _Operation.ValueType # 7
218
+ """General storage costs
219
+ Example: Vector database storage for embeddings
220
+ """
221
+ OPERATION_CONTEXT_CACHE_STORAGE: _Operation.ValueType # 8
222
+ """Context cache storage charged per time unit
223
+ Example: $0.10/GB/hour for maintaining cached contexts
224
+ """
225
+ OPERATION_PER_CALL: _Operation.ValueType # 9
226
+ """Fixed price per API call regardless of tokens
227
+ Example: $0.00255/call for file search tool
228
+ """
229
+ OPERATION_PER_CONTAINER: _Operation.ValueType # 10
230
+ """Per container/session pricing for isolated environments
231
+ Example: $0.03/container for Code Interpreter execution
232
+ """
233
+
234
+ class Operation(_Operation, metaclass=_OperationEnumTypeWrapper):
235
+ """Operation defines the specific type of usage being priced."""
236
+
237
+ OPERATION_UNSPECIFIED: Operation.ValueType # 0
238
+ """Default/unknown operation"""
239
+ OPERATION_INPUT: Operation.ValueType # 1
240
+ """Input/prompt tokens sent to the model
241
+ Example: User message in chat, $2.50/1M tokens for GPT-4o
242
+ """
243
+ OPERATION_OUTPUT: Operation.ValueType # 2
244
+ """Output/completion tokens generated by the model
245
+ Example: Model response, $10.00/1M tokens for GPT-4o
246
+ """
247
+ OPERATION_CACHED_INPUT: Operation.ValueType # 3
248
+ """Cached input tokens (discounted rate for repeated context)
249
+ Example: $1.25/1M tokens for GPT-4o cached prompt (50% discount)
250
+ """
251
+ OPERATION_CACHE_READ: Operation.ValueType # 4
252
+ """Reading from cache (if priced separately from cached input)
253
+ Example: Anthropic Claude cache read operations
254
+ """
255
+ OPERATION_CACHE_WRITE: Operation.ValueType # 5
256
+ """Writing to cache (creating cached context)
257
+ Example: Anthropic Claude cache creation fee
258
+ """
259
+ OPERATION_TRAINING: Operation.ValueType # 6
260
+ """Fine-tuning training cost (per token or per hour)
261
+ Example: $25.00/1M tokens or $3.00/hour for GPT-4o-mini training
262
+ """
263
+ OPERATION_STORAGE: Operation.ValueType # 7
264
+ """General storage costs
265
+ Example: Vector database storage for embeddings
266
+ """
267
+ OPERATION_CONTEXT_CACHE_STORAGE: Operation.ValueType # 8
268
+ """Context cache storage charged per time unit
269
+ Example: $0.10/GB/hour for maintaining cached contexts
270
+ """
271
+ OPERATION_PER_CALL: Operation.ValueType # 9
272
+ """Fixed price per API call regardless of tokens
273
+ Example: $0.00255/call for file search tool
274
+ """
275
+ OPERATION_PER_CONTAINER: Operation.ValueType # 10
276
+ """Per container/session pricing for isolated environments
277
+ Example: $0.03/container for Code Interpreter execution
278
+ """
279
+ global___Operation = Operation
280
+
281
+ class _PriceUnit:
282
+ ValueType = typing.NewType("ValueType", builtins.int)
283
+ V: typing_extensions.TypeAlias = ValueType
284
+
285
+ class _PriceUnitEnumTypeWrapper(
286
+ google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_PriceUnit.ValueType],
287
+ builtins.type,
288
+ ):
289
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
290
+ PRICE_UNIT_UNSPECIFIED: _PriceUnit.ValueType # 0
291
+ """Default/unknown unit"""
292
+ PRICE_UNIT_PER_1M_TOKENS: _PriceUnit.ValueType # 1
293
+ """Price per million tokens (most common for LLMs)
294
+ Example: $2.50 per 1M input tokens
295
+ """
296
+ PRICE_UNIT_PER_IMAGE: _PriceUnit.ValueType # 2
297
+ """Price per generated image
298
+ Example: DALL-E 3 at $0.040 per 1024x1024 image
299
+ """
300
+ PRICE_UNIT_PER_MINUTE: _PriceUnit.ValueType # 3
301
+ """Price per minute of processing
302
+ Example: Whisper at $0.006 per minute of audio
303
+ """
304
+ PRICE_UNIT_PER_1M_CHARACTERS: _PriceUnit.ValueType # 4
305
+ """Price per million characters (for text not tokenized)
306
+ Example: Some translation APIs charge per character
307
+ """
308
+ PRICE_UNIT_PER_CALL: _PriceUnit.ValueType # 5
309
+ """Fixed price per API call
310
+ Example: Moderation at $0.001 per call
311
+ """
312
+ PRICE_UNIT_PER_GB_DAY: _PriceUnit.ValueType # 6
313
+ """Storage price per GB per day
314
+ Example: File search storage at $0.20/GB/day
315
+ """
316
+ PRICE_UNIT_PER_HOUR: _PriceUnit.ValueType # 7
317
+ """Price per hour (training or runtime)
318
+ Example: Fine-tuning at $3.00/hour for small models
319
+ """
320
+ PRICE_UNIT_PER_1K_CALLS: _PriceUnit.ValueType # 8
321
+ """Price per thousand API calls
322
+ Example: Web search at $2.00 per 1k searches
323
+ """
324
+
325
+ class PriceUnit(_PriceUnit, metaclass=_PriceUnitEnumTypeWrapper):
326
+ """PriceUnit specifies how the price is measured/charged."""
327
+
328
+ PRICE_UNIT_UNSPECIFIED: PriceUnit.ValueType # 0
329
+ """Default/unknown unit"""
330
+ PRICE_UNIT_PER_1M_TOKENS: PriceUnit.ValueType # 1
331
+ """Price per million tokens (most common for LLMs)
332
+ Example: $2.50 per 1M input tokens
333
+ """
334
+ PRICE_UNIT_PER_IMAGE: PriceUnit.ValueType # 2
335
+ """Price per generated image
336
+ Example: DALL-E 3 at $0.040 per 1024x1024 image
337
+ """
338
+ PRICE_UNIT_PER_MINUTE: PriceUnit.ValueType # 3
339
+ """Price per minute of processing
340
+ Example: Whisper at $0.006 per minute of audio
341
+ """
342
+ PRICE_UNIT_PER_1M_CHARACTERS: PriceUnit.ValueType # 4
343
+ """Price per million characters (for text not tokenized)
344
+ Example: Some translation APIs charge per character
345
+ """
346
+ PRICE_UNIT_PER_CALL: PriceUnit.ValueType # 5
347
+ """Fixed price per API call
348
+ Example: Moderation at $0.001 per call
349
+ """
350
+ PRICE_UNIT_PER_GB_DAY: PriceUnit.ValueType # 6
351
+ """Storage price per GB per day
352
+ Example: File search storage at $0.20/GB/day
353
+ """
354
+ PRICE_UNIT_PER_HOUR: PriceUnit.ValueType # 7
355
+ """Price per hour (training or runtime)
356
+ Example: Fine-tuning at $3.00/hour for small models
357
+ """
358
+ PRICE_UNIT_PER_1K_CALLS: PriceUnit.ValueType # 8
359
+ """Price per thousand API calls
360
+ Example: Web search at $2.00 per 1k searches
361
+ """
362
+ global___PriceUnit = PriceUnit
363
+
364
+ @typing.final
365
+ class Pricing(google.protobuf.message.Message):
366
+ """Pricing represents the complete pricing structure for a model or service.
367
+ A single model may have multiple pricing items for different operations,
368
+ tiers, and use cases.
369
+ """
370
+
371
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
372
+
373
+ @typing.final
374
+ class MetadataEntry(google.protobuf.message.Message):
375
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
376
+
377
+ KEY_FIELD_NUMBER: builtins.int
378
+ VALUE_FIELD_NUMBER: builtins.int
379
+ key: builtins.str
380
+ value: builtins.str
381
+ def __init__(
382
+ self,
383
+ *,
384
+ key: builtins.str = ...,
385
+ value: builtins.str = ...,
386
+ ) -> None: ...
387
+ def ClearField(
388
+ self, field_name: typing.Literal["key", b"key", "value", b"value"]
389
+ ) -> None: ...
390
+
391
+ CURRENCY_FIELD_NUMBER: builtins.int
392
+ ITEMS_FIELD_NUMBER: builtins.int
393
+ METADATA_FIELD_NUMBER: builtins.int
394
+ currency: builtins.str
395
+ """Currency code for all prices in this message.
396
+ Examples: "USD", "EUR", "GBP"
397
+ """
398
+ @property
399
+ def items(
400
+ self,
401
+ ) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
402
+ global___PricingItem
403
+ ]:
404
+ """List of all pricing entries for this model.
405
+ Each item represents a specific price point for a particular
406
+ operation/tier combination.
407
+ Example: One item for standard input tokens, another for batch input tokens
408
+ """
409
+
410
+ @property
411
+ def metadata(
412
+ self,
413
+ ) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]:
414
+ """Additional metadata as key-value pairs.
415
+ Common keys:
416
+ - "footnote": Additional pricing notes (e.g., "[1] Limited availability")
417
+ - "estimated_cost": Estimated costs for transcription models
418
+ - "source_url": URL where pricing was sourced from
419
+ - "last_updated": ISO 8601 timestamp of last update
420
+ """
421
+
422
+ def __init__(
423
+ self,
424
+ *,
425
+ currency: builtins.str = ...,
426
+ items: collections.abc.Iterable[global___PricingItem] | None = ...,
427
+ metadata: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
428
+ ) -> None: ...
429
+ def ClearField(
430
+ self,
431
+ field_name: typing.Literal[
432
+ "currency", b"currency", "items", b"items", "metadata", b"metadata"
433
+ ],
434
+ ) -> None: ...
435
+
436
+ global___Pricing = Pricing
437
+
438
+ @typing.final
439
+ class TokenBand(google.protobuf.message.Message):
440
+ """TokenBand represents tiered pricing based on token count thresholds.
441
+ Some models have different rates based on cumulative token usage.
442
+ """
443
+
444
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
445
+
446
+ MIN_PROMPT_TOKENS_FIELD_NUMBER: builtins.int
447
+ MAX_PROMPT_TOKENS_FIELD_NUMBER: builtins.int
448
+ min_prompt_tokens: builtins.int
449
+ """Minimum number of prompt tokens for this pricing tier (inclusive).
450
+ Example: 0 for the first tier, 200001 for the "over 200k" tier
451
+ Set to 0 if not applicable or for the lowest tier
452
+ """
453
+ max_prompt_tokens: builtins.int
454
+ """Maximum number of prompt tokens for this pricing tier (inclusive).
455
+ Example: 200000 for "up to 200k tokens" tier
456
+ Set to 0 if unlimited or not applicable
457
+ """
458
+ def __init__(
459
+ self,
460
+ *,
461
+ min_prompt_tokens: builtins.int = ...,
462
+ max_prompt_tokens: builtins.int = ...,
463
+ ) -> None: ...
464
+ def ClearField(
465
+ self,
466
+ field_name: typing.Literal[
467
+ "max_prompt_tokens",
468
+ b"max_prompt_tokens",
469
+ "min_prompt_tokens",
470
+ b"min_prompt_tokens",
471
+ ],
472
+ ) -> None: ...
473
+
474
+ global___TokenBand = TokenBand
475
+
476
+ @typing.final
477
+ class PricingItem(google.protobuf.message.Message):
478
+ """PricingItem represents a specific price point for a model/service.
479
+ Each item captures one pricing scenario with all relevant qualifiers.
480
+ """
481
+
482
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
483
+
484
+ CATEGORY_FIELD_NUMBER: builtins.int
485
+ TIER_FIELD_NUMBER: builtins.int
486
+ OPERATION_FIELD_NUMBER: builtins.int
487
+ PRICE_FIELD_NUMBER: builtins.int
488
+ UNIT_FIELD_NUMBER: builtins.int
489
+ QUALITY_FIELD_NUMBER: builtins.int
490
+ RESOLUTION_FIELD_NUMBER: builtins.int
491
+ TOKEN_BAND_FIELD_NUMBER: builtins.int
492
+ INCLUDES_THINKING_TOKENS_FIELD_NUMBER: builtins.int
493
+ TOOL_NAME_FIELD_NUMBER: builtins.int
494
+ TOKEN_TYPE_FIELD_NUMBER: builtins.int
495
+ NOTES_FIELD_NUMBER: builtins.int
496
+ category: global___PricingCategory.ValueType
497
+ """The type of AI capability this price applies to.
498
+ Example: PRICING_CATEGORY_TEXT for GPT-4o chat completion
499
+ """
500
+ tier: global___PricingTier.ValueType
501
+ """Service tier affecting price and SLA.
502
+ Example: PRICING_TIER_BATCH for 50% discounted async processing
503
+ """
504
+ operation: global___Operation.ValueType
505
+ """The specific operation being charged for.
506
+ Example: OPERATION_INPUT for prompt tokens, OPERATION_OUTPUT for completions
507
+ """
508
+ price: builtins.float
509
+ """The numeric cost amount.
510
+ Example: 2.50 for "$2.50 per 1M tokens"
511
+ """
512
+ unit: global___PriceUnit.ValueType
513
+ """The unit that the price applies to.
514
+ Example: PRICE_UNIT_PER_1M_TOKENS for token-based pricing
515
+ """
516
+ quality: builtins.str
517
+ """Optional qualifiers to disambiguate pricing variants:
518
+
519
+ Quality level for image generation.
520
+ Examples: "standard", "hd" for DALL-E, "low", "medium", "high" for others
521
+ """
522
+ resolution: builtins.str
523
+ """Image resolution for image generation pricing.
524
+ Examples: "1024x1024", "1792x1024", "1024x1792"
525
+ """
526
+ includes_thinking_tokens: builtins.bool
527
+ """Whether output pricing includes hidden reasoning tokens.
528
+ Example: true for o1-preview which charges for internal thinking
529
+ """
530
+ tool_name: builtins.str
531
+ """Name of the tool for PRICING_CATEGORY_TOOL items.
532
+ Examples: "Web Search", "File Search", "Code Interpreter"
533
+ """
534
+ token_type: builtins.str
535
+ """Token type for multi-modal pricing.
536
+ Examples: "text" vs "audio" for Whisper transcription models
537
+ """
538
+ notes: builtins.str
539
+ """Additional human-readable notes about this pricing.
540
+ Example: "Discounted pricing with data sharing enabled"
541
+ """
542
+ @property
543
+ def token_band(self) -> global___TokenBand:
544
+ """Token count thresholds for tiered pricing.
545
+ Example: Different rates for prompts over 200k tokens
546
+ """
547
+
548
+ def __init__(
549
+ self,
550
+ *,
551
+ category: global___PricingCategory.ValueType = ...,
552
+ tier: global___PricingTier.ValueType = ...,
553
+ operation: global___Operation.ValueType = ...,
554
+ price: builtins.float = ...,
555
+ unit: global___PriceUnit.ValueType = ...,
556
+ quality: builtins.str = ...,
557
+ resolution: builtins.str = ...,
558
+ token_band: global___TokenBand | None = ...,
559
+ includes_thinking_tokens: builtins.bool = ...,
560
+ tool_name: builtins.str = ...,
561
+ token_type: builtins.str = ...,
562
+ notes: builtins.str = ...,
563
+ ) -> None: ...
564
+ def HasField(
565
+ self, field_name: typing.Literal["token_band", b"token_band"]
566
+ ) -> builtins.bool: ...
567
+ def ClearField(
568
+ self,
569
+ field_name: typing.Literal[
570
+ "category",
571
+ b"category",
572
+ "includes_thinking_tokens",
573
+ b"includes_thinking_tokens",
574
+ "notes",
575
+ b"notes",
576
+ "operation",
577
+ b"operation",
578
+ "price",
579
+ b"price",
580
+ "quality",
581
+ b"quality",
582
+ "resolution",
583
+ b"resolution",
584
+ "tier",
585
+ b"tier",
586
+ "token_band",
587
+ b"token_band",
588
+ "token_type",
589
+ b"token_type",
590
+ "tool_name",
591
+ b"tool_name",
592
+ "unit",
593
+ b"unit",
594
+ ],
595
+ ) -> None: ...
596
+
597
+ global___PricingItem = PricingItem
@@ -0,0 +1,2 @@
1
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
2
+ """Client and server classes corresponding to protobuf-defined services."""