Skip to content

Commit

Permalink
Merge pull request #249 from n4ze3m/next
Browse files Browse the repository at this point in the history
v1.8.0
  • Loading branch information
n4ze3m committed Apr 22, 2024
2 parents b8db1a2 + 17cded4 commit 40ae6be
Show file tree
Hide file tree
Showing 53 changed files with 1,899 additions and 1,219 deletions.
2 changes: 1 addition & 1 deletion app/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "app",
"private": true,
"version": "1.7.9",
"version": "1.8.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
25 changes: 16 additions & 9 deletions app/ui/src/components/Bot/DS/DsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ export const DsTable = ({
message: "Data source deleted successfully",
});
},
onError: () => {
onError: (err: any) => {
notification.error({
message: "Error while deleting data source",
message:
err?.response?.data?.message ||
err?.response?.data?.error ||
"Error while deleting data source",
});
},
}
Expand All @@ -96,9 +99,12 @@ export const DsTable = ({
message: "Data source updated successfully",
});
},
onError: () => {
onError: (err: any) => {
notification.error({
message: "Error while updating data source",
message:
err?.response?.data?.message ||
err?.response?.data?.error ||
"Error while deleting data source",
});
},
}
Expand All @@ -109,7 +115,8 @@ export const DsTable = ({
<div className="sm:flex sm:items-center">
<div className="sm:flex-auto">
<h1 className="text-xl font-semibold text-gray-900 dark:text-white">
Data Sources</h1>
Data Sources
</h1>
<p className="mt-2 text-sm text-gray-700 dark:text-gray-400">
List of data sources that are currently being used by your bot.
</p>
Expand All @@ -125,9 +132,9 @@ export const DsTable = ({
</div>
</div>
<div className="mt-8 flex flex-col">
<div className="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="inline-block min-w-full py-2 align-middle md:px-6 lg:px-8">
<div className="overflow-hidden bg-white ring-1 ring-black ring-opacity-5 md:rounded-lg dark:bg-[#262626]">
<div className="-my-2 -mx-4 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="inline-block min-w-full p-2 align-middle md:px-6 lg:px-8">
<div className="overflow-hidden bg-white ring-1 ring-black ring-opacity-5 rounded-lg dark:bg-[#262626]">
{data.length === 0 && (
<Empty description="No data sources found." className="m-8" />
)}
Expand Down Expand Up @@ -163,7 +170,7 @@ export const DsTable = ({
</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-200 bg-white dark:bg-[#1e1e1e] dark:divide-gray-800">
<tbody className="divide-y divide-gray-200 bg-white dark:bg-[#1e1e1e] dark:divide-gray-800">
{data.map((source) => (
<tr key={source.id}>
<td className="whitespace-nowrap py-4 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6">
Expand Down
9 changes: 6 additions & 3 deletions app/ui/src/components/Common/BotForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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}
/>
</Form.Item>
Expand Down Expand Up @@ -675,6 +677,7 @@ export const BotForm = ({
.localeCompare((optionB?.label ?? "").toLowerCase())
}
options={botConfig.embeddingModel}
placeholder="Select an Embedding Model"
/>
</Form.Item>

Expand Down
24 changes: 24 additions & 0 deletions app/ui/src/components/Settings/Application/ApplicationCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export const ApplicationCard = ({
children,
description,
title,
}: {
children: React.ReactNode;
title: string;
description: string;
}) => {
return (
<div>
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{title}
</h2>
<p className="mt-1 text-sm leading-6 text-gray-500 dark:text-gray-200">
{description}
</p>

<dl className="mt-6 space-y-6 divide-y divide-gray-100 border-gray-200 text-sm leading-6 dark:text-gray-200">
<div className="mt-5 md:col-span-2 md:mt-0">{children}</div>
</dl>
</div>
);
};
2 changes: 2 additions & 0 deletions app/ui/src/hooks/useCreateConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const useCreateConfig = () => {
label: string;
value: string;
}[];
defaultChatModel?: string;
defaultEmbeddingModel?: string;
};
}
);
Expand Down
1 change: 0 additions & 1 deletion app/ui/src/hooks/useMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ export const useMessage = () => {
setHistory(responseData.history);
setMessages(newMessage);
setIsProcessing(false);
reader.releaseLock();
break;
}
}
Expand Down

0 comments on commit 40ae6be

Please sign in to comment.