Bug fixed
This commit is contained in:
@@ -1018,6 +1018,16 @@ async def entrypoint(ctx: JobContext, avatar_dispatcher_url: str = None, vision_
|
||||
initial_instructions = participant.attributes.get("instructions")
|
||||
logger.info(f"User selected instructions: {initial_instructions}")
|
||||
|
||||
# Read talking_mode from frontend state
|
||||
initial_talking_mode = DEFAULT_TALKING_MODE
|
||||
if participant.attributes.get("talking_mode"):
|
||||
frontend_talking_mode = participant.attributes.get("talking_mode")
|
||||
if frontend_talking_mode in ["push_to_talk", "realtime"]:
|
||||
initial_talking_mode = frontend_talking_mode
|
||||
logger.info(f"Initializing talking_mode from frontend: {initial_talking_mode}")
|
||||
else:
|
||||
logger.warning(f"Invalid talking_mode from frontend: {frontend_talking_mode}, using default: {initial_talking_mode}")
|
||||
|
||||
# Replace the datetime and weekday placeholders to avoid KeyError from other braces in the prompt
|
||||
initial_instructions = initial_instructions.replace("{datetime}", current_time)
|
||||
initial_instructions = initial_instructions.replace("{weekday}", current_weekday)
|
||||
@@ -1128,7 +1138,7 @@ async def entrypoint(ctx: JobContext, avatar_dispatcher_url: str = None, vision_
|
||||
)
|
||||
|
||||
# disable input audio at the start
|
||||
_talking_mode = DEFAULT_TALKING_MODE
|
||||
_talking_mode = initial_talking_mode
|
||||
if _talking_mode == "push_to_talk":
|
||||
session.input.set_audio_enabled(False)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user