Skip to main content

AgentConfig

AgentConfig is the central data structure in Voiceblox. It’s the framework-agnostic, serializable representation of a complete voice agent — produced from the graph and consumed by the agent runtime. Defined in lib/agent/models.ts.

Top-level type

type AgentConfig = {
  frameworkId: string
  frameworkProvider: string       // "livekit"
  agentName: string
  instructions: string            // System prompt from Persona node
  language: string                // BCP-47 language code
  allowInterruption?: boolean     // Default: true
  llm: LLMConfig
  tts: TTSConfig
  stt: STTConfig
  steps: ConversationStep[]
  mcpServers?: McpServerConfig[]
  exaConfigs?: ExaConfig[]
}

LLMConfig

type LLMConfig = {
  model: string          // e.g., "openai/gpt-4.1-mini"
  provider: string       // e.g., "openai"
  temperature?: number
  maxTokens?: number
  apiKey?: string
  baseURL?: string       // For custom endpoints (Ollama, Azure, etc.)
}

TTSConfig

type TTSConfig = {
  model: string
  provider: string
  voiceId?: string
  apiKey?: string
  instructions?: string    // OpenAI TTS style prompt
  stability?: number       // ElevenLabs (0–1)
  similarityBoost?: number // ElevenLabs (0–1)
  emotion?: string         // Cartesia
}

STTConfig

type STTConfig = {
  model: string
  provider: string
  apiKey?: string
  keyterms?: string          // Comma-separated (Deepgram, AssemblyAI)
  enableDiarization?: boolean
  keytermsPrompt?: string    // AssemblyAI
  languageDetection?: boolean
}

ConversationStep

type ConversationStep = {
  id: string
  type: "start" | "timer" | "burst" | "end" | "webhook" | "opentalk" | "ifelse" | "categorize"
  command?: string
  isLiteral?: boolean
  duration?: number          // timer steps: seconds
  rounds?: number            // burst steps
  webhookUrl?: string        // webhook steps
  conditionText?: string     // ifelse steps
  categories?: string[]      // categorize steps
  nextStepIds?: Record<string, string>  // handle → step ID (supports branching)
  evaluationLlm?: LLMConfig  // ifelse/categorize: LLM for condition evaluation
}

McpServerConfig

type McpServerConfig = {
  serverUrl: string
  authType: "none" | "bearer" | "api_key"
  authValue?: string
  selectedTools: string[]   // Tool names to expose to the LLM
}

ExaConfig

type ExaConfig = {
  apiKey?: string
  searchType: "auto" | "neural" | "keyword"
  numResults: number        // 1–10
  includeContents: boolean
}