Archived
feat: extend voice API workspace and speech controls
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user