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