Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyu committed Dec 23, 2024
1 parent d22467a commit 8619efe
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 47 deletions.
2 changes: 1 addition & 1 deletion packages/ui/src/ui-component/table/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const TableViewOnly = ({ columns, rows, sx }) => {
return (
<>
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650, ...sx }} aria-label='simple table'>
<Table sx={{ ...sx }} aria-label='simple table'>
<TableHead>
<TableRow>
{columns.map((col, index) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ const CustomAssistantConfigurePreview = () => {
<Box className='bg-white shadow-card p-4 rounded'>
<div style={{ display: 'flex', flexDirection: 'row' }}>
<Typography>
Select Model<span style={{ color: 'red' }}>&nbsp;*</span>
选择模型<span style={{ color: 'red' }}>&nbsp;*</span>
</Typography>
</div>
<Dropdown
Expand Down Expand Up @@ -929,7 +929,7 @@ const CustomAssistantConfigurePreview = () => {
<Box className='bg-white shadow-card p-4 rounded mt-4'>
<Stack sx={{ position: 'relative', alignItems: 'center' }} direction='row'>
<Typography>
Instructions<span style={{ color: 'red' }}>&nbsp;*</span>
指令<span style={{ color: 'red' }}>&nbsp;*</span>
</Typography>
<div style={{ flex: 1 }}></div>
{selectedChatModel?.name && (
Expand All @@ -956,7 +956,7 @@ const CustomAssistantConfigurePreview = () => {
</Box>
<Box className='bg-white shadow-card p-4 rounded mt-4'>
<Stack sx={{ position: 'relative', alignItems: 'center' }} direction='row'>
<Typography>Knowledge (Document Stores)</Typography>
<Typography>知识库 (Document Stores)</Typography>
<TooltipWithParser title='Give your assistant context about different document sources' />
</Stack>
<MultiDropdown
Expand Down Expand Up @@ -1131,23 +1131,18 @@ const CustomAssistantConfigurePreview = () => {
variant='outlined'
onClick={() => setSelectedTools([...selectedTools, {}])}
>
Add Tool
添加工具
</Button>
</Box>
{selectedChatModel && Object.keys(selectedChatModel).length > 0 && (
<Button
fullWidth
title='Save Assistant'
sx={{
mt: 1,
mb: 1,
borderRadius: 20,
background: 'linear-gradient(45deg, #673ab7 30%, #1e88e5 90%)'
}}
className='mt-4'
variant='contained'
onClick={onSaveAndProcess}
>
Save Assistant
保存
</Button>
)}
</Box>
Expand Down
59 changes: 24 additions & 35 deletions packages/ui/src/views/chatflows/APICodeDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -719,15 +719,14 @@ formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")`
showLineNumbers={false}
wrapLines
/>
<CheckboxInput label='Show Override Config' value={checkboxVal} onChange={onCheckBoxChanged} />
<CheckboxInput label='显示可配置参数' value={checkboxVal} onChange={onCheckBoxChanged} />
{checkboxVal && getConfigApi.data && getConfigApi.data.length > 0 && (
<>
<Typography sx={{ mt: 2, mb: 3 }}>
You can override existing input configuration of the chatflow with overrideConfig
property.
您可以使用overrideConfig属性覆盖现有的配置参数。
</Typography>
<Stack direction='column' spacing={2} sx={{ width: '100%', my: 2 }}>
<Card sx={{ borderColor: theme.palette.primary[200] + 75, p: 2 }} variant='outlined'>
<Box>
<Stack
sx={{ mt: 1, mb: 2, ml: 1, alignItems: 'center' }}
direction='row'
Expand All @@ -744,6 +743,7 @@ formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")`
onChange={handleAccordionChange(nodeLabel)}
key={nodeLabel}
disableGutters
className='shadow-none'
>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
Expand Down Expand Up @@ -794,8 +794,8 @@ formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")`
</AccordionDetails>
</Accordion>
))}
</Card>
<Card sx={{ borderColor: theme.palette.primary[200] + 75, p: 2 }} variant='outlined'>
</Box>
<Box>
<Stack
sx={{ mt: 1, mb: 2, ml: 1, alignItems: 'center' }}
direction='row'
Expand All @@ -805,7 +805,7 @@ formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")`
<Typography variant='h4'>Variables</Typography>
</Stack>
<TableViewOnly rows={variableOverrides} columns={['name', 'type', 'enabled']} />
</Card>
</Box>
</Stack>
<CopyBlock
theme={atomOneDark}
Expand All @@ -826,52 +826,41 @@ formData.append("openAIApiKey[openAIEmbeddings_0]", "sk-my-openai-2nd-key")`
style={{
display: 'flex',
flexDirection: 'column',
borderRadius: 10,
background: '#d8f3dc',
padding: 10,
marginTop: 10,
marginBottom: 10
}}
>
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
}}
>
<IconBulb size={30} color='#2d6a4f' />
<span style={{ color: '#2d6a4f', marginLeft: 10, fontWeight: 500 }}>
<div className='flex items-center mb-2 mt-2'>
<IconBulb size='1.2rem' color='#2d6a4f' />
<span style={{ color: '#2d6a4f', marginLeft: 5, fontWeight: 500 }}>
您还可以通过指定节点id为配置参数指定多个值
</span>
</div>
<div style={{ padding: 10 }}>
<CopyBlock
theme={atomOneDark}
text={
dialogProps.isFormDataRequired
? getMultiConfigCodeWithFormData(codeLang)
: getMultiConfigCode()
}
language={getLang(codeLang)}
showLineNumbers={false}
wrapLines
/>
</div>
<CopyBlock
theme={atomOneDark}
text={
dialogProps.isFormDataRequired
? getMultiConfigCodeWithFormData(codeLang)
: getMultiConfigCode()
}
language={getLang(codeLang)}
showLineNumbers={false}
wrapLines
/>
</div>
</>
)}
{getIsChatflowStreamingApi.data?.isStreaming && (
<p>
Read&nbsp;
查看&nbsp;
<a
rel='noreferrer'
target='_blank'
href='https://docs.flowiseai.com/using-flowise/streaming'
>
here
这里
</a>
&nbsp;on how to stream response back to application
&nbsp;了解应用程序如何接收流式响应。
</p>
)}
</Box>
Expand Down

0 comments on commit 8619efe

Please sign in to comment.