handles history
This commit is contained in:
parent
dfb077be70
commit
85be8d6ef4
7 changed files with 452 additions and 212 deletions
|
@ -39,6 +39,9 @@
|
|||
|
||||
|
||||
static const uint32 kSendReply = 'krpl';
|
||||
static const uint32 kModelsReceived = 'mdls';
|
||||
static const uint32 kClearHistory = 'clrh';
|
||||
|
||||
|
||||
#include "include/json.hpp"
|
||||
|
||||
|
@ -61,18 +64,25 @@ public:
|
|||
std::vector<std::string> FilterTextModels(const json& modelsJson);
|
||||
|
||||
void ask(const std::string& prompt);
|
||||
void setModel(const std::string& prompt);
|
||||
void loadModels();
|
||||
void PrintAsJsonArray(const std::vector<std::string>& models) ;
|
||||
|
||||
void ClearHistory();
|
||||
std::string buildHistoryInfoLine();
|
||||
|
||||
private:
|
||||
|
||||
std::string buildBearerKey();
|
||||
|
||||
|
||||
std::string buildBearerKey();
|
||||
|
||||
std::vector<json> _messageHistory;
|
||||
|
||||
void sendReply(BMessage message);
|
||||
BHandler* replyTarget;
|
||||
BString ReadOpenAIKey();
|
||||
BString _apiKey;
|
||||
BHttpSession _sharedSession = BHttpSession ();
|
||||
std::optional<BHttpResult> _lastResult;
|
||||
|
||||
std::string _activeModel = "gpt-4o";
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue