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:
27
skills/ASR/scripts/asr.ts
Executable file
27
skills/ASR/scripts/asr.ts
Executable file
@@ -0,0 +1,27 @@
|
||||
import ZAI from 'z-ai-web-dev-sdk';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
async function main(inputFile: string) {
|
||||
if (!fs.existsSync(inputFile)) {
|
||||
console.error(`Audio file not found: ${inputFile}`);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const zai = await ZAI.create();
|
||||
|
||||
const audioBuffer = fs.readFileSync(inputFile);
|
||||
const file_base64 = audioBuffer.toString('base64');
|
||||
|
||||
const result = await zai.audio.asr.create({ file_base64 });
|
||||
|
||||
console.log('Transcription result:');
|
||||
console.log(result.text ?? JSON.stringify(result, null, 2));
|
||||
} catch (err: any) {
|
||||
console.error('ASR failed:', err?.message || err);
|
||||
}
|
||||
}
|
||||
|
||||
main('./output.wav');
|
||||
|
||||
Reference in New Issue
Block a user