Closed kamilk91 closed 9 months ago
I'm quite not sure if I can distinguish whether the request is from service call or assist pipeline.
If it's possible to distinguish and okay to hard code, creating an input_text
and storing id in there might be one way.
You can save and modify input_text
whenever you want, and let conversation use state of input_text
as conversation_id
.
async def async_process(
self, user_input: conversation.ConversationInput
) -> conversation.ConversationResult:
if is_from_service_call(): # I don't know if it's possible to distinguish
conversation_id = self.hass.states.get("input_text.xxxx").state
else:
conversation_id = ulid.ulid()
However, if you don't need it right away, then pray for https://github.com/home-assistant/core/pull/106078 to be merged soon.
Looks like it just got merged!
Thank you, you are helpful as always @jekalmin!
Hi.
Since conversation process service has no option to provide very important
conversation_id
which is ULID format (probably?) i wanted to do something to allow do that by HASS variable, or another way.My plan is to specify where current
conversation_id
is stored and define events to recreate this id (like time pattern, or message count patter, whatever).I wanted to make try with constant variable in Python, in your code @jekalmin
I modified
__init__.py
but to be honest it is a little bit confusing for me.But it produces exception:
invalid agent ID for dictionary value @ data['agent_id']
Do you have any ideas where exactly should i start ? Which place will be best to pass this Id without making new problems?