28 lines
1.4 KiB
C++
28 lines
1.4 KiB
C++
// muse exec flags: measured on a 16KB tai prompt, the default reasoning effort took 36.5s and
|
|||
|
|
// let the model call its own tools (step_limit failure); low effort plus the empty preset took 2.4s.
|
||
|
|
#include <algorithm>
|
||
|
|
#include <cstdio>
|
||
|
|
#include "consts.h"
|
||
|
|
#include "muse.h"
|
||
|
|
static int g_fail = 0;
|
||
|
|
#define CHECK(cond) do { if (!(cond)) { g_fail++; std::printf("FAIL %s:%d %s\n", __FILE__, __LINE__, #cond); } } while (0)
|
||
|
|
|
||
|
|
static bool has_pair(const std::vector<std::string>& v, const std::string& a, const std::string& b) {
|
||
|
|
for (size_t i = 0; i + 1 < v.size(); ++i) { if (v[i] == a && v[i + 1] == b) { return true; } }
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
auto argv = detz::llm::muse_argv("", "s.json", "p.txt", std::nullopt);
|
||
|
|
CHECK(has_pair(argv, "--reasoning-effort", detz::llm::kMuseReasoningEffort));
|
||
|
|
CHECK(has_pair(argv, "--preset", "empty"));
|
||
|
|
CHECK(std::find(argv.begin(), argv.end(), "--no-foreign-personal-context") != argv.end());
|
||
|
|
CHECK(std::find(argv.begin(), argv.end(), "--no-session-log") != argv.end());
|
||
|
|
auto sess = detz::llm::muse_argv("", "s.json", "p.txt", std::string("abc"));
|
||
|
|
CHECK(has_pair(sess, "--session-id", "abc"));
|
||
|
|
CHECK(has_pair(sess, "--preset", "empty"));
|
||
|
|
CHECK(detz::llm::kCliFallbackTimeout > 0 && detz::llm::kCliFallbackTimeout <= 60);
|
||
|
|
std::printf(g_fail ? "muse_flags_test: %d FAILED\n" : "muse_flags_test: ok\n", g_fail);
|
||
|
|
return g_fail ? 1 : 0;
|
||
|
|
}
|