MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / executeAsync

Method executeAsync

tools/FindFileTool.cpp:66–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66QFuture<LLMQore::ToolResult> FindFileTool::executeAsync(const QJsonObject &input)
67{
68 return QtConcurrent::run([this, input]() -> LLMQore::ToolResult {
69 QString query = input["query"].toString().trimmed();
70 if (query.isEmpty()) {
71 throw LLMQore::ToolInvalidArgument("'query' parameter is required and cannot be empty");
72 }
73
74 QString filePattern = input["file_pattern"].toString();
75
76 LOG_MESSAGE(QString("FindFileTool: Searching for '%1' (pattern: %2)")
77 .arg(query, filePattern.isEmpty() ? "none" : filePattern));
78
79 FileSearchUtils::FileMatch match
80 = FileSearchUtils::findBestMatch(query, filePattern, 10, m_ignoreManager);
81
82 if (match.absolutePath.isEmpty()) {
83 return LLMQore::ToolResult::text(QString("No file found matching '%1'").arg(query));
84 }
85
86 QString result = QString("Found file: %1\nAbsolute path: %2\nProject: %3")
87 .arg(match.relativePath, match.absolutePath, match.projectName);
88
89 return LLMQore::ToolResult::text(result);
90 });
91}
92
93} // namespace QodeAssist::Tools

Callers

nothing calls this directly

Calls 3

ToolInvalidArgumentClass · 0.85
toStringMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected