@youdotcom-oss/ai-sdk-plugin 2.0.7 → 2.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.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Give your AI applications **real-time access to the web** with native AI SDK too
6
6
 
7
7
  Build AI applications that can:
8
8
  - **Search the web in real-time** - Access current information with advanced filtering (dates, sites, file types)
9
- - **Generate answers with web context** - Fast AI responses enhanced with live web data
9
+ - **Research** - Comprehensive answers with cited sources, configurable effort (lite to exhaustive)
10
10
  - **Extract any webpage** - Pull full content in markdown or HTML format
11
11
  - **Zero configuration** - Works with any AI SDK model provider (Anthropic, OpenAI, Google, and more)
12
12
  - **Type-safe** - Full TypeScript support with Zod schema validation
@@ -57,7 +57,7 @@ Import the tools and add them to your AI SDK configuration:
57
57
  ```typescript
58
58
  import { createAnthropic } from '@ai-sdk/anthropic';
59
59
  import { generateText, stepCountIs } from 'ai';
60
- import { youSearch, youContents } from '@youdotcom-oss/ai-sdk-plugin';
60
+ import { youSearch, youResearch, youContents } from '@youdotcom-oss/ai-sdk-plugin';
61
61
 
62
62
  // Create your AI model provider
63
63
  const anthropic = createAnthropic({
@@ -68,6 +68,7 @@ const result = await generateText({
68
68
  model: anthropic('claude-sonnet-4-5-20250929'),
69
69
  tools: {
70
70
  search: youSearch(),
71
+ research: youResearch(),
71
72
  extract: youContents(),
72
73
  },
73
74
  stopWhen: stepCountIs(5), // Required for tool result processing
@@ -228,6 +229,15 @@ Comprehensive web and news search with advanced filtering capabilities. Perfect
228
229
  - Finding specific content with filters (dates, sites, file types)
229
230
  - Research queries requiring multiple results
230
231
 
232
+ ### youResearch()
233
+
234
+ Research with comprehensive answers and cited sources. Configurable effort levels (lite, standard, deep, exhaustive) let you trade speed for thoroughness.
235
+
236
+ **When your AI will use this:**
237
+ - Complex questions requiring in-depth analysis
238
+ - Research reports needing cited sources
239
+ - Thorough comparisons or detailed explanations
240
+
231
241
  ### youContents()
232
242
 
233
243
  Extract full page content from URLs in markdown or HTML format. Useful for documentation analysis, content processing, and batch URL extraction.
package/dist/main.d.ts CHANGED
@@ -10,27 +10,14 @@ export type YouToolsConfig = {
10
10
  * @param config - Configuration options
11
11
  * @returns A tool that can be used with AI SDK's generateText, streamText, etc.
12
12
  *
13
- * @example
14
- * ```ts
15
- * import { generateText, stepCountIs } from 'ai';
16
- * import { youSearch } from '@youdotcom-oss/ai-sdk-plugin';
17
- *
18
- * const { text } = await generateText({
19
- * model: 'anthropic/claude-sonnet-4.5',
20
- * prompt: 'What happened in San Francisco last week?',
21
- * tools: {
22
- * search: youSearch(),
23
- * },
24
- * stopWhen: stepCountIs(3),
25
- * });
26
- * ```
13
+ * @public
27
14
  */
28
15
  export declare const youSearch: (config?: YouToolsConfig) => import("ai").Tool<{
29
16
  query: string;
30
17
  count?: number | undefined;
31
18
  freshness?: string | undefined;
32
19
  offset?: number | undefined;
33
- country?: "AR" | "CA" | "NL" | "FI" | "FR" | "DE" | "IT" | "JP" | "PL" | "PT-BR" | "RU" | "ES" | "TR" | "AU" | "AT" | "BE" | "BR" | "CL" | "DK" | "HK" | "IN" | "ID" | "KR" | "MY" | "MX" | "NZ" | "NO" | "CN" | "PT" | "PH" | "SA" | "ZA" | "SE" | "CH" | "TW" | "GB" | "US" | undefined;
20
+ country?: "AR" | "CA" | "NL" | "FI" | "FR" | "DE" | "IT" | "JP" | "PL" | "RU" | "ES" | "TR" | "AU" | "AT" | "BE" | "BR" | "CL" | "DK" | "HK" | "IN" | "ID" | "KR" | "MY" | "MX" | "NZ" | "NO" | "CN" | "PT" | "PH" | "SA" | "ZA" | "SE" | "CH" | "TW" | "GB" | "US" | undefined;
34
21
  safesearch?: "off" | "moderate" | "strict" | undefined;
35
22
  livecrawl?: "web" | "news" | "all" | undefined;
36
23
  livecrawl_formats?: "markdown" | "html" | undefined;
@@ -68,6 +55,30 @@ export declare const youSearch: (config?: YouToolsConfig) => import("ai").Tool<{
68
55
  latency?: number | undefined;
69
56
  };
70
57
  }>;
58
+ /**
59
+ * You.com research tool for Vercel AI SDK
60
+ *
61
+ * Perform research with cited sources and configurable effort (lite, standard, deep, exhaustive).
62
+ *
63
+ * @param config - Configuration options
64
+ * @returns A tool that can be used with AI SDK's generateText, streamText, etc.
65
+ *
66
+ * @public
67
+ */
68
+ export declare const youResearch: (config?: YouToolsConfig) => import("ai").Tool<{
69
+ input: string;
70
+ research_effort: "lite" | "standard" | "deep" | "exhaustive";
71
+ }, {
72
+ output: {
73
+ content: string;
74
+ content_type: "text";
75
+ sources: {
76
+ url: string;
77
+ snippets: string[];
78
+ title?: string | undefined;
79
+ }[];
80
+ };
81
+ }>;
71
82
  /**
72
83
  * You.com content extraction tool for Vercel AI SDK
73
84
  *
@@ -76,20 +87,7 @@ export declare const youSearch: (config?: YouToolsConfig) => import("ai").Tool<{
76
87
  * @param config - Configuration options
77
88
  * @returns A tool that can be used with AI SDK's generateText, streamText, etc.
78
89
  *
79
- * @example
80
- * ```ts
81
- * import { generateText, stepCountIs } from 'ai';
82
- * import { youContents } from '@youdotcom-oss/ai-sdk-plugin';
83
- *
84
- * const { text } = await generateText({
85
- * model: 'anthropic/claude-sonnet-4.5',
86
- * prompt: 'Summarize the content from vercel.com/blog',
87
- * tools: {
88
- * extract: youContents(),
89
- * },
90
- * stopWhen: stepCountIs(3),
91
- * });
92
- * ```
90
+ * @public
93
91
  */
94
92
  export declare const youContents: (config?: YouToolsConfig) => import("ai").Tool<{
95
93
  urls: string[];