Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
add xspace-agent/xspace-agent/providers/stt.js
overstepping0041b50d855f
diff --git a/xspace-agent/xspace-agent/providers/stt.js b/xspace-agent/xspace-agent/providers/stt.jsnew file mode 100644index 000000000..a0efb1f42--- /dev/null+++ b/xspace-agent/xspace-agent/providers/stt.js@@ -0,0 +1,45 @@+// SPDX-License-Identifier: Apache-2.0+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent) [§79]++// DEPRECATED: Use packages/core (xspace-agent) instead.+// This file is kept for backward compatibility with server.js.+// Will be removed in v1.0.++const axios = require("axios")+const FormData = require("form-data")++const STT_PROVIDER = (process.env.STT_PROVIDER || "groq").toLowerCase()+const GROQ_API_KEY = process.env.GROQ_API_KEY+const OPENAI_API_KEY = process.env.OPENAI_API_KEY++async function transcribe(audioBuffer, mimeType = "audio/webm") {+ const ext = mimeType.includes("wav") ? "wav" : "webm"+ const form = new FormData()+ form.append("file", audioBuffer, { filename: `audio.${ext}`, contentType: mimeType })+ form.append("model", STT_PROVIDER === "openai" ? "whisper-1" : "whisper-large-v3")++ const baseUrl = STT_PROVIDER === "openai"+ ? "https://api.openai.com/v1/audio/transcriptions"+ : "https://api.groq.com/openai/v1/audio/transcriptions"++ const apiKey = STT_PROVIDER === "openai" ? OPENAI_API_KEY : GROQ_API_KEY++ if (!apiKey) {+ throw new Error(`Missing API key for STT provider: ${STT_PROVIDER}`)+ }++ const response = await axios.post(baseUrl, form, {+ headers: {+ Authorization: `Bearer ${apiKey}`,+ ...form.getHeaders()+ },+ maxContentLength: Infinity,+ maxBodyLength: Infinity+ })++ return { text: response.data.text || "" }+}++module.exports = { transcribe, STT_PROVIDER }++