OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
OpenAnima::Core::ActionCatalogue Class Reference

#include <ActionCatalogue.h>

Public Member Functions

void add (ActionSpec spec)
 
const std::vector< ActionSpec > & actions () const noexcept
 
nlohmann::json replySchema () const
 
std::string replyInstruction () const
 

Static Public Member Functions

static ActionCatalogue base ()
 

Detailed Description

The actions available to one NPC, and the reply schema built from them.

One definition serves two things: the schema the answer is asked for in, and the instruction sent with the prompt, which is what a provider that ignores the schema still reads.

Member Function Documentation

◆ actions()

const std::vector< ActionSpec > & OpenAnima::Core::ActionCatalogue::actions ( ) const
inlinenoexcept
Returns
The actions, in the order they were added.

◆ add()

void OpenAnima::Core::ActionCatalogue::add ( ActionSpec  spec)

Adds an action, or replaces the one that already has its name.

Parameters
specAction to add. Its name must not be empty.

◆ base()

static ActionCatalogue OpenAnima::Core::ActionCatalogue::base ( )
static
Returns
The catalogue the reply schema describes: wait, end_conversation and emote.

◆ replyInstruction()

std::string OpenAnima::Core::ActionCatalogue::replyInstruction ( ) const
Returns
The instruction that goes with the prompt: what to answer with, in which order, and which actions exist. It asks for the keys in the order that streams best, because a schema does not carry an order.

◆ replySchema()

nlohmann::json OpenAnima::Core::ActionCatalogue::replySchema ( ) const
Returns
The schema a reply is asked for in: reasoning, dialogue and the actions of this catalogue, with every key required.

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