From 3c582d1d599cf69a998e351f161c0fbc359ec463 Mon Sep 17 00:00:00 2001 From: Renee <121910637+Ssstars@users.noreply.github.com> Date: Fri, 5 Jan 2024 08:00:42 +0800 Subject: [PATCH 1/8] Update about.md Changed roadmap hyperlink --- docs/docs/about/about.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/about/about.md b/docs/docs/about/about.md index 4e55e0744c..cfd82bb53a 100644 --- a/docs/docs/about/about.md +++ b/docs/docs/about/about.md @@ -64,7 +64,7 @@ Jan is a startup with an open source business model. We believe in the need for We use Github to build in public, and welcome anyone to join in. - [Jan's Kanban](https://github.com/orgs/janhq/projects/5) -- [Jan's Roadmap](https://github.com/orgs/janhq/projects/5/views/2) +- [Jan's Roadmap](https://github.com/orgs/janhq/projects/5/views/29) ### Bootstrapped @@ -90,4 +90,4 @@ Drop us a message in our [Discord](https://discord.gg/af6SaTdzpx) and we'll get Jan has a culture of ownership, independent thought, and lightning fast execution. If you'd like to join us, we have open positions on our [careers page](https://janai.bamboohr.com/careers). -## Footnotes \ No newline at end of file +## Footnotes From 51f8d011fbfe9d785cc3657bac7146114ba31256 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Thu, 4 Jan 2024 21:48:03 +0700 Subject: [PATCH 2/8] fix stop streaming when user delete or clean thread --- web/screens/Chat/ThreadList/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web/screens/Chat/ThreadList/index.tsx b/web/screens/Chat/ThreadList/index.tsx index 516bfb6c43..d82951a3fc 100644 --- a/web/screens/Chat/ThreadList/index.tsx +++ b/web/screens/Chat/ThreadList/index.tsx @@ -1,5 +1,6 @@ import { useEffect } from 'react' +import { MessageStatus } from '@janhq/core' import { Modal, ModalTrigger, @@ -33,6 +34,7 @@ import useThreads from '@/hooks/useThreads' import { displayDate } from '@/utils/datetime' +import { getCurrentChatMessagesAtom } from '@/helpers/atoms/ChatMessage.atom' import { activeThreadAtom, threadStatesAtom, @@ -48,6 +50,7 @@ export default function ThreadList() { const activeThread = useAtomValue(activeThreadAtom) const { deleteThread, cleanThread } = useDeleteThread() const { downloadedModels } = useGetDownloadedModels() + const messages = useAtomValue(getCurrentChatMessagesAtom) const { activeThreadId, setActiveThread: onThreadClick } = useSetActiveThread() @@ -89,7 +92,14 @@ export default function ThreadList() { className={twMerge( `group/message relative mb-1 flex cursor-pointer flex-col transition-all hover:rounded-lg hover:bg-gray-100 hover:dark:bg-secondary/50` )} - onClick={() => onThreadClick(thread)} + onClick={() => { + if ( + messages[messages.length - 1]?.status !== + MessageStatus.Pending + ) { + onThreadClick(thread) + } + }} >
From 370f0c4696263ed4853d3991df3faf81e1d77b37 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Thu, 4 Jan 2024 23:44:18 +0700 Subject: [PATCH 3/8] fix: stop streaming while delete and clean thread --- web/screens/Chat/ThreadList/index.tsx | 38 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/web/screens/Chat/ThreadList/index.tsx b/web/screens/Chat/ThreadList/index.tsx index d82951a3fc..0a98e91d29 100644 --- a/web/screens/Chat/ThreadList/index.tsx +++ b/web/screens/Chat/ThreadList/index.tsx @@ -6,6 +6,7 @@ import { ModalTrigger, ModalClose, ModalFooter, + ModalPortal, ModalContent, ModalHeader, ModalTitle, @@ -34,7 +35,6 @@ import useThreads from '@/hooks/useThreads' import { displayDate } from '@/utils/datetime' -import { getCurrentChatMessagesAtom } from '@/helpers/atoms/ChatMessage.atom' import { activeThreadAtom, threadStatesAtom, @@ -50,7 +50,6 @@ export default function ThreadList() { const activeThread = useAtomValue(activeThreadAtom) const { deleteThread, cleanThread } = useDeleteThread() const { downloadedModels } = useGetDownloadedModels() - const messages = useAtomValue(getCurrentChatMessagesAtom) const { activeThreadId, setActiveThread: onThreadClick } = useSetActiveThread() @@ -93,12 +92,8 @@ export default function ThreadList() { `group/message relative mb-1 flex cursor-pointer flex-col transition-all hover:rounded-lg hover:bg-gray-100 hover:dark:bg-secondary/50` )} onClick={() => { - if ( - messages[messages.length - 1]?.status !== - MessageStatus.Pending - ) { - onThreadClick(thread) - } + console.log('a') + onThreadClick(thread) }} >
@@ -121,7 +116,7 @@ export default function ThreadList() {
- + e.stopPropagation()}>
+ Clean Thread @@ -139,13 +135,19 @@ export default function ThreadList() {

Are you sure you want to clean this thread?

- + e.stopPropagation()} + > From 497c51cc4f450e4d2cca0b18fa0ab1f14e2120ca Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Thu, 4 Jan 2024 23:45:13 +0700 Subject: [PATCH 4/8] fix: remove unused import --- web/screens/Chat/ThreadList/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/web/screens/Chat/ThreadList/index.tsx b/web/screens/Chat/ThreadList/index.tsx index 0a98e91d29..c7c4c7df66 100644 --- a/web/screens/Chat/ThreadList/index.tsx +++ b/web/screens/Chat/ThreadList/index.tsx @@ -1,6 +1,5 @@ import { useEffect } from 'react' -import { MessageStatus } from '@janhq/core' import { Modal, ModalTrigger, From 08957166a66a564dcc4b8830408747e2968d129a Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 5 Jan 2024 09:46:07 +0700 Subject: [PATCH 5/8] Update web/screens/Chat/ThreadList/index.tsx --- web/screens/Chat/ThreadList/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/web/screens/Chat/ThreadList/index.tsx b/web/screens/Chat/ThreadList/index.tsx index c7c4c7df66..0e09a20a79 100644 --- a/web/screens/Chat/ThreadList/index.tsx +++ b/web/screens/Chat/ThreadList/index.tsx @@ -91,7 +91,6 @@ export default function ThreadList() { `group/message relative mb-1 flex cursor-pointer flex-col transition-all hover:rounded-lg hover:bg-gray-100 hover:dark:bg-secondary/50` )} onClick={() => { - console.log('a') onThreadClick(thread) }} > From 13ac421cddc3c25ef3ab34324e4add5b80bd35ec Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 5 Jan 2024 11:22:28 +0700 Subject: [PATCH 6/8] fix: copy stream tooltip and hide section when no params setting --- .../Chat/ModelSetting/predefinedComponent.ts | 2 +- web/screens/Chat/Sidebar/index.tsx | 64 +++++++++++-------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/web/screens/Chat/ModelSetting/predefinedComponent.ts b/web/screens/Chat/ModelSetting/predefinedComponent.ts index cc794556db..b8eafa2f17 100644 --- a/web/screens/Chat/ModelSetting/predefinedComponent.ts +++ b/web/screens/Chat/ModelSetting/predefinedComponent.ts @@ -72,7 +72,7 @@ export const presetConfiguration: Record = { stream: { name: 'stream', title: 'Stream', - description: 'Stream', + description: 'Enable real-time data processing for faster predictions.', controllerType: 'checkbox', controllerData: { checked: false, diff --git a/web/screens/Chat/Sidebar/index.tsx b/web/screens/Chat/Sidebar/index.tsx index dce4fdf072..14c2a67d65 100644 --- a/web/screens/Chat/Sidebar/index.tsx +++ b/web/screens/Chat/Sidebar/index.tsx @@ -19,7 +19,7 @@ import DropdownListSidebar, { import { useCreateNewThread } from '@/hooks/useCreateNewThread' import { getConfigurationsData } from '@/utils/componentSettings' -import { toSettingParams } from '@/utils/model_param' +import { toRuntimeParams, toSettingParams } from '@/utils/model_param' import EngineSetting from '../EngineSetting' import ModelSetting from '../ModelSetting' @@ -44,7 +44,9 @@ const Sidebar: React.FC = () => { const threadStates = useAtomValue(threadStatesAtom) const modelEngineParams = toSettingParams(activeModelParams) - const componentDataEngineSetting = getConfigurationsData(modelEngineParams) + const modelRuntimeParams = toRuntimeParams(activeModelParams) + const componentDataRuntimeSetting = getConfigurationsData(modelEngineParams) + const componentDataEngineSetting = getConfigurationsData(modelRuntimeParams) const onReviewInFinderClick = async (type: string) => { if (!activeThread) return @@ -224,34 +226,42 @@ const Sidebar: React.FC = () => {
-
- -
- -
-
-
+ {componentDataRuntimeSetting.length !== 0 && ( +
+ +
+ +
+
+
+ )} -
- -
- {settingComponentBuilder(componentDataEngineSetting, true)} + {componentDataEngineSetting.length !== 0 && ( + <> +
+ +
+ {settingComponentBuilder( + componentDataEngineSetting, + true + )} +
+
- -
- -
- -
- +
+ +
+ +
+
- -
+ + )}
From 0d8e6204b86871bae75329045eea7b64865206d5 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 5 Jan 2024 11:25:59 +0700 Subject: [PATCH 7/8] fix: conditional section promp_template --- web/screens/Chat/Sidebar/index.tsx | 50 ++++++++++++++++-------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/web/screens/Chat/Sidebar/index.tsx b/web/screens/Chat/Sidebar/index.tsx index 14c2a67d65..bfa8bde9d5 100644 --- a/web/screens/Chat/Sidebar/index.tsx +++ b/web/screens/Chat/Sidebar/index.tsx @@ -48,6 +48,8 @@ const Sidebar: React.FC = () => { const componentDataRuntimeSetting = getConfigurationsData(modelEngineParams) const componentDataEngineSetting = getConfigurationsData(modelRuntimeParams) + console.log(componentDataEngineSetting) + const onReviewInFinderClick = async (type: string) => { if (!activeThread) return const activeThreadState = threadStates[activeThread.id] @@ -236,31 +238,31 @@ const Sidebar: React.FC = () => {
)} + {componentDataEngineSetting.filter( + (x) => x.name === 'prompt_template' + ).length !== 0 && ( +
+ +
+ {settingComponentBuilder(componentDataEngineSetting, true)} +
+
+
+ )} + {componentDataEngineSetting.length !== 0 && ( - <> -
- -
- {settingComponentBuilder( - componentDataEngineSetting, - true - )} -
-
-
-
- -
- -
-
-
- +
+ +
+ +
+
+
)}
From d59f83c8e9aa6cd0fb957ead29f10abeb8fac57a Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 5 Jan 2024 11:34:57 +0700 Subject: [PATCH 8/8] fix: show hide section engine params --- web/screens/Chat/Sidebar/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/screens/Chat/Sidebar/index.tsx b/web/screens/Chat/Sidebar/index.tsx index bfa8bde9d5..b1af0a19e4 100644 --- a/web/screens/Chat/Sidebar/index.tsx +++ b/web/screens/Chat/Sidebar/index.tsx @@ -45,10 +45,8 @@ const Sidebar: React.FC = () => { const modelEngineParams = toSettingParams(activeModelParams) const modelRuntimeParams = toRuntimeParams(activeModelParams) - const componentDataRuntimeSetting = getConfigurationsData(modelEngineParams) - const componentDataEngineSetting = getConfigurationsData(modelRuntimeParams) - - console.log(componentDataEngineSetting) + const componentDataEngineSetting = getConfigurationsData(modelEngineParams) + const componentDataRuntimeSetting = getConfigurationsData(modelRuntimeParams) const onReviewInFinderClick = async (type: string) => { if (!activeThread) return