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
@@ -146,56 +155,47 @@ local make_tool = check_cli_wrap(function(opts)
146
155
end,
147
156
},
148
157
schema= {
149
-
{
150
-
tool= {
151
-
_attr= { name="vectorcode" },
152
-
action= {
153
-
command="query",
154
-
options= {
155
-
query= { "keyword1", "keyword2" },
156
-
count=5,
158
+
type="function",
159
+
["function"] = {
160
+
name="vectorcode",
161
+
description="Retrieves code documents using semantic search or lists indexed projects",
162
+
parameters= {
163
+
type="object",
164
+
properties= {
165
+
command= {
166
+
type="string",
167
+
enum= { "query", "ls" },
168
+
description="Action to perform: 'query' for semantic search or 'ls' to list projects",
157
169
},
158
-
},
159
-
},
160
-
},
161
-
{
162
-
tool= {
163
-
_attr= { name="vectorcode" },
164
-
action= {
165
-
command="query",
166
170
options= {
167
-
query= { "keyword1" },
168
-
count=2,
171
+
type="object",
172
+
properties= {
173
+
query= {
174
+
type="array",
175
+
items= { type="string" },
176
+
description="Search keywords (required for 'query' command). Orthogornal keywords should be in distinct strings.",
177
+
},
178
+
count= {
179
+
type="integer",
180
+
description="Number of documents to retrieve, must be positive",
181
+
},
182
+
project_root= {
183
+
type="string",
184
+
description="Project path to search within (must be from 'ls' results)",
185
+
},
186
+
},
187
+
required= { "query" },
188
+
additionalProperties=false,
169
189
},
170
190
},
191
+
required= { "command" },
192
+
additionalProperties=false,
171
193
},
172
-
},
173
-
{
174
-
tool= {
175
-
_attr= { name="vectorcode" },
176
-
action= {
177
-
command="query",
178
-
options= {
179
-
query= { "keyword1" },
180
-
count=3,
181
-
project_root="path/to/other/project",
182
-
},
183
-
},
184
-
},
185
-
},
186
-
{
187
-
tool= {
188
-
_attr= { name="vectorcode" },
189
-
action= {
190
-
command="ls",
191
-
},
192
-
},
194
+
strict=true,
193
195
},
194
196
},
195
-
system_prompt=function(schema, xml2lua)
197
+
system_prompt=function()
196
198
localguidelines= {
197
-
" - Ensure XML is **valid and follows the schema**",
198
-
" - Make sure the tools xml block is **surrounded by ```xml**",
199
199
" - 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",
200
200
" - 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",
201
201
" - Include one single command call for VectorCode each time. You may include multiple keywords in the command",
@@ -242,40 +242,37 @@ local make_tool = check_cli_wrap(function(opts)
242
242
243
243
1. **Purpose**: This gives you the ability to access the repository to find information that you may need to assist the user.
244
244
245
-
2. **Usage**: Return an XML markdown code block that retrieves relevant documents corresponding to the generated query.
246
-
247
-
3. **Key Points**:
245
+
2. **Key Points**:
248
246
%s
249
247
250
-
4. **Actions**:
251
-
252
-
a) **Query for 5 documents using 2 keywords: `keyword1` and `keyword2`**:
253
-
254
-
```xml
255
-
%s
248
+
3. Example Tool Call
249
+
**Querying a project and retrieve the 10 most relevant files with keywords "keyword1" and "keyword2"**
256
250
```
257
-
258
-
b) **Query for 2 documents using one keyword: `keyword1`**:
259
-
260
-
```xml
261
-
%s
251
+
{
252
+
"_attr": "vectorcode",
253
+
{
254
+
"action": "query",
255
+
"options": {
256
+
"query": ["keyword1", "keyword2"],
257
+
"count": 10,
258
+
"project_root": "/path/to/project",
259
+
}
260
+
}
261
+
}
262
262
```
263
-
c) **Query for 3 documents using one keyword: `keyword1` in a different project located at `path/to/other/project` (relative to current working directory)**:
264
-
```xml
265
-
%s
263
+
264
+
**Listing available projects**
266
265
```
267
-
d) **Get all indexed project**
268
-
```xml
269
-
%s
266
+
{
267
+
"_attr": "vectorcode",
268
+
{
269
+
"action": "ls"
270
+
}
271
+
}
270
272
```
271
273
272
-
Remember:
273
-
- Minimize explanations unless prompted. Focus on generating correct XML.]],
0 commit comments