feat(clients): azure: Azure OpenAI and AI Foundry package, 147-row spec table, Entra auth, demo
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
#include "vendors/azure/batches.h"
|
||||
|
||||
#include "vendors/azure/check.h"
|
||||
|
||||
namespace molo::azure {
|
||||
|
||||
using clients::body::Json;
|
||||
|
||||
Json BatchesService::create(const Json& body) {
|
||||
Check::has_string(body, "endpoint");
|
||||
Check::has_string(body, "completion_window");
|
||||
Check::require(body.find("input_file_id") || body.find("input_blob"),
|
||||
"input_file_id (or input_blob) is required");
|
||||
return call(Op::kCreateBatch, {}, &body);
|
||||
}
|
||||
|
||||
Json BatchesService::get(const std::string& id) {
|
||||
Check::id("batch", id);
|
||||
return call(Op::kRetrieveBatch, {"", {id}});
|
||||
}
|
||||
|
||||
Json BatchesService::list(const ListParams& params) {
|
||||
params.validate();
|
||||
Query q;
|
||||
params.apply(q);
|
||||
return call(Op::kListBatches, {}, nullptr, &q);
|
||||
}
|
||||
|
||||
Listing BatchesService::list_all(const ListParams& params, std::size_t max_pages) {
|
||||
return walk(Op::kListBatches, {}, params, Query(), max_pages);
|
||||
}
|
||||
|
||||
Json BatchesService::cancel(const std::string& id) {
|
||||
Check::id("batch", id);
|
||||
return call(Op::kCancelBatch, {"", {id}});
|
||||
}
|
||||
|
||||
} // namespace molo::azure
|
||||
Reference in New Issue
Block a user