Skip to content

Commit

Permalink
Merge branch 'main' into docs/add-guides
Browse files Browse the repository at this point in the history
  • Loading branch information
freelerobot authored Jan 5, 2024
2 parents f5b5dfd + d59f83c commit 565e690
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 38 deletions.
4 changes: 2 additions & 2 deletions docs/docs/about/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
## Footnotes
2 changes: 1 addition & 1 deletion web/screens/Chat/ModelSetting/predefinedComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const presetConfiguration: Record<string, SettingComponentData> = {
stream: {
name: 'stream',
title: 'Stream',
description: 'Stream',
description: 'Enable real-time data processing for faster predictions.',
controllerType: 'checkbox',
controllerData: {
checked: false,
Expand Down
64 changes: 37 additions & 27 deletions web/screens/Chat/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -44,7 +44,9 @@ const Sidebar: React.FC = () => {
const threadStates = useAtomValue(threadStatesAtom)

const modelEngineParams = toSettingParams(activeModelParams)
const modelRuntimeParams = toRuntimeParams(activeModelParams)
const componentDataEngineSetting = getConfigurationsData(modelEngineParams)
const componentDataRuntimeSetting = getConfigurationsData(modelRuntimeParams)

const onReviewInFinderClick = async (type: string) => {
if (!activeThread) return
Expand Down Expand Up @@ -224,34 +226,42 @@ const Sidebar: React.FC = () => {
<DropdownListSidebar />
</div>

<div className="mt-6">
<CardSidebar title="Inference Parameters" asChild>
<div className="px-2 py-4">
<ModelSetting />
</div>
</CardSidebar>
</div>
{componentDataRuntimeSetting.length !== 0 && (
<div className="mt-6">
<CardSidebar title="Inference Parameters" asChild>
<div className="px-2 py-4">
<ModelSetting />
</div>
</CardSidebar>
</div>
)}

<div className="mt-4">
<CardSidebar title="Model Parameters" asChild>
<div className="px-2 py-4">
{settingComponentBuilder(componentDataEngineSetting, true)}
</div>
</CardSidebar>
</div>
{componentDataEngineSetting.filter(
(x) => x.name === 'prompt_template'
).length !== 0 && (
<div className="mt-4">
<CardSidebar title="Model Parameters" asChild>
<div className="px-2 py-4">
{settingComponentBuilder(componentDataEngineSetting, true)}
</div>
</CardSidebar>
</div>
)}

<div className="my-4">
<CardSidebar
title="Engine Parameters"
onRevealInFinderClick={onReviewInFinderClick}
onViewJsonClick={onViewJsonClick}
asChild
>
<div className="px-2 py-4">
<EngineSetting />
</div>
</CardSidebar>
</div>
{componentDataEngineSetting.length !== 0 && (
<div className="my-4">
<CardSidebar
title="Engine Parameters"
onRevealInFinderClick={onReviewInFinderClick}
onViewJsonClick={onViewJsonClick}
asChild
>
<div className="px-2 py-4">
<EngineSetting />
</div>
</CardSidebar>
</div>
)}
</div>
</CardSidebar>
</div>
Expand Down
32 changes: 24 additions & 8 deletions web/screens/Chat/ThreadList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ModalTrigger,
ModalClose,
ModalFooter,
ModalPortal,
ModalContent,
ModalHeader,
ModalTitle,
Expand Down Expand Up @@ -89,7 +90,9 @@ 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={() => {
onThreadClick(thread)
}}
>
<div className="relative z-10 p-4 py-4">
<div className="flex justify-between">
Expand All @@ -111,7 +114,7 @@ export default function ThreadList() {
<MoreVerticalIcon />
<div className="invisible absolute right-0 z-20 w-40 overflow-hidden rounded-lg border border-border bg-background shadow-lg group-hover/icon:visible">
<Modal>
<ModalTrigger asChild>
<ModalTrigger asChild onClick={(e) => e.stopPropagation()}>
<div className="flex cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-secondary">
<Paintbrush
size={16}
Expand All @@ -122,20 +125,27 @@ export default function ThreadList() {
</span>
</div>
</ModalTrigger>
<ModalPortal />
<ModalContent>
<ModalHeader>
<ModalTitle>Clean Thread</ModalTitle>
</ModalHeader>
<p>Are you sure you want to clean this thread?</p>
<ModalFooter>
<div className="flex gap-x-2">
<ModalClose asChild>
<ModalClose
asChild
onClick={(e) => e.stopPropagation()}
>
<Button themes="ghost">No</Button>
</ModalClose>
<ModalClose asChild>
<Button
themes="danger"
onClick={() => cleanThread(thread.id)}
onClick={(e) => {
e.stopPropagation()
cleanThread(thread.id)
}}
autoFocus
>
Yes
Expand All @@ -145,9 +155,8 @@ export default function ThreadList() {
</ModalFooter>
</ModalContent>
</Modal>

<Modal>
<ModalTrigger asChild>
<ModalTrigger asChild onClick={(e) => e.stopPropagation()}>
<div className="flex cursor-pointer items-center space-x-2 px-4 py-2 hover:bg-secondary">
<Trash2Icon
size={16}
Expand All @@ -158,6 +167,7 @@ export default function ThreadList() {
</span>
</div>
</ModalTrigger>
<ModalPortal />
<ModalContent>
<ModalHeader>
<ModalTitle>Delete Thread</ModalTitle>
Expand All @@ -168,14 +178,20 @@ export default function ThreadList() {
</p>
<ModalFooter>
<div className="flex gap-x-2">
<ModalClose asChild>
<ModalClose
asChild
onClick={(e) => e.stopPropagation()}
>
<Button themes="ghost">No</Button>
</ModalClose>
<ModalClose asChild>
<Button
autoFocus
themes="danger"
onClick={() => deleteThread(thread.id)}
onClick={(e) => {
e.stopPropagation()
deleteThread(thread.id)
}}
>
Yes
</Button>
Expand Down

0 comments on commit 565e690

Please sign in to comment.