#pragma once // Base for every sandbox service: the v1beta1 aiplatform endpoint of the // sandbox's own location, name validation, and the one execute call that // code, shell, workspace and computer use all share. #include #include #include #include "google/service.h" #include "google/sandbox/chunk.h" #include "google/sandbox/names.h" namespace molo::google::sandbox { class SandboxService : public Service { public: explicit SandboxService(std::shared_ptr client); // Points every call at `base` (scheme://host[:port], no path) instead of // https://{location}-aiplatform.googleapis.com. For tests against a local // server and for proxies; empty restores the default. Only http(s) URLs. void use_base_url(const std::string& base); protected: // https://{location}-aiplatform.googleapis.com/v1 (every call but bidiExecute). ServiceEndpoint endpoint_in(const std::string& location) const; // .../v1beta1: bidiExecute exists only there (see calls.h). ServiceEndpoint beta_endpoint_in(const std::string& location) const; // POST {sandbox}:execute with the given inputs; returns the raw reply. clients::body::Json execute_raw(const std::string& sandbox_name, const std::vector& inputs) const; ExecutionResult execute(const std::string& sandbox_name, const std::vector& inputs) const; private: std::string base_url_; }; } // namespace molo::google::sandbox