import { Callbacks, Mode, Status } from "@elevenlabs/types"; import type { BaseConnection, SessionConfig, FormatConfig } from "./utils/BaseConnection.js"; import type { Conversation } from "./index.js"; import type { AgentAudioEvent, AgentChatResponsePartEvent, AgentResponseEvent, ClientToolCallEvent, InternalTentativeAgentResponseEvent, InterruptionEvent, UserTranscriptionEvent, VadScoreEvent, MCPToolCallClientEvent, AgentToolResponseEvent, ConversationMetadataEvent, AsrInitiationMetadataEvent, MCPConnectionStatusEvent, ErrorMessageEvent, AgentToolRequestEvent, GuardrailTriggeredEvent } from "./utils/events.js"; import type { InputConfig } from "./utils/input.js"; import type { OutputConfig } from "./utils/output.js"; export type { Role, Mode, Status, Callbacks } from "@elevenlabs/types"; export { CALLBACK_KEYS } from "@elevenlabs/types"; /** Allows self-hosting the worklets to avoid whitelisting blob: and data: in the CSP script-src */ export type AudioWorkletConfig = { workletPaths?: { rawAudioProcessor?: string; audioConcatProcessor?: string; }; libsampleratePath?: string; }; export type ConversationCreatedCallback = (conversation: Conversation) => void; export type ConversationLifecycleOptions = { onConversationCreated?: ConversationCreatedCallback; }; export type Options = SessionConfig & Callbacks & ConversationLifecycleOptions & ClientToolsConfig & InputConfig & OutputConfig & AudioWorkletConfig; export type PartialOptions = SessionConfig & Partial & ConversationLifecycleOptions & Partial & Partial & Partial & Partial & Partial; export type MultimodalMessageInput = { text?: string; fileId?: string; }; export type UploadFileResult = { fileId: string; }; export type ClientToolsConfig = { clientTools: Record Promise | string | number | void>; }; export declare function isTextOnly(options: PartialOptions): boolean | undefined; export declare abstract class BaseConversation { protected readonly options: Options; protected readonly connection: BaseConnection; protected lastInterruptTimestamp: number; protected mode: Mode; protected status: Status; protected volume: number; protected currentEventId: number; protected lastFeedbackEventId: number; protected canSendFeedback: boolean; protected static getFullOptions(partialOptions: PartialOptions): Options; protected constructor(options: Options, connection: BaseConnection); protected markConnected(): void; endSession(): Promise; private endSessionWithDetails; protected handleEndSession(): Promise; protected updateMode(mode: Mode): void; protected updateStatus(status: Status): void; protected updateCanSendFeedback(): void; protected handleInterruption(event: InterruptionEvent): void; protected handleAgentResponse(event: AgentResponseEvent): void; protected handleUserTranscript(event: UserTranscriptionEvent): void; protected handleTentativeAgentResponse(event: InternalTentativeAgentResponseEvent): void; protected handleVadScore(event: VadScoreEvent): void; protected handleClientToolCall(event: ClientToolCallEvent): Promise; protected handleAudio(event: AgentAudioEvent): void; protected handleMCPToolCall(event: MCPToolCallClientEvent): void; protected handleMCPConnectionStatus(event: MCPConnectionStatusEvent): void; protected handleAgentToolRequest(event: AgentToolRequestEvent): void; protected handleAgentToolResponse(event: AgentToolResponseEvent): void; protected handleConversationMetadata(event: ConversationMetadataEvent): void; protected handleAsrInitiationMetadata(event: AsrInitiationMetadataEvent): void; protected handleAgentChatResponsePart(event: AgentChatResponsePartEvent): void; protected handleGuardrailTriggered(_event: GuardrailTriggeredEvent): void; protected handleErrorEvent(event: ErrorMessageEvent): void; private onMessage; private onError; getId(): string; isOpen(): boolean; abstract setVolume(options: { volume: number; }): void; abstract setMicMuted(isMuted: boolean): void; /** * Returns byte frequency data (0-255) for the input audio, focused on the * human voice range (100-8000 Hz). */ abstract getInputByteFrequencyData(): Uint8Array; /** * Returns byte frequency data (0-255) for the output audio, focused on the * human voice range (100-8000 Hz). */ abstract getOutputByteFrequencyData(): Uint8Array; abstract getInputVolume(): number; abstract getOutputVolume(): number; sendFeedback(like: boolean): void; sendContextualUpdate(text: string): void; sendUserMessage(text: string): void; sendUserActivity(): void; sendMCPToolApprovalResult(toolCallId: string, isApproved: boolean): void; sendMultimodalMessage(options: MultimodalMessageInput): void; uploadFile(file: Blob): Promise; } //# sourceMappingURL=BaseConversation.d.ts.map