confamnode 0.2.0__tar.gz → 0.2.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.
Files changed (23) hide show
  1. {confamnode-0.2.0 → confamnode-0.2.2}/PKG-INFO +4 -10
  2. {confamnode-0.2.0 → confamnode-0.2.2}/README.md +3 -9
  3. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/__init__.py +1 -1
  4. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/client.py +11 -2
  5. {confamnode-0.2.0 → confamnode-0.2.2}/pyproject.toml +1 -1
  6. {confamnode-0.2.0 → confamnode-0.2.2}/uv.lock +1 -1
  7. {confamnode-0.2.0 → confamnode-0.2.2}/.gitignore +0 -0
  8. {confamnode-0.2.0 → confamnode-0.2.2}/.python-version +0 -0
  9. {confamnode-0.2.0 → confamnode-0.2.2}/LICENSE +0 -0
  10. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/ansa.py +0 -0
  11. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/builders.py +0 -0
  12. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/config.py +0 -0
  13. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/exceptions.py +0 -0
  14. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/models.py +0 -0
  15. {confamnode-0.2.0 → confamnode-0.2.2}/confamnode/registry.py +0 -0
  16. {confamnode-0.2.0 → confamnode-0.2.2}/tests/__init__.py +0 -0
  17. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_ansa.py +0 -0
  18. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_client.py +0 -0
  19. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_exceptions.py +0 -0
  20. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_gist.py +0 -0
  21. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_init.py +0 -0
  22. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_models.py +0 -0
  23. {confamnode-0.2.0 → confamnode-0.2.2}/tests/test_stream.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: confamnode
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: The Nigerian AI inference gateway
5
5
  Project-URL: Repository, https://github.com/confamnodeai/confamnode
6
6
  Project-URL: Bug Tracker, https://github.com/confamnodeai/confamnode/issues
@@ -124,8 +124,6 @@ ansa = stream.get_ansa()
124
124
  print(f"\nModel: {ansa.model}")
125
125
  print(f"Tokens: {ansa.usage.total_tokens}")
126
126
  print(f"Cost: ₦{ansa.cost.naira:.6f}")
127
- if ansa.cost.dollars:
128
- print(f"${ansa.cost.dollars:.8f}")
129
127
  print(f"ID: {ansa.id}")
130
128
  ```
131
129
 
@@ -155,7 +153,6 @@ ansa.usage.total_tokens # total tokens used
155
153
  ansa.cost.naira # total cost in Naira ← primary
156
154
  ansa.cost.naira_input # input cost in Naira
157
155
  ansa.cost.naira_output # output cost in Naira
158
- ansa.cost.dollars # cost in USD (if available)
159
156
 
160
157
  # Identity
161
158
  ansa.is_local # True — runs on Nigerian hardware
@@ -265,10 +262,8 @@ Enable extended thinking for complex problems:
265
262
  ansa = client.gist(
266
263
  model="confam-reasoning",
267
264
  messages="One trader buy goods for ₦50,000 sell am for ₦75,000. After e pay ₦5,000 for transport and ₦3,000 for market, wetin be the real profit? Show how you calculate am.",
268
- allowed_openai_params=["reasoning_effort"],
269
- reasoning_effort={"effort": "low", "summary": "detailed"}
270
- # effort: "low", "medium", "high", or "xhigh"
271
- # summary: "detailed" or "concise"
265
+ reasoning_effort="low"
266
+ # one of: "xhigh", "high", "medium", "low", "minimal", "none"
272
267
  )
273
268
 
274
269
  print(ansa.reasoning) # thinking trace
@@ -281,8 +276,7 @@ Also available on `confam-deep-reasoning` for more complex multi-step problems:
281
276
  ansa = client.gist(
282
277
  model="confam-deep-reasoning",
283
278
  messages="Analyse the financial risk of a Nigerian fintech expanding to Ghana...",
284
- allowed_openai_params=["reasoning_effort"],
285
- reasoning_effort={"effort": "high", "summary": "detailed"}
279
+ reasoning_effort="high"
286
280
  )
287
281
 
288
282
  print(ansa.reasoning) # full thinking trace
@@ -100,8 +100,6 @@ ansa = stream.get_ansa()
100
100
  print(f"\nModel: {ansa.model}")
101
101
  print(f"Tokens: {ansa.usage.total_tokens}")
102
102
  print(f"Cost: ₦{ansa.cost.naira:.6f}")
103
- if ansa.cost.dollars:
104
- print(f"${ansa.cost.dollars:.8f}")
105
103
  print(f"ID: {ansa.id}")
106
104
  ```
107
105
 
@@ -131,7 +129,6 @@ ansa.usage.total_tokens # total tokens used
131
129
  ansa.cost.naira # total cost in Naira ← primary
132
130
  ansa.cost.naira_input # input cost in Naira
133
131
  ansa.cost.naira_output # output cost in Naira
134
- ansa.cost.dollars # cost in USD (if available)
135
132
 
136
133
  # Identity
137
134
  ansa.is_local # True — runs on Nigerian hardware
@@ -241,10 +238,8 @@ Enable extended thinking for complex problems:
241
238
  ansa = client.gist(
242
239
  model="confam-reasoning",
243
240
  messages="One trader buy goods for ₦50,000 sell am for ₦75,000. After e pay ₦5,000 for transport and ₦3,000 for market, wetin be the real profit? Show how you calculate am.",
244
- allowed_openai_params=["reasoning_effort"],
245
- reasoning_effort={"effort": "low", "summary": "detailed"}
246
- # effort: "low", "medium", "high", or "xhigh"
247
- # summary: "detailed" or "concise"
241
+ reasoning_effort="low"
242
+ # one of: "xhigh", "high", "medium", "low", "minimal", "none"
248
243
  )
249
244
 
250
245
  print(ansa.reasoning) # thinking trace
@@ -257,8 +252,7 @@ Also available on `confam-deep-reasoning` for more complex multi-step problems:
257
252
  ansa = client.gist(
258
253
  model="confam-deep-reasoning",
259
254
  messages="Analyse the financial risk of a Nigerian fintech expanding to Ghana...",
260
- allowed_openai_params=["reasoning_effort"],
261
- reasoning_effort={"effort": "high", "summary": "detailed"}
255
+ reasoning_effort="high"
262
256
  )
263
257
 
264
258
  print(ansa.reasoning) # full thinking trace
@@ -8,7 +8,7 @@ from confamnode.exceptions import (
8
8
  from confamnode.ansa import Ansa, Usage, Cost
9
9
  from confamnode import models
10
10
 
11
- __version__ = "0.2.0"
11
+ __version__ = "0.2.2"
12
12
 
13
13
  __all__ = [
14
14
  "ConfamNode",
@@ -188,13 +188,18 @@ class ConfamStream:
188
188
  if self._chunks and self._chunks[-1].choices:
189
189
  finish_reason = self._chunks[-1].choices[0].finish_reason or "stop"
190
190
 
191
+ usage_data = self._confam_meta.get("usage", {})
191
192
  cost_data = self._confam_meta.get("cost", {})
192
193
 
193
194
  return Ansa(
194
195
  id=self._confam_meta.get("request_id", ""),
195
196
  text=text,
196
197
  model=self._model,
197
- usage=Usage(prompt_tokens=0, completion_tokens=0, total_tokens=0),
198
+ usage=Usage(
199
+ prompt_tokens=usage_data.get("prompt_tokens", 0),
200
+ completion_tokens=usage_data.get("completion_tokens", 0),
201
+ total_tokens=usage_data.get("total_tokens", 0),
202
+ ),
198
203
  cost=Cost(
199
204
  naira=cost_data.get("naira", 0.0),
200
205
  naira_input=cost_data.get("naira_input", 0.0),
@@ -203,7 +208,11 @@ class ConfamStream:
203
208
  finish_reason=finish_reason,
204
209
  raw={
205
210
  "id": self._confam_meta.get("request_id", ""),
206
- "usage": {"prompt_tokens": 0, "completion_tokens": 0}
211
+ "usage": {
212
+ "prompt_tokens": usage_data.get("prompt_tokens", 0),
213
+ "completion_tokens": usage_data.get("completion_tokens", 0),
214
+ "total_tokens": usage_data.get("total_tokens", 0)
215
+ }
207
216
  },
208
217
  is_local=self._confam_meta.get("is_local", False),
209
218
  is_ngn_data_residency=self._confam_meta.get("is_ngn_data_residency", False),
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "confamnode"
3
- version = "0.2.0"
3
+ version = "0.2.2"
4
4
  description = "The Nigerian AI inference gateway"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -40,7 +40,7 @@ wheels = [
40
40
 
41
41
  [[package]]
42
42
  name = "confamnode"
43
- version = "0.2.0"
43
+ version = "0.2.1"
44
44
  source = { editable = "." }
45
45
  dependencies = [
46
46
  { name = "httpx" },
File without changes
File without changes
File without changes
File without changes