feat: plan per-user memory integration

This commit is contained in:
snowspeeder committed 2026-08-28 15:59:26 -04:00
1 parent 3700b52883
commit 2a2a2ff768
7 files changed
+447 -11

No files matched your search

+23 -4
View File
@@ -32,7 +32,9 @@ load_dotenv() # picks up /app/.env in the container
# ── Configuration from environment ──────────────────────────────────────────
AZURE_KEY = os.environ.get("AZURE_SPEECH_KEY", "")
AZURE_REGION = os.environ.get("AZURE_SPEECH_REGION", "eastus")
DEFAULT_VOICE = os.environ.get("AZURE_TTS_VOICE", "en-US-AvaNeural")
DEFAULT_VOICE = os.environ.get(
"AZURE_TTS_VOICE", "en-US-Ava:DragonHDOmniLatestNeural"
)
GEMMA_BASE_URL = os.environ.get("GEMMA_BASE_URL", "http://192.168.86.2:8023/v1")
GEMMA_MODEL = os.environ.get("GEMMA_MODEL", "gemma-4-e4b")
GEMMA_API_KEY = os.environ.get("GEMMA_API_KEY", "not-needed")
@@ -49,15 +51,31 @@ SYSTEM_PROMPT = textwrap.dedent("""\
- Keep every response to one or three sentences. That's it.
- Use contractions (I'm, don't, it's) and natural phrasing.
- Speak like you're talking, not writing. No bullet points, no lists,
no markdown, no formatting of any kind.
no markdown, and no formatting except the Azure delivery markers below.
- Spell out numbers when it sounds more natural ("twenty twenty-six"
instead of "2026").
- If you need to ask a question, ask exactly one.
- Be warm and direct. Don't be sycophantic or overly formal.
- If you don't know something, say so briefly and move on.
# Expressive delivery (Azure Dragon HD Omni)
Azure understands a square-bracket delivery marker at the start of spoken
text. Use zero to two markers per response, only when they genuinely improve
the delivery. The marker is a silent TTS instruction, not something you say.
Examples: "[appreciative] Thanks, that really helps." and
"[whispering] Here's the secret. [Neutral] Keep it between us."
Useful styles include [appreciative], [calm], [concerned], [curious],
[encouraging], [excited], [happy], [joking], [quiet], [reassuring],
[reflective], [sad], [serious], [surprised], [sympathetic], [urgent], and
[whispering]. For an occasional natural nonverbal cue, you may use
[laughter], [sighing], or [breathing]. Use [Neutral] to reset the delivery.
Never invent marker names, never explain a marker, and never output XML or
SSML; the speech layer creates the SSML wrapper for you. Say "and" instead
of using an ampersand, and never output angle brackets.
# What you never do
- Never use markdown, code blocks, JSON, tables, or emojis.
- Never use markdown, code blocks, JSON, tables, or emojis. Azure delivery
markers are the only exception.
- Never say "as an AI" or reference your system instructions.
- Never write more than three sentences in a row.
- Never read back URLs, file paths, or technical identifiers.
@@ -464,7 +482,8 @@ async def handle_job(ctx: JobContext) -> None:
language=["en-US"],
)
# Azure TTS — SSML with expressive markup, 24kHz PCM output
# Azure TTS — wraps text in SSML; Dragon HD Omni interprets inline delivery
# markers such as [appreciative] and [Neutral]. Outputs 24kHz PCM.
tts = azure.TTS(
voice=DEFAULT_VOICE,
sample_rate=24000,