import type { CompletionRequest, Message } from '../types/messages.js'; import type { NexusResponse } from '../types/response.js'; import type { SpeechRequest, SpeechResponse, TranscriptionRequest, TranscriptionResponse, VoiceSessionConfig, VoiceSessionTurnInput, VoiceSessionTurnResponse } from '../types/voice.js'; /** The part of a client a voice session needs. */ export interface VoiceSessionCompletionClient { /** Runs one completion. */ complete(request: CompletionRequest): Promise; } /** The speech operations a voice session needs, such as a `VoiceManager`. */ export interface VoiceSessionRuntime { /** Transcribes audio. */ transcribe(request: TranscriptionRequest): Promise; /** Synthesizes speech. */ speak(request: SpeechRequest): Promise; } /** * A multi-turn voice conversation: each turn transcribes the user, answers with the model, and * speaks the answer, keeping the history. */ export declare class VoiceSession { private config; private voice; private client; /** The session's id. */ readonly id: string; private history; constructor(config: VoiceSessionConfig, voice: VoiceSessionRuntime, client: VoiceSessionCompletionClient); /** A copy of the conversation so far. */ getHistory(): Message[]; /** * Replaces the history, by default with the session's starting messages. Returns the session, for * chaining. */ reset(messages?: Message[]): this; /** Runs one turn from audio or a transcript, adding both sides to the history. */ handleTurn(input?: VoiceSessionTurnInput): Promise; private transcribeInput; private completeWithTools; private createCompletionRequest; private speakResponse; private selectTaskPrompts; private matchesTask; private selectTools; private createSystemMessage; private taskTexts; private createTranscriptMessage; private texts; private parseToolArgs; }