tokenator 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tokenator/__init__.py +12 -4
- {tokenator-0.1.2.dist-info → tokenator-0.1.3.dist-info}/METADATA +1 -1
- {tokenator-0.1.2.dist-info → tokenator-0.1.3.dist-info}/RECORD +5 -5
- {tokenator-0.1.2.dist-info → tokenator-0.1.3.dist-info}/LICENSE +0 -0
- {tokenator-0.1.2.dist-info → tokenator-0.1.3.dist-info}/WHEEL +0 -0
tokenator/__init__.py
CHANGED
@@ -1,12 +1,20 @@
|
|
1
1
|
"""Tokenator - Track and analyze your OpenAI API token usage and costs."""
|
2
2
|
|
3
|
+
import logging
|
3
4
|
from .client_openai import OpenAIWrapper
|
4
5
|
from . import usage
|
5
|
-
from .utils import get_default_db_path
|
6
|
-
from .migrations import check_and_run_migrations
|
6
|
+
from .utils import get_default_db_path, is_colab
|
7
7
|
|
8
8
|
__version__ = "0.1.0"
|
9
9
|
__all__ = ["OpenAIWrapper", "usage", "get_default_db_path"]
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
logger = logging.getLogger(__name__)
|
12
|
+
|
13
|
+
try:
|
14
|
+
if not is_colab():
|
15
|
+
from .migrations import check_and_run_migrations
|
16
|
+
check_and_run_migrations()
|
17
|
+
else:
|
18
|
+
logger.info("Running in Colab environment - skipping migrations")
|
19
|
+
except Exception as e:
|
20
|
+
logger.warning(f"Failed to run migrations, but continuing anyway: {e}")
|
@@ -1,4 +1,4 @@
|
|
1
|
-
tokenator/__init__.py,sha256=
|
1
|
+
tokenator/__init__.py,sha256=SB81-PEkyU-JHuckDNqeoopfpzbfL1jDweLaETPa4J0,626
|
2
2
|
tokenator/base_wrapper.py,sha256=vSu_pStKYulho7_5g0jMCNf84KRxC4kTKep0v8YE61M,2377
|
3
3
|
tokenator/client_anthropic.py,sha256=1ejWIZBxtk-mWTVaKWeMUvS2hZ_Dn-vNKYa3yopdjAU,6714
|
4
4
|
tokenator/client_openai.py,sha256=1xZuRA90kwlflTwEuFkXJHHN584XTeNh1CfEBMLELbQ,6308
|
@@ -10,7 +10,7 @@ tokenator/models.py,sha256=EprE_MMJxDS-YXlcIQLZzfekH7xTYbeOC3bx3B2osVw,1171
|
|
10
10
|
tokenator/schemas.py,sha256=eVdBWi6_hTETnPw50glq0OvSh3PbP2pLl_aHdf3fi-M,2278
|
11
11
|
tokenator/usage.py,sha256=aHjGwzDzaiVznahNk5HqVyk3IxDo5FtFVfOUCeE7DZ4,7833
|
12
12
|
tokenator/utils.py,sha256=UHV6tKLd6zoz7Fml1LokkbGmN1hvQMfXDY4Aulkhar8,1910
|
13
|
-
tokenator-0.1.
|
14
|
-
tokenator-0.1.
|
15
|
-
tokenator-0.1.
|
16
|
-
tokenator-0.1.
|
13
|
+
tokenator-0.1.3.dist-info/LICENSE,sha256=wdG-B6-ODk8RQ4jq5uXSn0w1UWTzCH_MMyvh7AwtGns,1074
|
14
|
+
tokenator-0.1.3.dist-info/METADATA,sha256=kOesX0EPrxsqvrowcayXbA8phU7Ix9xPmp6Jqb_fYHM,2444
|
15
|
+
tokenator-0.1.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
16
|
+
tokenator-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|