tokenator 0.1.12__py3-none-any.whl → 0.1.13__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.
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: tokenator
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.13
|
4
4
|
Summary: Token usage tracking wrapper for LLMs
|
5
5
|
License: MIT
|
6
6
|
Author: Ujjwal Maheshwari
|
@@ -186,7 +186,7 @@ xai_client = OpenAI(
|
|
186
186
|
)
|
187
187
|
|
188
188
|
# Wrap it with Tokenator
|
189
|
-
client = tokenator_openai(
|
189
|
+
client = tokenator_openai(xai_client, db_path=temp_db, provider="xai")
|
190
190
|
|
191
191
|
# Use it exactly like the OpenAI client but with xAI models
|
192
192
|
response = client.chat.completions.create(
|
@@ -210,17 +210,17 @@ For example, let's see how we can track usage of `perplexity` tokens.
|
|
210
210
|
from openai import OpenAI
|
211
211
|
from tokenator import tokenator_openai
|
212
212
|
|
213
|
-
|
213
|
+
perplexity_client = OpenAI(
|
214
214
|
api_key=os.getenv("PERPLEXITY_API_KEY"),
|
215
215
|
base_url="https://api.perplexity.ai"
|
216
216
|
)
|
217
217
|
|
218
218
|
# Wrap it with Tokenator
|
219
|
-
client = tokenator_openai(
|
219
|
+
client = tokenator_openai(perplexity_client, db_path=temp_db, provider="perplexity")
|
220
220
|
|
221
|
-
# Use it exactly like the OpenAI client but with
|
221
|
+
# Use it exactly like the OpenAI client but with perplexity models
|
222
222
|
response = client.chat.completions.create(
|
223
|
-
model="
|
223
|
+
model="llama-3.1-sonar-small-128k-online",
|
224
224
|
messages=[{"role": "user", "content": "Hello!"}]
|
225
225
|
)
|
226
226
|
|
@@ -13,7 +13,7 @@ tokenator/openai/stream_interceptors.py,sha256=ez1MnjRZW_rEalv2SIPAvrU9oMD6OJoD9
|
|
13
13
|
tokenator/schemas.py,sha256=Ye8hqZlrm3Gh2FyvOVX-hWCpKynWxS58QQRQMfDtIAQ,2114
|
14
14
|
tokenator/usage.py,sha256=eTWfcRrTLop-30FmwHpi7_GwCJxU6Qfji374hG1Qptw,8476
|
15
15
|
tokenator/utils.py,sha256=xg9l2GV1yJL1BlxKL1r8CboABWDslf3G5rGQEJSjFrE,1973
|
16
|
-
tokenator-0.1.
|
17
|
-
tokenator-0.1.
|
18
|
-
tokenator-0.1.
|
19
|
-
tokenator-0.1.
|
16
|
+
tokenator-0.1.13.dist-info/LICENSE,sha256=wdG-B6-ODk8RQ4jq5uXSn0w1UWTzCH_MMyvh7AwtGns,1074
|
17
|
+
tokenator-0.1.13.dist-info/METADATA,sha256=fyNOYplEXJkHP8jyAigmrhr30U1TDhgC2BBNahusyJw,6018
|
18
|
+
tokenator-0.1.13.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
19
|
+
tokenator-0.1.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|