mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Remove attribution from Assist dialog (#17038)
This commit is contained in:
parent
d169ff6a96
commit
d656269d75
@ -52,10 +52,6 @@ export interface ConversationResult {
|
|||||||
| IntentResultError;
|
| IntentResultError;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AgentInfo {
|
|
||||||
attribution?: { name: string; url: string };
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Agent {
|
export interface Agent {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@ -87,15 +83,6 @@ export const listAgents = (
|
|||||||
country,
|
country,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const getAgentInfo = (
|
|
||||||
hass: HomeAssistant,
|
|
||||||
agent_id?: string
|
|
||||||
): Promise<AgentInfo> =>
|
|
||||||
hass.callWS({
|
|
||||||
type: "conversation/agent/info",
|
|
||||||
agent_id,
|
|
||||||
});
|
|
||||||
|
|
||||||
export const prepareConversation = (
|
export const prepareConversation = (
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
language?: string
|
language?: string
|
||||||
|
@ -35,7 +35,6 @@ import {
|
|||||||
listAssistPipelines,
|
listAssistPipelines,
|
||||||
runAssistPipeline,
|
runAssistPipeline,
|
||||||
} from "../../data/assist_pipeline";
|
} from "../../data/assist_pipeline";
|
||||||
import { AgentInfo, getAgentInfo } from "../../data/conversation";
|
|
||||||
import { haStyleDialog } from "../../resources/styles";
|
import { haStyleDialog } from "../../resources/styles";
|
||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import { AudioRecorder } from "../../util/audio-recorder";
|
import { AudioRecorder } from "../../util/audio-recorder";
|
||||||
@ -66,8 +65,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
|
|
||||||
@state() private _pipeline?: AssistPipeline;
|
@state() private _pipeline?: AssistPipeline;
|
||||||
|
|
||||||
@state() private _agentInfo?: AgentInfo;
|
|
||||||
|
|
||||||
@state() private _showSendButton = false;
|
@state() private _showSendButton = false;
|
||||||
|
|
||||||
@state() private _pipelines?: AssistPipeline[];
|
@state() private _pipelines?: AssistPipeline[];
|
||||||
@ -115,7 +112,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
this._opened = false;
|
this._opened = false;
|
||||||
this._pipeline = undefined;
|
this._pipeline = undefined;
|
||||||
this._pipelines = undefined;
|
this._pipelines = undefined;
|
||||||
this._agentInfo = undefined;
|
|
||||||
this._conversation = undefined;
|
this._conversation = undefined;
|
||||||
this._conversationId = null;
|
this._conversationId = null;
|
||||||
this._audioRecorder?.close();
|
this._audioRecorder?.close();
|
||||||
@ -265,17 +261,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
`}
|
`}
|
||||||
</span>
|
</span>
|
||||||
</ha-textfield>
|
</ha-textfield>
|
||||||
${this._agentInfo && this._agentInfo.attribution
|
|
||||||
? html`
|
|
||||||
<a
|
|
||||||
href=${this._agentInfo.attribution.url}
|
|
||||||
class="attribution"
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer"
|
|
||||||
>${this._agentInfo.attribution.name}</a
|
|
||||||
>
|
|
||||||
`
|
|
||||||
: ""}
|
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
`;
|
`;
|
||||||
@ -298,12 +283,7 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
if (e.code === "not_found") {
|
if (e.code === "not_found") {
|
||||||
this._pipelineId = undefined;
|
this._pipelineId = undefined;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this._agentInfo = await getAgentInfo(
|
|
||||||
this.hass,
|
|
||||||
this._pipeline.conversation_engine
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _loadPipelines() {
|
private async _loadPipelines() {
|
||||||
@ -728,12 +708,6 @@ export class HaVoiceCommandDialog extends LitElement {
|
|||||||
flex: 1 0;
|
flex: 1 0;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
}
|
}
|
||||||
.attribution {
|
|
||||||
display: block;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
padding-top: 4px;
|
|
||||||
margin-bottom: -8px;
|
|
||||||
}
|
|
||||||
.messages {
|
.messages {
|
||||||
display: block;
|
display: block;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user