mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-07-20 02:01:23 -04:00
refactor: Restructure project into sources/tests layout and dissolve PluginLLMCore
This commit is contained in:
68
sources/llmcore/ContextData.hpp
Normal file
68
sources/llmcore/ContextData.hpp
Normal file
@@ -0,0 +1,68 @@
|
||||
// Copyright (C) 2024-2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
namespace QodeAssist::LLMCore {
|
||||
|
||||
struct ImageAttachment
|
||||
{
|
||||
QString data; // Base64 encoded data or URL
|
||||
QString mediaType; // e.g., "image/png", "image/jpeg", "image/webp", "image/gif"
|
||||
bool isUrl = false; // true if data is URL, false if base64
|
||||
|
||||
bool operator==(const ImageAttachment &) const = default;
|
||||
};
|
||||
|
||||
struct ToolCall
|
||||
{
|
||||
QString id;
|
||||
QString name;
|
||||
QJsonObject arguments;
|
||||
|
||||
bool operator==(const ToolCall &) const = default;
|
||||
};
|
||||
|
||||
struct Message
|
||||
{
|
||||
QString role;
|
||||
QString content;
|
||||
QString signature;
|
||||
bool isThinking = false;
|
||||
bool isRedacted = false;
|
||||
std::optional<QVector<ImageAttachment>> images;
|
||||
|
||||
QVector<ToolCall> toolCalls;
|
||||
QString toolCallId;
|
||||
QString toolName;
|
||||
|
||||
// clang-format off
|
||||
bool operator==(const Message&) const = default;
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
struct FileMetadata
|
||||
{
|
||||
QString filePath;
|
||||
QString content;
|
||||
bool operator==(const FileMetadata &) const = default;
|
||||
};
|
||||
|
||||
struct ContextData
|
||||
{
|
||||
std::optional<QString> systemPrompt;
|
||||
std::optional<QString> prefix;
|
||||
std::optional<QString> suffix;
|
||||
std::optional<QString> fileContext;
|
||||
std::optional<QVector<Message>> history;
|
||||
std::optional<QList<FileMetadata>> filesMetadata;
|
||||
|
||||
bool operator==(const ContextData &) const = default;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist::LLMCore
|
||||
13
sources/llmcore/RequestType.hpp
Normal file
13
sources/llmcore/RequestType.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2024-2026 Petr Mironychev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
||||
|
||||
#include <QString>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace QodeAssist::LLMCore {
|
||||
|
||||
enum RequestType { CodeCompletion, Chat, Embedding, QuickRefactoring };
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user