fix: conditional section promp_template

This commit is contained in:
Faisal Amir 2024-01-05 11:25:59 +07:00
parent 13ac421cdd
commit 0d8e6204b8

View File

@ -48,6 +48,8 @@ const Sidebar: React.FC = () => {
const componentDataRuntimeSetting = getConfigurationsData(modelEngineParams) const componentDataRuntimeSetting = getConfigurationsData(modelEngineParams)
const componentDataEngineSetting = getConfigurationsData(modelRuntimeParams) const componentDataEngineSetting = getConfigurationsData(modelRuntimeParams)
console.log(componentDataEngineSetting)
const onReviewInFinderClick = async (type: string) => { const onReviewInFinderClick = async (type: string) => {
if (!activeThread) return if (!activeThread) return
const activeThreadState = threadStates[activeThread.id] const activeThreadState = threadStates[activeThread.id]
@ -236,31 +238,31 @@ const Sidebar: React.FC = () => {
</div> </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 && ( {componentDataEngineSetting.length !== 0 && (
<> <div className="my-4">
<div className="mt-4"> <CardSidebar
<CardSidebar title="Model Parameters" asChild> title="Engine Parameters"
<div className="px-2 py-4"> onRevealInFinderClick={onReviewInFinderClick}
{settingComponentBuilder( onViewJsonClick={onViewJsonClick}
componentDataEngineSetting, asChild
true >
)} <div className="px-2 py-4">
</div> <EngineSetting />
</CardSidebar> </div>
</div> </CardSidebar>
<div className="my-4"> </div>
<CardSidebar
title="Engine Parameters"
onRevealInFinderClick={onReviewInFinderClick}
onViewJsonClick={onViewJsonClick}
asChild
>
<div className="px-2 py-4">
<EngineSetting />
</div>
</CardSidebar>
</div>
</>
)} )}
</div> </div>
</CardSidebar> </CardSidebar>