@quercle/ai-sdk 0.2.0 → 1.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 +126 -52
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tools.d.ts +90 -4
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +158 -13
- package/dist/tools.js.map +1 -1
- package/package.json +13 -10
package/README.md
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
# @quercle/ai-sdk
|
|
2
2
|
|
|
3
|
-
Quercle web tools for the [Vercel AI SDK](https://sdk.vercel.ai/).
|
|
4
|
-
|
|
5
|
-
Provides `quercleSearch` and `quercleFetch` tools that integrate seamlessly with AI applications built on the Vercel AI SDK.
|
|
3
|
+
Quercle web search and fetch tools for the [Vercel AI SDK](https://sdk.vercel.ai/).
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
```bash
|
|
10
8
|
bun add @quercle/ai-sdk
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
```bash
|
|
9
|
+
# or
|
|
14
10
|
npm install @quercle/ai-sdk
|
|
15
11
|
```
|
|
16
12
|
|
|
17
13
|
## Setup
|
|
18
14
|
|
|
19
|
-
Set your
|
|
15
|
+
Set your API key as an environment variable:
|
|
20
16
|
|
|
21
17
|
```bash
|
|
22
18
|
export QUERCLE_API_KEY=qk_...
|
|
@@ -24,76 +20,154 @@ export QUERCLE_API_KEY=qk_...
|
|
|
24
20
|
|
|
25
21
|
Get your API key at [quercle.dev](https://quercle.dev).
|
|
26
22
|
|
|
27
|
-
##
|
|
23
|
+
## Tools
|
|
24
|
+
|
|
25
|
+
| Tool | Description | Parameters |
|
|
26
|
+
|---|---|---|
|
|
27
|
+
| `quercleSearch` | Search the web and get AI-synthesized answers with citations | `query`, `allowedDomains?`, `blockedDomains?` |
|
|
28
|
+
| `quercleFetch` | Fetch a URL and analyze its content with AI | `url`, `prompt` |
|
|
29
|
+
| `quercleRawSearch` | Raw web search results without AI synthesis | `query`, `format?` (`markdown` \| `json`), `useSafeguard?` |
|
|
30
|
+
| `quercleRawFetch` | Fetch raw page content without AI processing | `url`, `format?` (`markdown` \| `html`), `useSafeguard?` |
|
|
31
|
+
| `quercleExtract` | Extract content relevant to a query from a URL | `url`, `query`, `format?` (`markdown` \| `json`), `useSafeguard?` |
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
## Quick Start
|
|
30
34
|
|
|
31
|
-
```
|
|
32
|
-
import { quercleSearch, quercleFetch } from "@quercle/ai-sdk";
|
|
35
|
+
```ts
|
|
36
|
+
import { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract } from "@quercle/ai-sdk";
|
|
33
37
|
import { generateText } from "ai";
|
|
34
38
|
import { openai } from "@ai-sdk/openai";
|
|
35
39
|
|
|
36
|
-
const
|
|
40
|
+
const { text } = await generateText({
|
|
37
41
|
model: openai("gpt-4o"),
|
|
38
|
-
tools: { quercleSearch, quercleFetch },
|
|
39
|
-
|
|
42
|
+
tools: { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract },
|
|
43
|
+
maxSteps: 5,
|
|
44
|
+
prompt: "Search for the latest news about AI agents and summarize what you find",
|
|
40
45
|
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
### With streamText
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
import { streamText } from "ai";
|
|
48
|
-
import { openai } from "@ai-sdk/openai";
|
|
49
|
-
|
|
50
|
-
const stream = streamText({
|
|
51
|
-
model: openai("gpt-4o"),
|
|
52
|
-
tools: { quercleSearch, quercleFetch },
|
|
53
|
-
prompt: "Find information about TypeScript 5",
|
|
54
|
-
});
|
|
47
|
+
console.log(text);
|
|
48
|
+
```
|
|
55
49
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
## Direct Tool Usage
|
|
51
|
+
|
|
52
|
+
Use the tools directly without an LLM:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract } from "@quercle/ai-sdk";
|
|
56
|
+
|
|
57
|
+
// Search with AI-synthesized answer
|
|
58
|
+
const searchResult = await quercleSearch.execute(
|
|
59
|
+
{ query: "best practices for building AI agents" },
|
|
60
|
+
{ toolCallId: "1", messages: [] },
|
|
61
|
+
);
|
|
62
|
+
console.log(searchResult);
|
|
63
|
+
|
|
64
|
+
// Search with domain filtering
|
|
65
|
+
const filtered = await quercleSearch.execute(
|
|
66
|
+
{
|
|
67
|
+
query: "TypeScript documentation",
|
|
68
|
+
allowedDomains: ["typescriptlang.org"],
|
|
69
|
+
},
|
|
70
|
+
{ toolCallId: "2", messages: [] },
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// Fetch and analyze a page
|
|
74
|
+
const fetchResult = await quercleFetch.execute(
|
|
75
|
+
{
|
|
76
|
+
url: "https://en.wikipedia.org/wiki/TypeScript",
|
|
77
|
+
prompt: "Summarize the key features of TypeScript",
|
|
78
|
+
},
|
|
79
|
+
{ toolCallId: "3", messages: [] },
|
|
80
|
+
);
|
|
81
|
+
console.log(fetchResult);
|
|
82
|
+
|
|
83
|
+
// Raw search results (markdown or JSON)
|
|
84
|
+
const rawResults = await quercleRawSearch.execute(
|
|
85
|
+
{ query: "TypeScript 5 features", format: "json" },
|
|
86
|
+
{ toolCallId: "4", messages: [] },
|
|
87
|
+
);
|
|
88
|
+
console.log(rawResults);
|
|
89
|
+
|
|
90
|
+
// Raw page content
|
|
91
|
+
const rawPage = await quercleRawFetch.execute(
|
|
92
|
+
{ url: "https://en.wikipedia.org/wiki/TypeScript", format: "markdown" },
|
|
93
|
+
{ toolCallId: "5", messages: [] },
|
|
94
|
+
);
|
|
95
|
+
console.log(rawPage);
|
|
96
|
+
|
|
97
|
+
// Extract relevant content from a page
|
|
98
|
+
const extracted = await quercleExtract.execute(
|
|
99
|
+
{
|
|
100
|
+
url: "https://en.wikipedia.org/wiki/TypeScript",
|
|
101
|
+
query: "type system features",
|
|
102
|
+
format: "markdown",
|
|
103
|
+
},
|
|
104
|
+
{ toolCallId: "6", messages: [] },
|
|
105
|
+
);
|
|
106
|
+
console.log(extracted);
|
|
59
107
|
```
|
|
60
108
|
|
|
61
|
-
###
|
|
109
|
+
### Custom API Key
|
|
62
110
|
|
|
63
|
-
```
|
|
111
|
+
```ts
|
|
64
112
|
import { createQuercleTools } from "@quercle/ai-sdk";
|
|
65
|
-
import { generateText } from "ai";
|
|
66
|
-
import { openai } from "@ai-sdk/openai";
|
|
67
113
|
|
|
68
|
-
const { quercleSearch, quercleFetch } = createQuercleTools({
|
|
114
|
+
const { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract } = createQuercleTools({
|
|
69
115
|
apiKey: "qk_...",
|
|
70
116
|
});
|
|
117
|
+
```
|
|
71
118
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
119
|
+
## Agentic Usage
|
|
120
|
+
|
|
121
|
+
### Multi-Step with generateText
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
import { quercleSearch, quercleFetch, quercleExtract } from "@quercle/ai-sdk";
|
|
125
|
+
import { generateText } from "ai";
|
|
126
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
127
|
+
|
|
128
|
+
const { text, steps } = await generateText({
|
|
129
|
+
model: anthropic("claude-sonnet-4-20250514"),
|
|
130
|
+
tools: { quercleSearch, quercleFetch, quercleExtract },
|
|
131
|
+
maxSteps: 10,
|
|
132
|
+
prompt: "Research the latest developments in WebAssembly and write a summary",
|
|
133
|
+
onStepFinish({ text, toolCalls, finishReason }) {
|
|
134
|
+
console.log("Step finished:", finishReason, toolCalls.length, "tool calls");
|
|
135
|
+
},
|
|
76
136
|
});
|
|
77
|
-
```
|
|
78
137
|
|
|
79
|
-
|
|
138
|
+
console.log(text);
|
|
139
|
+
console.log(`Completed in ${steps.length} steps`);
|
|
140
|
+
```
|
|
80
141
|
|
|
81
|
-
###
|
|
142
|
+
### Streaming with streamText
|
|
82
143
|
|
|
83
|
-
|
|
144
|
+
```ts
|
|
145
|
+
import { quercleSearch, quercleFetch } from "@quercle/ai-sdk";
|
|
146
|
+
import { streamText } from "ai";
|
|
147
|
+
import { openai } from "@ai-sdk/openai";
|
|
84
148
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
149
|
+
const result = streamText({
|
|
150
|
+
model: openai("gpt-4o"),
|
|
151
|
+
tools: { quercleSearch, quercleFetch },
|
|
152
|
+
maxSteps: 5,
|
|
153
|
+
prompt: "Find and summarize the top 3 trending AI papers this week",
|
|
154
|
+
});
|
|
89
155
|
|
|
90
|
-
|
|
156
|
+
for await (const chunk of result.textStream) {
|
|
157
|
+
process.stdout.write(chunk);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
91
160
|
|
|
92
|
-
|
|
161
|
+
## API Reference
|
|
93
162
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
163
|
+
| Export | Description |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `quercleSearch` | AI SDK tool for web search with AI-synthesized answers (uses `QUERCLE_API_KEY` env var) |
|
|
166
|
+
| `quercleFetch` | AI SDK tool for URL fetch + AI analysis (uses `QUERCLE_API_KEY` env var) |
|
|
167
|
+
| `quercleRawSearch` | AI SDK tool for raw web search results (uses `QUERCLE_API_KEY` env var) |
|
|
168
|
+
| `quercleRawFetch` | AI SDK tool for raw page content fetching (uses `QUERCLE_API_KEY` env var) |
|
|
169
|
+
| `quercleExtract` | AI SDK tool for extracting relevant content from a URL (uses `QUERCLE_API_KEY` env var) |
|
|
170
|
+
| `createQuercleTools(options?)` | Factory that returns all 5 tools with a custom API key or config |
|
|
97
171
|
|
|
98
172
|
## License
|
|
99
173
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { quercleSearch, quercleFetch, createQuercleTools } from "./tools.js";
|
|
2
|
-
export type {
|
|
1
|
+
export { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract, createQuercleTools, } from "./tools.js";
|
|
2
|
+
export type { QuercleClientOptions, SearchOptions, SearchResponse, FetchResponse, RawSearchOptions, RawSearchResponse, RawFetchOptions, RawFetchResponse, ExtractOptions, ExtractResponse, } from "@quercle/sdk";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,GAChB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { quercleSearch, quercleFetch, createQuercleTools } from "./tools.js";
|
|
1
|
+
export { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract, createQuercleTools, } from "./tools.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
package/dist/tools.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type QuercleClientOptions } from "@quercle/sdk";
|
|
2
2
|
/**
|
|
3
3
|
* Search the web using Quercle and get AI-synthesized answers with citations.
|
|
4
4
|
*
|
|
@@ -44,6 +44,76 @@ export declare const quercleFetch: import("ai").Tool<{
|
|
|
44
44
|
url: string;
|
|
45
45
|
prompt: string;
|
|
46
46
|
}, string>;
|
|
47
|
+
/**
|
|
48
|
+
* Run a web search using Quercle and return raw results.
|
|
49
|
+
*
|
|
50
|
+
* Uses the QUERCLE_API_KEY environment variable for authentication.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* import { quercleRawSearch } from "@quercle/ai-sdk";
|
|
55
|
+
* import { generateText } from "ai";
|
|
56
|
+
* import { openai } from "@ai-sdk/openai";
|
|
57
|
+
*
|
|
58
|
+
* const result = await generateText({
|
|
59
|
+
* model: openai("gpt-4"),
|
|
60
|
+
* tools: { quercleRawSearch },
|
|
61
|
+
* prompt: "Search for the latest news about AI",
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare const quercleRawSearch: import("ai").Tool<{
|
|
66
|
+
query: string;
|
|
67
|
+
format?: "markdown" | "json" | undefined;
|
|
68
|
+
useSafeguard?: boolean | undefined;
|
|
69
|
+
}, string>;
|
|
70
|
+
/**
|
|
71
|
+
* Fetch a URL using Quercle and return raw markdown or HTML.
|
|
72
|
+
*
|
|
73
|
+
* Uses the QUERCLE_API_KEY environment variable for authentication.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import { quercleRawFetch } from "@quercle/ai-sdk";
|
|
78
|
+
* import { generateText } from "ai";
|
|
79
|
+
* import { openai } from "@ai-sdk/openai";
|
|
80
|
+
*
|
|
81
|
+
* const result = await generateText({
|
|
82
|
+
* model: openai("gpt-4"),
|
|
83
|
+
* tools: { quercleRawFetch },
|
|
84
|
+
* prompt: "Fetch https://example.com and return its content",
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare const quercleRawFetch: import("ai").Tool<{
|
|
89
|
+
url: string;
|
|
90
|
+
format?: "markdown" | "html" | undefined;
|
|
91
|
+
useSafeguard?: boolean | undefined;
|
|
92
|
+
}, string>;
|
|
93
|
+
/**
|
|
94
|
+
* Fetch a URL using Quercle and return chunks relevant to a query.
|
|
95
|
+
*
|
|
96
|
+
* Uses the QUERCLE_API_KEY environment variable for authentication.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* import { quercleExtract } from "@quercle/ai-sdk";
|
|
101
|
+
* import { generateText } from "ai";
|
|
102
|
+
* import { openai } from "@ai-sdk/openai";
|
|
103
|
+
*
|
|
104
|
+
* const result = await generateText({
|
|
105
|
+
* model: openai("gpt-4"),
|
|
106
|
+
* tools: { quercleExtract },
|
|
107
|
+
* prompt: "Extract pricing info from https://example.com",
|
|
108
|
+
* });
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
export declare const quercleExtract: import("ai").Tool<{
|
|
112
|
+
query: string;
|
|
113
|
+
url: string;
|
|
114
|
+
format?: "markdown" | "json" | undefined;
|
|
115
|
+
useSafeguard?: boolean | undefined;
|
|
116
|
+
}, string>;
|
|
47
117
|
/**
|
|
48
118
|
* Create Quercle tools with custom configuration.
|
|
49
119
|
*
|
|
@@ -56,18 +126,18 @@ export declare const quercleFetch: import("ai").Tool<{
|
|
|
56
126
|
* import { generateText } from "ai";
|
|
57
127
|
* import { openai } from "@ai-sdk/openai";
|
|
58
128
|
*
|
|
59
|
-
* const { quercleSearch, quercleFetch } = createQuercleTools({
|
|
129
|
+
* const { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract } = createQuercleTools({
|
|
60
130
|
* apiKey: "qk_...",
|
|
61
131
|
* });
|
|
62
132
|
*
|
|
63
133
|
* const result = await generateText({
|
|
64
134
|
* model: openai("gpt-4"),
|
|
65
|
-
* tools: { quercleSearch, quercleFetch },
|
|
135
|
+
* tools: { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract },
|
|
66
136
|
* prompt: "Search for TypeScript best practices",
|
|
67
137
|
* });
|
|
68
138
|
* ```
|
|
69
139
|
*/
|
|
70
|
-
export declare function createQuercleTools(config?:
|
|
140
|
+
export declare function createQuercleTools(config?: QuercleClientOptions): {
|
|
71
141
|
quercleSearch: import("ai").Tool<{
|
|
72
142
|
query: string;
|
|
73
143
|
allowedDomains?: string[] | undefined;
|
|
@@ -77,5 +147,21 @@ export declare function createQuercleTools(config?: QuercleConfig): {
|
|
|
77
147
|
url: string;
|
|
78
148
|
prompt: string;
|
|
79
149
|
}, string>;
|
|
150
|
+
quercleRawSearch: import("ai").Tool<{
|
|
151
|
+
query: string;
|
|
152
|
+
format?: "markdown" | "json" | undefined;
|
|
153
|
+
useSafeguard?: boolean | undefined;
|
|
154
|
+
}, string>;
|
|
155
|
+
quercleRawFetch: import("ai").Tool<{
|
|
156
|
+
url: string;
|
|
157
|
+
format?: "markdown" | "html" | undefined;
|
|
158
|
+
useSafeguard?: boolean | undefined;
|
|
159
|
+
}, string>;
|
|
160
|
+
quercleExtract: import("ai").Tool<{
|
|
161
|
+
query: string;
|
|
162
|
+
url: string;
|
|
163
|
+
format?: "markdown" | "json" | undefined;
|
|
164
|
+
useSafeguard?: boolean | undefined;
|
|
165
|
+
}, string>;
|
|
80
166
|
};
|
|
81
167
|
//# sourceMappingURL=tools.d.ts.map
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AA4DtB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa;;;;UAMxB,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY;;;UAMvB,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB;;;;UAO3B,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe;;;;UAO1B,CAAC;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc;;;;;UAOzB,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;EA2C/D"}
|
package/dist/tools.js
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
import { tool } from "ai";
|
|
2
|
-
import { QuercleClient,
|
|
2
|
+
import { QuercleClient, toolMetadata, } from "@quercle/sdk";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
const searchToolSchema = z.object({
|
|
5
|
+
query: z.string().describe(toolMetadata.search.parameters.query),
|
|
6
|
+
allowedDomains: z.array(z.string()).optional().describe(toolMetadata.search.parameters.allowed_domains),
|
|
7
|
+
blockedDomains: z.array(z.string()).optional().describe(toolMetadata.search.parameters.blocked_domains),
|
|
8
|
+
});
|
|
9
|
+
const fetchToolSchema = z.object({
|
|
10
|
+
url: z.string().describe(toolMetadata.fetch.parameters.url),
|
|
11
|
+
prompt: z.string().describe(toolMetadata.fetch.parameters.prompt),
|
|
12
|
+
});
|
|
13
|
+
const rawSearchToolSchema = z.object({
|
|
14
|
+
query: z.string().describe(toolMetadata.rawSearch.parameters.query),
|
|
15
|
+
format: z.enum(["markdown", "json"]).optional().describe(toolMetadata.rawSearch.parameters.format),
|
|
16
|
+
useSafeguard: z.boolean().optional().describe(toolMetadata.rawSearch.parameters.use_safeguard),
|
|
17
|
+
});
|
|
18
|
+
const rawFetchToolSchema = z.object({
|
|
19
|
+
url: z.string().describe(toolMetadata.rawFetch.parameters.url),
|
|
20
|
+
format: z.enum(["markdown", "html"]).optional().describe(toolMetadata.rawFetch.parameters.format),
|
|
21
|
+
useSafeguard: z.boolean().optional().describe(toolMetadata.rawFetch.parameters.use_safeguard),
|
|
22
|
+
});
|
|
23
|
+
const extractToolSchema = z.object({
|
|
24
|
+
url: z.string().describe(toolMetadata.extract.parameters.url),
|
|
25
|
+
query: z.string().describe(toolMetadata.extract.parameters.query),
|
|
26
|
+
format: z.enum(["markdown", "json"]).optional().describe(toolMetadata.extract.parameters.format),
|
|
27
|
+
useSafeguard: z.boolean().optional().describe(toolMetadata.extract.parameters.use_safeguard),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Format a raw/extract response result as a string.
|
|
31
|
+
*
|
|
32
|
+
* If the result is already a string it is returned directly.
|
|
33
|
+
* If it is an array it is JSON-stringified.
|
|
34
|
+
* When the response is flagged as unsafe, the string is prefixed with "[UNSAFE] ".
|
|
35
|
+
*/
|
|
36
|
+
function formatRawResult(result, unsafe) {
|
|
37
|
+
const text = typeof result === "string" ? result : JSON.stringify(result);
|
|
38
|
+
return unsafe ? `[UNSAFE] ${text}` : text;
|
|
39
|
+
}
|
|
40
|
+
/** Shared default client instance, lazily initialized on first use. */
|
|
41
|
+
let _defaultClient;
|
|
42
|
+
function getDefaultClient() {
|
|
43
|
+
if (!_defaultClient) {
|
|
44
|
+
_defaultClient = new QuercleClient();
|
|
45
|
+
}
|
|
46
|
+
return _defaultClient;
|
|
47
|
+
}
|
|
3
48
|
/**
|
|
4
49
|
* Search the web using Quercle and get AI-synthesized answers with citations.
|
|
5
50
|
*
|
|
@@ -19,11 +64,10 @@ import { QuercleClient, TOOL_DESCRIPTIONS, searchToolSchema, fetchToolSchema, }
|
|
|
19
64
|
* ```
|
|
20
65
|
*/
|
|
21
66
|
export const quercleSearch = tool({
|
|
22
|
-
description:
|
|
67
|
+
description: toolMetadata.search.description,
|
|
23
68
|
inputSchema: searchToolSchema,
|
|
24
69
|
execute: async ({ query, allowedDomains, blockedDomains }) => {
|
|
25
|
-
|
|
26
|
-
return await client.search(query, { allowedDomains, blockedDomains });
|
|
70
|
+
return (await getDefaultClient().search(query, { allowedDomains, blockedDomains })).result;
|
|
27
71
|
},
|
|
28
72
|
});
|
|
29
73
|
/**
|
|
@@ -45,11 +89,88 @@ export const quercleSearch = tool({
|
|
|
45
89
|
* ```
|
|
46
90
|
*/
|
|
47
91
|
export const quercleFetch = tool({
|
|
48
|
-
description:
|
|
92
|
+
description: toolMetadata.fetch.description,
|
|
49
93
|
inputSchema: fetchToolSchema,
|
|
50
94
|
execute: async ({ url, prompt }) => {
|
|
51
|
-
|
|
52
|
-
|
|
95
|
+
return (await getDefaultClient().fetch(url, prompt)).result;
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Run a web search using Quercle and return raw results.
|
|
100
|
+
*
|
|
101
|
+
* Uses the QUERCLE_API_KEY environment variable for authentication.
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* import { quercleRawSearch } from "@quercle/ai-sdk";
|
|
106
|
+
* import { generateText } from "ai";
|
|
107
|
+
* import { openai } from "@ai-sdk/openai";
|
|
108
|
+
*
|
|
109
|
+
* const result = await generateText({
|
|
110
|
+
* model: openai("gpt-4"),
|
|
111
|
+
* tools: { quercleRawSearch },
|
|
112
|
+
* prompt: "Search for the latest news about AI",
|
|
113
|
+
* });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export const quercleRawSearch = tool({
|
|
117
|
+
description: toolMetadata.rawSearch.description,
|
|
118
|
+
inputSchema: rawSearchToolSchema,
|
|
119
|
+
execute: async ({ query, format, useSafeguard }) => {
|
|
120
|
+
const response = await getDefaultClient().rawSearch(query, { format, useSafeguard });
|
|
121
|
+
return formatRawResult(response.result, response.unsafe);
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
/**
|
|
125
|
+
* Fetch a URL using Quercle and return raw markdown or HTML.
|
|
126
|
+
*
|
|
127
|
+
* Uses the QUERCLE_API_KEY environment variable for authentication.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* import { quercleRawFetch } from "@quercle/ai-sdk";
|
|
132
|
+
* import { generateText } from "ai";
|
|
133
|
+
* import { openai } from "@ai-sdk/openai";
|
|
134
|
+
*
|
|
135
|
+
* const result = await generateText({
|
|
136
|
+
* model: openai("gpt-4"),
|
|
137
|
+
* tools: { quercleRawFetch },
|
|
138
|
+
* prompt: "Fetch https://example.com and return its content",
|
|
139
|
+
* });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
export const quercleRawFetch = tool({
|
|
143
|
+
description: toolMetadata.rawFetch.description,
|
|
144
|
+
inputSchema: rawFetchToolSchema,
|
|
145
|
+
execute: async ({ url, format, useSafeguard }) => {
|
|
146
|
+
const response = await getDefaultClient().rawFetch(url, { format, useSafeguard });
|
|
147
|
+
return formatRawResult(response.result, response.unsafe);
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
/**
|
|
151
|
+
* Fetch a URL using Quercle and return chunks relevant to a query.
|
|
152
|
+
*
|
|
153
|
+
* Uses the QUERCLE_API_KEY environment variable for authentication.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* import { quercleExtract } from "@quercle/ai-sdk";
|
|
158
|
+
* import { generateText } from "ai";
|
|
159
|
+
* import { openai } from "@ai-sdk/openai";
|
|
160
|
+
*
|
|
161
|
+
* const result = await generateText({
|
|
162
|
+
* model: openai("gpt-4"),
|
|
163
|
+
* tools: { quercleExtract },
|
|
164
|
+
* prompt: "Extract pricing info from https://example.com",
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
export const quercleExtract = tool({
|
|
169
|
+
description: toolMetadata.extract.description,
|
|
170
|
+
inputSchema: extractToolSchema,
|
|
171
|
+
execute: async ({ url, query, format, useSafeguard }) => {
|
|
172
|
+
const response = await getDefaultClient().extract(url, query, { format, useSafeguard });
|
|
173
|
+
return formatRawResult(response.result, response.unsafe);
|
|
53
174
|
},
|
|
54
175
|
});
|
|
55
176
|
/**
|
|
@@ -64,13 +185,13 @@ export const quercleFetch = tool({
|
|
|
64
185
|
* import { generateText } from "ai";
|
|
65
186
|
* import { openai } from "@ai-sdk/openai";
|
|
66
187
|
*
|
|
67
|
-
* const { quercleSearch, quercleFetch } = createQuercleTools({
|
|
188
|
+
* const { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract } = createQuercleTools({
|
|
68
189
|
* apiKey: "qk_...",
|
|
69
190
|
* });
|
|
70
191
|
*
|
|
71
192
|
* const result = await generateText({
|
|
72
193
|
* model: openai("gpt-4"),
|
|
73
|
-
* tools: { quercleSearch, quercleFetch },
|
|
194
|
+
* tools: { quercleSearch, quercleFetch, quercleRawSearch, quercleRawFetch, quercleExtract },
|
|
74
195
|
* prompt: "Search for TypeScript best practices",
|
|
75
196
|
* });
|
|
76
197
|
* ```
|
|
@@ -79,17 +200,41 @@ export function createQuercleTools(config) {
|
|
|
79
200
|
const client = new QuercleClient(config);
|
|
80
201
|
return {
|
|
81
202
|
quercleSearch: tool({
|
|
82
|
-
description:
|
|
203
|
+
description: toolMetadata.search.description,
|
|
83
204
|
inputSchema: searchToolSchema,
|
|
84
205
|
execute: async ({ query, allowedDomains, blockedDomains }) => {
|
|
85
|
-
return await client.search(query, { allowedDomains, blockedDomains });
|
|
206
|
+
return (await client.search(query, { allowedDomains, blockedDomains })).result;
|
|
86
207
|
},
|
|
87
208
|
}),
|
|
88
209
|
quercleFetch: tool({
|
|
89
|
-
description:
|
|
210
|
+
description: toolMetadata.fetch.description,
|
|
90
211
|
inputSchema: fetchToolSchema,
|
|
91
212
|
execute: async ({ url, prompt }) => {
|
|
92
|
-
return await client.fetch(url, prompt);
|
|
213
|
+
return (await client.fetch(url, prompt)).result;
|
|
214
|
+
},
|
|
215
|
+
}),
|
|
216
|
+
quercleRawSearch: tool({
|
|
217
|
+
description: toolMetadata.rawSearch.description,
|
|
218
|
+
inputSchema: rawSearchToolSchema,
|
|
219
|
+
execute: async ({ query, format, useSafeguard }) => {
|
|
220
|
+
const response = await client.rawSearch(query, { format, useSafeguard });
|
|
221
|
+
return formatRawResult(response.result, response.unsafe);
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
quercleRawFetch: tool({
|
|
225
|
+
description: toolMetadata.rawFetch.description,
|
|
226
|
+
inputSchema: rawFetchToolSchema,
|
|
227
|
+
execute: async ({ url, format, useSafeguard }) => {
|
|
228
|
+
const response = await client.rawFetch(url, { format, useSafeguard });
|
|
229
|
+
return formatRawResult(response.result, response.unsafe);
|
|
230
|
+
},
|
|
231
|
+
}),
|
|
232
|
+
quercleExtract: tool({
|
|
233
|
+
description: toolMetadata.extract.description,
|
|
234
|
+
inputSchema: extractToolSchema,
|
|
235
|
+
execute: async ({ url, query, format, useSafeguard }) => {
|
|
236
|
+
const response = await client.extract(url, query, { format, useSafeguard });
|
|
237
|
+
return formatRawResult(response.result, response.unsafe);
|
|
93
238
|
},
|
|
94
239
|
}),
|
|
95
240
|
};
|
package/dist/tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,E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
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -19,17 +19,17 @@
|
|
|
19
19
|
"prepublishOnly": "bun run build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@quercle/sdk": "^0.
|
|
23
|
-
"ai": "^5.0.
|
|
24
|
-
"zod": "^3.
|
|
22
|
+
"@quercle/sdk": "^1.0.0",
|
|
23
|
+
"ai": "^5.0.124",
|
|
24
|
+
"zod": "^3.25.76"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@eslint/js": "^9.39.
|
|
28
|
-
"@types/bun": "^1.3.
|
|
29
|
-
"@types/node": "^22.
|
|
30
|
-
"eslint": "^9.39.
|
|
31
|
-
"typescript": "^5.
|
|
32
|
-
"typescript-eslint": "^8.
|
|
27
|
+
"@eslint/js": "^9.39.2",
|
|
28
|
+
"@types/bun": "^1.3.8",
|
|
29
|
+
"@types/node": "^22.19.7",
|
|
30
|
+
"eslint": "^9.39.2",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"typescript-eslint": "^8.54.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"ai": ">=5.0.0"
|
|
@@ -40,6 +40,9 @@
|
|
|
40
40
|
"files": [
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
43
46
|
"keywords": [
|
|
44
47
|
"quercle",
|
|
45
48
|
"ai",
|