|
OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
|
#include <ResponseFormat.h>
Public Types | |
| enum class | Kind : std::uint8_t { Text , JsonObject , JsonSchema } |
| The shapes an answer can be asked for in. More... | |
Static Public Member Functions | |
| static ResponseFormat | text () |
| static ResponseFormat | jsonObject () |
| static ResponseFormat | jsonSchema (nlohmann::json schema) |
Public Attributes | |
| Kind | kind {Kind::Text} |
| Which of the three is being asked for. | |
| nlohmann::json | schema |
| The schema, used when the kind is JsonSchema. | |
What a caller expects the model to answer with.
The chat-completions contract spells this as response_format, and a server that does not know the field ignores it. What arrives is then checked here instead: as soon as a shape other than text is asked for, the answer is read as JSON, and an answer that is not JSON is a ParseError rather than something the caller has to discover.
|
strong |
|
inlinestatic |
References JsonObject.
|
inlinestatic |
| schema | JSON Schema the answer has to follow, sent as it is given. |
References JsonSchema, and schema.
|
inlinestatic |