@trillet-ai/web-sdk
Version:
Trillet Web SDK for real-time audio communication with AI agents
36 lines (35 loc) • 928 B
TypeScript
export interface ToolUsed {
name: string;
args?: any;
status?: 'pending' | 'success' | 'error';
}
export interface Transcript {
role: 'user' | 'assistant';
text: string;
isFinal: boolean;
timestamp: Date;
participantId?: string;
toolUsed?: ToolUsed;
}
export declare class TranscriptManager {
private transcripts;
private currentTranscript;
getTranscripts(): Transcript[];
getCurrentTranscript(): {
[key: string]: string;
};
addToolStarted(toolCall: {
name: string;
args: any;
}): void;
addToolCompleted(toolResult: {
name: string;
result: any;
isError: boolean;
}): void;
handleTranscript(participantId: string, isAgent: boolean, transcriptData: {
text: string;
isFinal: boolean;
}): boolean;
addMessage(role: 'user' | 'assistant', text: string, participantId?: string): void;
}