fix(workflow): prevent fixed speech continuation
This commit is contained in:
@@ -12,6 +12,20 @@ from services.brains.base import BrainRuntime
|
||||
from services.runtime_variables import DynamicVariableStore
|
||||
|
||||
|
||||
FIXED_SPEECH_CONTEXT_MARKER = "[会话事实:以下固定消息已向用户播报]"
|
||||
|
||||
|
||||
def fixed_speech_context_message(content: str) -> dict[str, str] | None:
|
||||
"""Keep deterministic speech in context without inviting assistant continuation."""
|
||||
text = content.strip()
|
||||
if not text:
|
||||
return None
|
||||
return {
|
||||
"role": "system",
|
||||
"content": f"{FIXED_SPEECH_CONTEXT_MARKER}\n{text}",
|
||||
}
|
||||
|
||||
|
||||
class FixedSpeechOutput:
|
||||
"""Display and synthesize fixed speech without waiting for playback."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user