#Jinja snippet to determine which voice preview speaker is being invoked by the user?

1 messages · Page 1 of 1 (latest)

torpid hatch
#

Hello, all. I'm running Extended OpenAI Conversation, and I'm trying to figure out how to pass which voice preview speaker the user is speaking through.

Ideally, I'd want something that I can put in the jinja2 system prompt that outputs Current Speaker: Living Room Voice Preview Speaker, but I can't figure it out after pouring over documentation. Thanks for any assistance.

hoary laurel
torpid hatch
hoary laurel
#

AFAIK it should be in the context that HA is sending to the model. At least for default integration it's there. Pipeline knows what is the device, and which area it's in.
I'm aware that Extended integration has hand-written prompt. So it's matter of this integration to provide the device area for prompt.

torpid hatch
hoary laurel
#

Nice! So it's there, just wasn't included into the prompt!

torpid hatch
#
{%- for entity_id in device_entities(current_device_id) if entity_id.startswith('assist_satellite.') %}
The request is being made through speaker: {{entity_id}} located in the {{area_name(area_id(entity_id))}}.
{%- endfor %}

Which outputs: The request is being made through speaker: assist_satellite.computer_room_voice_preview_assist_satellite located in the Computer Room.

#

Well, the device_id is some long string of letters/numbers, but can be looked up as entities, which is what the spaghetti code above does.