@jeyaprakash120690/ai-voice-assistant
v0.1.3
Published
Drop-in floating voice assistant for React/Next.js
Downloads
31
Readme
@your-scope/ai-voice-assistant
Drop-in floating voice assistant for React/Next.js with Web Speech (STT) and speechSynthesis (TTS).
Install
npm i @your-scope/ai-voice-assistant
# peer deps (in your app)
npm i react react-domUsage
"use client";
import { AiVoiceAssistant } from "@your-scope/ai-voice-assistant";
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<AiVoiceAssistant
wakePrompt="How may I help you?"
hintText="Ask: 'What were yesterday’s sales?'"
apiEndpoint="/api/voice-query"
position="bottom-right"
hotkey="Control+Shift+V"
/>
</>
);
}API contract
The component requires either:
onQuery(query) => Promise<string | { text: string }>orapiEndpoint(POST{ query }→{ answer: string })
See the demo Next.js app for a working API route.
