mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
refactor: share qqbot speech provider schema
This commit is contained in:
@@ -15,31 +15,24 @@ const AudioFormatPolicySchema = z
|
||||
|
||||
const QQBotSpeechQueryParamsSchema = z.record(z.string(), z.string()).optional();
|
||||
|
||||
const QQBotTtsSchema = z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
provider: z.string().optional(),
|
||||
baseUrl: z.string().optional(),
|
||||
apiKey: z.string().optional(),
|
||||
model: z.string().optional(),
|
||||
voice: z.string().optional(),
|
||||
authStyle: z.enum(["bearer", "api-key"]).optional(),
|
||||
queryParams: QQBotSpeechQueryParamsSchema,
|
||||
speed: z.number().optional(),
|
||||
})
|
||||
const QQBotSpeechProviderSchema = z.object({
|
||||
enabled: z.boolean().optional(),
|
||||
provider: z.string().optional(),
|
||||
baseUrl: z.string().optional(),
|
||||
apiKey: z.string().optional(),
|
||||
model: z.string().optional(),
|
||||
});
|
||||
|
||||
const QQBotTtsSchema = QQBotSpeechProviderSchema.extend({
|
||||
voice: z.string().optional(),
|
||||
authStyle: z.enum(["bearer", "api-key"]).optional(),
|
||||
queryParams: QQBotSpeechQueryParamsSchema,
|
||||
speed: z.number().optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional();
|
||||
|
||||
const QQBotSttSchema = z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
provider: z.string().optional(),
|
||||
baseUrl: z.string().optional(),
|
||||
apiKey: z.string().optional(),
|
||||
model: z.string().optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional();
|
||||
const QQBotSttSchema = QQBotSpeechProviderSchema.strict().optional();
|
||||
|
||||
const QQBotStreamingSchema = z
|
||||
.union([
|
||||
|
||||
Reference in New Issue
Block a user