mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-05-30 02:49:12 -04:00
23 lines
594 B
C++
23 lines
594 B
C++
// Copyright (C) 2024-2026 Petr Mironychev
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include "ContentFile.hpp"
|
|
#include <QList>
|
|
#include <QString>
|
|
|
|
namespace QodeAssist::Context {
|
|
|
|
class TokenUtils
|
|
{
|
|
public:
|
|
static int estimateTokens(const QString &text);
|
|
static int estimateFileTokens(const Context::ContentFile &file);
|
|
static int estimateFilesTokens(const QList<Context::ContentFile> &files);
|
|
static bool isImageFilePath(const QString &filePath);
|
|
static int estimateImageAttachmentTokens(const QString &filePath);
|
|
};
|
|
|
|
} // namespace QodeAssist::Context
|