refactor, add stop and force commands
refine hardcoded system prompt a little
This commit is contained in:
47
src/solanaceae/rpbot/rpbot_states.hpp
Normal file
47
src/solanaceae/rpbot/rpbot_states.hpp
Normal file
@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "./rpbot.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <future>
|
||||
#include <cstdint>
|
||||
|
||||
struct TagStopRPBot {};
|
||||
|
||||
// sleeps until onMsg or onTimer
|
||||
struct StateIdle {
|
||||
static constexpr const char* name {"StateIdle"};
|
||||
float timeout {0.f};
|
||||
bool force {false};
|
||||
};
|
||||
|
||||
// determines if self should generate a message
|
||||
struct StateNext {
|
||||
static constexpr const char* name {"StateNext"};
|
||||
|
||||
std::string prompt;
|
||||
std::vector<std::string> possible_names;
|
||||
std::vector<Contact3> possible_contacts;
|
||||
|
||||
std::future<int64_t> future;
|
||||
};
|
||||
|
||||
// generate message
|
||||
struct StateGenerateMsg {
|
||||
static constexpr const char* name {"StateGenerateMsg"};
|
||||
|
||||
std::string prompt;
|
||||
|
||||
// returns new line (single message)
|
||||
std::future<std::string> future;
|
||||
};
|
||||
|
||||
// look if it took too long/too many new messages came in
|
||||
// while also optionally sleeping to make message appear not too fast
|
||||
// HACK: skip, just send for now
|
||||
struct StateTimingCheck {
|
||||
static constexpr const char* name {"StateTimingCheck"};
|
||||
int tmp;
|
||||
};
|
||||
|
Reference in New Issue
Block a user