openmeter 1.0.0b54__py3-none-any.whl → 2.0.0__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.
Potentially problematic release.
This version of openmeter might be problematic. Click here for more details.
- openmeter/__init__.py +89 -15
- openmeter/_base_client.py +2041 -0
- openmeter/_client.py +518 -70
- openmeter/_compat.py +221 -0
- openmeter/_constants.py +14 -0
- openmeter/_exceptions.py +108 -0
- openmeter/_files.py +127 -0
- openmeter/_models.py +777 -0
- openmeter/_qs.py +150 -0
- openmeter/_resource.py +43 -0
- openmeter/_response.py +820 -0
- openmeter/_streaming.py +333 -0
- openmeter/_types.py +222 -0
- openmeter/_utils/__init__.py +56 -0
- openmeter/_utils/_logs.py +25 -0
- openmeter/_utils/_proxy.py +63 -0
- openmeter/_utils/_reflection.py +42 -0
- openmeter/_utils/_streams.py +12 -0
- openmeter/_utils/_sync.py +81 -0
- openmeter/_utils/_transform.py +387 -0
- openmeter/_utils/_typing.py +120 -0
- openmeter/_utils/_utils.py +419 -0
- openmeter/_version.py +4 -0
- openmeter/lib/.keep +4 -0
- openmeter/py.typed +0 -1
- openmeter/resources/__init__.py +103 -0
- openmeter/resources/debug/__init__.py +33 -0
- openmeter/resources/debug/debug.py +102 -0
- openmeter/resources/debug/metrics.py +146 -0
- openmeter/resources/entitlements/__init__.py +47 -0
- openmeter/resources/entitlements/entitlements.py +450 -0
- openmeter/resources/entitlements/features.py +578 -0
- openmeter/resources/entitlements/grants.py +389 -0
- openmeter/resources/events.py +442 -0
- openmeter/resources/meters/__init__.py +33 -0
- openmeter/resources/meters/meters.py +666 -0
- openmeter/resources/meters/subjects.py +163 -0
- openmeter/resources/notifications/__init__.py +75 -0
- openmeter/resources/notifications/channels.py +686 -0
- openmeter/resources/notifications/events.py +365 -0
- openmeter/resources/notifications/notifications.py +198 -0
- openmeter/resources/notifications/rules.py +781 -0
- openmeter/resources/notifications/webhook.py +208 -0
- openmeter/resources/portal/__init__.py +47 -0
- openmeter/resources/portal/meters.py +230 -0
- openmeter/resources/portal/portal.py +112 -0
- openmeter/resources/portal/tokens.py +359 -0
- openmeter/resources/subjects/entitlements/__init__.py +33 -0
- openmeter/resources/subjects/entitlements/entitlements.py +1881 -0
- openmeter/resources/subjects/entitlements/grants.py +453 -0
- openmeter/resources/subjects.py +419 -0
- openmeter/types/__init__.py +21 -0
- openmeter/types/debug/__init__.py +5 -0
- openmeter/types/debug/metric_list_response.py +7 -0
- openmeter/types/entitlement.py +238 -0
- openmeter/types/entitlements/__init__.py +11 -0
- openmeter/types/entitlements/feature.py +61 -0
- openmeter/types/entitlements/feature_create_params.py +43 -0
- openmeter/types/entitlements/feature_list_params.py +23 -0
- openmeter/types/entitlements/grant_list_params.py +57 -0
- openmeter/types/entitlements/grant_list_response.py +11 -0
- openmeter/types/entitlements/grant_paginated_response.py +24 -0
- openmeter/types/entitlements/list_features_result.py +28 -0
- openmeter/types/event_ingest_params.py +46 -0
- openmeter/types/event_ingest_response.py +43 -0
- openmeter/types/event_list_params.py +22 -0
- openmeter/types/event_list_response.py +9 -0
- openmeter/types/ingested_event.py +59 -0
- openmeter/types/list_entitlements_result.py +28 -0
- openmeter/types/meter.py +53 -0
- openmeter/types/meter_create_params.py +50 -0
- openmeter/types/meter_list_response.py +9 -0
- openmeter/types/meter_query_params.py +50 -0
- openmeter/types/meter_query_result.py +35 -0
- openmeter/types/meters/__init__.py +5 -0
- openmeter/types/meters/subject_list_response.py +8 -0
- openmeter/types/notifications/__init__.py +18 -0
- openmeter/types/notifications/channel_create_params.py +34 -0
- openmeter/types/notifications/channel_list_params.py +41 -0
- openmeter/types/notifications/channel_list_response.py +24 -0
- openmeter/types/notifications/channel_update_params.py +34 -0
- openmeter/types/notifications/event_list_params.py +61 -0
- openmeter/types/notifications/event_list_response.py +24 -0
- openmeter/types/notifications/notification_channel.py +47 -0
- openmeter/types/notifications/notification_event.py +215 -0
- openmeter/types/notifications/notification_rule.py +70 -0
- openmeter/types/notifications/rule_create_params.py +39 -0
- openmeter/types/notifications/rule_list_params.py +54 -0
- openmeter/types/notifications/rule_list_response.py +24 -0
- openmeter/types/notifications/rule_update_params.py +39 -0
- openmeter/types/notifications/webhook_svix_params.py +26 -0
- openmeter/types/portal/__init__.py +10 -0
- openmeter/types/portal/meter_query_params.py +44 -0
- openmeter/types/portal/portal_token.py +28 -0
- openmeter/types/portal/token_create_params.py +17 -0
- openmeter/types/portal/token_invalidate_params.py +15 -0
- openmeter/types/portal/token_list_params.py +12 -0
- openmeter/types/portal/token_list_response.py +9 -0
- openmeter/types/shared/__init__.py +3 -0
- openmeter/types/subject.py +37 -0
- openmeter/types/subject_list_response.py +9 -0
- openmeter/types/subject_param.py +27 -0
- openmeter/types/subject_upsert_params.py +39 -0
- openmeter/types/subject_upsert_response.py +10 -0
- openmeter/types/subjects/__init__.py +13 -0
- openmeter/types/subjects/entitlement_history_params.py +35 -0
- openmeter/types/subjects/entitlement_history_response.py +98 -0
- openmeter/types/subjects/entitlement_list_response.py +10 -0
- openmeter/types/subjects/entitlements/__init__.py +8 -0
- openmeter/types/subjects/entitlements/entitlement_grant.py +103 -0
- openmeter/types/subjects/entitlements/grant_list_response.py +10 -0
- openmeter-2.0.0.dist-info/METADATA +396 -0
- openmeter-2.0.0.dist-info/RECORD +115 -0
- {openmeter-1.0.0b54.dist-info → openmeter-2.0.0.dist-info}/WHEEL +1 -1
- openmeter-2.0.0.dist-info/licenses/LICENSE +201 -0
- openmeter/_configuration.py +0 -36
- openmeter/_operations/__init__.py +0 -17
- openmeter/_operations/_operations.py +0 -2105
- openmeter/_operations/_patch.py +0 -20
- openmeter/_patch.py +0 -20
- openmeter/_serialization.py +0 -2008
- openmeter/_vendor.py +0 -24
- openmeter/aio/__init__.py +0 -21
- openmeter/aio/_client.py +0 -83
- openmeter/aio/_configuration.py +0 -36
- openmeter/aio/_operations/__init__.py +0 -17
- openmeter/aio/_operations/_operations.py +0 -1778
- openmeter/aio/_operations/_patch.py +0 -20
- openmeter/aio/_patch.py +0 -20
- openmeter/aio/_vendor.py +0 -24
- openmeter-1.0.0b54.dist-info/METADATA +0 -92
- openmeter-1.0.0b54.dist-info/RECORD +0 -21
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# ------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation.
|
|
3
|
-
# Licensed under the MIT License.
|
|
4
|
-
# ------------------------------------
|
|
5
|
-
"""Customize generated code here.
|
|
6
|
-
|
|
7
|
-
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
8
|
-
"""
|
|
9
|
-
from typing import List
|
|
10
|
-
|
|
11
|
-
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def patch_sdk():
|
|
15
|
-
"""Do not remove from this file.
|
|
16
|
-
|
|
17
|
-
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
|
18
|
-
you can't accomplish using the techniques described in
|
|
19
|
-
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
20
|
-
"""
|
openmeter/aio/_patch.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# ------------------------------------
|
|
2
|
-
# Copyright (c) Microsoft Corporation.
|
|
3
|
-
# Licensed under the MIT License.
|
|
4
|
-
# ------------------------------------
|
|
5
|
-
"""Customize generated code here.
|
|
6
|
-
|
|
7
|
-
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
8
|
-
"""
|
|
9
|
-
from typing import List
|
|
10
|
-
|
|
11
|
-
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def patch_sdk():
|
|
15
|
-
"""Do not remove from this file.
|
|
16
|
-
|
|
17
|
-
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
|
18
|
-
you can't accomplish using the techniques described in
|
|
19
|
-
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
|
20
|
-
"""
|
openmeter/aio/_vendor.py
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# --------------------------------------------------------------------------
|
|
2
|
-
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/python@6.9.4)
|
|
3
|
-
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
|
-
# --------------------------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
from abc import ABC
|
|
7
|
-
from typing import TYPE_CHECKING
|
|
8
|
-
|
|
9
|
-
from ._configuration import ClientConfiguration
|
|
10
|
-
|
|
11
|
-
if TYPE_CHECKING:
|
|
12
|
-
# pylint: disable=unused-import,ungrouped-imports
|
|
13
|
-
from azure.core import AsyncPipelineClient
|
|
14
|
-
|
|
15
|
-
from .._serialization import Deserializer, Serializer
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class ClientMixinABC(ABC):
|
|
19
|
-
"""DO NOT use this class. It is for internal typing use only."""
|
|
20
|
-
|
|
21
|
-
_client: "AsyncPipelineClient"
|
|
22
|
-
_config: ClientConfiguration
|
|
23
|
-
_serialize: "Serializer"
|
|
24
|
-
_deserialize: "Deserializer"
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: openmeter
|
|
3
|
-
Version: 1.0.0b54
|
|
4
|
-
Summary: Client for OpenMeter: Real-Time and Scalable Usage Metering
|
|
5
|
-
Home-page: https://openmeter.io
|
|
6
|
-
License: Apache-2.0
|
|
7
|
-
Keywords: openmeter,api,client,usage,usage-based,metering,ai,aggregation,real-time,billing,cloud
|
|
8
|
-
Author: Andras Toth
|
|
9
|
-
Author-email: 4157749+tothandras@users.noreply.github.com
|
|
10
|
-
Requires-Python: >=3.9,<4.0
|
|
11
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
-
Provides-Extra: aio
|
|
18
|
-
Requires-Dist: aiohttp (>=3.0) ; extra == "aio"
|
|
19
|
-
Requires-Dist: azure-core (>=1.29.4,<2.0.0)
|
|
20
|
-
Requires-Dist: cloudevents (>=1.10.0,<2.0.0)
|
|
21
|
-
Requires-Dist: isodate (>=0.6.1,<0.7.0)
|
|
22
|
-
Project-URL: Repository, https://github.com/openmeter/openmeter
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
|
|
25
|
-
# OpenMeter Python SDK
|
|
26
|
-
|
|
27
|
-
[https://pypi.org/project/openmeter](On PyPI)
|
|
28
|
-
|
|
29
|
-
## Prerequisites
|
|
30
|
-
|
|
31
|
-
Python version: >= 3.9
|
|
32
|
-
|
|
33
|
-
## Install
|
|
34
|
-
|
|
35
|
-
> The Python SDK is in preview mode.
|
|
36
|
-
|
|
37
|
-
```sh
|
|
38
|
-
pip install openmeter
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Quickstart
|
|
42
|
-
|
|
43
|
-
The client can be initialized with `openmeter.Client()`:
|
|
44
|
-
|
|
45
|
-
```python
|
|
46
|
-
from os import environ
|
|
47
|
-
from openmeter import Client
|
|
48
|
-
|
|
49
|
-
ENDPOINT = environ.get("OPENMETER_ENDPOINT") or "http://localhost:8888"
|
|
50
|
-
|
|
51
|
-
# it's recommended to also set the Accept header at the client level
|
|
52
|
-
client = Client(
|
|
53
|
-
endpoint=ENDPOINT,
|
|
54
|
-
headers={"Accept": "application/json"},
|
|
55
|
-
)
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**Async** client can be initialized by importing the `Client` from `openmeter.aio`.
|
|
59
|
-
|
|
60
|
-
Ingest events:
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
from cloudevents.http import CloudEvent
|
|
64
|
-
from cloudevents.conversion import to_dict
|
|
65
|
-
|
|
66
|
-
event = CloudEvent(
|
|
67
|
-
attributes={
|
|
68
|
-
"type": "tokens",
|
|
69
|
-
"source": "openmeter-python",
|
|
70
|
-
"subject": "user-id",
|
|
71
|
-
},
|
|
72
|
-
data={
|
|
73
|
-
"prompt_tokens": 5,
|
|
74
|
-
"completion_tokens": 10,
|
|
75
|
-
"total_tokens": 15,
|
|
76
|
-
"model": "gpt-3.5-turbo",
|
|
77
|
-
},
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
resp = client.ingest_events(to_dict(event))
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Publish
|
|
84
|
-
|
|
85
|
-
Update version number in `pyproject.toml`.
|
|
86
|
-
Run the following commands:
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
poetry config pypi-token.pypi {your_pypi_api_token}
|
|
90
|
-
poetry publish --build
|
|
91
|
-
```
|
|
92
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
openmeter/__init__.py,sha256=sDCb6heo0vb_f5FVQnnx_lDZFZygXgRWUnycaKvPfBw,701
|
|
2
|
-
openmeter/_client.py,sha256=1YI-BPc_eIxFn9knp3ioaPLSZPL-Rh2UhsjG2VpKCsE,3514
|
|
3
|
-
openmeter/_configuration.py,sha256=BdtwxXvtkdq830K2yFMwW75llzYHpLcw6_LfNETJUI0,1806
|
|
4
|
-
openmeter/_operations/__init__.py,sha256=GEeZyaruo01Fpg-mQYcX9fE7XMTNb4Wweg-VGWsBmCk,681
|
|
5
|
-
openmeter/_operations/_operations.py,sha256=bJYLGtvb_bHLENYMOfUSQtOOvvCKXl9R5EIMvUKR73g,84465
|
|
6
|
-
openmeter/_operations/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
7
|
-
openmeter/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
8
|
-
openmeter/_serialization.py,sha256=Gf75oa-fUBJ7t3KCPzvDclsiKcO8_VYvmOvKnYocS38,79505
|
|
9
|
-
openmeter/_vendor.py,sha256=S7WUg_C2IYZtSkFTL_9DpxKXiCqRb-LaoP4lZ-KCJes,850
|
|
10
|
-
openmeter/aio/__init__.py,sha256=sDCb6heo0vb_f5FVQnnx_lDZFZygXgRWUnycaKvPfBw,701
|
|
11
|
-
openmeter/aio/_client.py,sha256=Gqsceh8vJjbUqeXq_FXTWCIuqvZuQYlYTOt01jEzDLY,3618
|
|
12
|
-
openmeter/aio/_configuration.py,sha256=hj0kewhjCmS53Cn9Zs-YjU0P5lEP9ggBPde3AFuwBIg,1816
|
|
13
|
-
openmeter/aio/_operations/__init__.py,sha256=GEeZyaruo01Fpg-mQYcX9fE7XMTNb4Wweg-VGWsBmCk,681
|
|
14
|
-
openmeter/aio/_operations/_operations.py,sha256=GRC0ZwDTjFGhRBr9W8dwbXXUtK31lkYyLdtyamCb-dE,73082
|
|
15
|
-
openmeter/aio/_operations/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
16
|
-
openmeter/aio/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
17
|
-
openmeter/aio/_vendor.py,sha256=BLqug67t_h-HiZOlAYvwp3vc5vCO4KZ-r3pGSu6uQfM,861
|
|
18
|
-
openmeter/py.typed,sha256=dcrsqJrcYfTX-ckLFJMTaj6mD8aDe2u0tkQG-ZYxnEg,26
|
|
19
|
-
openmeter-1.0.0b54.dist-info/METADATA,sha256=dymQ4O_goQnvFTjQla77gg3q5fPvPi8jI7CO8u6jOrs,2257
|
|
20
|
-
openmeter-1.0.0b54.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
21
|
-
openmeter-1.0.0b54.dist-info/RECORD,,
|