african-knowledge-ai-node-sdk
v1.0.7
Published
SDK for node-based applications
Readme
African Knowledge AI SDK
A Node.js SDK for AI-powered translation, OCR, STT, and TTS in African languages.
AI-powered African language translation & speech recognition Open-source African knowledge & history repository AI-driven bias detection & fact-checking
Usage
1️⃣ Initialize the SDK
const AfricanKnowledgeAIClient = require("african-knowledge-ai-node-sdk");
const client = new AfricanKnowledgeAIClient("your-api-key");
2️⃣ Perform OCR (Image-to-Text)
(async () => { const result = await client.requestModel("ocr", { filePath: "./image.png" }); console.log("Extracted Text:", result); })();
3️⃣ Perform Translation
(async () => { const result = await client.requestModel("translate", { data: { text: "Hello", target_lang: "sw" } }); console.log("Translated Text:", result); })();
4️⃣ Speech-to-Text (STT)
(async () => { const result = await client.requestModel("stt", { filePath: "./audio.mp3" }); console.log("Transcribed Text:", result); })();
5️⃣ Text-to-Speech (TTS)
(async () => { const result = await client.requestModel("tts", { data: { text: "Hello world", lang: "sw" } }); console.log("TTS Audio URL:", result.audio_url); })();
API Endpoints
| Model | Description |
|--------------|--------------------------------------|
| ocr | Image-to-Text (OCR) |
| translate | AI Translation |
| stt | Speech-to-Text |
| tts | Text-to-Speech |
| chat | Fact-Checking & Bias Detection |
| afri-history | African Knowledge & History Repository |
License This SDK is licensed under the MIT License.
