-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmodel_picker.cpp
More file actions
30 lines (24 loc) · 856 Bytes
/
Copy pathmodel_picker.cpp
File metadata and controls
30 lines (24 loc) · 856 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
// src/tui/model_picker.cpp
//
// /model picker 的纯逻辑实现。把 saved_models 拆成结构化选项给
// main.cpp 的 inline overlay 渲染层 + 事件层用。
#include "model_picker.hpp"
#include "../config/model_provider_registry.hpp"
#include <utility>
namespace acecode {
std::vector<ModelPickerOption> build_model_picker_options(
const AppConfig& cfg, const std::string& current_name) {
std::vector<ModelPickerOption> out;
out.reserve(cfg.saved_models.size());
for (const auto& e : cfg.saved_models) {
if (!is_runtime_model_provider_enabled(e.provider)) continue;
ModelPickerOption o;
o.name = e.name;
o.provider = e.provider;
o.model = e.model;
o.is_current = (e.name == current_name);
out.push_back(std::move(o));
}
return out;
}
} // namespace acecode