nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo::Storyteller Class Reference

#include <storyteller.h>

Public Types

using Told = std::function<void(absl::StatusOr<std::string>)>
 Gets the story, or why there isn't one.

Public Member Functions

 Storyteller (asio::io_context &io, std::string host)
void Tell (std::string prompt, Told told)

Static Public Attributes

static constexpr uint16_t kPort = 8000

Detailed Description

Asks mvGPT's completions API, the storyteller service, for stories, on threads of its own, so that a tick never waits for the model.

Definition at line 16 of file storyteller.h.

Member Typedef Documentation

◆ Told

using nanommo::Storyteller::Told = std::function<void(absl::StatusOr<std::string>)>

Gets the story, or why there isn't one.

Definition at line 21 of file storyteller.h.

Constructor & Destructor Documentation

◆ Storyteller()

nanommo::Storyteller::Storyteller ( asio::io_context & io,
std::string host )

Definition at line 30 of file storyteller.cc.

Member Function Documentation

◆ Tell()

void nanommo::Storyteller::Tell ( std::string prompt,
Told told )

Asks for a story that goes on from the prompt, and calls told with it on the io_context's thread, where the rest of the server runs.

Definition at line 33 of file storyteller.cc.

Member Data Documentation

◆ kPort

uint16_t nanommo::Storyteller::kPort = 8000
staticconstexpr

Definition at line 18 of file storyteller.h.


The documentation for this class was generated from the following files: