cost-katana 1.0.1__py3-none-any.whl → 1.0.2__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.
- cost_katana/__init__.py +16 -14
- cost_katana/cli.py +581 -119
- cost_katana/client.py +298 -75
- cost_katana/config.py +82 -85
- cost_katana/exceptions.py +19 -1
- cost_katana/models.py +110 -111
- {cost_katana-1.0.1.dist-info → cost_katana-1.0.2.dist-info}/METADATA +5 -4
- cost_katana-1.0.2.dist-info/RECORD +12 -0
- cost_katana-1.0.1.dist-info/RECORD +0 -12
- {cost_katana-1.0.1.dist-info → cost_katana-1.0.2.dist-info}/WHEEL +0 -0
- {cost_katana-1.0.1.dist-info → cost_katana-1.0.2.dist-info}/entry_points.txt +0 -0
- {cost_katana-1.0.1.dist-info → cost_katana-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {cost_katana-1.0.1.dist-info → cost_katana-1.0.2.dist-info}/top_level.txt +0 -0
cost_katana/__init__.py
CHANGED
@@ -9,10 +9,10 @@ Simple interface for AI models that routes through Cost Katana for:
|
|
9
9
|
|
10
10
|
Example:
|
11
11
|
import cost_katana as ck
|
12
|
-
|
12
|
+
|
13
13
|
# Configure once
|
14
14
|
ck.configure(config_file='config.json')
|
15
|
-
|
15
|
+
|
16
16
|
# Use like any AI library
|
17
17
|
model = ck.GenerativeModel('gemini-2.0-flash')
|
18
18
|
chat = model.start_chat()
|
@@ -21,49 +21,51 @@ Example:
|
|
21
21
|
"""
|
22
22
|
|
23
23
|
from .client import CostKatanaClient, get_global_client
|
24
|
-
from .models import
|
24
|
+
from .models import ChatSession
|
25
25
|
from .exceptions import (
|
26
26
|
CostKatanaError,
|
27
27
|
AuthenticationError,
|
28
28
|
ModelNotAvailableError,
|
29
29
|
RateLimitError,
|
30
|
-
CostLimitExceededError
|
30
|
+
CostLimitExceededError,
|
31
31
|
)
|
32
32
|
from .config import Config
|
33
33
|
|
34
|
-
__version__ = "1.0.
|
34
|
+
__version__ = "1.0.2"
|
35
35
|
__all__ = [
|
36
36
|
"configure",
|
37
|
-
"
|
37
|
+
"create_generative_model",
|
38
38
|
"ChatSession",
|
39
39
|
"CostKatanaClient",
|
40
40
|
"CostKatanaError",
|
41
|
-
"AuthenticationError",
|
41
|
+
"AuthenticationError",
|
42
42
|
"ModelNotAvailableError",
|
43
43
|
"RateLimitError",
|
44
44
|
"CostLimitExceededError",
|
45
|
-
"Config"
|
45
|
+
"Config",
|
46
46
|
]
|
47
47
|
|
48
48
|
# Import configure function from client
|
49
49
|
from .client import configure
|
50
50
|
|
51
|
-
|
51
|
+
|
52
|
+
def create_generative_model(model_name: str, **kwargs):
|
52
53
|
"""
|
53
54
|
Create a generative model instance.
|
54
|
-
|
55
|
+
|
55
56
|
Args:
|
56
57
|
model_name: Name of the model (e.g., 'gemini-2.0-flash', 'claude-3-sonnet', 'gpt-4')
|
57
58
|
**kwargs: Additional model configuration
|
58
|
-
|
59
|
+
|
59
60
|
Returns:
|
60
61
|
GenerativeModel instance
|
61
|
-
|
62
|
+
|
62
63
|
Example:
|
63
64
|
model = cost_katana.GenerativeModel('gemini-2.0-flash')
|
64
65
|
response = model.generate_content("Hello, world!")
|
65
66
|
"""
|
66
67
|
client = get_global_client()
|
67
|
-
|
68
|
+
|
68
69
|
from .models import GenerativeModel as GM
|
69
|
-
|
70
|
+
|
71
|
+
return GM(client, model_name, **kwargs)
|