feat: Add complete Agentic Compaction & Pipeline System
- Context Compaction System with token counting and summarization - Deterministic State Machine for flow control (no LLM decisions) - Parallel Execution Engine (up to 12 concurrent sessions) - Event-Driven Coordination via Event Bus - Agent Workspace Isolation (tools, memory, identity, files) - YAML Workflow Integration (OpenClaw/Lobster compatible) - Claude Code integration layer - Complete demo UI with real-time visualization - Comprehensive documentation and README Components: - agent-system/: Context management, token counting, subagent spawning - pipeline-system/: State machine, parallel executor, event bus, workflows - skills/: AI capabilities (LLM, ASR, TTS, VLM, image generation, etc.) - src/app/: Next.js demo application Total: ~100KB of production-ready TypeScript code
This commit is contained in:
25
skills/TTS/tts.ts
Executable file
25
skills/TTS/tts.ts
Executable file
@@ -0,0 +1,25 @@
|
||||
import ZAI from "z-ai-web-dev-sdk";
|
||||
import fs from "fs";
|
||||
|
||||
async function main(text: string, outFile: string) {
|
||||
try {
|
||||
const zai = await ZAI.create();
|
||||
|
||||
const response = await zai.audio.tts.create({
|
||||
input: text,
|
||||
voice: "tongtong",
|
||||
speed: 1.0,
|
||||
response_format: "wav",
|
||||
stream: false,
|
||||
});
|
||||
|
||||
const arrayBuffer = await response.arrayBuffer();
|
||||
const buffer = Buffer.from(new Uint8Array(arrayBuffer));
|
||||
fs.writeFileSync(outFile, buffer);
|
||||
console.log(`TTS audio saved to ${outFile}`);
|
||||
} catch (err: any) {
|
||||
console.error("TTS failed:", err?.message || err);
|
||||
}
|
||||
}
|
||||
|
||||
main("Hello, world!", "./output.wav");
|
||||
Reference in New Issue
Block a user