text stringlengths 0 59.1k |
|---|
```bash |
ββββββββββββββββββββββββββββββββββββββββββββββββββ |
VOLTAGENT SERVER STARTED SUCCESSFULLY |
ββββββββββββββββββββββββββββββββββββββββββββββββββ |
β HTTP Server: http://localhost:3141 |
VoltOps Platform: https://console.voltagent.dev |
ββββββββββββββββββββββββββββββββββββββββββββββββββ |
``` |
 |
You can start chatting with your agent right away through the VoltOps Console! |
## Multi-Agent Systems - Delegated Agents |
The framework's sub-agent system allows complex tasks to be divided among specialized agents: |
```typescript |
// Research specialist agent |
const researchAgent = new Agent({ |
name: "Researcher", |
instructions: "Conducts detailed research using web search", |
tools: [webSearchTool], |
}); |
// Writing specialist agent |
const writerAgent = new Agent({ |
name: "Writer", |
instructions: "Creates engaging content based on research data", |
tools: [contentGeneratorTool], |
}); |
// Coordinator agent |
const coordinator = new Agent({ |
name: "Coordinator", |
instructions: "Coordinates research and writing tasks", |
llm: new VercelAIProvider(), |
model: openai("gpt-4o"), |
subAgents: [researchAgent, writerAgent], // Automatic delegate_task tool |
}); |
// Complex workflow in a single call |
await coordinator.generateText("Write a blog post about quantum computing"); |
// Coordinator will delegate research to researcher, writing to writer |
``` |
## Voice Features |
VoltAgent's voice integration is also designed with a TypeScript-first approach: |
```typescript |
import { ElevenLabsVoiceProvider, OpenAIVoiceProvider } from "@voltagent/voice"; |
// Realistic voice with ElevenLabs |
const elevenLabsVoice = new ElevenLabsVoiceProvider({ |
apiKey: process.env.ELEVENLABS_API_KEY, |
voice: "Rachel", |
ttsModel: "eleven_multilingual_v2", |
}); |
const voiceAgent = new Agent({ |
name: "Voice Assistant", |
instructions: "Assistant that helps with voice responses", |
llm: new VercelAIProvider(), |
model: openai("gpt-4o"), |
voice: elevenLabsVoice, |
}); |
// Generate text response |
const response = await voiceAgent.generateText("Tell me a short story"); |
// Convert to voice |
if (voiceAgent.voice && response.text) { |
const audioStream = await voiceAgent.voice.speak(response.text); |
// Save to file |
import { createWriteStream } from "node:fs"; |
import { pipeline } from "node:stream/promises"; |
const fileStream = createWriteStream("story.mp3"); |
await pipeline(audioStream, fileStream); |
console.log("Audio file ready!"); |
} |
``` |
## Production-Ready Features |
### Error Handling & Resilience |
```typescript |
import { createHooks } from "@voltagent/core"; |
const hooks = createHooks({ |
onStart: async ({ agent, context }) => { |
const requestId = `req-${Date.now()}`; |
context.context.set("requestId", requestId); |
console.log(`[${agent.name}] Request started: ${requestId}`); |
}, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.