mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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
|
| PipelineTTSStartEvent
|
||||||
| PipelineTTSEndEvent;
|
| PipelineTTSEndEvent;
|
||||||
|
|
||||||
export interface PipelineRunOptions {
|
export type PipelineRunOptions = (
|
||||||
start_stage: "stt" | "intent" | "tts";
|
| {
|
||||||
|
start_stage: "intent" | "tts";
|
||||||
|
input: { text: string };
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
start_stage: "stt";
|
||||||
|
input: { sample_rate: number };
|
||||||
|
}
|
||||||
|
) & {
|
||||||
end_stage: "stt" | "intent" | "tts";
|
end_stage: "stt" | "intent" | "tts";
|
||||||
language?: string;
|
language?: string;
|
||||||
pipeline?: string;
|
pipeline?: string;
|
||||||
input?: { text: string };
|
|
||||||
conversation_id?: string | null;
|
conversation_id?: string | null;
|
||||||
}
|
};
|
||||||
|
|
||||||
export interface PipelineRun {
|
export interface PipelineRun {
|
||||||
init_options: PipelineRunOptions;
|
init_options: PipelineRunOptions;
|
||||||
|
@ -255,6 +255,9 @@ export class AssistPipelineDebug extends LitElement {
|
|||||||
{
|
{
|
||||||
start_stage: "stt",
|
start_stage: "stt",
|
||||||
end_stage: "tts",
|
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 messages: Array<{ from: string; text: string }> = [];
|
||||||
|
|
||||||
const userMessage =
|
const userMessage =
|
||||||
this.pipelineRun.init_options.input?.text ||
|
("text" in this.pipelineRun.init_options.input
|
||||||
this.pipelineRun?.stt?.stt_output?.text;
|
? this.pipelineRun.init_options.input.text
|
||||||
|
: undefined) || this.pipelineRun?.stt?.stt_output?.text;
|
||||||
|
|
||||||
if (userMessage) {
|
if (userMessage) {
|
||||||
messages.push({
|
messages.push({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user