@absolutejs/voice 0.0.22-beta.540 → 0.0.22-beta.541

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -737,7 +737,7 @@ export type VoiceSurfaceConfig<O> = false | O | (Record<string, never> extends O
737
737
  export type VoicePluginConfig<TContext = unknown, TSession extends VoiceSessionRecord = VoiceSessionRecord, TResult = unknown> = {
738
738
  costTelemetry?: VoiceCostTelemetryConfig<TContext, TSession, TResult>;
739
739
  path: string;
740
- greeting?: string;
740
+ greeting?: string | (() => string | Promise<string>);
741
741
  languageStrategy?: VoiceLanguageStrategy;
742
742
  lexicon?: VoiceLexiconEntry[] | VoiceLexiconResolver<TContext>;
743
743
  phraseHints?: VoicePhraseHint[] | VoicePhraseHintResolver<TContext>;
@@ -851,7 +851,7 @@ export type CreateVoiceSessionOptions<TContext = unknown, TSession extends Voice
851
851
  id: string;
852
852
  context: TContext;
853
853
  socket: VoiceSocket;
854
- greeting?: string;
854
+ greeting?: string | (() => string | Promise<string>);
855
855
  stt?: STTAdapter;
856
856
  realtime?: RealtimeAdapter;
857
857
  realtimeInputFormat?: AudioFormat;
package/dist/index.js CHANGED
@@ -5577,7 +5577,7 @@ var createVoiceSession = (options) => {
5577
5577
  kickCallSilenceWatchdog();
5578
5578
  startAmdEvaluationTimer();
5579
5579
  if (shouldFireOnSession && options.greeting && session.turns.length === 0) {
5580
- const greetingText = options.greeting;
5580
+ const greetingText = typeof options.greeting === "function" ? await options.greeting() : options.greeting;
5581
5581
  const greetingTurnId = createId();
5582
5582
  await send({
5583
5583
  text: greetingText,
@@ -7439,7 +7439,7 @@ var createVoiceSession = (options) => {
7439
7439
  kickCallSilenceWatchdog();
7440
7440
  startAmdEvaluationTimer();
7441
7441
  if (shouldFireOnSession && options.greeting && session.turns.length === 0) {
7442
- const greetingText = options.greeting;
7442
+ const greetingText = typeof options.greeting === "function" ? await options.greeting() : options.greeting;
7443
7443
  const greetingTurnId = createId();
7444
7444
  await send({
7445
7445
  text: greetingText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/voice",
3
- "version": "0.0.22-beta.540",
3
+ "version": "0.0.22-beta.541",
4
4
  "description": "Voice primitives and Elysia plugin for AbsoluteJS",
5
5
  "repository": {
6
6
  "type": "git",