@blockrun/llm 2.13.0 → 3.0.0
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.
- package/README.md +1 -49
- package/dist/index.cjs +34 -528
- package/dist/index.d.cts +1 -347
- package/dist/index.d.ts +1 -347
- package/dist/index.js +33 -526
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ Four call shapes cover every endpoint type:
|
|
|
83
83
|
- `stream<T>(path, body?)` — async iterator over SSE chunks (chat)
|
|
84
84
|
|
|
85
85
|
The per-API client classes (`LLMClient`, `ImageClient`, `VideoClient`,
|
|
86
|
-
`PortraitClient`, `VoiceClient`, `MusicClient`, `SearchClient`, `
|
|
86
|
+
`PortraitClient`, `VoiceClient`, `MusicClient`, `SearchClient`, `RpcClient`,
|
|
87
87
|
`PriceClient`, `SurfClient`) all remain — they will be soft-deprecated in 2.6 (rewritten as
|
|
88
88
|
shims over `BlockrunClient`) and removed in 3.0.
|
|
89
89
|
|
|
@@ -593,21 +593,6 @@ console.log(result.summary);
|
|
|
593
593
|
for (const url of result.citations ?? []) console.log(url);
|
|
594
594
|
```
|
|
595
595
|
|
|
596
|
-
### X/Twitter (AttentionVC)
|
|
597
|
-
|
|
598
|
-
`XClient` covers the full `/v1/x/*` endpoint family — previously the `X*`
|
|
599
|
-
types were exported but there was no client to call them with.
|
|
600
|
-
|
|
601
|
-
```ts
|
|
602
|
-
import { XClient } from '@blockrun/llm';
|
|
603
|
-
|
|
604
|
-
const x = new XClient();
|
|
605
|
-
const info = await x.userInfo('elonmusk');
|
|
606
|
-
const followers = await x.followers('paulg');
|
|
607
|
-
const results = await x.search('x402 micropayments', { queryType: 'Latest' });
|
|
608
|
-
const tweets = await x.userTweets({ username: 'vitalikbuterin', includeReplies: false });
|
|
609
|
-
```
|
|
610
|
-
|
|
611
596
|
### Surf Crypto Data
|
|
612
597
|
|
|
613
598
|
`SurfClient` exposes the full `/v1/surf/*` catalog — 84+ pay-per-call
|
|
@@ -737,38 +722,6 @@ gateway cache — same price, lower latency.
|
|
|
737
722
|
|
|
738
723
|
*Testnet models use flat pricing (no token counting) for simplicity.*
|
|
739
724
|
|
|
740
|
-
## X/Twitter Data (Powered by AttentionVC)
|
|
741
|
-
|
|
742
|
-
Access X/Twitter user profiles, followers, and followings via [AttentionVC](https://attentionvc.ai) partner API. No API keys needed — pay-per-request via x402.
|
|
743
|
-
|
|
744
|
-
```typescript
|
|
745
|
-
import { LLMClient } from '@blockrun/llm';
|
|
746
|
-
|
|
747
|
-
const client = new LLMClient();
|
|
748
|
-
|
|
749
|
-
// Look up user profiles ($0.002/user, min $0.02)
|
|
750
|
-
const users = await client.xUserLookup(['elonmusk', 'blockaborr']);
|
|
751
|
-
for (const user of users.users) {
|
|
752
|
-
console.log(`@${user.userName}: ${user.followers} followers`);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
// Get followers ($0.05/page, ~200 accounts)
|
|
756
|
-
let result = await client.xFollowers('blockaborr');
|
|
757
|
-
for (const f of result.followers) {
|
|
758
|
-
console.log(` @${f.screen_name}`);
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
// Paginate through all followers
|
|
762
|
-
while (result.has_next_page) {
|
|
763
|
-
result = await client.xFollowers('blockaborr', result.next_cursor);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
// Get followings ($0.05/page)
|
|
767
|
-
const followings = await client.xFollowings('blockaborr');
|
|
768
|
-
```
|
|
769
|
-
|
|
770
|
-
Works on both `LLMClient` (Base) and `SolanaLLMClient`.
|
|
771
|
-
|
|
772
725
|
## Standalone Search
|
|
773
726
|
|
|
774
727
|
Search web, X/Twitter, and news without using a chat model:
|
|
@@ -1290,7 +1243,6 @@ The SDK caches responses to avoid duplicate payments:
|
|
|
1290
1243
|
import { getCachedByRequest, saveToCache, clearCache } from '@blockrun/llm';
|
|
1291
1244
|
|
|
1292
1245
|
// Automatic TTLs by endpoint:
|
|
1293
|
-
// - X/Twitter: 1 hour
|
|
1294
1246
|
// - Search: 15 minutes
|
|
1295
1247
|
// - Models: 24 hours
|
|
1296
1248
|
// - Chat/Image: no cache (every call is unique)
|