OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
Loading...
Searching...
No Matches
Public Attributes | List of all members
OpenAnima::Core::Completion Struct Reference

#include <Completion.h>

Public Attributes

std::string text
 Assistant text, ready to show.
 
std::string model
 Model that actually answered.
 
FinishReason finishReason {FinishReason::Unknown}
 Why generation stopped.
 
std::optional< TokenUsage > usage
 
std::optional< nlohmann::ordered_json > json
 

Detailed Description

One answer from a provider, together with what it cost and why it ended.

Providers are free to leave the metadata out: usage stays empty when the provider reports none, and finishReason stays Unknown when the value is not one of the modelled ones.

Member Data Documentation

◆ json

std::optional<nlohmann::ordered_json> OpenAnima::Core::Completion::json

The answer read as JSON, when a shape other than text was asked for. Empty when text was asked for, and empty on a turn that was cancelled before it was whole. It is ordered, so a document keeps the order the model wrote its keys in.

◆ usage

std::optional<TokenUsage> OpenAnima::Core::Completion::usage

Empty when none was reported.


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