ForestHub SDK 0.1.0
C++14 LLM SDK for PC and embedded platforms
Loading...
Searching...
No Matches
foresthub::core::InputItems Class Reference

An ordered list of InputItem elements. More...

#include <input.hpp>

Inheritance diagram for foresthub::core::InputItems:
foresthub::core::Input

Public Types

using Iterator = std::vector<std::shared_ptr<InputItem>>::iterator
 Mutable iterator over items.
using ConstIterator = std::vector<std::shared_ptr<InputItem>>::const_iterator
 Const iterator over items.

Public Member Functions

 InputItems ()=default
 Construct an empty item list.
 InputItems (const std::shared_ptr< InputItem > &item)
 Construct from a single item.
void PushBack (const std::shared_ptr< InputItem > &item)
 Append an item to the list.
InputType GetInputType () const override
 Identifies this input as an item list.
void ToJson (json &j) const override
 Serialize all items as a JSON array.
Iterator Begin ()
 Returns a mutable iterator to the first item.
Iterator End ()
 Returns a mutable past-the-end iterator.
ConstIterator Begin () const
 Returns a const iterator to the first item.
ConstIterator End () const
 Returns a const past-the-end iterator.
template<typename... Args>
void Insert (Args &&... args)
 Forwards all arguments to the underlying vector's insert().

Public Attributes

std::vector< std::shared_ptr< InputItem > > items
 Ordered conversation items.

Detailed Description

An ordered list of InputItem elements.

Member Function Documentation

◆ Insert()

template<typename... Args>
void foresthub::core::InputItems::Insert ( Args &&... args)
inline

Forwards all arguments to the underlying vector's insert().

Parameters
argsArguments forwarded to std::vector::insert (position iterator, then value(s) or range).
items->Insert(items->End(), other.Begin(), other.End());
std::vector< std::shared_ptr< InputItem > > items
Ordered conversation items.
Definition input.hpp:87

The documentation for this class was generated from the following file: