On this page

Utils::AiContextItem Class

class Utils::AiContextItem

The AiContextItem class is a piece of context that goes along with the prompt of an AiRequest. More...

Header: #include <aiassistance.h>

Public Types

enum Kind { File, Text, Image }

Public Variables

Utils::FilePath filePath
QImage image
Utils::AiContextItem::Kind kind
QString name
std::optional<Utils::Text::Range> range
QString text

Static Public Members

Utils::AiContextItem fromFile(const Utils::FilePath &filePath, const std::optional<Utils::Text::Range> &range = {})
Utils::AiContextItem fromImage(const QString &name, const QImage &image)
Utils::AiContextItem fromText(const QString &name, const QString &text)

Detailed Description

Create items with fromFile(), fromText(), and fromImage().

Member Type Documentation

enum AiContextItem::Kind

This enum describes what an item holds.

ConstantValueDescription
Utils::AiContextItem::File0A file, possibly only some of its lines.
Utils::AiContextItem::Text1A text with a name.
Utils::AiContextItem::Image2An image with a name.

Member Function Documentation

[static] Utils::AiContextItem AiContextItem::fromFile(const Utils::FilePath &filePath, const std::optional<Utils::Text::Range> &range = {})

Returns an item for filePath, or only the lines in range of it.

[static] Utils::AiContextItem AiContextItem::fromImage(const QString &name, const QImage &image)

Returns an item for image, which is shown as name.

[static] Utils::AiContextItem AiContextItem::fromText(const QString &name, const QString &text)

Returns an item for text, which is shown as name.

Member Variable Documentation

Utils::FilePath AiContextItem::filePath

This variable holds the file of a File item.

QImage AiContextItem::image

This variable holds the image of an Image item.

Utils::AiContextItem::Kind AiContextItem::kind

What the item holds.

QString AiContextItem::name

This variable holds the name that the item is shown with.

std::optional<Utils::Text::Range> AiContextItem::range

This variable holds the lines of the file that the item is about, if not the whole file.

QString AiContextItem::text

This variable holds the text of a Text item.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.