@serpbit/ai-sdk 0.1.1 → 0.1.2
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/index.d.ts +1 -0
- package/index.js +2 -2
- package/package.json +2 -2
- package/tools.js +2 -2
package/index.d.ts
CHANGED
|
@@ -52,6 +52,7 @@ export interface GoogleSearchInput extends Located {
|
|
|
52
52
|
pages?: number;
|
|
53
53
|
start?: number;
|
|
54
54
|
tbs?: string;
|
|
55
|
+
/** Left out: the AI Overview the page has. true: also one Google loads after the page. false: none. */
|
|
55
56
|
ai_overview?: boolean;
|
|
56
57
|
safe?: "off" | "active";
|
|
57
58
|
lr?: string;
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsonSchema, tool } from "ai";
|
|
|
5
5
|
import { Serpbit } from "serpbit";
|
|
6
6
|
import { TOOLS } from "./tools.js";
|
|
7
7
|
|
|
8
|
-
export const VERSION = "0.1.
|
|
8
|
+
export const VERSION = "0.1.2";
|
|
9
9
|
|
|
10
10
|
// A page read's most characters when the model names none: a model's context is smaller than an API client's buffer
|
|
11
11
|
// (the MCP server's mcpReadChars).
|
|
@@ -44,7 +44,7 @@ function make(name, options = {}, client = clientOf(options)) {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
/** Google Search: the results page
|
|
47
|
+
/** Google Search: the results page with the AI Overview it has (ai_overview true: also one loaded after it; false: none), and the first pages' text with content. */
|
|
48
48
|
export const googleSearch = (options) => make("google_search", options);
|
|
49
49
|
/** Google's News tab. */
|
|
50
50
|
export const googleNews = (options) => make("google_news", options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serpbit/ai-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Google Search, News, Shopping, Images, Videos, Maps, Autocomplete and AI Mode as tools for the Vercel AI SDK, through Serpbit.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "node --test test/tools.test.js"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"serpbit": "^0.3.
|
|
22
|
+
"serpbit": "^0.3.2"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"ai": ">=5.0.0 <8.0.0"
|
package/tools.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// server's Google tools, with the same names, descriptions, paths and input schemas.
|
|
3
3
|
export const TOOLS = [
|
|
4
4
|
{
|
|
5
|
-
"description": "Searches Google and returns the results page: organic results with links and snippets, People also ask, top stories, related searches, the knowledge panel, and the AI Overview
|
|
5
|
+
"description": "Searches Google and returns the results page: organic results with links and snippets, People also ask, top stories, related searches, the knowledge panel, and the AI Overview the page has; with content, also the main text of the first results' pages. The tool for general questions about the web. For one kind of result use google_news, google_images, google_videos, google_shopping or google_maps; for Google's written answer, google_ai_mode. pages asks pages 1 to N in one call, start one later page alone; the two do not combine. 1 credit per page, and 1 per page read.",
|
|
6
6
|
"inputSchema": {
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"properties": {
|
|
9
9
|
"ai_overview": {
|
|
10
|
-
"description": "
|
|
10
|
+
"description": "Left out: the AI Overview the page has. true: also one Google loads after the page, a few seconds more. false: none.",
|
|
11
11
|
"type": "boolean"
|
|
12
12
|
},
|
|
13
13
|
"content": {
|