17 lines
643 B
C++
17 lines
643 B
C++
// Route: GET /cli/ai (AI harness sample, secrets redacted)
|
|||
|
|
#include "support/Assert.hpp"
|
||
|
|
|
||
|
|
using namespace molo::example::test;
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
Fixture f;
|
||
|
|
auto res = f.client->get("/cli/ai?prompt=add+a+route");
|
||
|
|
check(res.status == 200, "status 200");
|
||
|
|
check(contains(res.body, "devplace.net/openai/v1"), "devplace base url");
|
||
|
|
check(contains(res.body, "\"model\":\"molodetz\""), "molodetz model");
|
||
|
|
auto secret = f.client->get("/cli/ai?prompt=DEVPLACE_API_KEY%3Dabc123");
|
||
|
|
check(!contains(secret.body, "abc123"), "secret redacted");
|
||
|
|
check(contains(secret.body, "REDACTED"), "redaction marker present");
|
||
|
|
return finish("cli/ai");
|
||
|
|
}
|