fenra 0.1.0__tar.gz → 0.1.2__tar.gz
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.
- {fenra-0.1.0 → fenra-0.1.2}/PKG-INFO +22 -5
- {fenra-0.1.0 → fenra-0.1.2}/README.md +19 -2
- {fenra-0.1.0 → fenra-0.1.2}/pyproject.toml +3 -3
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/_core.py +15 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/__init__.py +0 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/_context.py +0 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/integrations/__init__.py +0 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/integrations/anthropic/__init__.py +0 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/integrations/gemini/__init__.py +0 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/integrations/openai/__init__.py +0 -0
- {fenra-0.1.0 → fenra-0.1.2}/src/fenra/py.typed +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: fenra
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: FinOps platform for AI cost visibility
|
|
5
5
|
Author: Ajdin Ahmetovic
|
|
6
6
|
Author-email: Ajdin Ahmetovic <ahmetovicajdin@gmail.com>
|
|
7
7
|
Requires-Dist: requests>=2.28.0
|
|
@@ -13,7 +13,7 @@ Requires-Dist: mypy>=1.0.0 ; extra == 'dev'
|
|
|
13
13
|
Requires-Dist: ruff>=0.1.0 ; extra == 'dev'
|
|
14
14
|
Requires-Dist: google-genai>=1.0.0 ; extra == 'gemini'
|
|
15
15
|
Requires-Dist: openai>=1.0.0 ; extra == 'openai'
|
|
16
|
-
Requires-Python: >=3.
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
17
|
Provides-Extra: all
|
|
18
18
|
Provides-Extra: anthropic
|
|
19
19
|
Provides-Extra: dev
|
|
@@ -22,7 +22,7 @@ Provides-Extra: openai
|
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
24
24
|
<p align="center">
|
|
25
|
-
<img src="https://fenra.io/
|
|
25
|
+
<img src="https://assets.fenra.io/public/header.png" alt="Fenra" width="100%">
|
|
26
26
|
</p>
|
|
27
27
|
|
|
28
28
|
# Fenra Python SDK
|
|
@@ -57,7 +57,17 @@ response = client.chat.completions.create(
|
|
|
57
57
|
)
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
Works with Anthropic and Gemini the same way.
|
|
60
|
+
Works with Anthropic (Claude) and Google (Gemini) the same way.
|
|
61
|
+
|
|
62
|
+
Set context for cost attribution:
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
fenra.set_context(
|
|
66
|
+
billable_customer_id="cust_123", # recommended
|
|
67
|
+
environment="production",
|
|
68
|
+
feature="chat",
|
|
69
|
+
)
|
|
70
|
+
```
|
|
61
71
|
|
|
62
72
|
For custom providers or manual tracking:
|
|
63
73
|
|
|
@@ -76,6 +86,13 @@ To disable auto-tracking:
|
|
|
76
86
|
export FENRA_DISABLE_AUTO_TRACK=1
|
|
77
87
|
```
|
|
78
88
|
|
|
89
|
+
To enable debug logging:
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import logging
|
|
93
|
+
logging.getLogger("fenra").setLevel(logging.DEBUG)
|
|
94
|
+
```
|
|
95
|
+
|
|
79
96
|
## Support
|
|
80
97
|
|
|
81
98
|
- [Documentation](https://docs.fenra.io)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://fenra.io/
|
|
2
|
+
<img src="https://assets.fenra.io/public/header.png" alt="Fenra" width="100%">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# Fenra Python SDK
|
|
@@ -34,7 +34,17 @@ response = client.chat.completions.create(
|
|
|
34
34
|
)
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Works with Anthropic and Gemini the same way.
|
|
37
|
+
Works with Anthropic (Claude) and Google (Gemini) the same way.
|
|
38
|
+
|
|
39
|
+
Set context for cost attribution:
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
fenra.set_context(
|
|
43
|
+
billable_customer_id="cust_123", # recommended
|
|
44
|
+
environment="production",
|
|
45
|
+
feature="chat",
|
|
46
|
+
)
|
|
47
|
+
```
|
|
38
48
|
|
|
39
49
|
For custom providers or manual tracking:
|
|
40
50
|
|
|
@@ -53,6 +63,13 @@ To disable auto-tracking:
|
|
|
53
63
|
export FENRA_DISABLE_AUTO_TRACK=1
|
|
54
64
|
```
|
|
55
65
|
|
|
66
|
+
To enable debug logging:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
import logging
|
|
70
|
+
logging.getLogger("fenra").setLevel(logging.DEBUG)
|
|
71
|
+
```
|
|
72
|
+
|
|
56
73
|
## Support
|
|
57
74
|
|
|
58
75
|
- [Documentation](https://docs.fenra.io)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "fenra"
|
|
3
|
-
version = "0.1.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.1.2"
|
|
4
|
+
description = "FinOps platform for AI cost visibility"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
7
7
|
{ name = "Ajdin Ahmetovic", email = "ahmetovicajdin@gmail.com" }
|
|
8
8
|
]
|
|
9
|
-
requires-python = ">=3.
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"requests>=2.28.0",
|
|
12
12
|
]
|
|
@@ -221,6 +221,21 @@ def enqueue_transaction(transaction: dict[str, Any]) -> None:
|
|
|
221
221
|
if not config.enabled:
|
|
222
222
|
return
|
|
223
223
|
|
|
224
|
+
# Ensure billable_customer_id is set (required by API)
|
|
225
|
+
if "context" not in transaction:
|
|
226
|
+
transaction["context"] = {}
|
|
227
|
+
if not transaction["context"].get("billable_customer_id"):
|
|
228
|
+
transaction["context"]["billable_customer_id"] = "unknown"
|
|
229
|
+
logger.warning(
|
|
230
|
+
"Fenra: billable_customer_id not set. "
|
|
231
|
+
"Use fenra.set_context(billable_customer_id='...') for customer attribution."
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
logger.debug(
|
|
235
|
+
f"Fenra: Enqueuing transaction - provider={transaction.get('provider')}, "
|
|
236
|
+
f"model={transaction.get('model')}, context={transaction.get('context')}"
|
|
237
|
+
)
|
|
238
|
+
|
|
224
239
|
_get_queue().put_nowait(transaction)
|
|
225
240
|
except queue.Full:
|
|
226
241
|
logger.warning("Fenra transaction queue is full, dropping transaction")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|