fix: truncate webfetch content to fit context

This commit is contained in:
2026-09-30 15:01:28 +02:00
parent e700a4f96b
commit e2786a3f1e
31 changed files with 1386 additions and 135 deletions
+26
View File
@@ -0,0 +1,26 @@
#pragma once
#include "tool.hpp"
namespace ZShell::llm {
// Lets the model read text files from the local filesystem, in
// byte-offset windows small enough to fit the context. Primarily used to
// page through the full webfetch output stored under
// /tmp/zshell-llm/webfetch/.
class FileReadTool : public LlmTool {
Q_OBJECT
public:
explicit FileReadTool(QObject* parent = nullptr);
QString name() const override;
QString description() const override;
QJsonObject parameters() const override;
void execute(
const QString& toolCallId,
const QJsonObject& args,
std::function<void(const QJsonObject& result)> done) override;
};
} // namespace ZShell::llm