mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add sample rate to assist pipeline debug (#16135)
This commit is contained in:
parent
a1180b7118
commit
b076301513
@ -84,14 +84,21 @@ type PipelineRunEvent =
|
||||
| PipelineTTSStartEvent
|
||||
| PipelineTTSEndEvent;
|
||||
|
||||
export interface PipelineRunOptions {
|
||||
start_stage: "stt" | "intent" | "tts";
|
||||
export type PipelineRunOptions = (
|
||||
| {
|
||||
start_stage: "intent" | "tts";
|
||||
input: { text: string };
|
||||
}
|
||||
| {
|
||||
start_stage: "stt";
|
||||
input: { sample_rate: number };
|
||||
}
|
||||
) & {
|
||||
end_stage: "stt" | "intent" | "tts";
|
||||
language?: string;
|
||||
pipeline?: string;
|
||||
input?: { text: string };
|
||||
conversation_id?: string | null;
|
||||
}
|
||||
};
|
||||
|
||||
export interface PipelineRun {
|
||||
init_options: PipelineRunOptions;
|
||||
|
@ -255,6 +255,9 @@ export class AssistPipelineDebug extends LitElement {
|
||||
{
|
||||
start_stage: "stt",
|
||||
end_stage: "tts",
|
||||
input: {
|
||||
sample_rate: context.sampleRate,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -135,8 +135,9 @@ export class AssistPipelineDebug extends LitElement {
|
||||
const messages: Array<{ from: string; text: string }> = [];
|
||||
|
||||
const userMessage =
|
||||
this.pipelineRun.init_options.input?.text ||
|
||||
this.pipelineRun?.stt?.stt_output?.text;
|
||||
("text" in this.pipelineRun.init_options.input
|
||||
? this.pipelineRun.init_options.input.text
|
||||
: undefined) || this.pipelineRun?.stt?.stt_output?.text;
|
||||
|
||||
if (userMessage) {
|
||||
messages.push({
|
||||
|
Loading…
x
Reference in New Issue
Block a user