Logo Lanfrica

Dagi1995/hasab_api_test

Domain:

natural language processinghealthcare

Record type:

software
Creator:
Dag
Host:
# Hasab AI Medical Voice Assistant A real-time Amharic Medical Voice Assistant built with Next.js and integrated with Hasab AI's powerful APIs. This application allows users to speak their medical questions in Amharic, transcribes the speech to text, generates an intelligent Amharic medical response, and speaks the answer out loud using an advanced Text-to-Speech model. ## Features - **Real-time Amharic Speech Recognition** via Hasab Transcription API - **AI Medical Chatbot Responses** via Hasab Chat API (`hasab-1-lite` model) - **High-Quality Text-to-Speech Playback** via Hasab TTS API (Speaker: "selam") - **Beautiful UI** using TailwindCSS and Lucide React Icons ## Getting Started ### Prerequisites Make sure you have Node.js installed on your machine. You must have an API Key from Hasab AI. You can sign up and get your API key from Developer Hasab AI. ### Setup Instructions 1. **Clone the repository / open the folder:** Navigate into the `hasab_api` directory. 2. **Configure your Environment Variables:** Create a `.env` file in the root directory (if it doesn't already exist) and specify your exact Hasab API Key: ```bash HASAB_API_KEY=HASAB_KEY_YOUR_ACTUAL_API_KEY_HERE ``` *(Note: Never share or commit your actual API key publicly!)* 3. **Install Dependencies:** Run the following command in your terminal to install the necessary packages: ```bash npm install ``` 4. **Run the Development Server:** Start the Next.js local server: ```bash npm run dev ``` 5. **Open in Browser:** Open your browser and navigate to localhost. --- ## How it Works 1. **Start Conversation:** When you click "ውይይት ጀምር" (Start Conversation), the app connects to `/api/chat` and asks the AI to introduce itself as a medical assistant in Amharic. The response text is sent to `/api/tts` to hear the audio greeting. 2. **Listen:** The app uses the native `MediaRecorder` API to record your voice when you speak. 3. **Transcribe:** When you stop speaking, the recorded audio is s …