feat(clients): mistral: La Plateforme package, 347-op call table, typed services, ChatModel, demo

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 15:08:12 +01:00
co-authored by Claude Sonnet 5.5
parent 3db67fcf1f
commit d2e2888ef4
62 changed files with 7573 additions and 3 deletions
+37
View File
@@ -0,0 +1,37 @@
// Routes: GET /ai/mistral (page), /status, /calls (no credential needed)
#include <cstdlib>
#include "support/Assert.hpp"
using namespace molo::example::test;
int main() {
setenv("MOLO_ENV_FILES", "off", 1);
unsetenv("MISTRAL_API_KEY");
Fixture f;
auto page = f.client->get("/ai/mistral");
check(page.status == 200, "page 200");
check(contains(page.headers.get("Content-Type"), "text/html"), "html");
check(contains(page.body, "Mistral La Plateforme") && contains(page.body, "viewport"), "title and mobile viewport");
check(contains(page.body, "/embedded/ai_mistral.js"), "script wired");
check(f.client->post("/ai/mistral", "{}", "application/json").status == 405, "post page is 405");
auto st = f.client->get("/ai/mistral/status");
check(st.status == 200 && contains(st.body, "\"configured\":false"), "status without a key");
check(contains(st.body, "MISTRAL_API_KEY") && contains(st.body, "mistral-small-latest") &&
contains(st.body, "codestral-latest") && contains(st.body, "mistral-embed"),
"status names credential env and default models");
check(contains(st.body, "\"calls\":347"), "status counts the call table");
check(f.client->post("/ai/mistral/status", "{}", "application/json").status == 405, "post status is 405");
auto calls = f.client->get("/ai/mistral/calls");
check(calls.status == 200 && contains(calls.body, "/v1/chat/completions") &&
contains(calls.body, "/v1/fim/completions") && contains(calls.body, "/v1/ocr") &&
contains(calls.body, "/v1/batch/jobs"),
"call table listed");
auto chat_only = f.client->get("/ai/mistral/calls?area=chat");
check(chat_only.status == 200 && contains(chat_only.body, "/v1/chat/completions") &&
!contains(chat_only.body, "/v1/ocr"),
"call table filters by area");
return finish("ai/mistral/page");
}