ai-chat-voice-assistant
v1.0.4
Published
A React component for AI voice chat assistant with recording and MP3 conversion
Downloads
403
Maintainers
Readme
AI Chat Voice Assistant
A React component library for building AI-powered voice chat interfaces with recording and MP3 conversion capabilities.
Features
- 🎙️ Voice recording with microphone access
- 🎵 Automatic MP3 conversion using lamejs
- 💬 Chat interface with message bubbles
- 🎨 Material-UI based design
- 📱 Responsive layout
- 🔧 TypeScript support
Installation
npm install ai-chat-voice-assistantUsage
import { ChatUI } from 'ai-chat-voice-assistant';
function App() {
const handleSend = async (message: string) => {
// Your AI API call here
return "AI response";
};
return (
<ChatUI onSend={handleSend} />
);
}Props
ChatUI
| Prop | Type | Description |
|------|------|-------------|
| onSend | (message: string) => Promise<string> | Function to handle sending messages to AI |
API
Types
type Message = {
role: "User" | "AI";
text: string;
audioUrl?: string;
};
type ChatUIProps = {
onSend?: (message: string) => Promise<string>;
};Development
# Install dependencies
npm install
# Start development server
npm run dev
# Build the library
npm run build
# Run linter
npm run lintLicense
MIT import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'], extends: [ // Other configs... // Enable lint rules for React reactX.configs['recommended-typescript'], // Enable lint rules for React DOM reactDom.configs.recommended, ], languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, // other options... }, }, ])
