Skip to content

Commit

Permalink
fix: conditional section promp_template
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Jan 5, 2024
1 parent 13ac421 commit 0d8e620
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions web/screens/Chat/Sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -236,31 +238,31 @@ const Sidebar: React.FC = () => {
</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>
)}

{componentDataEngineSetting.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>
</>
<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>
Expand Down

0 comments on commit 0d8e620

Please sign in to comment.