mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Track if intent was processed locally (#132166)
This commit is contained in:
parent
629c7a53ce
commit
49c40cd902
@ -1018,6 +1018,7 @@ class PipelineRun:
|
|||||||
"intent_input": intent_input,
|
"intent_input": intent_input,
|
||||||
"conversation_id": conversation_id,
|
"conversation_id": conversation_id,
|
||||||
"device_id": device_id,
|
"device_id": device_id,
|
||||||
|
"prefer_local_intents": self.pipeline.prefer_local_intents,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -1031,6 +1032,7 @@ class PipelineRun:
|
|||||||
language=self.pipeline.language,
|
language=self.pipeline.language,
|
||||||
agent_id=self.intent_agent,
|
agent_id=self.intent_agent,
|
||||||
)
|
)
|
||||||
|
processed_locally = self.intent_agent == conversation.HOME_ASSISTANT_AGENT
|
||||||
|
|
||||||
conversation_result: conversation.ConversationResult | None = None
|
conversation_result: conversation.ConversationResult | None = None
|
||||||
if user_input.agent_id != conversation.HOME_ASSISTANT_AGENT:
|
if user_input.agent_id != conversation.HOME_ASSISTANT_AGENT:
|
||||||
@ -1061,6 +1063,7 @@ class PipelineRun:
|
|||||||
response=intent_response,
|
response=intent_response,
|
||||||
conversation_id=user_input.conversation_id,
|
conversation_id=user_input.conversation_id,
|
||||||
)
|
)
|
||||||
|
processed_locally = True
|
||||||
|
|
||||||
if conversation_result is None:
|
if conversation_result is None:
|
||||||
# Fall back to pipeline conversation agent
|
# Fall back to pipeline conversation agent
|
||||||
@ -1085,7 +1088,10 @@ class PipelineRun:
|
|||||||
self.process_event(
|
self.process_event(
|
||||||
PipelineEvent(
|
PipelineEvent(
|
||||||
PipelineEventType.INTENT_END,
|
PipelineEventType.INTENT_END,
|
||||||
{"intent_output": conversation_result.as_dict()},
|
{
|
||||||
|
"processed_locally": processed_locally,
|
||||||
|
"intent_output": conversation_result.as_dict(),
|
||||||
|
},
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
||||||
}),
|
}),
|
||||||
@ -60,6 +61,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
||||||
}),
|
}),
|
||||||
@ -126,6 +128,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en-US',
|
'language': 'en-US',
|
||||||
|
'prefer_local_intents': False,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
||||||
}),
|
}),
|
||||||
@ -149,6 +152,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
||||||
}),
|
}),
|
||||||
@ -215,6 +219,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en-US',
|
'language': 'en-US',
|
||||||
|
'prefer_local_intents': False,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
||||||
}),
|
}),
|
||||||
@ -238,6 +243,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
||||||
}),
|
}),
|
||||||
@ -328,6 +334,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
'type': <PipelineEventType.INTENT_START: 'intent-start'>,
|
||||||
}),
|
}),
|
||||||
@ -351,6 +358,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
}),
|
}),
|
||||||
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
'type': <PipelineEventType.INTENT_END: 'intent-end'>,
|
||||||
}),
|
}),
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline.4
|
# name: test_audio_pipeline.4
|
||||||
@ -58,6 +59,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline.5
|
# name: test_audio_pipeline.5
|
||||||
@ -117,6 +119,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline_debug.4
|
# name: test_audio_pipeline_debug.4
|
||||||
@ -139,6 +142,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline_debug.5
|
# name: test_audio_pipeline_debug.5
|
||||||
@ -210,6 +214,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline_with_enhancements.4
|
# name: test_audio_pipeline_with_enhancements.4
|
||||||
@ -232,6 +237,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline_with_enhancements.5
|
# name: test_audio_pipeline_with_enhancements.5
|
||||||
@ -313,6 +319,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'test transcript',
|
'intent_input': 'test transcript',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline_with_wake_word_no_timeout.6
|
# name: test_audio_pipeline_with_wake_word_no_timeout.6
|
||||||
@ -335,6 +342,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_audio_pipeline_with_wake_word_no_timeout.7
|
# name: test_audio_pipeline_with_wake_word_no_timeout.7
|
||||||
@ -519,6 +527,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'Are the lights on?',
|
'intent_input': 'Are the lights on?',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_intent_failed.2
|
# name: test_intent_failed.2
|
||||||
@ -541,6 +550,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'Are the lights on?',
|
'intent_input': 'Are the lights on?',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_intent_timeout.2
|
# name: test_intent_timeout.2
|
||||||
@ -569,6 +579,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'never mind',
|
'intent_input': 'never mind',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_pipeline_empty_tts_output.2
|
# name: test_pipeline_empty_tts_output.2
|
||||||
@ -592,6 +603,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_pipeline_empty_tts_output.3
|
# name: test_pipeline_empty_tts_output.3
|
||||||
@ -680,6 +692,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'Are the lights on?',
|
'intent_input': 'Are the lights on?',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_text_only_pipeline[extra_msg0].2
|
# name: test_text_only_pipeline[extra_msg0].2
|
||||||
@ -702,6 +715,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_text_only_pipeline[extra_msg0].3
|
# name: test_text_only_pipeline[extra_msg0].3
|
||||||
@ -724,6 +738,7 @@
|
|||||||
'engine': 'conversation.home_assistant',
|
'engine': 'conversation.home_assistant',
|
||||||
'intent_input': 'Are the lights on?',
|
'intent_input': 'Are the lights on?',
|
||||||
'language': 'en',
|
'language': 'en',
|
||||||
|
'prefer_local_intents': False,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_text_only_pipeline[extra_msg1].2
|
# name: test_text_only_pipeline[extra_msg1].2
|
||||||
@ -746,6 +761,7 @@
|
|||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
|
'processed_locally': True,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_text_only_pipeline[extra_msg1].3
|
# name: test_text_only_pipeline[extra_msg1].3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user