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 bool memory_inspector = true;
49 };
50 struct ModelPreset {
51 std::string name;
52 std::string model;
53 std::string provider;
54 std::string host;
55 std::vector<std::string> tags;
56 bool pinned = false;
57 };
58
59 std::string provider;
60 std::string model;
61 std::string ollama_host;
62 std::string gemini_api_key;
63 std::string anthropic_api_key;
64 std::string openai_api_key;
65 std::string openai_base_url;
66 std::string host_id;
67 bool verbose = false;
68 bool show_reasoning = true;
71 float temperature = 0.25f;
72 float top_p = 0.95f;
74 bool stream_responses = false;
75 int chain_mode = 0;
76 std::vector<std::string> favorite_models;
77 std::vector<std::string> model_chain;
78 std::vector<ModelPreset> model_presets;
79 std::string persona_notes;
80 std::vector<std::string> goals;
82 };
83
84 struct Snapshot {
85 std::vector<cli::agent::ChatMessage> history;
88 std::optional<AgentConfigSnapshot> agent_config;
89 };
90
91 // Returns true when the codec can actually serialize / deserialize history.
92 static bool Available();
93
94 static absl::StatusOr<Snapshot> Load(const std::filesystem::path& path);
95 static absl::Status Save(const std::filesystem::path& path,
96 const Snapshot& snapshot);
97};
98
99} // namespace editor
100} // namespace yaze
101
102#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