|
OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
|
#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 |
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.
| 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.
| std::optional<TokenUsage> OpenAnima::Core::Completion::usage |
Empty when none was reported.