Skip to content

Commit b3de7dd

Browse files
committed
Fix resource tool search to use text() method like old context tool
- Use result.text() instead of result.point.payload.get('content') - Match the exact same format as the old context tool - Should fix search not finding results issue
1 parent 4ad3779 commit b3de7dd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

crates/chat-cli/src/cli/chat/tools/resource.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,10 @@ impl Resource {
343343
} else {
344344
let mut output = format!("Found {} matching indexed resources:\n", results.len());
345345
for result in results.iter() {
346-
// Get full content from payload
347-
let content = result.point.payload.get("content")
348-
.and_then(|v| v.as_str())
349-
.unwrap_or("No content available");
350-
output.push_str(&format!("- {} (distance: {:.2})\n", content, result.distance));
346+
// Use the same method as the old context tool
347+
if let Some(text) = result.text() {
348+
output.push_str(&format!("{}\\n\\n", text));
349+
}
351350
}
352351
output
353352
}

0 commit comments

Comments
 (0)