| 123456789101112131415161718192021222324252627282930313233 |
- #pragma once
- #include <nlohmann/json.hpp>
- #include <string>
- #include <vector>
- namespace svapi {
- /// Global service settings — no api_key field (keys live in KeyStore).
- struct Settings {
- std::string openaiApiBase = "https://api.openai.com";
- std::string openaiApiKey;
- std::string defaultEmbeddingModel = "text-embedding-3-small";
- std::vector<std::string> corsOrigins = {"*"};
- uint32_t sessionTtlMinutes = 720;
- bool webuiEnabled = true;
- std::string defaultProject = "default";
- uint32_t embeddingConnectTimeoutSec = 10;
- uint32_t embeddingReadTimeoutSec = 60;
- uint32_t embeddingCacheSize = 4096; // max entries
- uint32_t embeddingCacheTtlSec = 86400; // 0 = no expiry
- uint64_t embeddingCacheMaxBytes = 268435456; // 256 MB
- bool embeddingCacheNormalize = false; // opt-in trim+lowercase
- uint32_t embeddingClientPoolSize = 4; // keep-alive clients per upstream origin
- std::string captchaProvider; // "" = disabled | "turnstile" | "hcaptcha"
- std::string captchaSecret; // masked in GET
- std::string captchaVerifyUrl; // full verify endpoint
- static Settings fromJson(const nlohmann::json& j);
- nlohmann::json toJson() const;
- };
- } // namespace svapi
|