mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 13:19:16 +00:00
Fix default states for the model selector
This commit is contained in:
@@ -282,7 +282,6 @@ export default function ChatHistory(props: ChatHistoryProps) {
|
||||
function constructAgentName() {
|
||||
if (!data || !data.agent || !data.agent?.name) return `Agent`;
|
||||
if (data.agent.is_hidden) return 'Khoj';
|
||||
console.log(data.agent);
|
||||
return data.agent?.name;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ function ChatSidebarInternal({ ...props }: ChatSideBarProps) {
|
||||
|
||||
function setupAgentData() {
|
||||
if (agentData) {
|
||||
setSelectedModel(agentData.chat_model);
|
||||
setInputTools(agentData.input_tools);
|
||||
if (agentData.input_tools === undefined || agentData.input_tools.length === 0) {
|
||||
setInputTools(agentConfigurationOptions?.input_tools ? Object.keys(agentConfigurationOptions.input_tools) : []);
|
||||
@@ -94,8 +93,11 @@ function ChatSidebarInternal({ ...props }: ChatSideBarProps) {
|
||||
|
||||
if (agentData.slug.toLowerCase() === "khoj") {
|
||||
setIsDefaultAgent(true);
|
||||
setSelectedModel(undefined);
|
||||
setCustomPrompt(undefined);
|
||||
} else {
|
||||
setCustomPrompt(agentData.persona);
|
||||
setSelectedModel(agentData.chat_model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user