import { ElizaError } from "../errors.js"; import { type ModelHandler, type ModelRegistrationMetadata, type ResponseSkeleton, type StructuredStreamField, type TextStreamResult } from "../types/model.js"; import type { JsonValue } from "../types/primitives.js"; import type { IAgentRuntime } from "../types/runtime.js"; /** Capability absence is recoverable; malformed input/output is not absence. */ export declare function isUnavailableLocalModel(error: unknown): boolean; /** Distinguishes absent model configuration from a deliberately disabled capability. */ export declare class NoModelProviderConfiguredError extends ElizaError { readonly name = "NoModelProviderConfiguredError"; readonly reason: "no-provider" | "capability-disabled"; constructor(message?: string, reason?: "no-provider" | "capability-disabled"); } export declare const TEXT_GENERATION_MODEL_KEYS: readonly string[]; /** Exact (unnormalized) membership test for the built-in text-generation slots. */ export declare function isTextGenerationModelKey(modelKey: string): boolean; /** * The caller-declared stream fields a structured call may release, by field * name, with the part kinds that stream when the value is a parts array. * A free-string field streams only when the skeleton declares it one; a * field with `partKinds` also streams when the skeleton declares any other * value shape for it (the extractor walks only a `[{kind, value}]` array). */ export declare function resolveStructuredStreamFields(skeleton: ResponseSkeleton | undefined, requested: readonly StructuredStreamField[] | undefined): { fields: string[]; parts: Record; }; export declare function isTextStreamResult(value: JsonValue | object): value is TextStreamResult; /** Built-in text slots accept text, a typed text result, or a text stream. * Custom model slots retain their own result contracts. */ export declare function assertModelResultPresent(result: unknown, modelType: string): void; export declare function assertRuntimeModelOutputComplete(args: { result: unknown; provider: string; model: string; }): Promise; /** * Read the hidden reasoning-token count from a model response so it can be * surfaced on the successful model span. Native results (tool-call * shape) carry a `.usage` object; plain-text results do not, and the field is * left undefined there. Returns a finite non-negative number or `undefined`; * missing is preserved as missing rather than coerced to zero so an * unattributed burst stays distinguishable from a confirmed-none call. * * Covers the elizaOS `TokenUsage.reasoningTokens` field plus the two raw * provider shapes the AI SDK exposes (`usage.reasoningTokens` and * `providerMetadata.completion_tokens_details.reasoning_tokens`). */ export declare function readReasoningTokensFromResponse(response: unknown): number | undefined; export interface ResolvedModelRegistration { handler: ModelHandler["handler"]; metadata?: ModelRegistrationMetadata; modelKey: string; provider: string; } export declare function resolveProviderModelString(runtime: IAgentRuntime, resolvedModelType: string, optionsModel?: string, effectiveModelId?: string): string; export declare const CANONICAL_TEXT_CAPABILITY_SETTING = "ELIZA_CANONICAL_LLM_TEXT_ENABLED"; export declare const CANONICAL_EMBEDDING_CAPABILITY_SETTING = "ELIZA_CANONICAL_EMBEDDINGS_ENABLED"; export declare function isCanonicalModelCapabilityDisabled(runtime: Pick, modelType: string): boolean;