-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathturn_net_diff.hpp
More file actions
36 lines (27 loc) · 941 Bytes
/
Copy pathturn_net_diff.hpp
File metadata and controls
36 lines (27 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "../provider/llm_provider.hpp"
#include "../tool/diff_utils.hpp"
#include <nlohmann/json.hpp>
#include <optional>
#include <string>
#include <vector>
namespace acecode {
struct TurnNetDiffFile {
std::string file;
int additions = 0;
int deletions = 0;
std::vector<DiffHunk> hunks;
};
struct TurnNetDiffRecord {
std::string user_message_uuid;
bool complete = true;
std::vector<TurnNetDiffFile> files;
std::vector<std::string> errors;
};
nlohmann::json encode_turn_net_diff(const TurnNetDiffRecord& record);
std::optional<TurnNetDiffRecord> decode_turn_net_diff(const nlohmann::json& value);
ChatMessage make_turn_net_diff_message(const TurnNetDiffRecord& record,
const std::string& timestamp);
bool is_turn_net_diff_message(const ChatMessage& msg);
std::string turn_net_diff_user_message_uuid(const ChatMessage& msg);
} // namespace acecode