tokenator 0.1.5__tar.gz → 0.1.7__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {tokenator-0.1.5 → tokenator-0.1.7}/PKG-INFO +1 -1
- {tokenator-0.1.5 → tokenator-0.1.7}/pyproject.toml +1 -1
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/__init__.py +5 -5
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/utils.py +7 -1
- {tokenator-0.1.5 → tokenator-0.1.7}/LICENSE +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/README.md +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/base_wrapper.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/client_anthropic.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/client_openai.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/create_migrations.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/migrations/env.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/migrations/script.py.mako +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/migrations/versions/f6f1f2437513_initial_migration.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/migrations.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/models.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/schemas.py +0 -0
- {tokenator-0.1.5 → tokenator-0.1.7}/src/tokenator/usage.py +0 -0
@@ -1,18 +1,18 @@
|
|
1
1
|
"""Tokenator - Track and analyze your OpenAI API token usage and costs."""
|
2
2
|
|
3
3
|
import logging
|
4
|
-
from .client_openai import
|
4
|
+
from .client_openai import tokenator_openai
|
5
|
+
from .client_anthropic import tokenator_anthropic
|
5
6
|
from . import usage
|
6
|
-
from .utils import get_default_db_path
|
7
|
+
from .utils import get_default_db_path
|
8
|
+
from .migrations import check_and_run_migrations
|
7
9
|
|
8
10
|
__version__ = "0.1.0"
|
9
|
-
__all__ = ["
|
11
|
+
__all__ = ["tokenator_openai", "tokenator_anthropic", "usage", "get_default_db_path"]
|
10
12
|
|
11
13
|
logger = logging.getLogger(__name__)
|
12
14
|
|
13
15
|
try:
|
14
|
-
# Always run migrations, even in Colab
|
15
|
-
from .migrations import check_and_run_migrations
|
16
16
|
check_and_run_migrations()
|
17
17
|
except Exception as e:
|
18
18
|
logger.warning(f"Failed to run migrations, but continuing anyway: {e}")
|
@@ -47,4 +47,10 @@ def get_default_db_path() -> str:
|
|
47
47
|
# Fallback to current directory if we can't create the default path
|
48
48
|
fallback_path = os.path.join(os.getcwd(), "tokenator_usage.db")
|
49
49
|
logger.warning(f"Could not create default db path, falling back to {fallback_path}. Error: {e}")
|
50
|
-
return fallback_path
|
50
|
+
return fallback_path
|
51
|
+
|
52
|
+
__all__ = [
|
53
|
+
"get_default_db_path",
|
54
|
+
"is_colab",
|
55
|
+
# ... other exports ...
|
56
|
+
]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|