feat(clients): perplexity: Sonar, Search, Agent, embeddings, decisions, batches, skills, orchestrator

Package molo::perplexity covering all 39 operations of the five published
OpenAPI documents, PerplexityChatModel, demo routes under /ai/perplexity,
check_spec.py, SPEC.md, 46 unit cases and 111 route checks.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-25 15:01:55 +01:00
co-authored by Claude Sonnet 5.5
parent 3db67fcf1f
commit 3404392887
52 changed files with 7201 additions and 3 deletions
+65
View File
@@ -0,0 +1,65 @@
#pragma once
// Static ceilings for the Perplexity module. Never autotuned. "Documented"
// numbers come from the OpenAPI documents (see SPEC.md ## Sources), "ours"
// are hard caps we add.
#include <cstddef>
namespace molo::perplexity {
struct PerplexityCaps {
// Documented limits.
static constexpr int kSearchMaxResults = 20; // web / fast search
static constexpr int kSearchMaxResultsPeople = 50; // people search only
static constexpr int kSearchMaxTokens = 1000000; // max_tokens, max_tokens_per_page
static constexpr std::size_t kSearchDomainFilter = 20;
static constexpr std::size_t kSearchLanguageFilter = 20;
static constexpr std::size_t kEmbedTexts = 512; // texts / documents per request
static constexpr int kEmbedMinDims = 128;
static constexpr int kEmbedMaxDims = 2560; // 4b models
static constexpr int kEmbedMaxDims06 = 1024; // 0.6b models
static constexpr std::size_t kAgentModels = 5; // fallback chain
static constexpr int kAgentMaxSteps = 100;
static constexpr std::size_t kAgentSkills = 16;
static constexpr int kWebToolMaxResults = 50;
static constexpr int kImageToolMaxResults = 30;
static constexpr int kFetchToolMaxUrls = 10;
static constexpr std::size_t kImageFilterEntries = 10;
static constexpr std::size_t kInlineSkillDescription = 1024;
static constexpr std::size_t kInlineSkillInstructions = 65536;
static constexpr std::size_t kInlineSkillsTotal = 262144;
static constexpr std::size_t kDecisionQuestions = 128;
static constexpr std::size_t kChoiceOptions = 255;
static constexpr std::size_t kScoreLevels = 10;
static constexpr int kPageLimitMax = 100; // batches, files lists
static constexpr int kSkillPageLimitMax = 200;
static constexpr std::size_t kBatchMetadataPairs = 16;
static constexpr std::size_t kBatchMetadataKey = 64;
static constexpr std::size_t kBatchMetadataValue = 512;
static constexpr std::size_t kIdempotencyKey = 200;
static constexpr std::size_t kBatchFileLines = 50000;
static constexpr std::size_t kBatchFileBytes = 200u * 1024u * 1024u;
// Our own caps.
static constexpr std::size_t kMaxMessages = 4096;
static constexpr std::size_t kMaxStop = 16;
static constexpr std::size_t kMaxFilterEntries = 20;
static constexpr std::size_t kMaxTools = 128;
static constexpr std::size_t kMaxInputItems = 4096;
static constexpr std::size_t kMaxStreamEvents = 200000;
static constexpr std::size_t kMaxChoices = 8;
static constexpr std::size_t kMaxPageWalk = 20; // list walks
static constexpr std::size_t kMaxItemsReturned = 5000;
static constexpr std::size_t kMaxModelsReturned = 1024;
static constexpr std::size_t kMaxQueryChars = 8192;
static constexpr std::size_t kMaxModelChars = 128;
static constexpr std::size_t kMaxUploadBytes = 200u * 1024u * 1024u;
static constexpr std::size_t kMaxSkillBundleBytes = 64u * 1024u * 1024u;
static constexpr std::size_t kMaxFilenameBytes = 255;
static constexpr int kMaxPollSeconds = 600; // helper wait ceiling
static constexpr int kMinPollIntervalSeconds = 1; // floor: tier 0 is 1 request per second
static constexpr std::size_t kMaxEmbedDecodedBytes = 64u * 1024u * 1024u;
static constexpr std::size_t kMaxGatewayFields = 64;
};
} // namespace molo::perplexity