tensorfeed 1.2.0__tar.gz → 1.3.0__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.
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/PKG-INFO +21 -2
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/README.md +19 -0
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/pyproject.toml +2 -2
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed/__init__.py +1 -1
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed/client.py +143 -1
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed.egg-info/PKG-INFO +21 -2
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/setup.cfg +0 -0
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed/web3_signer.py +0 -0
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed.egg-info/SOURCES.txt +0 -0
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed.egg-info/dependency_links.txt +0 -0
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed.egg-info/requires.txt +0 -0
- {tensorfeed-1.2.0 → tensorfeed-1.3.0}/tensorfeed.egg-info/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensorfeed
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Python SDK for the TensorFeed.ai API: AI news, status, model pricing,
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Python SDK for the TensorFeed.ai API: AI news, status, model pricing, premium history series + routing, agent payments via USDC on Base (optional web3 auto-send)
|
|
5
5
|
Author-email: "TensorFeed.ai" <feedback@tensorfeed.ai>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://tensorfeed.ai
|
|
@@ -102,6 +102,21 @@ rec = tf.routing(
|
|
|
102
102
|
weights={"quality": 0.6, "cost": 0.3, "availability": 0.1, "latency": 0.0},
|
|
103
103
|
)
|
|
104
104
|
|
|
105
|
+
# Premium history series (1 credit each, range default = last 30 days, max 90)
|
|
106
|
+
prices = tf.pricing_series(model="Claude Opus 4.7")
|
|
107
|
+
print(f'Price changed {prices["summary"]["delta_pct_blended"]}% over the window')
|
|
108
|
+
|
|
109
|
+
scores = tf.benchmark_series(model="Claude Opus 4.7", benchmark="swe_bench")
|
|
110
|
+
print(f'SWE-bench moved {scores["summary"]["delta_pp"]} pp')
|
|
111
|
+
|
|
112
|
+
uptime = tf.status_uptime(provider="anthropic")
|
|
113
|
+
print(f'Anthropic uptime: {uptime["uptime_pct"]}% over {uptime["days_with_data"]} days')
|
|
114
|
+
|
|
115
|
+
diff = tf.history_compare(
|
|
116
|
+
from_date="2026-04-01", to_date="2026-04-27", snapshot_type="pricing",
|
|
117
|
+
)
|
|
118
|
+
print(f'{len(diff["changed"])} price changes, {len(diff["added"])} new models')
|
|
119
|
+
|
|
105
120
|
# Check remaining credits
|
|
106
121
|
print(tf.balance())
|
|
107
122
|
```
|
|
@@ -198,6 +213,10 @@ except TensorFeedError as e:
|
|
|
198
213
|
|--------|------|-------------|
|
|
199
214
|
| `tf.balance()` | Free | Check remaining credits |
|
|
200
215
|
| `tf.routing(task=, budget=, top_n=, weights=)` | 1 credit | Top-N ranked routing with full detail |
|
|
216
|
+
| `tf.pricing_series(model=, from_date=, to_date=)` | 1 credit | Daily price points for one model with min/max/delta summary |
|
|
217
|
+
| `tf.benchmark_series(model=, benchmark=, from_date=, to_date=)` | 1 credit | Score evolution for a benchmark on one model, returns delta_pp |
|
|
218
|
+
| `tf.status_uptime(provider=, from_date=, to_date=)` | 1 credit | Uptime % per provider with incident days (degraded = half) |
|
|
219
|
+
| `tf.history_compare(from_date=, to_date=, snapshot_type=)` | 1 credit | Diff two snapshots: added, removed, changed entries with deltas |
|
|
201
220
|
|
|
202
221
|
### Auto-send (requires `tensorfeed[web3]`)
|
|
203
222
|
|
|
@@ -75,6 +75,21 @@ rec = tf.routing(
|
|
|
75
75
|
weights={"quality": 0.6, "cost": 0.3, "availability": 0.1, "latency": 0.0},
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
+
# Premium history series (1 credit each, range default = last 30 days, max 90)
|
|
79
|
+
prices = tf.pricing_series(model="Claude Opus 4.7")
|
|
80
|
+
print(f'Price changed {prices["summary"]["delta_pct_blended"]}% over the window')
|
|
81
|
+
|
|
82
|
+
scores = tf.benchmark_series(model="Claude Opus 4.7", benchmark="swe_bench")
|
|
83
|
+
print(f'SWE-bench moved {scores["summary"]["delta_pp"]} pp')
|
|
84
|
+
|
|
85
|
+
uptime = tf.status_uptime(provider="anthropic")
|
|
86
|
+
print(f'Anthropic uptime: {uptime["uptime_pct"]}% over {uptime["days_with_data"]} days')
|
|
87
|
+
|
|
88
|
+
diff = tf.history_compare(
|
|
89
|
+
from_date="2026-04-01", to_date="2026-04-27", snapshot_type="pricing",
|
|
90
|
+
)
|
|
91
|
+
print(f'{len(diff["changed"])} price changes, {len(diff["added"])} new models')
|
|
92
|
+
|
|
78
93
|
# Check remaining credits
|
|
79
94
|
print(tf.balance())
|
|
80
95
|
```
|
|
@@ -171,6 +186,10 @@ except TensorFeedError as e:
|
|
|
171
186
|
|--------|------|-------------|
|
|
172
187
|
| `tf.balance()` | Free | Check remaining credits |
|
|
173
188
|
| `tf.routing(task=, budget=, top_n=, weights=)` | 1 credit | Top-N ranked routing with full detail |
|
|
189
|
+
| `tf.pricing_series(model=, from_date=, to_date=)` | 1 credit | Daily price points for one model with min/max/delta summary |
|
|
190
|
+
| `tf.benchmark_series(model=, benchmark=, from_date=, to_date=)` | 1 credit | Score evolution for a benchmark on one model, returns delta_pp |
|
|
191
|
+
| `tf.status_uptime(provider=, from_date=, to_date=)` | 1 credit | Uptime % per provider with incident days (degraded = half) |
|
|
192
|
+
| `tf.history_compare(from_date=, to_date=, snapshot_type=)` | 1 credit | Diff two snapshots: added, removed, changed entries with deltas |
|
|
174
193
|
|
|
175
194
|
### Auto-send (requires `tensorfeed[web3]`)
|
|
176
195
|
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tensorfeed"
|
|
7
|
-
version = "1.
|
|
8
|
-
description = "Python SDK for the TensorFeed.ai API: AI news, status, model pricing,
|
|
7
|
+
version = "1.3.0"
|
|
8
|
+
description = "Python SDK for the TensorFeed.ai API: AI news, status, model pricing, premium history series + routing, agent payments via USDC on Base (optional web3 auto-send)"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
requires-python = ">=3.9"
|
|
@@ -18,7 +18,7 @@ from typing import Any # noqa: F401 (re-exported by purchase_credits return ty
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
DEFAULT_BASE_URL = "https://tensorfeed.ai/api"
|
|
21
|
-
DEFAULT_USER_AGENT = "TensorFeed-SDK-Python/1.
|
|
21
|
+
DEFAULT_USER_AGENT = "TensorFeed-SDK-Python/1.3"
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class TensorFeedError(Exception):
|
|
@@ -405,3 +405,145 @@ class TensorFeed:
|
|
|
405
405
|
return self._request(
|
|
406
406
|
"GET", "/premium/routing", params=params, require_token=True
|
|
407
407
|
)
|
|
408
|
+
|
|
409
|
+
# ── Paid: history series (Tier 1, 1 credit/call) ───────────────
|
|
410
|
+
|
|
411
|
+
def _require_token(self, name: str) -> None:
|
|
412
|
+
if not self.token:
|
|
413
|
+
raise ValueError(
|
|
414
|
+
f"{name}() requires a token. Buy credits via buy_credits() and "
|
|
415
|
+
"confirm(), or pass an existing token to TensorFeed(token=...)."
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
def pricing_series(
|
|
419
|
+
self,
|
|
420
|
+
*,
|
|
421
|
+
model: str,
|
|
422
|
+
from_date: str | None = None,
|
|
423
|
+
to_date: str | None = None,
|
|
424
|
+
) -> dict[str, Any]:
|
|
425
|
+
"""Daily price points for one model with min/max/delta summary.
|
|
426
|
+
|
|
427
|
+
Costs 1 credit per call. Range capped at 90 days; default 30 days
|
|
428
|
+
back from today.
|
|
429
|
+
|
|
430
|
+
Args:
|
|
431
|
+
model: Model id or display name (e.g. "Claude Opus 4.7" or
|
|
432
|
+
"claude-opus-4-7"). Case-insensitive.
|
|
433
|
+
from_date: Start date in YYYY-MM-DD UTC. Defaults to 30 days ago.
|
|
434
|
+
to_date: End date in YYYY-MM-DD UTC. Defaults to today.
|
|
435
|
+
|
|
436
|
+
Returns:
|
|
437
|
+
Dict with ``points`` (list of {date, input, output, blended}),
|
|
438
|
+
``summary`` (first/latest/min/max/delta_pct/changes_detected),
|
|
439
|
+
``range``, and ``billing``.
|
|
440
|
+
|
|
441
|
+
Raises:
|
|
442
|
+
ValueError: if no token is set on the client
|
|
443
|
+
PaymentRequired: if the token has insufficient credits
|
|
444
|
+
"""
|
|
445
|
+
self._require_token("pricing_series")
|
|
446
|
+
return self._request(
|
|
447
|
+
"GET",
|
|
448
|
+
"/premium/history/pricing/series",
|
|
449
|
+
params={"model": model, "from": from_date, "to": to_date},
|
|
450
|
+
require_token=True,
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
def benchmark_series(
|
|
454
|
+
self,
|
|
455
|
+
*,
|
|
456
|
+
model: str,
|
|
457
|
+
benchmark: str,
|
|
458
|
+
from_date: str | None = None,
|
|
459
|
+
to_date: str | None = None,
|
|
460
|
+
) -> dict[str, Any]:
|
|
461
|
+
"""Score evolution for a single benchmark on one model.
|
|
462
|
+
|
|
463
|
+
Costs 1 credit per call. Range capped at 90 days; default 30 days
|
|
464
|
+
back from today.
|
|
465
|
+
|
|
466
|
+
Args:
|
|
467
|
+
model: Model id or display name. Case-insensitive.
|
|
468
|
+
benchmark: Benchmark key (e.g. "swe_bench", "mmlu_pro",
|
|
469
|
+
"gpqa_diamond", "math", "human_eval"). Case-insensitive.
|
|
470
|
+
from_date: Start date in YYYY-MM-DD UTC. Defaults to 30 days ago.
|
|
471
|
+
to_date: End date in YYYY-MM-DD UTC. Defaults to today.
|
|
472
|
+
|
|
473
|
+
Returns:
|
|
474
|
+
Dict with ``points`` (list of {date, score}), ``summary``
|
|
475
|
+
(first/latest/min_score/max_score/delta_pp), ``range``, and ``billing``.
|
|
476
|
+
"""
|
|
477
|
+
self._require_token("benchmark_series")
|
|
478
|
+
return self._request(
|
|
479
|
+
"GET",
|
|
480
|
+
"/premium/history/benchmarks/series",
|
|
481
|
+
params={
|
|
482
|
+
"model": model,
|
|
483
|
+
"benchmark": benchmark,
|
|
484
|
+
"from": from_date,
|
|
485
|
+
"to": to_date,
|
|
486
|
+
},
|
|
487
|
+
require_token=True,
|
|
488
|
+
)
|
|
489
|
+
|
|
490
|
+
def status_uptime(
|
|
491
|
+
self,
|
|
492
|
+
*,
|
|
493
|
+
provider: str,
|
|
494
|
+
from_date: str | None = None,
|
|
495
|
+
to_date: str | None = None,
|
|
496
|
+
) -> dict[str, Any]:
|
|
497
|
+
"""Daily uptime rollup for one provider.
|
|
498
|
+
|
|
499
|
+
Costs 1 credit per call. Operational days count fully, degraded
|
|
500
|
+
days count as half, missing-data days are excluded from the
|
|
501
|
+
denominator.
|
|
502
|
+
|
|
503
|
+
Args:
|
|
504
|
+
provider: Provider name (e.g. "anthropic", "openai", "google").
|
|
505
|
+
Case-insensitive.
|
|
506
|
+
from_date: Start date in YYYY-MM-DD UTC. Defaults to 30 days ago.
|
|
507
|
+
to_date: End date in YYYY-MM-DD UTC. Defaults to today.
|
|
508
|
+
|
|
509
|
+
Returns:
|
|
510
|
+
Dict with ``uptime_pct``, day counts by status, ``incident_days``,
|
|
511
|
+
and ``billing``.
|
|
512
|
+
"""
|
|
513
|
+
self._require_token("status_uptime")
|
|
514
|
+
return self._request(
|
|
515
|
+
"GET",
|
|
516
|
+
"/premium/history/status/uptime",
|
|
517
|
+
params={"provider": provider, "from": from_date, "to": to_date},
|
|
518
|
+
require_token=True,
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
def history_compare(
|
|
522
|
+
self,
|
|
523
|
+
*,
|
|
524
|
+
from_date: str,
|
|
525
|
+
to_date: str,
|
|
526
|
+
snapshot_type: str = "pricing",
|
|
527
|
+
) -> dict[str, Any]:
|
|
528
|
+
"""Diff two daily snapshots: added, removed, and changed entries.
|
|
529
|
+
|
|
530
|
+
Costs 1 credit per call.
|
|
531
|
+
|
|
532
|
+
Args:
|
|
533
|
+
from_date: Earlier snapshot date in YYYY-MM-DD UTC.
|
|
534
|
+
to_date: Later snapshot date in YYYY-MM-DD UTC.
|
|
535
|
+
snapshot_type: "pricing" (default) or "benchmarks".
|
|
536
|
+
|
|
537
|
+
Returns:
|
|
538
|
+
For pricing: ``added``, ``removed``, ``changed`` (with
|
|
539
|
+
field/from/to/delta_pct), and ``unchanged_count``.
|
|
540
|
+
For benchmarks: ``added_models``, ``removed_models``, and
|
|
541
|
+
``changed`` (with model/benchmark/from/to/delta_pp).
|
|
542
|
+
"""
|
|
543
|
+
self._require_token("history_compare")
|
|
544
|
+
return self._request(
|
|
545
|
+
"GET",
|
|
546
|
+
"/premium/history/compare",
|
|
547
|
+
params={"from": from_date, "to": to_date, "type": snapshot_type},
|
|
548
|
+
require_token=True,
|
|
549
|
+
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tensorfeed
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Python SDK for the TensorFeed.ai API: AI news, status, model pricing,
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Python SDK for the TensorFeed.ai API: AI news, status, model pricing, premium history series + routing, agent payments via USDC on Base (optional web3 auto-send)
|
|
5
5
|
Author-email: "TensorFeed.ai" <feedback@tensorfeed.ai>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://tensorfeed.ai
|
|
@@ -102,6 +102,21 @@ rec = tf.routing(
|
|
|
102
102
|
weights={"quality": 0.6, "cost": 0.3, "availability": 0.1, "latency": 0.0},
|
|
103
103
|
)
|
|
104
104
|
|
|
105
|
+
# Premium history series (1 credit each, range default = last 30 days, max 90)
|
|
106
|
+
prices = tf.pricing_series(model="Claude Opus 4.7")
|
|
107
|
+
print(f'Price changed {prices["summary"]["delta_pct_blended"]}% over the window')
|
|
108
|
+
|
|
109
|
+
scores = tf.benchmark_series(model="Claude Opus 4.7", benchmark="swe_bench")
|
|
110
|
+
print(f'SWE-bench moved {scores["summary"]["delta_pp"]} pp')
|
|
111
|
+
|
|
112
|
+
uptime = tf.status_uptime(provider="anthropic")
|
|
113
|
+
print(f'Anthropic uptime: {uptime["uptime_pct"]}% over {uptime["days_with_data"]} days')
|
|
114
|
+
|
|
115
|
+
diff = tf.history_compare(
|
|
116
|
+
from_date="2026-04-01", to_date="2026-04-27", snapshot_type="pricing",
|
|
117
|
+
)
|
|
118
|
+
print(f'{len(diff["changed"])} price changes, {len(diff["added"])} new models')
|
|
119
|
+
|
|
105
120
|
# Check remaining credits
|
|
106
121
|
print(tf.balance())
|
|
107
122
|
```
|
|
@@ -198,6 +213,10 @@ except TensorFeedError as e:
|
|
|
198
213
|
|--------|------|-------------|
|
|
199
214
|
| `tf.balance()` | Free | Check remaining credits |
|
|
200
215
|
| `tf.routing(task=, budget=, top_n=, weights=)` | 1 credit | Top-N ranked routing with full detail |
|
|
216
|
+
| `tf.pricing_series(model=, from_date=, to_date=)` | 1 credit | Daily price points for one model with min/max/delta summary |
|
|
217
|
+
| `tf.benchmark_series(model=, benchmark=, from_date=, to_date=)` | 1 credit | Score evolution for a benchmark on one model, returns delta_pp |
|
|
218
|
+
| `tf.status_uptime(provider=, from_date=, to_date=)` | 1 credit | Uptime % per provider with incident days (degraded = half) |
|
|
219
|
+
| `tf.history_compare(from_date=, to_date=, snapshot_type=)` | 1 credit | Diff two snapshots: added, removed, changed entries with deltas |
|
|
201
220
|
|
|
202
221
|
### Auto-send (requires `tensorfeed[web3]`)
|
|
203
222
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|