Fix default states for the model selector

This commit is contained in:
sabaimran
2025-01-20 10:18:09 -08:00
parent 98baa93a31
commit d7800812ad
4 changed files with 11 additions and 5 deletions

View File

@@ -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);
}
}
}