Expand description
Pillars: [AI][DevX]
Voice + LLM Interface for MockForge
This module provides voice input capability that allows users to build mocks conversationally using natural language commands. It leverages MockForge’s existing LLM infrastructure to interpret voice commands and generate mock APIs.
§Features
- Natural Language Command Parsing: Interpret voice commands using LLM
- OpenAPI Spec Generation: Generate OpenAPI 3.0 specs from voice commands
- Conversational Mode: Support multi-turn conversations for iterative refinement
- Single-Shot Mode: Process complete commands in one go
§Example Usage
use mockforge_core::voice::{VoiceCommandParser, VoiceCommand};
use mockforge_core::intelligent_behavior::IntelligentBehaviorConfig;
let config = IntelligentBehaviorConfig::default();
let parser = VoiceCommandParser::new(config);
// Parse a voice command
let command = "Create a fake e-commerce API with 20 products and a checkout flow";
let parsed = parser.parse_command(command).await?;
// Generate OpenAPI spec
let spec_generator = VoiceSpecGenerator::new();
let spec = spec_generator.generate_spec(&parsed).await?;Re-exports§
pub use command_parser::ApiRequirement;pub use command_parser::EntityRequirement;pub use command_parser::ParsedCommand;pub use command_parser::ParsedContinuumRule;pub use command_parser::ParsedDriftBudget;pub use command_parser::ParsedRealityContinuum;pub use command_parser::ParsedServiceBudget;pub use command_parser::ParsedWorkspaceCreation;pub use command_parser::ParsedWorkspaceScenario;pub use command_parser::PersonaRequirement;pub use command_parser::ScenarioRequirement;pub use command_parser::VoiceCommandParser;pub use conversation::ConversationContext;pub use conversation::ConversationManager;pub use conversation::ConversationState;pub use hook_transpiler::HookTranspiler;pub use spec_generator::VoiceSpecGenerator;pub use workspace_builder::BuiltWorkspace;pub use workspace_builder::WorkspaceBuilder;pub use workspace_scenario_generator::GeneratedWorkspaceScenario;pub use workspace_scenario_generator::WorkspaceConfigSummary;pub use workspace_scenario_generator::WorkspaceScenarioGenerator;
Modules§
- command_
parser - LLM-based command parser for voice commands
- conversation
- Conversation state management for multi-turn voice interactions
- hook_
transpiler - Natural language to hook transpiler
- spec_
generator - OpenAPI spec generator from parsed voice commands
- workspace_
builder - Workspace builder for creating complete workspaces from parsed commands
- workspace_
scenario_ generator - Workspace scenario generator