yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
agent_chat_history_codec.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_CODEC_H_
2#define YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_CODEC_H_
3
4#include <filesystem>
5#include <optional>
6#include <string>
7#include <vector>
8
9#include "absl/status/status.h"
10#include "absl/status/statusor.h"
11#include "absl/time/time.h"
13
14namespace yaze {
15namespace editor {
16
17// Bridges chat history persistence to optional JSON support. When the
18// application is built without gRPC/JSON support these helpers gracefully
19// degrade and report an Unimplemented status so the UI can disable
20// persistence instead of failing to compile.
22 public:
24 bool active = false;
25 std::string session_id;
26 std::string session_name;
27 std::vector<std::string> participants;
28 absl::Time last_synced = absl::InfinitePast();
29 };
30
32 std::optional<std::filesystem::path> last_capture_path;
33 std::string status_message;
34 absl::Time last_updated = absl::InfinitePast();
35 };
36
38 struct ToolFlags {
39 bool resources = true;
40 bool dungeon = true;
41 bool overworld = true;
42 bool dialogue = true;
43 bool messages = true;
44 bool gui = true;
45 bool music = true;
46 bool sprite = true;
47 bool emulator = true;
48 };
49 struct ModelPreset {
50 std::string name;
51 std::string model;
52 std::string provider;
53 std::string host;
54 std::vector<std::string> tags;
55 bool pinned = false;
56 };
57
58 std::string provider;
59 std::string model;
60 std::string ollama_host;
61 std::string gemini_api_key;
62 bool verbose = false;
63 bool show_reasoning = true;
66 float temperature = 0.25f;
67 float top_p = 0.95f;
69 bool stream_responses = false;
70 int chain_mode = 0;
71 std::vector<std::string> favorite_models;
72 std::vector<std::string> model_chain;
73 std::vector<ModelPreset> model_presets;
74 std::string persona_notes;
75 std::vector<std::string> goals;
77 };
78
79 struct Snapshot {
80 std::vector<cli::agent::ChatMessage> history;
83 std::optional<AgentConfigSnapshot> agent_config;
84 };
85
86 // Returns true when the codec can actually serialize / deserialize history.
87 static bool Available();
88
89 static absl::StatusOr<Snapshot> Load(const std::filesystem::path& path);
90 static absl::Status Save(const std::filesystem::path& path,
91 const Snapshot& snapshot);
92};
93
94} // namespace editor
95} // namespace yaze
96
97#endif // YAZE_APP_EDITOR_AGENT_AGENT_CHAT_HISTORY_CODEC_H_
static absl::Status Save(const std::filesystem::path &path, const Snapshot &snapshot)
static absl::StatusOr< Snapshot > Load(const std::filesystem::path &path)
std::optional< std::filesystem::path > last_capture_path
std::vector< cli::agent::ChatMessage > history
std::optional< AgentConfigSnapshot > agent_config