Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions template/src/ai-agent/components/CustomSettingsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,33 @@ const AdvancedSettings = () => {
);
};

const ASRSettings = () => {
const {agentId} = useContext(AgentContext);
const {
data: {agents},
} = useRoomInfo();

// Get the selected agent and check if ASR vendor is "ares"
const selectedAgent = agents?.find(a => a.id === agentId);
const isAresASR = selectedAgent?.asr?.vendor === 'ares';

// Only render ASR settings if the agent uses "ares" as ASR vendor
if (!isAresASR) {
return null;
}

return (
<>
<SelectUserLanguage />
<Spacer size={16} />
<AdvancedSettings />
</>
);
};

const CustomSettingsPanel = () => {
const isAgentAvailable = useIsAgentAvailable();

return (
<View style={styles.container}>
<ScrollView style={styles.contentContainer}>
Expand All @@ -174,9 +199,7 @@ const CustomSettingsPanel = () => {
<Spacer size={16} />
<UserPrompt />
<Spacer size={16} />
<SelectUserLanguage />
<Spacer size={16} />
<AdvancedSettings />
<ASRSettings />
</>
) : (
<></>
Expand Down
4 changes: 4 additions & 0 deletions template/src/components/room-info/useRoomInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export interface AIAgentInterface {
region: string;
};
};
asr: {
vendor: string;
params: Record<string, any>;
};
}

export interface RoomInfoContextInterface {
Expand Down