|
OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
|
The agent and the vocabulary of a conversation. More...
Classes | |
| class | ActionCatalogue |
| struct | ActionSpec |
| One action an NPC may ask the host application to take. More... | |
| struct | ChatMessage |
| A single message exchanged with a language-model provider. More... | |
| struct | Completion |
| struct | Event |
| struct | NpcAction |
| One thing an NPC asks the host application to do. More... | |
| class | NPCBrain |
| One NPC: its persona, its memory and the conversation it is having. More... | |
| struct | NpcReply |
| struct | ResponseFormat |
| struct | TokenUsage |
| Tokens billed for one exchange. More... | |
Typedefs | |
| using | RequestId = std::uint64_t |
| Names a turn that was handed to a brain and not collected yet. | |
Enumerations | |
| enum class | FinishReason : std::uint8_t { Unknown , Stop , Length , ToolCalls , ContentFilter , Cancelled } |
| Why a provider stopped generating. More... | |
| enum class | EventKind : std::uint8_t { Started , Delta , Finished , Failed } |
| What an event reports, in the order the events of one turn arrive. More... | |
| enum class | Role : std::uint8_t { System , User , Assistant , Tool } |
| Identifies the author of a ChatMessage. More... | |
Functions | |
| NpcReply | readReply (const Completion &completion, const std::string &partialDialogue={}) |
The agent and the vocabulary of a conversation.
Messages, roles, the answer a provider returns, the events a turn reports, and the brain that keeps the history and drives the exchange.
|
strong |
What an event reports, in the order the events of one turn arrive.
|
strong |
Why a provider stopped generating.
|
strong |
Identifies the author of a ChatMessage.
| NpcReply OpenAnima::Core::readReply | ( | const Completion & | completion, |
| const std::string & | partialDialogue = {} |
||
| ) |
Reads a reply out of an answer asked for with a reply schema.
| completion | Answer as the provider reported it. |
| partialDialogue | Dialogue read from the answer while it arrived, used when the turn was cancelled before the document was whole. |
| ParseError | when the answer is not a reply, or a key is missing or has the wrong type. A cancelled turn is not an error: it returns what it had said. |