Router Module¶
voice_agent.router
¶
Command routing for voice transcriptions.
Parses intent from transcribed text and routes to appropriate handlers.
CommandType
¶
Bases: Enum
Types of commands that can be parsed from voice input.
Source code in src/voice_agent/router.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |
ParsedCommand
dataclass
¶
Result of parsing a voice transcription.
Attributes:
| Name | Type | Description |
|---|---|---|
command_type |
CommandType
|
The type of command detected. |
text |
str
|
The original transcription text. |
project |
str | None
|
Project name if SWITCH_PROJECT command. |
Source code in src/voice_agent/router.py
28 29 30 31 32 33 34 35 36 37 38 39 40 | |
parse_command(text, projects=None)
¶
Parse a voice transcription into a command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Transcribed text from voice input. |
required |
projects
|
dict[str, str] | None
|
Optional mapping of project names to paths for switch detection. |
None
|
Returns:
| Type | Description |
|---|---|
ParsedCommand
|
ParsedCommand with detected intent. |
Source code in src/voice_agent/router.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | |