|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Named, node-owned connection to an LLM endpoint (CMSDK 2.2.0). More...
Go to the source code of this file.
Classes | |
| struct | cmlabs::LLMHeader |
| One configured HTTP header. More... | |
| struct | cmlabs::LLMConstraints |
Per-connection constraints declared on the <llm> element. More... | |
| struct | cmlabs::LLMStats |
| Connection statistics: uptime, bytes, requests, tokens and cost. More... | |
| class | cmlabs::LLMConnection |
| Named, node-owned connection to an LLM endpoint. More... | |
Namespaces | |
| namespace | cmlabs |
Typedefs | |
| typedef bool(* | cmlabs::LLMStreamCallback) (const char *token, uint32 size, void *userData) |
| Sink for incremental streaming output (mode B). | |
| typedef void(* | cmlabs::LLMOwnerEndCallback) (void *owner, LLMConnection *connection, const LLMStats &finalStats) |
| Owner-notification hook, fired when a connection ends. | |
Functions | |
| const char * | cmlabs::LLMResultText (LLMResult result) |
| Human-readable name for an ::LLMResult, for logs and error reporting. | |
| const char * | cmlabs::LLMVendorTypeText (LLMVendorType type) |
| Human-readable name for an ::LLMVendorType. | |
| const char * | cmlabs::LLMStreamTransportText (LLMStreamTransport transport) |
| Human-readable name for an ::LLMStreamTransport. | |
Named, node-owned connection to an LLM endpoint (CMSDK 2.2.0).
An LLMConnection turns talking to a language model into declared, observable system configuration instead of ad-hoc HTTP scattered through modules. The endpoint, vendor shape, model list, credential reference and per-connection constraints all live in XML; code calls configure(), connect() and then interact() or interactStream().
Configured from the reserved <llm> named-connection element, which contains one <llmvendor> vendor-descriptor sub-block carrying <header>, <requesttemplate>, <responsetemplate> and <models>.
apikeyref attribute is an indirect reference resolved at configure() time: env:NAME reads environment variable NAME; file:/path reads the file contents (trailing whitespace trimmed); a bare NAME is the legacy form (env var, else a key=value entry in the optional secretsfile). An inline apikey attribute or <apikey> child is a typed configuration error (::LLM_ERR_CONFIG_INLINE_SECRET). The secret value, and the detail of any failure to resolve it, never appears in logs, errors or status output.Two call modes are supported: mode A is a blocking request/reply exchange (interact()); mode B streams incremental tokens to a callback (interactStream()) over SSE, AWS event-stream or raw chunked transfer, chosen once at configure() time so callers never branch on vendor.
Definition in file LLMConnection.h.