mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(voice-call): add speed and instructions to OpenAI TTS config schema (#39226)
Merged via squash.
Prepared head SHA: 775e3063b5
Co-authored-by: ademczuk <5212682+ademczuk@users.noreply.github.com>
Co-authored-by: obviyus <22031114+obviyus@users.noreply.github.com>
Reviewed-by: @obviyus
This commit is contained in:
@@ -522,11 +522,22 @@
|
||||
"apiKey": {
|
||||
"type": "string"
|
||||
},
|
||||
"baseUrl": {
|
||||
"type": "string"
|
||||
},
|
||||
"model": {
|
||||
"type": "string"
|
||||
},
|
||||
"voice": {
|
||||
"type": "string"
|
||||
},
|
||||
"speed": {
|
||||
"type": "number",
|
||||
"minimum": 0.25,
|
||||
"maximum": 4.0
|
||||
},
|
||||
"instructions": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { resolveOpenAITtsInstructions } from "openclaw/plugin-sdk/voice-call";
|
||||
import { pcmToMulaw } from "../telephony-audio.js";
|
||||
|
||||
/**
|
||||
@@ -110,9 +111,11 @@ export class OpenAITTSProvider {
|
||||
speed: this.speed,
|
||||
};
|
||||
|
||||
// Add instructions if using gpt-4o-mini-tts model
|
||||
const effectiveInstructions = trimToUndefined(instructions) ?? this.instructions;
|
||||
if (effectiveInstructions && this.model.includes("gpt-4o-mini-tts")) {
|
||||
const effectiveInstructions = resolveOpenAITtsInstructions(
|
||||
this.model,
|
||||
trimToUndefined(instructions) ?? this.instructions,
|
||||
);
|
||||
if (effectiveInstructions) {
|
||||
body.instructions = effectiveInstructions;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user