feat: extend voice API workspace and speech controls
CI / Verify and package (ubuntu-latest) (push) Canceled after 0s
CI / Verify and package (windows-latest) (push) Canceled after 0s

This commit is contained in:
snowspeeder
2026-08-06 12:09:34 -04:00
parent 1adb459e04
commit a71cb8334a
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# Voice Conversation API (v1)
`/api/v1/voice` is a server-side device API for native iOS and Echo-style clients. It is separate from the browser voice feature. Azure credentials remain on the PI WEB host.
`/api/v1/voice` is a server-side device API for native iOS and Echo-style clients. It is separate from the browser voice feature. Azure credentials remain on the PI WEB host. Every voice turn automatically includes server-side instructions to produce concise, natural DragonHD-friendly speech without Markdown or visual-only formatting.
## Security and provisioning
+6 -1
View File
@@ -31,6 +31,7 @@ const EVENT_OPEN_TIMEOUT_MS = 10_000;
const TURN_TIMEOUT_MS = 120_000;
const WORKING_PROGRESS_INTERVAL_MS = 15_000;
const DEVICE_WORKSPACE_ROOT = "/home/hope/workspaces";
const VOICE_CONVERSATION_INSTRUCTIONS = "This is a voice conversation. Respond in natural, concise spoken language suitable for Azure DragonHD text-to-speech. Do not use Markdown, headings, tables, bullet lists, code fences, URLs unless explicitly requested, or visual-only references. Speak punctuation naturally and expand ambiguous symbols when useful.";
interface TokenRecord {
id: string;
hash: string;
@@ -608,7 +609,11 @@ async function runTurn(
speech: VoiceSpeechGateway,
text: string
): Promise<void> {
const prompt = conversation.context === undefined ? text : `${conversation.context}\n\n${text}`;
const prompt = [
VOICE_CONVERSATION_INSTRUCTIONS,
...(conversation.context === undefined ? [] : [conversation.context]),
text,
].join("\n\n");
// The event subscription is fully open before the prompt is submitted, so
// a fast Pi run cannot emit agent_settled before this device starts waiting.
const { settled } = await startSettledWaiter(