getpatter 0.6.5 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-CRPJLVHB.mjs → chunk-YJX2EKON.mjs} +649 -80
- package/dist/cli.js +501 -2
- package/dist/index.d.mts +233 -10
- package/dist/index.d.ts +233 -10
- package/dist/index.js +1591 -198
- package/dist/index.mjs +883 -78
- package/dist/{test-mode-HGHI2AUV.mjs → test-mode-XFOADUNE.mjs} +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -909,6 +909,9 @@ interface CallMetrics {
|
|
|
909
909
|
readonly stt_model?: string;
|
|
910
910
|
readonly tts_model?: string;
|
|
911
911
|
readonly llm_model?: string;
|
|
912
|
+
/** Terminal error code when the call ended abnormally (a lowercased ErrorCode
|
|
913
|
+
* value or "other"); empty/absent for a clean call. Never the message. */
|
|
914
|
+
readonly error_code?: string;
|
|
912
915
|
}
|
|
913
916
|
/** Programmatic control surface for a live call (transfer, hangup, DTMF). */
|
|
914
917
|
interface CallControl {
|
|
@@ -949,6 +952,7 @@ declare class CallMetricsAccumulator {
|
|
|
949
952
|
readonly ttsModel: string;
|
|
950
953
|
readonly realtimeModel: string;
|
|
951
954
|
private readonly _pricing;
|
|
955
|
+
private _errorCode;
|
|
952
956
|
private readonly _callStart;
|
|
953
957
|
private readonly _turns;
|
|
954
958
|
private _turnStart;
|
|
@@ -1259,6 +1263,12 @@ declare class CallMetricsAccumulator {
|
|
|
1259
1263
|
recordLlmUsage(provider: string, model: string, inputTokens: number, outputTokens: number, cacheReadTokens?: number, cacheWriteTokens?: number): void;
|
|
1260
1264
|
/** Finalize the call: flush any in-flight turn, compute aggregates, and return `CallMetrics`. */
|
|
1261
1265
|
endCall(): CallMetrics;
|
|
1266
|
+
/**
|
|
1267
|
+
* Record the call's terminal error as a coarse, anonymous code. Stores the
|
|
1268
|
+
* PatterError `.code` lowercased; maps common timeout/connection errors; falls
|
|
1269
|
+
* back to "other". Never stores the message. Last write wins.
|
|
1270
|
+
*/
|
|
1271
|
+
recordError(err: unknown): void;
|
|
1262
1272
|
/** Return the cost breakdown for the call so far without ending it. */
|
|
1263
1273
|
getCostSoFar(): CostBreakdown;
|
|
1264
1274
|
/**
|
|
@@ -2266,6 +2276,17 @@ interface LLMStreamOptions {
|
|
|
2266
2276
|
* config) no ``user`` field is sent — fully backward compatible.
|
|
2267
2277
|
*/
|
|
2268
2278
|
callId?: string;
|
|
2279
|
+
/**
|
|
2280
|
+
* Caller / callee for this turn (the same values the stream handler builds
|
|
2281
|
+
* into ``callCtx.caller`` / ``callCtx.callee``). Threaded purely so a
|
|
2282
|
+
* session-aware provider with a ``sessionKeyFactory`` can derive a per-caller
|
|
2283
|
+
* memory scope from the NON-REVERSIBLE caller hash. Additive and optional:
|
|
2284
|
+
* providers that read only ``signal`` / ``callId`` ignore them, and the raw
|
|
2285
|
+
* ``caller`` is never logged. Mirrors the Python loop threading
|
|
2286
|
+
* ``caller`` / ``callee`` into the provider's ``stream``.
|
|
2287
|
+
*/
|
|
2288
|
+
caller?: string;
|
|
2289
|
+
callee?: string;
|
|
2269
2290
|
}
|
|
2270
2291
|
interface LLMProvider {
|
|
2271
2292
|
stream(messages: Array<Record<string, unknown>>, tools?: Array<Record<string, unknown>> | null, opts?: LLMStreamOptions): AsyncGenerator<LLMChunk, void, unknown>;
|
|
@@ -2819,6 +2840,18 @@ interface LocalOptions {
|
|
|
2819
2840
|
* used via ``phone.agent({ engine: new OpenAIRealtime({ apiKey }) })``.
|
|
2820
2841
|
*/
|
|
2821
2842
|
readonly openaiKey?: string;
|
|
2843
|
+
/**
|
|
2844
|
+
* Anonymous usage telemetry (opt-out, **on by default**). Lets the Patter
|
|
2845
|
+
* maintainers see coarse, anonymous usage (engines/providers/carriers, OS,
|
|
2846
|
+
* SDK version) — never PII or call content. Fire-and-forget and fail-safe.
|
|
2847
|
+
*
|
|
2848
|
+
* - omitted / ``true``: enabled (unless disabled by ``PATTER_TELEMETRY_DISABLED=1``,
|
|
2849
|
+
* ``DO_NOT_TRACK=1``, or a CI/test environment).
|
|
2850
|
+
* - ``false``: opt out in code.
|
|
2851
|
+
*
|
|
2852
|
+
* Inspect-without-send with ``PATTER_TELEMETRY_DEBUG=1``. See the telemetry docs.
|
|
2853
|
+
*/
|
|
2854
|
+
readonly telemetry?: boolean;
|
|
2822
2855
|
}
|
|
2823
2856
|
/** Internal shape of a guardrail (matches `Guardrail` class from `public-api.ts`). */
|
|
2824
2857
|
interface Guardrail {
|
|
@@ -2936,6 +2969,28 @@ interface BackgroundAudioPlayer$1 {
|
|
|
2936
2969
|
* (see ``Patter.agent()`` for the resolution).
|
|
2937
2970
|
* 3. Otherwise, the AgentOptions default is used.
|
|
2938
2971
|
*/
|
|
2972
|
+
/**
|
|
2973
|
+
* Per-call context handed to a ``sessionKeyFactory`` (see
|
|
2974
|
+
* {@link OpenAICompatibleLLMOptions.sessionKeyFactory}).
|
|
2975
|
+
*
|
|
2976
|
+
* A session-aware LLM provider (e.g. the Hermes preset) can derive its
|
|
2977
|
+
* memory-scope header value per call from this — most usefully from
|
|
2978
|
+
* {@link SessionContext.callerHash}, a stable non-reversible hash of the
|
|
2979
|
+
* caller, so one phone number maps to one durable memory namespace across calls
|
|
2980
|
+
* WITHOUT the raw number ever being emitted or logged.
|
|
2981
|
+
*
|
|
2982
|
+
* All fields are optional: ``callId`` / ``caller`` / ``callee`` are present when
|
|
2983
|
+
* the call provides them; ``callerHash`` is {@link hashCaller} of ``caller``
|
|
2984
|
+
* (``undefined`` when there is no caller). The raw ``caller`` is carried here
|
|
2985
|
+
* only so a factory CAN re-derive its own scope — it must never be put on the
|
|
2986
|
+
* wire or logged beyond what already exists. Mirrors Python ``SessionContext``.
|
|
2987
|
+
*/
|
|
2988
|
+
interface SessionContext {
|
|
2989
|
+
readonly callId?: string;
|
|
2990
|
+
readonly caller?: string;
|
|
2991
|
+
readonly callee?: string;
|
|
2992
|
+
readonly callerHash?: string;
|
|
2993
|
+
}
|
|
2939
2994
|
/** Configuration for a local-mode voice AI agent (passed to `phone.agent({...})`). */
|
|
2940
2995
|
interface AgentOptions {
|
|
2941
2996
|
readonly systemPrompt: string;
|
|
@@ -2971,6 +3026,26 @@ interface AgentOptions {
|
|
|
2971
3026
|
* Mirrors Python ``llm_error_message`` on ``Patter.agent()`` / ``Agent``.
|
|
2972
3027
|
*/
|
|
2973
3028
|
readonly llmErrorMessage?: string;
|
|
3029
|
+
/**
|
|
3030
|
+
* Opt-in short filler spoken when an LLM turn is SLOW (e.g. an agent runtime
|
|
3031
|
+
* running tools / memory) and no audio has reached the carrier yet — DISTINCT
|
|
3032
|
+
* from ``llmErrorMessage`` (which fires on an ERROR; this fires on SLOWNESS).
|
|
3033
|
+
* When set to a non-empty string and the turn has produced NO audio after
|
|
3034
|
+
* ``longTurnMessageAfterS`` seconds, the SDK synthesizes this line ONCE
|
|
3035
|
+
* through the normal TTS turn lifecycle (subject to barge-in) to fill the
|
|
3036
|
+
* gap. It never fires once real audio has started this turn, and never
|
|
3037
|
+
* double-speaks. ``undefined`` (default) keeps today's behaviour: nothing is
|
|
3038
|
+
* spoken while a slow turn runs. Pipeline mode only. Mirrors Python
|
|
3039
|
+
* ``long_turn_message`` on ``Patter.agent()`` / ``Agent``.
|
|
3040
|
+
*/
|
|
3041
|
+
readonly longTurnMessage?: string;
|
|
3042
|
+
/**
|
|
3043
|
+
* Seconds to wait after the turn begins speaking before the
|
|
3044
|
+
* ``longTurnMessage`` filler fires (only consulted when ``longTurnMessage``
|
|
3045
|
+
* is set and no audio has reached the carrier yet). Default ``4.0``. Mirrors
|
|
3046
|
+
* Python ``long_turn_message_after_s``.
|
|
3047
|
+
*/
|
|
3048
|
+
readonly longTurnMessageAfterS?: number;
|
|
2974
3049
|
/** Tool definitions — ``Tool`` class instances from ``getpatter``. */
|
|
2975
3050
|
readonly tools?: ReadonlyArray<Tool>;
|
|
2976
3051
|
/**
|
|
@@ -3890,6 +3965,14 @@ declare class Patter {
|
|
|
3890
3965
|
* ``Cannot use both tunnel: true and webhookUrl``.
|
|
3891
3966
|
*/
|
|
3892
3967
|
private tunnelOwnsWebhookUrl;
|
|
3968
|
+
/**
|
|
3969
|
+
* Anonymous usage telemetry (opt-out, default ON). Separate from
|
|
3970
|
+
* ``./observability`` (user-facing OTel). Fire-and-forget and fail-safe — it
|
|
3971
|
+
* can never block or break a call. See ``./telemetry``.
|
|
3972
|
+
*/
|
|
3973
|
+
private readonly telemetry;
|
|
3974
|
+
private readonly telemetrySeenEngines;
|
|
3975
|
+
private readonly telemetrySeenAgentShapes;
|
|
3893
3976
|
/**
|
|
3894
3977
|
* Pre-rendered first-message TTS audio per outbound call_id. Populated
|
|
3895
3978
|
* by :meth:`call` when ``agent.prewarmFirstMessage`` is true; consumed
|
|
@@ -4964,6 +5047,7 @@ declare class PatterTool {
|
|
|
4964
5047
|
private readonly maxDurationSec;
|
|
4965
5048
|
private readonly recording;
|
|
4966
5049
|
private started;
|
|
5050
|
+
private hermesTelemetryEmitted;
|
|
4967
5051
|
/** Cached in-progress (or completed) start promise so concurrent execute()
|
|
4968
5052
|
* callers all await the same boot sequence instead of each racing into
|
|
4969
5053
|
* phone.serve(). Reset to null on failure so callers can retry after a
|
|
@@ -6997,7 +7081,7 @@ interface OpenAILLMOptions {
|
|
|
6997
7081
|
* const llm = new openai.LLM({ apiKey: "sk-...", model: "gpt-4o-mini", temperature: 0.4 });
|
|
6998
7082
|
* ```
|
|
6999
7083
|
*/
|
|
7000
|
-
declare class LLM$
|
|
7084
|
+
declare class LLM$8 extends OpenAILLMProvider {
|
|
7001
7085
|
static readonly providerKey = "openai";
|
|
7002
7086
|
constructor(opts?: OpenAILLMOptions);
|
|
7003
7087
|
}
|
|
@@ -7108,7 +7192,7 @@ interface AnthropicLLMOptions {
|
|
|
7108
7192
|
* const llm = new anthropic.LLM({ promptCaching: false }); // opt out of caching
|
|
7109
7193
|
* ```
|
|
7110
7194
|
*/
|
|
7111
|
-
declare class LLM$
|
|
7195
|
+
declare class LLM$7 extends AnthropicLLMProvider {
|
|
7112
7196
|
static readonly providerKey = "anthropic";
|
|
7113
7197
|
constructor(opts?: AnthropicLLMOptions);
|
|
7114
7198
|
}
|
|
@@ -7216,7 +7300,7 @@ interface GroqLLMOptions {
|
|
|
7216
7300
|
* const llm = new groq.LLM({ apiKey: "gsk_...", model: "llama-3.3-70b-versatile" });
|
|
7217
7301
|
* ```
|
|
7218
7302
|
*/
|
|
7219
|
-
declare class LLM$
|
|
7303
|
+
declare class LLM$6 extends GroqLLMProvider {
|
|
7220
7304
|
static readonly providerKey = "groq";
|
|
7221
7305
|
constructor(opts?: GroqLLMOptions);
|
|
7222
7306
|
}
|
|
@@ -7361,7 +7445,7 @@ interface CerebrasLLMOptions {
|
|
|
7361
7445
|
* const llm = new cerebras.LLM({ apiKey: "csk-...", model: "llama3.1-8b" });
|
|
7362
7446
|
* ```
|
|
7363
7447
|
*/
|
|
7364
|
-
declare class LLM$
|
|
7448
|
+
declare class LLM$5 extends CerebrasLLMProvider {
|
|
7365
7449
|
static readonly providerKey = "cerebras";
|
|
7366
7450
|
constructor(opts?: CerebrasLLMOptions);
|
|
7367
7451
|
}
|
|
@@ -7443,7 +7527,7 @@ interface GoogleLLMOptions {
|
|
|
7443
7527
|
* const llm = new google.LLM({ apiKey: "AIza...", model: "gemini-2.5-flash" });
|
|
7444
7528
|
* ```
|
|
7445
7529
|
*/
|
|
7446
|
-
declare class LLM$
|
|
7530
|
+
declare class LLM$4 extends GoogleLLMProvider {
|
|
7447
7531
|
static readonly providerKey = "google";
|
|
7448
7532
|
constructor(opts?: GoogleLLMOptions);
|
|
7449
7533
|
}
|
|
@@ -7494,6 +7578,20 @@ declare class LLM$3 extends GoogleLLMProvider {
|
|
|
7494
7578
|
* ``Bearer EMPTY`` placeholder breaks some gateways).
|
|
7495
7579
|
*/
|
|
7496
7580
|
|
|
7581
|
+
/**
|
|
7582
|
+
* Stable, non-reversible 16-char hash of a caller for session scoping.
|
|
7583
|
+
*
|
|
7584
|
+
* Used to derive a per-caller memory namespace (e.g. an agent runtime's session
|
|
7585
|
+
* key) WITHOUT ever exposing the raw phone number — the call site keys cross-
|
|
7586
|
+
* call memory off the hash, never the number itself. Returns the first 16 hex
|
|
7587
|
+
* chars of the SHA-256 digest of the UTF-8 ``caller`` string, or ``undefined``
|
|
7588
|
+
* when ``caller`` is undefined / empty. The 16-char (64-bit) truncation is
|
|
7589
|
+
* plenty for namespacing while keeping the emitted header value compact; it is
|
|
7590
|
+
* NOT a security primitive (a phone number has too little entropy to make the
|
|
7591
|
+
* digest a secret) — its only job is to keep the raw number off the wire / out
|
|
7592
|
+
* of logs. Mirrors Python ``hash_caller``.
|
|
7593
|
+
*/
|
|
7594
|
+
declare function hashCaller(caller?: string): string | undefined;
|
|
7497
7595
|
/** Constructor options for {@link OpenAICompatibleLLMProvider}. */
|
|
7498
7596
|
interface OpenAICompatibleLLMOptions {
|
|
7499
7597
|
/**
|
|
@@ -7558,6 +7656,28 @@ interface OpenAICompatibleLLMOptions {
|
|
|
7558
7656
|
* scope — NEVER logged. ``undefined`` (default) means the header is omitted.
|
|
7559
7657
|
*/
|
|
7560
7658
|
sessionKey?: string;
|
|
7659
|
+
/**
|
|
7660
|
+
* Optional callback that derives the ``sessionKeyHeader`` VALUE per call from
|
|
7661
|
+
* a {@link SessionContext} (carrying ``callId`` / ``caller`` / ``callee`` /
|
|
7662
|
+
* ``callerHash``). When set it takes PRECEDENCE over the static ``sessionKey``:
|
|
7663
|
+
* at request-build time the factory is called and its return value is emitted
|
|
7664
|
+
* in ``sessionKeyHeader``. A falsy return (``undefined`` / ``''``) omits the
|
|
7665
|
+
* header for that call. The static ``sessionKey`` remains the simple fallback
|
|
7666
|
+
* used when no factory is configured. The returned value is a credential-grade
|
|
7667
|
+
* memory scope and is NEVER logged. Mirrors Python ``session_key_factory``.
|
|
7668
|
+
*/
|
|
7669
|
+
sessionKeyFactory?: (ctx: SessionContext) => string | undefined;
|
|
7670
|
+
/**
|
|
7671
|
+
* Convenience selector for a built-in per-call key derivation (requires
|
|
7672
|
+
* ``sessionKeyHeader``). Set to ``'caller_hash'`` to derive the session key
|
|
7673
|
+
* per call as ``` `patter-caller-${ctx.callerHash}` ``` (a stable,
|
|
7674
|
+
* non-reversible hash of the caller — never the raw number), enabling
|
|
7675
|
+
* per-caller cross-call memory on any runtime that scopes memory by header.
|
|
7676
|
+
* ``undefined`` (default) uses the static ``sessionKey`` path. Ignored when
|
|
7677
|
+
* ``sessionKeyFactory`` is given explicitly. Same semantics as the Hermes
|
|
7678
|
+
* preset's selector; mirrors Python ``session_key_from``.
|
|
7679
|
+
*/
|
|
7680
|
+
sessionKeyFrom?: 'caller_hash';
|
|
7561
7681
|
/** Sampling temperature [0, 2]. */
|
|
7562
7682
|
temperature?: number;
|
|
7563
7683
|
/** Max tokens in the assistant response (sent as ``max_completion_tokens``). */
|
|
@@ -7603,6 +7723,7 @@ declare class OpenAICompatibleLLMProvider implements LLMProvider {
|
|
|
7603
7723
|
private readonly sessionIdPrefix?;
|
|
7604
7724
|
private readonly sessionKeyHeader?;
|
|
7605
7725
|
private readonly sessionKey?;
|
|
7726
|
+
private readonly sessionKeyFactory?;
|
|
7606
7727
|
private readonly temperature?;
|
|
7607
7728
|
private readonly maxTokens?;
|
|
7608
7729
|
private readonly responseFormat?;
|
|
@@ -7627,6 +7748,14 @@ declare class OpenAICompatibleLLMProvider implements LLMProvider {
|
|
|
7627
7748
|
* ``sessionKey`` is a credential-grade memory scope and is never logged.
|
|
7628
7749
|
*/
|
|
7629
7750
|
private buildHeaders;
|
|
7751
|
+
/**
|
|
7752
|
+
* Resolve the ``sessionKeyHeader`` VALUE for this call. When a
|
|
7753
|
+
* ``sessionKeyFactory`` is configured it is called with a
|
|
7754
|
+
* {@link SessionContext} (the raw ``caller`` plus its non-reversible
|
|
7755
|
+
* {@link hashCaller}) and its return value wins — a falsy return omits the
|
|
7756
|
+
* header. Otherwise the static ``sessionKey`` is used. Never logged.
|
|
7757
|
+
*/
|
|
7758
|
+
private resolveSessionKey;
|
|
7630
7759
|
/**
|
|
7631
7760
|
* Pre-call DNS / TLS warmup for the configured endpoint. Best-effort:
|
|
7632
7761
|
* 5 s timeout, all exceptions swallowed at debug level. The ``Authorization``
|
|
@@ -7658,10 +7787,74 @@ declare class OpenAICompatibleLLMProvider implements LLMProvider {
|
|
|
7658
7787
|
* });
|
|
7659
7788
|
* ```
|
|
7660
7789
|
*/
|
|
7661
|
-
declare class LLM$
|
|
7790
|
+
declare class LLM$3 extends OpenAICompatibleLLMProvider {
|
|
7662
7791
|
static readonly providerKey = "openai_compatible";
|
|
7663
7792
|
}
|
|
7664
7793
|
|
|
7794
|
+
/**
|
|
7795
|
+
* Custom LLM — point Patter's pipeline at ANY OpenAI-compatible endpoint.
|
|
7796
|
+
*
|
|
7797
|
+
* The industry-standard "Custom LLM" pattern (the same concept ElevenLabs
|
|
7798
|
+
* Agents, Retell, and Vapi expose under that name): Patter owns the phone leg
|
|
7799
|
+
* — carrier, STT, turn-taking, barge-in, TTS — and POSTs each conversation
|
|
7800
|
+
* turn to YOUR ``/chat/completions`` endpoint. That endpoint can be:
|
|
7801
|
+
*
|
|
7802
|
+
* - an **agent runtime** (Hermes, OpenClaw — prefer the dedicated presets in
|
|
7803
|
+
* ``llm/hermes`` / ``llm/openclaw``, thin subclasses of this same engine
|
|
7804
|
+
* with the right defaults baked in),
|
|
7805
|
+
* - a **local inference gateway** (Ollama, vLLM, LM Studio — keyless OK),
|
|
7806
|
+
* - or **your own service** that speaks the OpenAI Chat Completions protocol
|
|
7807
|
+
* (SSE streaming, optional tool calls).
|
|
7808
|
+
*
|
|
7809
|
+
* ``CustomLLM`` is the canonical name for the generic engine
|
|
7810
|
+
* ({@link OpenAICompatibleLLMProvider}): same streaming loop, same barge-in
|
|
7811
|
+
* cancellation, same opt-in session continuity (per-call ``user`` field,
|
|
7812
|
+
* per-call session-id header, and a static or factory-derived memory-scope
|
|
7813
|
+
* header).
|
|
7814
|
+
*
|
|
7815
|
+
* @example
|
|
7816
|
+
* ```ts
|
|
7817
|
+
* import { CustomLLM } from "getpatter";
|
|
7818
|
+
*
|
|
7819
|
+
* // Your own agent service (any OpenAI-compatible /chat/completions):
|
|
7820
|
+
* const llm = new CustomLLM({
|
|
7821
|
+
* baseUrl: "http://127.0.0.1:9000/v1",
|
|
7822
|
+
* model: "my-agent",
|
|
7823
|
+
* apiKeyEnv: "MY_AGENT_KEY",
|
|
7824
|
+
* timeout: 120, // agent runtimes run tools before replying
|
|
7825
|
+
* });
|
|
7826
|
+
*
|
|
7827
|
+
* // Keyless local gateway (Ollama / vLLM / LM Studio):
|
|
7828
|
+
* const llm = new CustomLLM({ baseUrl: "http://127.0.0.1:11434/v1", model: "llama3.1" });
|
|
7829
|
+
*
|
|
7830
|
+
* // Per-call session continuity + per-caller long-term memory, on a runtime
|
|
7831
|
+
* // that scopes sessions/memory by header:
|
|
7832
|
+
* const llm = new CustomLLM({
|
|
7833
|
+
* baseUrl: "http://127.0.0.1:9000/v1",
|
|
7834
|
+
* model: "my-agent",
|
|
7835
|
+
* sessionIdHeader: "X-My-Session-Id", // value = `${prefix}${callId}`
|
|
7836
|
+
* sessionIdPrefix: "patter-call-",
|
|
7837
|
+
* sessionKeyHeader: "X-My-Memory-Key",
|
|
7838
|
+
* sessionKeyFrom: "caller_hash", // patter-caller-<hash>
|
|
7839
|
+
* });
|
|
7840
|
+
* ```
|
|
7841
|
+
*/
|
|
7842
|
+
|
|
7843
|
+
/** Constructor options for the generic Custom LLM provider. */
|
|
7844
|
+
type CustomLLMOptions = OpenAICompatibleLLMOptions;
|
|
7845
|
+
/**
|
|
7846
|
+
* Generic "Custom LLM" provider for any OpenAI-compatible endpoint.
|
|
7847
|
+
*
|
|
7848
|
+
* All constructor options are inherited from
|
|
7849
|
+
* {@link OpenAICompatibleLLMOptions} (``baseUrl`` and ``model`` are
|
|
7850
|
+
* required). The Hermes / OpenClaw presets are subclasses of the same engine
|
|
7851
|
+
* — use them when they exist; use this for everything else.
|
|
7852
|
+
*/
|
|
7853
|
+
declare class LLM$2 extends OpenAICompatibleLLMProvider {
|
|
7854
|
+
/** Stable pricing/dashboard key — read by stream-handler/metrics. */
|
|
7855
|
+
static readonly providerKey: string;
|
|
7856
|
+
}
|
|
7857
|
+
|
|
7665
7858
|
/**
|
|
7666
7859
|
* Hermes agent-runtime LLM preset for Patter's pipeline mode.
|
|
7667
7860
|
*
|
|
@@ -7690,11 +7883,28 @@ interface HermesLLMOptions {
|
|
|
7690
7883
|
/** Per-request timeout in seconds. Default ``120``. */
|
|
7691
7884
|
timeout?: number;
|
|
7692
7885
|
/**
|
|
7693
|
-
*
|
|
7694
|
-
* scopes durable memory to this value across calls. ``undefined``
|
|
7695
|
-
* means the header is not sent. Credential-grade — never logged.
|
|
7886
|
+
* Static long-term memory scope. When set, emits ``X-Hermes-Session-Key`` so
|
|
7887
|
+
* Hermes scopes durable memory to this value across calls. ``undefined``
|
|
7888
|
+
* (default) means the header is not sent. Credential-grade — never logged.
|
|
7696
7889
|
*/
|
|
7697
7890
|
sessionKey?: string;
|
|
7891
|
+
/**
|
|
7892
|
+
* Convenience selector for a built-in per-call key derivation. Set to
|
|
7893
|
+
* ``'caller_hash'`` to derive the session key per call as
|
|
7894
|
+
* ``` `patter-caller-${ctx.callerHash}` ``` (a stable, non-reversible hash of
|
|
7895
|
+
* the caller — never the raw number), enabling per-caller cross-call memory.
|
|
7896
|
+
* ``undefined`` (default) uses the static ``sessionKey`` path. Ignored when
|
|
7897
|
+
* ``sessionKeyFactory`` is given explicitly. Mirrors Python
|
|
7898
|
+
* ``session_key_from``.
|
|
7899
|
+
*/
|
|
7900
|
+
sessionKeyFrom?: 'caller_hash';
|
|
7901
|
+
/**
|
|
7902
|
+
* Custom callback deriving the ``X-Hermes-Session-Key`` value per call from a
|
|
7903
|
+
* {@link SessionContext}. Takes precedence over both ``sessionKey`` and
|
|
7904
|
+
* ``sessionKeyFrom``. A falsy return omits the header for that call.
|
|
7905
|
+
* Credential-grade — never logged. Mirrors Python ``session_key_factory``.
|
|
7906
|
+
*/
|
|
7907
|
+
sessionKeyFactory?: (ctx: SessionContext) => string | undefined;
|
|
7698
7908
|
/** Extra headers merged after the SDK ``User-Agent``. */
|
|
7699
7909
|
extraHeaders?: Record<string, string>;
|
|
7700
7910
|
/** Sampling temperature [0, 2]. */
|
|
@@ -9207,4 +9417,17 @@ interface CallEvent {
|
|
|
9207
9417
|
readonly direction?: string;
|
|
9208
9418
|
}
|
|
9209
9419
|
|
|
9210
|
-
|
|
9420
|
+
declare const hermes: Readonly<{
|
|
9421
|
+
LLM: typeof LLM$1;
|
|
9422
|
+
}>;
|
|
9423
|
+
declare const openclaw: Readonly<{
|
|
9424
|
+
LLM: typeof LLM;
|
|
9425
|
+
}>;
|
|
9426
|
+
declare const openaiCompatible: Readonly<{
|
|
9427
|
+
LLM: typeof LLM$3;
|
|
9428
|
+
}>;
|
|
9429
|
+
declare const custom: Readonly<{
|
|
9430
|
+
LLM: typeof LLM$2;
|
|
9431
|
+
}>;
|
|
9432
|
+
|
|
9433
|
+
export { type AgentOptions, type AgentState, AllProvidersFailedError, type AnthropicConversion, LLM$7 as AnthropicLLM, type AnthropicLLMOptions, type AnthropicMessage, AssemblyAIEncoding, AssemblyAIModel, STT$1 as AssemblyAISTT, type AssemblyAISTTOptions, type AudioConfig, type AudioSource, AuthenticationError, type BackgroundAudioOptions, BackgroundAudioPlayer, type EvaluateContext as BargeInEvaluateContext, type BargeInStrategy, BuiltinAudioClip, type BuiltinAudioClipName, type BuiltinPcmSource, type CallControl, type CallEvent, type CallEventHandler, type CallMetrics, CallMetricsAccumulator, type CallOutcome, type CallRecord, type CallResult, type CarrierKind, type CartesiaEncoding, STT$3 as CartesiaSTT, type CartesiaSTTOptions, TTS$3 as CartesiaTTS, CartesiaTTSModel, type CartesiaTTSOptions, CartesiaTTSVoiceMode, LLM$5 as CerebrasLLM, type CerebrasLLMOptions, ChatContext, type ChatMessage, type ChatRole, CloudflareTunnel, type ConsultConfig, type ConversationStateSnapshot, type CostBreakdown, LLM$2 as CustomLLM, type CustomLLMOptions, DEFAULT_MIN_SENTENCE_LEN, DEFAULT_PRICING, DTMF_EVENTS, DeepFilterNetFilter, type DeepFilterNetOptions, DeepgramModel, STT$6 as DeepgramSTT, type DeepgramSTTOptions, DefaultToolExecutor, type DefaultToolExecutorOptions, type DefineToolInput, type DtmfEvent, ConvAI as ElevenLabsConvAI, ElevenLabsConvAIAdapter, type ConvAIOptions as ElevenLabsConvAIOptions, ElevenLabsModel, ElevenLabsOutputFormat, ElevenLabsTTS as ElevenLabsRestTTS, TTS$6 as ElevenLabsTTS, type ElevenLabsTTSOptions, type ElevenLabsWebSocketOptions, TTS$5 as ElevenLabsWebSocketTTS, type EouTrigger, ErrorCode, EventBus, FallbackLLMProvider, type FallbackLLMProviderOptions, type FilePcmSource, GEMINI_DEFAULT_INPUT_SR, GEMINI_DEFAULT_OUTPUT_SR, GeminiLiveAdapter, type GeminiLiveEventHandler, LLM$4 as GoogleLLM, type GoogleLLMOptions, LLM$6 as GroqLLM, type GroqLLMOptions, Guardrail$1 as Guardrail, type GuardrailOptions, LLM$1 as HermesLLM, type HermesLLMOptions, type HookContext, IVRActivity, type IVRActivityOptions, type IVRToolDefinition, type IncomingMessage, type InitTracingOptions, TTS as InworldTTS, type InworldTTSOptions, type JobCallback, KrispFrameDuration, KrispSampleRate, KrispVivaFilter, type KrispVivaFilterOptions, type LLMChunk, LLMLoop, type LLMProvider, LMNTAudioFormat, LMNTModel, LMNTSampleRate, TTS$1 as LMNTTTS, type LMNTTTSOptions, type LatencyBreakdown, type LocalCallOptions, type LocalConfig, type LocalOptions, type Logger, type LoopCallback, type MessageHandler, MetricsStore, MinWordsStrategy, type MinWordsStrategyOptions, type ModelPricing, Ngrok, type OpenAICompatibleConsult, LLM$3 as OpenAICompatibleLLM, type OpenAICompatibleLLMOptions, OpenAICompatibleLLMProvider, LLM$8 as OpenAILLM, type OpenAILLMOptions, OpenAILLMProvider, type OpenAIMessage, Realtime as OpenAIRealtime, Realtime2 as OpenAIRealtime2, OpenAIRealtime2Adapter, type Realtime2Options as OpenAIRealtime2Options, OpenAIRealtimeAdapter, OpenAIRealtimeAudioFormat, OpenAIRealtimeModel, type RealtimeOptions as OpenAIRealtimeOptions, OpenAIRealtimeVADType, TTS$4 as OpenAITTS, type OpenAITTSOptions, STT$4 as OpenAITranscribeSTT, type OpenAITranscribeSTTOptions, OpenAITranscriptionModel, OpenAIVoice, LLM as OpenClawLLM, type OpenClawLLMOptions, PRICING_LAST_UPDATED, PRICING_VERSION, type ParamSpec, PartialStreamError, Patter, PatterConfigError, PatterConnectionError, PatterError, type PatterEventType, PatterTool, type PatterToolExecuteArgs, type PatterToolOptions, type PatterToolResult, PcmCarry, PipelineHookExecutor, type PipelineHooks, type PipelineMessageHandler, Carrier as Plivo, PlivoAdapter, type PlivoCarrierOptions, type InitiateCallOptions as PlivoInitiateCallOptions, type InitiateCallResult as PlivoInitiateCallResult, PricingUnit, type PricingUnitValue, type ProviderPricing, ProvisionError, RateLimitError, type RawPcmSource, type RealtimeConfig, type RealtimeTurnDetection, RemoteMessageHandler, RimeAudioFormat, RimeModel, TTS$2 as RimeTTS, type RimeTTSOptions, SPAN_BARGEIN, SPAN_CALL, SPAN_ENDPOINT, SPAN_LLM, SPAN_STT, SPAN_TOOL, SPAN_TTS, type SSEEvent, type STTConfig, type ScheduleHandle, SentenceChunker, type ServeOptions, type SessionContext, type SilenceCallback, type SileroSampleRate, SileroVAD, type SileroVADOptions, STT$2 as SonioxSTT, type SonioxSTTOptions$1 as SonioxSTTOptions, type Span, type SpeechEventCallback, SpeechEvents, SpeechmaticsAudioEncoding, SpeechmaticsOperatingPoint, STT as SpeechmaticsSTT, type SpeechmaticsSTTOptions, SpeechmaticsSampleRate, SpeechmaticsServerMessage, TurnDetectionMode as SpeechmaticsTurnDetectionMode, StatefulResampler, type StatefulResamplerOptions, Static as StaticTunnel, type TTSConfig, Carrier$1 as Telnyx, TelnyxAdapter, type TelnyxCarrierOptions, type ConfigureNumberOptions as TelnyxConfigureNumberOptions, type EndCallOptions as TelnyxEndCallOptions, type InitiateCallOptions$1 as TelnyxInitiateCallOptions, type InitiateCallResult$1 as TelnyxInitiateCallResult, type ProvisionNumberOptions as TelnyxProvisionNumberOptions, type ProvisionNumberResult as TelnyxProvisionNumberResult, TelnyxSTT, TelnyxSTTInputFormat, TelnyxSTTSampleRate, type Transcript as TelnyxSTTTranscript, TelnyxTTS, TelnyxTTSSampleRate, TelnyxTTSVoice, type TelnyxTranscriptionEngine, TestSession, TfidfLoopDetector, type TfidfLoopDetectorOptions, Tool, type ToolDefinition, type ToolExecutor, type ToolHandler, type ToolOptions, type TunnelHandle, type TurnMetrics, Carrier$2 as Twilio, TwilioAdapter, type TwilioAdapterOptions, type TwilioCarrierOptions, type ConfigureNumberOptions$1 as TwilioConfigureNumberOptions, type InitiateCallOptions$2 as TwilioInitiateCallOptions, type InitiateCallResult$2 as TwilioInitiateCallResult, type ProvisionNumberOptions$1 as TwilioProvisionNumberOptions, type ProvisionNumberResult$1 as TwilioProvisionNumberResult, ULTRAVOX_DEFAULT_API_BASE, ULTRAVOX_DEFAULT_SR, type UltravoxEventHandler, UltravoxRealtimeAdapter, type UserState, STT$5 as WhisperSTT, type WhisperSTTOptions, assemblyai, builtinClipPath, calculateRealtimeCost, calculateSttCost, calculateTelephonyCost, calculateTtsCost, callsToCsv, callsToJson, cartesia, createResampler16kTo8k, createResampler24kTo16k, createResampler24kTo8k, createResampler8kTo16k, custom, deepgram, defineTool, elevenlabs, evaluateStrategies as evaluateBargeInStrategies, filterEmoji, filterForTTS, filterMarkdown, formatDtmf, geminiLive, getLogger, guardrail, hashCaller, hermes, initTracing, isRemoteUrl, isTracingEnabled, isWebSocketUrl, lmnt, makeAuthMiddleware, mergePricing, mixPcm, mountApi, mountDashboard, mulawToPcm16, notifyDashboard, openaiCompatible, openaiTts, openclaw, openclawConsult, openclawPostCallNotifier, pcm16ToMulaw, resample16kTo8k, resample24kTo16k, resample8kTo16k, resamplePcm, resetStrategies as resetBargeInStrategies, rime, scheduleCron, scheduleInterval, scheduleOnce, selectSoundFromList, setLogger, soniox, speechmatics, startSpan, startTunnel, tool, ultravox, whisper };
|