@@ -331,6 +331,16 @@ vectorcode query foo bar --include path
331331This will only include the ` path ` in the output. This is effective for both
332332normal CLI usage and [ ` --pipe ` mode] ( #for-developers ) .
333333
334+ For some applications, it may be overkill to use the full document as context
335+ and all you need is the chunks. You can do this by using ` --include chunk ` or
336+ ` --include chunk path ` in the command. This will return chunks from the
337+ document, and in ` pipe ` mode the objects will also include the line numbers of
338+ the first and last lines in the chunk. Note that ` chunk ` and ` document ` cannot be used at
339+ the same time, and the number of query result (the ` -n ` parameter) will refer to
340+ the number of retrieved chunks when you use ` --include chunk ` . For the sake of
341+ completeness, the first and last lines of a chunk will be completed to include
342+ the whole lines if the chunker broke the text from mid-line.
343+
334344### Listing All Collections
335345
336346You can use ` vectorcode ls ` command to list all collections in your ChromaDB.
@@ -433,6 +443,25 @@ For the query command, here's the format printed in the `pipe` mode:
433443Basically an array of dictionaries with 2 keys: ` "path" ` for the path to the
434444document, and ` "document" ` for the content of the document.
435445
446+ If you used ` --include chunk path ` parameters, the array will look like this:
447+ ``` json
448+ [
449+ {
450+ "path" : " path_to_your_code.py" ,
451+ "chunk" : " foo" ,
452+ "start_line" : 1 ,
453+ "end_line" : 1 ,
454+ },
455+ {
456+ "path" : " path_to_another_file.py" ,
457+ "chunk" : " bar" ,
458+ "start_line" : 1 ,
459+ "end_line" : 1 ,
460+ }
461+ ]
462+ ```
463+ Keep in mind that both ` start_line ` and ` end_line ` are inclusive.
464+
436465#### ` vectorcode vectorise `
437466The output is in JSON format. It contains a dictionary with the following fields:
438467- ` "add" ` : number of added documents;
0 commit comments