feat(clients): add OpenAI and OpenRouter packages to the vendor platform plan and stubs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 06:10:55 +02:00
co-authored by Claude Sonnet 5.5
parent 86b6321820
commit 2e0270c043
8 changed files with 86 additions and 5 deletions
+4
View File
@@ -24,6 +24,10 @@ void register_ai_anthropic_demo(fw::Router& router, Services& services);
void register_ai_anthropicadmin_demo(fw::Router& router, Services& services);
void register_ai_meta_demo(fw::Router& router, Services& services);
void register_ai_deepseek_demo(fw::Router& router, Services& services);
void register_ai_openai_demo(fw::Router& router, Services& services);
void register_ai_openaiplatform_demo(fw::Router& router, Services& services);
void register_ai_openaiadmin_demo(fw::Router& router, Services& services);
void register_ai_openrouter_demo(fw::Router& router, Services& services);
// Mounts every vendor router at "" (called once from build_application).
void register_ai_demos(std::shared_ptr<fw::Application> app, Services& services);
+20
View File
@@ -35,6 +35,26 @@ void register_ai_demos(std::shared_ptr<fw::Application> app, Services& services)
register_ai_deepseek_demo(r, services);
app->include_router("", r);
}
{
fw::Router r;
register_ai_openai_demo(r, services);
app->include_router("", r);
}
{
fw::Router r;
register_ai_openaiplatform_demo(r, services);
app->include_router("", r);
}
{
fw::Router r;
register_ai_openaiadmin_demo(r, services);
app->include_router("", r);
}
{
fw::Router r;
register_ai_openrouter_demo(r, services);
app->include_router("", r);
}
}
} // namespace molo::example::app
+13
View File
@@ -0,0 +1,13 @@
#include "../AiDemos.hpp"
#include "../../fw/Router.hpp"
namespace molo::example::app {
// OpenAI: organization admin API, usage, costs, audit logs, webhooks. Stub: the module agent fills this in.
void register_ai_openaiadmin_demo(fw::Router& router, Services& services) {
(void)router;
(void)services;
}
} // namespace molo::example::app
+13
View File
@@ -0,0 +1,13 @@
#include "../AiDemos.hpp"
#include "../../fw/Router.hpp"
namespace molo::example::app {
// OpenAI: responses, chat, images, audio, video, embeddings, moderations, models. Stub: the module agent fills this in.
void register_ai_openai_demo(fw::Router& router, Services& services) {
(void)router;
(void)services;
}
} // namespace molo::example::app
+13
View File
@@ -0,0 +1,13 @@
#include "../AiDemos.hpp"
#include "../../fw/Router.hpp"
namespace molo::example::app {
// OpenAI: realtime, files, uploads, batch, fine-tuning, vector stores, evals, conversations, containers, assistants. Stub: the module agent fills this in.
void register_ai_openaiplatform_demo(fw::Router& router, Services& services) {
(void)router;
(void)services;
}
} // namespace molo::example::app
+13
View File
@@ -0,0 +1,13 @@
#include "../AiDemos.hpp"
#include "../../fw/Router.hpp"
namespace molo::example::app {
// OpenRouter: routing, models, providers, generations, credits, keys, presets, plugins. Stub: the module agent fills this in.
void register_ai_openrouter_demo(fw::Router& router, Services& services) {
(void)router;
(void)services;
}
} // namespace molo::example::app
+6 -2
View File
@@ -1,4 +1,4 @@
# 17 LLM vendor platforms: xAI, Anthropic, Meta, DeepSeek
# 17 LLM vendor platforms: xAI, Anthropic, Meta, DeepSeek, OpenAI, OpenRouter
Status: plan, 2026-10-24. Same method as plan 16 (Google): one module per
product area, derived from authoritative machine-readable sources, one call
@@ -26,6 +26,10 @@ finished module (for example `src/google/runtime`: `calls.cpp` table,
| anthropic core | `src/anthropic/core` | Messages (create, streaming with every event type, thinking, tools: client tools and server tools such as web search, web fetch, code execution, computer use, bash, text editor, memory, tool search, MCP connector), vision / PDF / documents / citations / search results, prompt caching, structured outputs, Message Batches, token counting, Models, Files, Skills, beta header handling, `AnthropicChatModel : ChatModel` |
| anthropic admin | `src/anthropic/admin` | Admin API (organization, users, invites, workspaces and members, API keys), usage and cost reports (messages, Claude Code), and any public managed-agents / sessions / environments REST surface; admin key is a separate credential |
| meta | `src/meta` | Meta Model API (dev.meta.ai): Muse Spark (Responses-style and any chat/messages endpoints the docs list), tool calling, structured output, reasoning, vision input, Muse Wonder, Muse Image, Muse Voice Transcribe, Segment Anything, Muse Spark Open, Muse Glimmer, models, files / uploads if public, usage and pricing fields, the Muse Code agent surface if it has an API, `MetaChatModel : ChatModel` |
| openai core | `src/openai/core` | Responses API (create, retrieve, delete, cancel, input items, streaming events), Chat Completions (stored completions get/list/update/delete), legacy Completions, tools (function calling, web search, file search, code interpreter, computer use, image generation tool, remote MCP, custom tools), structured outputs, reasoning, Images (generate, edit, variations), Audio (speech, transcription, translation, streaming), Videos (Sora), Embeddings, Moderations, Models, `OpenaiChatModel : ChatModel` |
| openai platform | `src/openai/platform` | Realtime (WebSocket and client secrets / ephemeral keys, SIP calls; reuse `src/google/live` `WsClient`), Files, Uploads (multipart parts), Batch, Fine-tuning (jobs, events, checkpoints, graders), Vector stores (files, file batches, search), Evals (runs, output items), Conversations (items), Containers (files), Assistants / Threads / Runs (legacy beta), ChatKit and agent builder surfaces if public |
| openai admin | `src/openai/admin` | Organization Admin API (admin keys, users, invites, projects, project users, service accounts, API keys, rate limits, certificates, groups / roles if public), Usage and Costs endpoints, Audit logs, Webhooks (events, signature verification), data residency fields; separate admin key |
| openrouter | `src/openrouter` | Chat completions, Responses (beta) and the Anthropic-compatible messages endpoint if public, models (list, per-model endpoints, user models, filters), providers, generation stats, credits, activity, API keys management (create / list / update / delete with the management key), presets, routing parameters (provider preferences, fallbacks, `models` array, `:online`, variants like `:nitro`), plugins (web search, file parser, response healing), embeddings, auth (OAuth PKCE key exchange), BYOK and guardrails if public, `OpenrouterChatModel : ChatModel` |
| deepseek | `src/deepseek` | Chat completions (chat and reasoner, `reasoning_content`, tool calls, JSON output), beta: prefix completion and FIM, context caching usage, models, user balance, the Anthropic-compatible endpoint, errors and rate-limit semantics, `DeepseekChatModel : ChatModel` |
## 2. Rules for every package
@@ -72,7 +76,7 @@ finished module (for example `src/google/runtime`: `calls.cpp` table,
Record them under `## Verified live`. Build opt-in live tests gated on
`MOLO_LIVE_NET=1` plus the vendor key (`ANTHROPIC_API_KEY`,
`ANTHROPIC_ADMIN_KEY`, `XAI_API_KEY`, `XAI_MANAGEMENT_KEY`,
`DEEPSEEK_API_KEY`, `META_API_KEY` (the docs' own example uses `MODEL_API_KEY`; accept both), loaded via `llm::Config::get`), with
`DEEPSEEK_API_KEY`, `META_API_KEY` (the docs' own example uses `MODEL_API_KEY`; accept both), `OPENAI_API_KEY`, `OPENAI_ADMIN_KEY`, `OPENROUTER_API_KEY`, `OPENROUTER_MANAGEMENT_KEY`, loaded via `llm::Config::get`), with
a loud SKIP otherwise. Live tests are read-only (models list, balance,
retrieve) plus at most one smallest-possible completion. Anything that
costs real money (media generation, batches, fine-tuning, long
+4 -3
View File
@@ -1,5 +1,6 @@
# Per-part fragment for the LLM vendor platforms (owned dirs: src/llm shared
# layer, src/xai, src/anthropic, src/meta, src/deepseek). Included by the root
# layer, src/xai, src/anthropic, src/meta, src/deepseek, src/openai,
# src/openrouter). Included by the root
# Makefile, or run standalone:
# make -f src/ai.mk [ai|ai-test|ai-clean]
# Root wiring: `all` depends on `ai`, `test` on `ai-test`, `clean` on `ai-clean`.
@@ -17,11 +18,11 @@ GOOGLE_LIB ?= $(ROOT)/build/google/libgoogle.a
# Recursive: every vendor module builds without editing this file.
AI_SRCS := $(sort $(shell find $(ROOT)/src/llm $(ROOT)/src/xai $(ROOT)/src/anthropic \
$(ROOT)/src/meta $(ROOT)/src/deepseek -name "*.cpp")) \
$(ROOT)/src/meta $(ROOT)/src/deepseek $(ROOT)/src/openai $(ROOT)/src/openrouter -name "*.cpp")) \
$(ROOT)/src/security/crypto/Base64.cpp
AI_TEST_SRCS := $(sort $(shell find $(ROOT)/tests/src/llm $(ROOT)/tests/src/xai \
$(ROOT)/tests/src/anthropic $(ROOT)/tests/src/meta \
$(ROOT)/tests/src/deepseek -name "*.cpp"))
$(ROOT)/tests/src/deepseek $(ROOT)/tests/src/openai $(ROOT)/tests/src/openrouter -name "*.cpp"))
AI_BUILD := $(ROOT)/build/ai
AI_OBJDIR := $(AI_BUILD)/objs