@copilotkit/react-ui
Version:
<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />
20 lines (17 loc) • 771 B
TypeScript
import * as React from 'react';
import { Message } from '@copilotkit/shared';
declare const checkMicrophonePermission: () => Promise<boolean | undefined>;
declare const requestMicAndPlaybackPermission: () => Promise<{
stream: MediaStream;
audioContext: AudioContext;
} | null>;
type PushToTalkState = "idle" | "recording" | "transcribing";
type SendFunction = (text: string) => Promise<Message>;
declare const usePushToTalk: ({ sendFunction, inProgress, }: {
sendFunction: SendFunction;
inProgress: boolean;
}) => {
pushToTalkState: PushToTalkState;
setPushToTalkState: React.Dispatch<React.SetStateAction<PushToTalkState>>;
};
export { PushToTalkState, SendFunction, checkMicrophonePermission, requestMicAndPlaybackPermission, usePushToTalk };