mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-15 07:04:01 -06:00
62bd760c0e
* style: apply SwiftFormat 0.62.1 rules Refs #103202 * ci: enforce deterministic Swift lint Refs #103202 * refactor: keep gateway connect lint-clean Refs #103202 * style: keep iOS typography checks warning-free * ci: route MLX Swift changes through pre-push * fix: preserve native i18n extraction after Swift cleanup * refactor: keep rebased Swift surfaces lint-clean * style: format latest Swift additions * chore: refresh native i18n inventory * style: keep generated Swift formatter-clean * fix: preserve node route invalidation callbacks * fix: keep native translation IDs stable * fix: retain native translation identifiers * fix: preserve translations across Swift source moves
28 lines
923 B
Swift
28 lines
923 B
Swift
public enum TalkPromptBuilder: Sendable {
|
|
public static func build(
|
|
transcript: String,
|
|
interruptedAtSeconds: Double?,
|
|
includeVoiceDirectiveHint: Bool = true) -> String
|
|
{
|
|
var lines: [String] = [
|
|
"Talk Mode active. Reply in a concise, spoken tone.",
|
|
]
|
|
|
|
if includeVoiceDirectiveHint {
|
|
let directiveHint =
|
|
"You may optionally prefix the response with JSON (first line) to set ElevenLabs voice " +
|
|
"(id or alias), e.g. {\"voice\":\"<id>\",\"once\":true}."
|
|
lines.append(directiveHint)
|
|
}
|
|
|
|
if let interruptedAtSeconds {
|
|
let formatted = String(format: "%.1f", interruptedAtSeconds)
|
|
lines.append("Assistant speech interrupted at \(formatted)s.")
|
|
}
|
|
|
|
lines.append("")
|
|
lines.append(transcript)
|
|
return lines.joined(separator: "\n")
|
|
}
|
|
}
|