1080-row Discovery-derived call table, validating Caller, typed facades, demo under /google/enterprise, Discovery checker, live read checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
73 lines
3.3 KiB
C++
73 lines
3.3 KiB
C++
#pragma once
|
|
|
|
// Dialogflow ES (v2) and CX (v3): detect intent, match intent, agents,
|
|
// intents, flows, pages, sessions. Other rows through caller().
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "google/enterprise/caller.h"
|
|
|
|
namespace molo::google::enterprise {
|
|
|
|
// queryInput for detectIntent: text with a language code.
|
|
clients::body::Json text_query_input(const std::string& text, const std::string& language);
|
|
|
|
class DialogflowEs {
|
|
public:
|
|
// location "global" uses the legacy `projects/{p}/agent` names; any other
|
|
// uses `projects/{p}/locations/{l}/agent` on the regional host.
|
|
DialogflowEs(std::shared_ptr<GoogleClient> client, std::string location = "global");
|
|
Caller& caller() { return caller_; }
|
|
const Caller& caller() const { return caller_; }
|
|
|
|
static std::string session_name(const std::string& project, const std::string& location,
|
|
const std::string& session_id);
|
|
static Invocation detect_intent_invocation(const std::string& session, const std::string& text,
|
|
const std::string& language);
|
|
|
|
clients::body::Json detect_intent(const std::string& session, const std::string& text,
|
|
const std::string& language) const;
|
|
clients::body::Json get_agent(const std::string& project) const; // projects/{p}/agent
|
|
ListResult list_intents(const std::string& agent_parent) const;
|
|
ListResult list_entity_types(const std::string& agent_parent) const;
|
|
ListResult list_environments(const std::string& agent_parent) const;
|
|
ListResult list_contexts(const std::string& session) const;
|
|
// Starts training: a long-running operation. Not read-only.
|
|
clients::body::Json train_agent(const std::string& project_parent) const; // projects/{p}[/locations/{l}]
|
|
clients::body::Json delete_contexts(const std::string& session, bool confirm) const;
|
|
|
|
private:
|
|
bool regional(const std::string& name) const;
|
|
Caller caller_;
|
|
};
|
|
|
|
class DialogflowCx {
|
|
public:
|
|
DialogflowCx(std::shared_ptr<GoogleClient> client, std::string location = "global");
|
|
Caller& caller() { return caller_; }
|
|
const Caller& caller() const { return caller_; }
|
|
|
|
static std::string session_name(const std::string& project, const std::string& location,
|
|
const std::string& agent, const std::string& session_id);
|
|
static Invocation detect_intent_invocation(const std::string& session, const std::string& text,
|
|
const std::string& language);
|
|
|
|
clients::body::Json detect_intent(const std::string& session, const std::string& text,
|
|
const std::string& language) const;
|
|
clients::body::Json match_intent(const std::string& session, const std::string& text,
|
|
const std::string& language) const;
|
|
ListResult list_agents(const std::string& location_parent) const;
|
|
clients::body::Json get_agent(const std::string& name) const;
|
|
ListResult list_flows(const std::string& agent) const;
|
|
ListResult list_pages(const std::string& flow) const;
|
|
ListResult list_intents(const std::string& agent) const;
|
|
clients::body::Json validate_agent(const std::string& agent) const; // starts validation
|
|
clients::body::Json delete_agent(const std::string& name, bool confirm) const;
|
|
|
|
private:
|
|
Caller caller_;
|
|
};
|
|
|
|
} // namespace molo::google::enterprise
|