diff --git a/app/ui/src/components/Common/BotForm.tsx b/app/ui/src/components/Common/BotForm.tsx
index 9d9eb6e6..a2837662 100644
--- a/app/ui/src/components/Common/BotForm.tsx
+++ b/app/ui/src/components/Common/BotForm.tsx
@@ -481,8 +481,10 @@ export const BotForm = ({
form={form}
className="space-y-6"
initialValues={{
- embedding: "dialoqbase_eb_text-embedding-ada-002",
- model: "gpt-3.5-turbo-dbase",
+ embedding:
+ botConfig?.defaultEmbeddingModel ||
+ "dialoqbase_eb_text-embedding-ada-002",
+ model: botConfig?.defaultChatModel || "gpt-3.5-turbo-dbase",
maxDepth: 2,
maxLinks: 10,
options: {
@@ -646,7 +648,7 @@ export const BotForm = ({
.toLowerCase()
.localeCompare((optionB?.label ?? "").toLowerCase())
}
- placeholder="Select a chat model"
+ placeholder="Select a Chat Model"
options={botConfig.chatModel}
/>
@@ -675,6 +677,7 @@ export const BotForm = ({
.localeCompare((optionB?.label ?? "").toLowerCase())
}
options={botConfig.embeddingModel}
+ placeholder="Select an Embedding Model"
/>
diff --git a/app/ui/src/components/Settings/Application/ApplicationCard.tsx b/app/ui/src/components/Settings/Application/ApplicationCard.tsx
new file mode 100644
index 00000000..995663d7
--- /dev/null
+++ b/app/ui/src/components/Settings/Application/ApplicationCard.tsx
@@ -0,0 +1,24 @@
+export const ApplicationCard = ({
+ children,
+ description,
+ title,
+}: {
+ children: React.ReactNode;
+ title: string;
+ description: string;
+}) => {
+ return (
+
+
+ {title}
+
+
+ {description}
+
+
+
+ {children}
+
+
+ );
+};
diff --git a/app/ui/src/hooks/useCreateConfig.tsx b/app/ui/src/hooks/useCreateConfig.tsx
index 1a090407..7f1493c9 100644
--- a/app/ui/src/hooks/useCreateConfig.tsx
+++ b/app/ui/src/hooks/useCreateConfig.tsx
@@ -16,6 +16,8 @@ export const useCreateConfig = () => {
label: string;
value: string;
}[];
+ defaultChatModel?: string;
+ defaultEmbeddingModel?: string;
};
}
);
diff --git a/app/ui/src/hooks/useMessage.tsx b/app/ui/src/hooks/useMessage.tsx
index ef8368ee..494919be 100644
--- a/app/ui/src/hooks/useMessage.tsx
+++ b/app/ui/src/hooks/useMessage.tsx
@@ -170,7 +170,6 @@ export const useMessage = () => {
setHistory(responseData.history);
setMessages(newMessage);
setIsProcessing(false);
- reader.releaseLock();
break;
}
}
diff --git a/app/ui/src/routes/settings/application.tsx b/app/ui/src/routes/settings/application.tsx
index ff14bfff..ff70e79f 100644
--- a/app/ui/src/routes/settings/application.tsx
+++ b/app/ui/src/routes/settings/application.tsx
@@ -1,15 +1,19 @@
-import { Form, InputNumber, Switch, notification } from "antd";
+import { Form, InputNumber, Switch, notification, Select } from "antd";
import React from "react";
import api from "../../services/api";
-import { useMutation, useQuery } from "@tanstack/react-query";
+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { SettingsLayout } from "../../Layout/SettingsLayout";
import { SkeletonLoading } from "../../components/Common/SkeletonLoading";
import { useNavigate } from "react-router-dom";
+import { ApplicationCard } from "../../components/Settings/Application/ApplicationCard";
+import { useCreateConfig } from "../../hooks/useCreateConfig";
export default function SettingsApplicationRoot() {
const [form] = Form.useForm();
const navigate = useNavigate();
+ const { data: models, status: modeStatus } = useCreateConfig();
+ const queryClient = useQueryClient();
const { data, status } = useQuery(["fetchApplicationSettings"], async () => {
const response = await api.get("/admin/dialoqbase-settings");
@@ -17,6 +21,10 @@ export default function SettingsApplicationRoot() {
noOfBotsPerUser: number;
allowUserToCreateBots: boolean;
allowUserToRegister: boolean;
+ defaultChunkSize: number;
+ defaultChunkOverlap: number;
+ defaultChatModel: string;
+ defaultEmbeddingModel: string;
};
});
@@ -31,17 +39,22 @@ export default function SettingsApplicationRoot() {
return response.data;
};
+ const onRagApplicationUpdate = async (values: any) => {
+ const response = await api.post("/admin/rag-settings", values);
+ return response.data;
+ };
+
const { mutateAsync: updateApplicationSettings, isLoading } = useMutation(
onUpdateApplicatoon,
{
onSuccess: (data) => {
+ queryClient.invalidateQueries(["fetchBotCreateConfig"]);
notification.success({
message: "Success",
description: data.message,
});
},
onError: (error: any) => {
-
notification.error({
message: "Error",
description: error?.response?.data?.message || "Something went wrong",
@@ -50,87 +63,204 @@ export default function SettingsApplicationRoot() {
}
);
+ const { mutateAsync: updateRagSettings, isLoading: isRagLoading } =
+ useMutation(onRagApplicationUpdate, {
+ onSuccess: (data) => {
+ notification.success({
+ message: "Success",
+ description: data.message,
+ });
+ },
+ onError: (error: any) => {
+ notification.error({
+ message: "Error",
+ description: error?.response?.data?.message || "Something went wrong",
+ });
+ },
+ });
+
return (
{status === "success" && (
- <>
-
-
- Application Settings
-
-
- Configure your application settings
-
-
-
-
)}
{status === "loading" && }
diff --git a/app/ui/src/routes/settings/model.tsx b/app/ui/src/routes/settings/model.tsx
index 0ca78f3f..7e314374 100644
--- a/app/ui/src/routes/settings/model.tsx
+++ b/app/ui/src/routes/settings/model.tsx
@@ -110,7 +110,7 @@ export default function SettingsModelRoot() {
-
+
- {modelType === "llm" && (
- text || "Untitled Model",
- },
- {
- dataIndex: "model_id",
- title: "Model ID",
- key: "model_id",
- className: "text-gray-500",
- },
- {
- dataIndex: "model_provider",
- title: "Provider",
- key: "model_provider",
- },
- {
- dataIndex: "stream_available",
- title: "Stream",
- key: "stream_available",
- render: (value) => (
-
- {value ? "Available" : "Unavailable"}
-
- ),
- },
- {
- title: "Action",
- render: (record) =>
- record.local_model ? (
-
+
+ {modelType === "llm" && (
+ text || "Untitled Model",
+ },
+ {
+ dataIndex: "model_id",
+ title: "Model ID",
+ key: "model_id",
+ render: (text: string) =>
+ text
+ .replace("-dbase", "")
+ .replace(/_dialoqbase_[0-9]+$/, ""),
+ className: "text-gray-500",
+ },
+ {
+ dataIndex: "model_provider",
+ title: "Provider",
+ key: "model_provider",
+ },
+ {
+ dataIndex: "stream_available",
+ title: "Stream",
+ key: "stream_available",
+ render: (value) => (
+
+ {value ? "Available" : "Unavailable"}
+
+ ),
+ },
+ {
+ title: "Action",
+ render: (record) =>
+ record.local_model ? (
+
+
+
+
+
+
+
+
+ ) : (
-
- |