Add JsonQuery examples to the description of Complex Query for it to work more reliably
This commit is contained in:
@@ -341,13 +341,39 @@ class ComplexSearchToolHandler(ToolHandler):
|
|||||||
Supports standard JsonLogic operators plus 'glob' and 'regexp' for pattern matching. Results must be non-falsy.
|
Supports standard JsonLogic operators plus 'glob' and 'regexp' for pattern matching. Results must be non-falsy.
|
||||||
|
|
||||||
Use this tool when you want to do a complex search, e.g. for all documents with certain tags etc.
|
Use this tool when you want to do a complex search, e.g. for all documents with certain tags etc.
|
||||||
|
ALWAYS follow query syntax in examples.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
1. Match all markdown files
|
||||||
|
{"glob": ["*.md", {"var": "path"}]}
|
||||||
|
|
||||||
|
2. Match all markdown files with 1221 substring inside them
|
||||||
|
{
|
||||||
|
"and": [
|
||||||
|
{ "glob": ["*.md", {"var": "path"}] },
|
||||||
|
{ "regexp": [".*1221.*", {"var": "content"}] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
3. Match all markdown files in Work folder containing name Keaton
|
||||||
|
{
|
||||||
|
"and": [
|
||||||
|
{ "glob": ["*.md", {"var": "path"}] },
|
||||||
|
{ "regexp": [".*Work.*", {"var": "path"}] },
|
||||||
|
{ "regexp": ["Keaton", {"var": "content"}] }
|
||||||
|
]
|
||||||
|
}
|
||||||
""",
|
""",
|
||||||
inputSchema={
|
inputSchema={
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"query": {
|
"query": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"description": "JsonLogic query object. Example: {\"glob\": [\"*.md\", {\"var\": \"path\"}]} matches all markdown files"
|
"description": "JsonLogic query object. ALWAYS follow query syntax in examples. \
|
||||||
|
Example 1: {\"glob\": [\"*.md\", {\"var\": \"path\"}]} matches all markdown files \
|
||||||
|
Example 2: {\"and\": [{\"glob\": [\"*.md\", {\"var\": \"path\"}]}, {\"regexp\": [\".*1221.*\", {\"var\": \"content\"}]}]} matches all markdown files with 1221 substring inside them \
|
||||||
|
Example 3: {\"and\": [{\"glob\": [\"*.md\", {\"var\": \"path\"}]}, {\"regexp\": [\".*Work.*\", {\"var\": \"path\"}]}, {\"regexp\": [\"Keaton\", {\"var\": \"content\"}]}]} matches all markdown files in Work folder containing name Keaton \
|
||||||
|
"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["query"]
|
"required": ["query"]
|
||||||
|
Reference in New Issue
Block a user