agentsvc 0.1.0 → 0.1.1

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 (3) hide show
  1. package/README.md +3 -3
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -25,13 +25,13 @@ const check = await svc.call('token-precheck', { tokens: ['0x4ed4E862860beD51a95
25
25
  ## Vercel AI SDK
26
26
 
27
27
  ```js
28
- import { generateText, stepCountIs } from 'ai';
29
- import { anthropic } from '@ai-sdk/anthropic';
28
+ import { generateText, isStepCount } from 'ai';
30
29
  import { createAgentsvc } from 'agentsvc';
31
30
  import { agentsvcTools } from 'agentsvc/ai-sdk';
32
31
 
33
32
  const tools = await agentsvcTools(createAgentsvc({ creditToken: process.env.AGENTSVC_CREDIT_TOKEN }), ['web-scrape', 'news-search', 'token-smart-money']);
34
- const { text } = await generateText({ model: anthropic('claude-haiku-5-5'), tools, stopWhen: stepCountIs(5), prompt: 'Who is buying BRETT on Base right now?' });
33
+ // Full guide: https://agentsvc.io/docs/ai-sdk
34
+ const { text } = await generateText({ model: 'anthropic/claude-haiku-5.5', tools, stopWhen: isStepCount(5), prompt: 'Who is buying BRETT on Base right now?' });
35
35
  ```
36
36
 
37
37
  ## LangChain.js
package/index.mjs CHANGED
@@ -57,7 +57,7 @@ export function createAgentsvc(opts = {}) {
57
57
  /** Call one service. Returns its data; throws AgentsvcError on 402 (no payment), input errors and service errors (none of them are charged). */
58
58
  async function call(slug, input = {}) {
59
59
  const f = await getFetch();
60
- const headers = { 'Content-Type': 'application/json', 'User-Agent': 'agentsvc-js/0.1.0' };
60
+ const headers = { 'Content-Type': 'application/json', 'User-Agent': 'agentsvc-js/0.1.1' };
61
61
  if (credit) headers.Authorization = `Bearer ${credit}`;
62
62
  const paid = credit || opts.privateKey || opts.payFetch;
63
63
  const url = paid ? `${base}/api/v1/proxy/${slug}` : `${base}/api/v1/try/${slug}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentsvc",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Pay-per-call tools for AI agents: 120+ web, data and crypto APIs paid in USDC via x402, with ready-made tools for the Vercel AI SDK and LangChain.js",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",