Skip to content

Speak the demo date naturally to the voice agent - #1

Merged
davidtilser merged 2 commits into
mainfrom
spoken-date
Sep 19, 2026
Merged

davidtilser merged 2 commits into
mainfrom
spoken-date

Conversation

@yoocas

@yoocas yoocas commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

The date dynamic variable handed to ElevenLabs is the raw ISO string, so the agent reads it aloud as "two thousand twenty-six dash zero nine dash nineteen".

Change

Format it for speech in VoiceService.start(), where dynamicVariables(session.context) is built:

  • today, Saturday, September 19th when the date is today
  • tomorrow, Sunday, September 20th when it's tomorrow
  • Monday, September 21st otherwise

Today/tomorrow are computed in the session's timezone (call.business.timezone). Ordinal suffixes handle the 11th/12th/13th and 21st/22nd/23rd cases.

Only the date dynamic variable changes. session.context.date stays the ISO DEMO_DATE string, so the dashboard and demoTime() are untouched.

Notes

  • New helper lives in apps/api/src/refill/time.ts, self-contained with no new dependencies.
  • npm run check passes: typecheck, 10/10 tests, web build. No existing test asserted on dynamicVariables.date.

🤖 Generated with Claude Code

yoocas and others added 2 commits September 19, 2026 13:57
The `date` dynamic variable was the raw ISO string, so ElevenLabs read it
aloud as "2026-09-19". Format it as "today, Saturday, September 19th"
("tomorrow, ..." the next day, plain weekday and date after that), computed
in the session's timezone with correct ordinal suffixes.

Only the `date` dynamic variable changes. session.context.date stays the ISO
string, so the dashboard and demoTime are unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@davidtilser
davidtilser merged commit 2c6a5e2 into main Sep 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants