#pragma once // POST /decisions (classification and scoring questions about an input) and // POST /content_provenance_checks (does a file carry OpenAI provenance // signals). Both are small single-call surfaces of the core API. #include #include #include "openai/core/service.h" #include "openai/core/upload_file.h" namespace molo::openai::core { struct DecisionQuestion { enum class Kind { kPredicate, kChoice, kScore }; Kind kind = Kind::kPredicate; std::string name; std::string instructions; std::vector choices; // kChoice: values std::vector levels; // kScore: labels, lowest first static DecisionQuestion predicate(std::string name, std::string instructions); static DecisionQuestion choice(std::string name, std::string instructions, std::vector choices); static DecisionQuestion score(std::string name, std::string instructions, std::vector levels); clients::body::Json to_json() const; }; struct DecisionRequest { std::string model; std::string input_text; std::vector questions; // at least one std::string safety_identifier; std::string prompt_cache_key; clients::body::Json extra; void validate() const; clients::body::Json to_json() const; }; struct ProvenanceRequest { UploadFile file; // image or audio void validate() const; clients::body::MultipartBody to_multipart() const; }; class DecisionsService : public OpenaiService { public: using OpenaiService::OpenaiService; clients::body::Json decide(const DecisionRequest& request); clients::body::Json check_provenance(const ProvenanceRequest& request); }; } // namespace molo::openai::core