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:
44
skills/web-search/scripts/web_search.ts
Executable file
44
skills/web-search/scripts/web_search.ts
Executable file
@@ -0,0 +1,44 @@
|
||||
import ZAI from 'z-ai-web-dev-sdk';
|
||||
|
||||
interface SearchFunctionResultItem {
|
||||
url: string;
|
||||
name: string;
|
||||
snippet: string;
|
||||
host_name: string;
|
||||
rank: number;
|
||||
date: string;
|
||||
favicon: string;
|
||||
}
|
||||
|
||||
async function main(query: string, num: number = 10) {
|
||||
try {
|
||||
const zai = await ZAI.create();
|
||||
|
||||
const searchResult = await zai.functions.invoke('web_search', {
|
||||
query: query,
|
||||
num: num
|
||||
});
|
||||
|
||||
console.log('Search Results:');
|
||||
console.log('================\n');
|
||||
|
||||
if (Array.isArray(searchResult)) {
|
||||
searchResult.forEach((item: SearchFunctionResultItem, index: number) => {
|
||||
console.log(`${index + 1}. ${item.name}`);
|
||||
console.log(` URL: ${item.url}`);
|
||||
console.log(` Snippet: ${item.snippet}`);
|
||||
console.log(` Host: ${item.host_name}`);
|
||||
console.log(` Date: ${item.date}`);
|
||||
console.log('');
|
||||
});
|
||||
|
||||
console.log(`\nTotal results: ${searchResult.length}`);
|
||||
} else {
|
||||
console.log('Unexpected response format:', searchResult);
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.error('Web search failed:', err?.message || err);
|
||||
}
|
||||
}
|
||||
|
||||
main('What is the capital of France?', 5);
|
||||
Reference in New Issue
Block a user