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
@@ -173,56 +183,47 @@ local make_tool = check_cli_wrap(function(opts)
173
183
end,
174
184
},
175
185
schema= {
176
-
{
177
-
tool= {
178
-
_attr= { name="vectorcode" },
179
-
action= {
180
-
command="query",
181
-
options= {
182
-
query= { "keyword1", "keyword2" },
183
-
count=5,
186
+
type="function",
187
+
["function"] = {
188
+
name="vectorcode",
189
+
description="Retrieves code documents using semantic search or lists indexed projects",
190
+
parameters= {
191
+
type="object",
192
+
properties= {
193
+
command= {
194
+
type="string",
195
+
enum= { "query", "ls" },
196
+
description="Action to perform: 'query' for semantic search or 'ls' to list projects",
184
197
},
185
-
},
186
-
},
187
-
},
188
-
{
189
-
tool= {
190
-
_attr= { name="vectorcode" },
191
-
action= {
192
-
command="query",
193
198
options= {
194
-
query= { "keyword1" },
195
-
count=2,
199
+
type="object",
200
+
properties= {
201
+
query= {
202
+
type="array",
203
+
items= { type="string" },
204
+
description="Search keywords (required for 'query' command). Orthogornal keywords should be in distinct strings.",
205
+
},
206
+
count= {
207
+
type="integer",
208
+
description="Number of documents to retrieve, must be positive",
209
+
},
210
+
project_root= {
211
+
type="string",
212
+
description="Project path to search within (must be from 'ls' results)",
213
+
},
214
+
},
215
+
required= { "query" },
216
+
additionalProperties=false,
196
217
},
197
218
},
219
+
required= { "command" },
220
+
additionalProperties=false,
198
221
},
199
-
},
200
-
{
201
-
tool= {
202
-
_attr= { name="vectorcode" },
203
-
action= {
204
-
command="query",
205
-
options= {
206
-
query= { "keyword1" },
207
-
count=3,
208
-
project_root="path/to/other/project",
209
-
},
210
-
},
211
-
},
212
-
},
213
-
{
214
-
tool= {
215
-
_attr= { name="vectorcode" },
216
-
action= {
217
-
command="ls",
218
-
},
219
-
},
222
+
strict=true,
220
223
},
221
224
},
222
-
system_prompt=function(schema, xml2lua)
225
+
system_prompt=function()
223
226
localguidelines= {
224
-
" - Ensure XML is **valid and follows the schema**",
225
-
" - Make sure the tools xml block is **surrounded by ```xml**",
226
227
" - The path of a retrieved file will be wrapped in `<path>` and `</path>` tags. Its content will be right after the `</path>` tag, wrapped by `<content>` and `</content>` tags",
227
228
" - If you used the tool, tell users that they may need to wait for the results and there will be a virtual text indicator showing the tool is still running",
228
229
" - Include one single command call for VectorCode each time. You may include multiple keywords in the command",
@@ -269,40 +270,37 @@ local make_tool = check_cli_wrap(function(opts)
269
270
270
271
1. **Purpose**: This gives you the ability to access the repository to find information that you may need to assist the user.
271
272
272
-
2. **Usage**: Return an XML markdown code block that retrieves relevant documents corresponding to the generated query.
273
-
274
-
3. **Key Points**:
273
+
2. **Key Points**:
275
274
%s
276
275
277
-
4. **Actions**:
278
-
279
-
a) **Query for 5 documents using 2 keywords: `keyword1` and `keyword2`**:
280
-
281
-
```xml
282
-
%s
276
+
3. Example Tool Call
277
+
**Querying a project and retrieve the 10 most relevant files with keywords "keyword1" and "keyword2"**
283
278
```
284
-
285
-
b) **Query for 2 documents using one keyword: `keyword1`**:
286
-
287
-
```xml
288
-
%s
279
+
{
280
+
"_attr": "vectorcode",
281
+
{
282
+
"action": "query",
283
+
"options": {
284
+
"query": ["keyword1", "keyword2"],
285
+
"count": 10,
286
+
"project_root": "/path/to/project",
287
+
}
288
+
}
289
+
}
289
290
```
290
-
c) **Query for 3 documents using one keyword: `keyword1` in a different project located at `path/to/other/project` (relative to current working directory)**:
291
-
```xml
292
-
%s
291
+
292
+
**Listing available projects**
293
293
```
294
-
d) **Get all indexed project**
295
-
```xml
296
-
%s
294
+
{
295
+
"_attr": "vectorcode",
296
+
{
297
+
"action": "ls"
298
+
}
299
+
}
297
300
```
298
301
299
-
Remember:
300
-
- Minimize explanations unless prompted. Focus on generating correct XML.]],
0 commit comments