fix: truncate webfetch content to fit context
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user