nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
stories.h
Go to the documentation of this file.
1#ifndef NANOMMO_SERVER_STORIES_H_
2#define NANOMMO_SERVER_STORIES_H_
3
4#include <cstddef>
5#include <optional>
6#include <string>
7#include <string_view>
8#include <vector>
9
10namespace nanommo {
11
12/// How many words mvGPT learned to write a story from.
13constexpr std::size_t kStoryWords = 3;
14
15/// mvGPT's prompt for a story with the words in it, the way it learned them:
16/// "Words: dragon, castle, gold\nStory:". It takes the first kStoryWords
17/// words, split at spaces and commas, in lowercase. Nothing if there are none.
18std::optional<std::string> StoryPrompt(std::string_view words);
19
20/// The story as lines of chat, each of at most kMaxChatLength bytes, broken
21/// after the last sentence that fits, or between words in a sentence that
22/// doesn't. A word longer than a line gets lines of its own, cut between two
23/// of its characters. A story that ran out of tokens stops in the middle of a
24/// sentence, so the story ends at its last full stop, or question or
25/// exclamation mark, when it has one.
26std::vector<std::string> StoryLines(std::string_view story);
27
28} // namespace nanommo
29
30#endif // NANOMMO_SERVER_STORIES_H_
Definition chat.cc:9
constexpr std::size_t kStoryWords
How many words mvGPT learned to write a story from.
Definition stories.h:13
std::vector< std::string > StoryLines(std::string_view story)
Definition stories.cc:60
std::optional< std::string > StoryPrompt(std::string_view words)
Definition stories.cc:44