feat(clients): runtime: Agent Engine reasoningEngines client, discovery-checked call table, typed deployment spec, demo routes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
// A reasoning engine (Agent Engine) as Google returns it, plus the input
|
||||
// types for create and update.
|
||||
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "clients/body/json.h"
|
||||
#include "google/runtime/deployment_spec.h"
|
||||
|
||||
namespace molo::google::runtime {
|
||||
|
||||
struct Engine {
|
||||
std::string name; // projects/{p}/locations/{l}/reasoningEngines/{id}
|
||||
std::string display_name;
|
||||
std::string description;
|
||||
std::string etag;
|
||||
std::string create_time;
|
||||
std::string update_time;
|
||||
std::map<std::string, std::string> labels;
|
||||
EngineSpec spec;
|
||||
std::string kms_key_name; // encryptionSpec.kmsKeyName
|
||||
clients::body::Json raw; // the full response document
|
||||
|
||||
std::string id() const; // last segment of name
|
||||
static Engine from_json(const clients::body::Json& doc);
|
||||
};
|
||||
|
||||
struct EngineDraft {
|
||||
std::string display_name; // required
|
||||
std::string description;
|
||||
std::map<std::string, std::string> labels;
|
||||
EngineSpec spec;
|
||||
std::string kms_key_name; // optional customer-managed key
|
||||
|
||||
void validate() const;
|
||||
clients::body::Json to_json() const;
|
||||
};
|
||||
|
||||
// Only the set fields are sent; updateMask is derived from them.
|
||||
struct EngineUpdate {
|
||||
std::optional<std::string> display_name;
|
||||
std::optional<std::string> description;
|
||||
std::optional<std::map<std::string, std::string>> labels;
|
||||
std::optional<EngineSpec> spec;
|
||||
|
||||
void validate() const;
|
||||
clients::body::Json to_json() const;
|
||||
std::string update_mask() const; // comma separated, never empty after validate()
|
||||
};
|
||||
|
||||
} // namespace molo::google::runtime
|
||||
Reference in New Issue
Block a user