mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 01:53:33 +00:00
talk: add configurable silence timeout
This commit is contained in:
committed by
Peter Steinberger
parent
097c588a6b
commit
6ff7e8f42e
@@ -42,6 +42,7 @@ export const TalkConfigResultSchema = Type.Object(
|
||||
outputFormat: Type.Optional(Type.String()),
|
||||
apiKey: Type.Optional(Type.String()),
|
||||
interruptOnSpeech: Type.Optional(Type.Boolean()),
|
||||
silenceTimeoutMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
||||
},
|
||||
{ additionalProperties: false },
|
||||
),
|
||||
|
||||
@@ -56,7 +56,11 @@ async function connectOperator(ws: GatewaySocket, scopes: string[]) {
|
||||
});
|
||||
}
|
||||
|
||||
async function writeTalkConfig(config: { apiKey?: string; voiceId?: string }) {
|
||||
async function writeTalkConfig(config: {
|
||||
apiKey?: string;
|
||||
voiceId?: string;
|
||||
silenceTimeoutMs?: number;
|
||||
}) {
|
||||
const { writeConfigFile } = await import("../config/config.js");
|
||||
await writeConfigFile({ talk: config });
|
||||
}
|
||||
@@ -68,6 +72,7 @@ describe("gateway talk.config", () => {
|
||||
talk: {
|
||||
voiceId: "voice-123",
|
||||
apiKey: "secret-key-abc", // pragma: allowlist secret
|
||||
silenceTimeoutMs: 1500,
|
||||
},
|
||||
session: {
|
||||
mainKey: "main-test",
|
||||
@@ -88,6 +93,7 @@ describe("gateway talk.config", () => {
|
||||
};
|
||||
apiKey?: string;
|
||||
voiceId?: string;
|
||||
silenceTimeoutMs?: number;
|
||||
};
|
||||
};
|
||||
}>(ws, "talk.config", {});
|
||||
@@ -99,6 +105,7 @@ describe("gateway talk.config", () => {
|
||||
);
|
||||
expect(res.payload?.config?.talk?.voiceId).toBe("voice-123");
|
||||
expect(res.payload?.config?.talk?.apiKey).toBe("__OPENCLAW_REDACTED__");
|
||||
expect(res.payload?.config?.talk?.silenceTimeoutMs).toBe(1500);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user