From 46088f09c3116818fa442c70fbaa9cfe643b5ef8 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 12 Dec 2025 10:09:17 +1000 Subject: [PATCH] docs: update READMEs to use AI SDK v6 streamText API - Replace deprecated Agent class with streamText - Add anthropic provider import - Add system prompt example --- packages/tools/registryExecute/README.md | 10 +++++++--- packages/tools/registrySearch/README.md | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/tools/registryExecute/README.md b/packages/tools/registryExecute/README.md index b047612..26dab95 100644 --- a/packages/tools/registryExecute/README.md +++ b/packages/tools/registryExecute/README.md @@ -13,16 +13,20 @@ pnpm add @tpmjs/registry-execute ## Usage ```typescript -import { Agent } from 'ai'; +import { streamText } from 'ai'; +import { anthropic } from '@ai-sdk/anthropic'; import { registrySearchTool } from '@tpmjs/registry-search'; import { registryExecuteTool } from '@tpmjs/registry-execute'; -const agent = new Agent({ - model: 'anthropic/claude-sonnet-4-20250514', +const result = streamText({ + model: anthropic('claude-sonnet-4-20250514'), tools: { registrySearch: registrySearchTool, registryExecute: registryExecuteTool, }, + system: `You have access to the TPMJS tool registry. +Use registrySearch to find tools, then registryExecute to run them.`, + prompt: 'Search for web scraping tools and scrape https://example.com', }); // The agent can now: diff --git a/packages/tools/registrySearch/README.md b/packages/tools/registrySearch/README.md index b622819..2f15d28 100644 --- a/packages/tools/registrySearch/README.md +++ b/packages/tools/registrySearch/README.md @@ -13,16 +13,20 @@ pnpm add @tpmjs/registry-search ## Usage ```typescript -import { Agent } from 'ai'; +import { streamText } from 'ai'; +import { anthropic } from '@ai-sdk/anthropic'; import { registrySearchTool } from '@tpmjs/registry-search'; import { registryExecuteTool } from '@tpmjs/registry-execute'; -const agent = new Agent({ - model: 'anthropic/claude-sonnet-4-20250514', +const result = streamText({ + model: anthropic('claude-sonnet-4-20250514'), tools: { registrySearch: registrySearchTool, registryExecute: registryExecuteTool, }, + system: `You have access to the TPMJS tool registry. +Use registrySearch to find tools, then registryExecute to run them.`, + prompt: 'Search for web scraping tools and scrape https://example.com', }); // The agent can now: