feat(clients): google foundation for the agent platform: all-verb client, streaming, typed Gemini content, operations
GoogleClient gets every verb and stream_json (SSE and plain JSON), typed Content/Part/Tool/GenerateRequest with the LanguageModel seam, CloudContext resource names, long-running operation polling and pagination, OAuth bearer tokens via GOOGLE_ACCESS_TOKEN. Example scaffold: one stub per agent module under example/app/agent, wildcard builds, locust excludes /voice /google /agent. plans/16-agent-platform.md splits the work into nine modules. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
// Agent Platform demos. One register function per module, each in its own
|
||||
// file under example/app/agent/. Every route lives under /agent/<module> and
|
||||
// is excluded from locust (paid Google APIs). Rules for a demo:
|
||||
// - GET pages and status routes answer 2xx without credentials (the matrix
|
||||
// test crawls them); anything that calls Google is a POST and answers 503
|
||||
// google_not_configured without a credential.
|
||||
// - State lives in objects created inside the register function and
|
||||
// captured by the handlers; do not edit Services.
|
||||
// - The Google client is services.google (null: GoogleClient::from_env()).
|
||||
|
||||
#include "App.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
void register_agent_models_demo(fw::Router& router, Services& services);
|
||||
void register_agent_runtime_demo(fw::Router& router, Services& services);
|
||||
void register_agent_sessions_demo(fw::Router& router, Services& services);
|
||||
void register_agent_sandbox_demo(fw::Router& router, Services& services);
|
||||
void register_agent_registry_demo(fw::Router& router, Services& services);
|
||||
void register_agent_armor_demo(fw::Router& router, Services& services);
|
||||
void register_agent_optimize_demo(fw::Router& router, Services& services);
|
||||
void register_agent_adk_demo(fw::Router& router, Services& services);
|
||||
void register_agent_live_demo(fw::Router& router, Services& services);
|
||||
|
||||
// Mounts every module's router at "" (called once from build_application).
|
||||
void register_agent_demos(std::shared_ptr<fw::Application> app, Services& services);
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "App.hpp"
|
||||
#include "AgentDemos.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
@@ -71,6 +72,8 @@ std::shared_ptr<fw::Application> build_application(Services& services) {
|
||||
register_voice_demo(voice, services);
|
||||
app->include_router("", voice);
|
||||
|
||||
register_agent_demos(app, services);
|
||||
|
||||
register_chain_demo(app, services);
|
||||
return app;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: adk. Stub: the module agent fills this in.
|
||||
void register_agent_adk_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,55 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
void register_agent_demos(std::shared_ptr<fw::Application> app, Services& services) {
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_models_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_runtime_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_sessions_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_sandbox_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_registry_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_armor_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_optimize_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_adk_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
{
|
||||
fw::Router r;
|
||||
register_agent_live_demo(r, services);
|
||||
app->include_router("", r);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: armor. Stub: the module agent fills this in.
|
||||
void register_agent_armor_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: live. Stub: the module agent fills this in.
|
||||
void register_agent_live_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: models. Stub: the module agent fills this in.
|
||||
void register_agent_models_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: optimize. Stub: the module agent fills this in.
|
||||
void register_agent_optimize_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: registry. Stub: the module agent fills this in.
|
||||
void register_agent_registry_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: runtime. Stub: the module agent fills this in.
|
||||
void register_agent_runtime_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: sandbox. Stub: the module agent fills this in.
|
||||
void register_agent_sandbox_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
@@ -0,0 +1,13 @@
|
||||
#include "../AgentDemos.hpp"
|
||||
|
||||
#include "../../fw/Router.hpp"
|
||||
|
||||
namespace molo::example::app {
|
||||
|
||||
// Agent Platform: sessions. Stub: the module agent fills this in.
|
||||
void register_agent_sessions_demo(fw::Router& router, Services& services) {
|
||||
(void)router;
|
||||
(void)services;
|
||||
}
|
||||
|
||||
} // namespace molo::example::app
|
||||
Reference in New Issue
Block a user