You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add tool search with semantic, local, and auto search modes (#322)
* Tool search with semantic and auto mode
* Fix CI Lint issues
* Cubic fixes
* refactor earch to make aligned with defender
* Fix CI Lint issues
* Add topk example
Copy file name to clipboardExpand all lines: README.md
+35-63Lines changed: 35 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,6 @@ bun add @stackone/ai zod
34
34
import { StackOneToolSet } from'@stackone/ai';
35
35
36
36
const toolset =newStackOneToolSet({
37
-
baseUrl: 'https://api.stackone.com',
38
37
accountId: 'your-account-id',
39
38
});
40
39
@@ -97,7 +96,6 @@ import { OpenAI } from 'openai';
97
96
import { StackOneToolSet } from'@stackone/ai';
98
97
99
98
const toolset =newStackOneToolSet({
100
-
baseUrl: 'https://api.stackone.com',
101
99
accountId: 'your-account-id',
102
100
});
103
101
@@ -135,7 +133,6 @@ import OpenAI from 'openai';
135
133
import { StackOneToolSet } from'@stackone/ai';
136
134
137
135
const toolset =newStackOneToolSet({
138
-
baseUrl: 'https://api.stackone.com',
139
136
accountId: 'your-account-id',
140
137
});
141
138
@@ -167,7 +164,6 @@ import Anthropic from '@anthropic-ai/sdk';
167
164
import { StackOneToolSet } from'@stackone/ai';
168
165
169
166
const toolset =newStackOneToolSet({
170
-
baseUrl: 'https://api.stackone.com',
171
167
accountId: 'your-account-id',
172
168
});
173
169
@@ -206,7 +202,6 @@ import { generateText } from 'ai';
206
202
import { StackOneToolSet } from'@stackone/ai';
207
203
208
204
const toolset =newStackOneToolSet({
209
-
baseUrl: 'https://api.stackone.com',
210
205
accountId: 'your-account-id',
211
206
});
212
207
@@ -237,7 +232,6 @@ import { z } from 'zod';
237
232
import { StackOneToolSet } from'@stackone/ai';
238
233
239
234
const toolset =newStackOneToolSet({
240
-
baseUrl: 'https://api.stackone.com',
241
235
accountId: 'your-account-id',
242
236
});
243
237
@@ -285,7 +279,6 @@ import { query } from '@anthropic-ai/claude-agent-sdk';
285
279
import { StackOneToolSet } from'@stackone/ai';
286
280
287
281
const toolset =newStackOneToolSet({
288
-
baseUrl: 'https://api.stackone.com',
289
282
accountId: 'your-account-id',
290
283
});
291
284
@@ -355,77 +348,60 @@ This is especially useful when you want to:
355
348
356
349
[View full example](examples/fetch-tools.ts)
357
350
358
-
### Utility Tools (Beta)
351
+
### Search Tool
359
352
360
-
Utility tools enable dynamic tool discovery and execution, allowing AI agents to search for relevant tools based on natural language queries without hardcoding tool names.
361
-
362
-
> **Beta Feature**: Utility tools are currently in beta and the API may change in future versions.
363
-
364
-
#### How Utility Tools Work
365
-
366
-
Utility tools provide two core capabilities:
367
-
368
-
1.**Tool Discovery** (`tool_search`): Search for tools using natural language queries
const result =awaitlistTool.execute({ query: { limit: 10 } });
389
370
```
390
371
391
-
#### Example: Dynamic Tool Discovery with AI SDK
372
+
### Semantic Search
373
+
374
+
Discover tools using natural language instead of exact names. Queries like "onboard new hire" resolve to the right actions even when the tool is called `bamboohr_create_employee`.
392
375
393
376
```typescript
394
-
import { generateText } from'ai';
395
-
import { openai } from'@ai-sdk/openai';
377
+
import { StackOneToolSet } from'@stackone/ai';
396
378
397
-
const { text } =awaitgenerateText({
398
-
model: openai('gpt-5.1'),
399
-
tools: aiSdkTools,
400
-
prompt: 'Find tools for managing employees and create a time off request',
Results are automatically scoped to connectors in your linked accounts. See [Search Tools Example](examples/search-tools.ts) for `SearchTool` (`getSearchTool`) integration, AI SDK, and agent loop patterns.
429
405
430
406
### Custom Base URL
431
407
@@ -443,9 +419,7 @@ You can use the `dryRun` option to return the api arguments from a tool call wit
0 commit comments