diff --git a/src/interface/web/app/components/modelPicker/modelPicker.tsx b/src/interface/web/app/components/modelPicker/modelPicker.tsx index 3691cf6a..40854d93 100644 --- a/src/interface/web/app/components/modelPicker/modelPicker.tsx +++ b/src/interface/web/app/components/modelPicker/modelPicker.tsx @@ -68,8 +68,8 @@ interface ModelPickerProps { } export const ModelPicker: React.FC = (props: ModelPickerProps) => { - const { data: models } = useOptionsRequest('/api/config/data/conversation/model/options'); - const { data: selectedModel } = useSelectedModel('/api/config/data/conversation/model'); + const { data: models } = useOptionsRequest('/api/config/chat/model/options'); + const { data: selectedModel } = useSelectedModel('/api/config/chat/model'); const [openLoginDialog, setOpenLoginDialog] = React.useState(false); let userData = useAuthenticatedData(); @@ -94,7 +94,7 @@ export const ModelPicker: React.FC = (props: ModelPickerProps) => { props.setModelUsed(model); } - fetch('/api/config/data/conversation/model' + '?id=' + String(model.id), { method: 'POST', body: JSON.stringify(model) }) + fetch('/api/config/chat/model' + '?id=' + String(model.id), { method: 'POST', body: JSON.stringify(model) }) .then((response) => { if (!response.ok) { throw new Error('Failed to select model'); diff --git a/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx b/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx index ced5c4e4..7232089f 100644 --- a/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx +++ b/src/interface/web/app/components/sidePanel/chatHistorySidePanel.tsx @@ -148,7 +148,7 @@ interface FilesMenuProps { function FilesMenu(props: FilesMenuProps) { // Use SWR to fetch files - const { data: files, error } = useSWR(props.conversationId ? '/api/config/data/computer' : null, fetcher); + const { data: files, error } = useSWR(props.conversationId ? '/api/config/content/computer' : null, fetcher); const { data: selectedFiles, error: selectedFilesError } = useSWR(props.conversationId ? `/api/chat/conversation/file-filters/${props.conversationId}` : null, fetcher); const [isOpen, setIsOpen] = useState(false); const [unfilteredFiles, setUnfilteredFiles] = useState([]); diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html index ad8ced27..7a819633 100644 --- a/src/khoj/interface/web/chat.html +++ b/src/khoj/interface/web/chat.html @@ -1954,7 +1954,7 @@ To get started, just start typing below. You can also type / to see a list of co } var allFiles; function renderAllFiles() { - fetch('/api/config/data/computer') + fetch('/api/config/content/computer') .then(response => response.json()) .then(data => { var indexedFiles = document.getElementsByClassName("indexed-files")[0]; diff --git a/src/khoj/interface/web/config.html b/src/khoj/interface/web/config.html index be47660f..b21fa3ac 100644 --- a/src/khoj/interface/web/config.html +++ b/src/khoj/interface/web/config.html @@ -421,7 +421,7 @@ saveVoiceModelButton.disabled = true; saveVoiceModelButton.textContent = "Saving..."; - fetch('/api/config/data/voice/model?id=' + voiceModel, { + fetch('/api/config/voice/model?id=' + voiceModel, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -455,7 +455,7 @@ saveModelButton.innerHTML = ""; saveModelButton.textContent = "Saving..."; - fetch('/api/config/data/conversation/model?id=' + chatModel, { + fetch('/api/config/chat/model?id=' + chatModel, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -494,7 +494,7 @@ saveSearchModelButton.disabled = true; saveSearchModelButton.textContent = "Saving..."; - fetch('/api/config/data/search/model?id=' + searchModel, { + fetch('/api/config/search/model?id=' + searchModel, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -526,7 +526,7 @@ saveModelButton.disabled = true; saveModelButton.innerHTML = "Saving..."; - fetch('/api/config/data/paint/model?id=' + paintModel, { + fetch('/api/config/paint/model?id=' + paintModel, { method: 'POST', headers: { 'Content-Type': 'application/json', @@ -553,7 +553,7 @@ }; function clearContentType(content_source) { - fetch('/api/config/data/content-source/' + content_source, { + fetch('/api/config/content/' + content_source, { method: 'DELETE', headers: { 'Content-Type': 'application/json', @@ -676,7 +676,7 @@ content_sources = ["computer", "github", "notion"]; content_sources.forEach(content_source => { - fetch(`/api/config/data/${content_source}`, { + fetch(`/api/config/content/${content_source}`, { method: 'GET', headers: { 'Content-Type': 'application/json', @@ -807,7 +807,7 @@ function getIndexedDataSize() { document.getElementById("indexed-data-size").textContent = "Calculating..."; - fetch('/api/config/index/size') + fetch('/api/config/content/size') .then(response => response.json()) .then(data => { document.getElementById("indexed-data-size").textContent = data.indexed_data_size_in_mb + " MB used"; @@ -815,7 +815,7 @@ } function removeFile(path) { - fetch('/api/config/data/file?filename=' + path, { + fetch('/api/config/content/file?filename=' + path, { method: 'DELETE', headers: { 'Content-Type': 'application/json', diff --git a/src/khoj/interface/web/content_source_computer_input.html b/src/khoj/interface/web/content_source_computer_input.html index ac3209c3..f9b02d57 100644 --- a/src/khoj/interface/web/content_source_computer_input.html +++ b/src/khoj/interface/web/content_source_computer_input.html @@ -32,7 +32,7 @@