mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:40:44 +00:00
feat(tts): resolve channel account config generically
This commit is contained in:
@@ -220,6 +220,45 @@ describe("FeishuConfigSchema optimization flags", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("FeishuConfigSchema TTS overrides", () => {
|
||||
it("accepts top-level and account-level TTS overrides", () => {
|
||||
const result = FeishuConfigSchema.parse({
|
||||
tts: {
|
||||
auto: "always",
|
||||
provider: "openai",
|
||||
providers: {
|
||||
openai: {
|
||||
voice: "alloy",
|
||||
},
|
||||
},
|
||||
},
|
||||
accounts: {
|
||||
english: {
|
||||
tts: {
|
||||
providers: {
|
||||
openai: {
|
||||
voice: "shimmer",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.tts).toMatchObject({
|
||||
auto: "always",
|
||||
provider: "openai",
|
||||
});
|
||||
expect(result.accounts?.english?.tts).toMatchObject({
|
||||
providers: {
|
||||
openai: {
|
||||
voice: "shimmer",
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("FeishuConfigSchema actions", () => {
|
||||
it("accepts top-level reactions action gate", () => {
|
||||
const result = FeishuConfigSchema.parse({
|
||||
|
||||
@@ -20,6 +20,23 @@ const FeishuDomainSchema = z.union([
|
||||
z.string().url().startsWith("https://"),
|
||||
]);
|
||||
const FeishuConnectionModeSchema = z.enum(["websocket", "webhook"]);
|
||||
const TtsOverrideSchema = z
|
||||
.object({
|
||||
auto: z.enum(["off", "always", "inbound", "tagged"]).optional(),
|
||||
enabled: z.boolean().optional(),
|
||||
mode: z.enum(["final", "all"]).optional(),
|
||||
provider: z.string().optional(),
|
||||
persona: z.string().optional(),
|
||||
personas: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
||||
summaryModel: z.string().optional(),
|
||||
modelOverrides: z.record(z.string(), z.unknown()).optional(),
|
||||
providers: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
|
||||
prefsPath: z.string().optional(),
|
||||
maxTextLength: z.number().int().min(1).optional(),
|
||||
timeoutMs: z.number().int().min(1000).max(120000).optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional();
|
||||
|
||||
const ToolPolicySchema = z
|
||||
.object({
|
||||
@@ -183,6 +200,7 @@ const FeishuSharedConfigShape = {
|
||||
reactionNotifications: ReactionNotificationModeSchema,
|
||||
typingIndicator: z.boolean().optional(),
|
||||
resolveSenderNames: z.boolean().optional(),
|
||||
tts: TtsOverrideSchema,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user