feat: 模型介绍和温度调整。完善聊天页提示

This commit is contained in:
Archer
2023-03-18 12:32:55 +08:00
parent 1c364eca35
commit 00b90f071d
32 changed files with 628 additions and 327 deletions

View File

@@ -172,7 +172,7 @@
}
.markdown ul,
.markdown ol {
padding-left: 30px;
padding-left: 1em;
}
.markdown ul.no-list,
.markdown ol.no-list {

View File

@@ -12,7 +12,7 @@ import 'katex/dist/katex.min.css';
import styles from './index.module.scss';
import { codeLight } from './codeLight';
const Markdown = ({ source, isChatting }: { source: string; isChatting: boolean }) => {
const Markdown = ({ source, isChatting = false }: { source: string; isChatting?: boolean }) => {
const formatSource = useMemo(() => source, [source]);
const { copyData } = useCopyData();

View File

@@ -0,0 +1,82 @@
import React, { useMemo } from 'react';
import {
Slider,
SliderTrack,
SliderFilledTrack,
SliderThumb,
SliderMark,
Box
} from '@chakra-ui/react';
const MySlider = ({
markList,
setVal,
activeVal,
max = 100,
min = 0,
step = 1
}: {
markList: {
label: string | number;
value: number;
}[];
activeVal?: number;
setVal: (index: number) => void;
max?: number;
min?: number;
step?: number;
}) => {
const startEndPointStyle = {
content: '""',
borderRadius: '10px',
width: '10px',
height: '10px',
backgroundColor: '#ffffff',
border: '2px solid #D7DBE2',
position: 'absolute',
zIndex: 1,
top: 0,
transform: 'translateY(-3px)'
};
const value = useMemo(() => {
const index = markList.findIndex((item) => item.value === activeVal);
return index > -1 ? index : 0;
}, [activeVal, markList]);
return (
<Slider max={max} min={min} step={step} size={'lg'} value={value} onChange={setVal}>
{markList.map((item, i) => (
<SliderMark
key={item.value}
value={i}
mt={3}
fontSize={'sm'}
transform={'translateX(-50%)'}
{...(activeVal === item.value ? { color: 'blue.500', fontWeight: 'bold' } : {})}
>
<Box px={3} cursor={'pointer'}>
{item.label}
</Box>
</SliderMark>
))}
<SliderTrack
bg={'#EAEDF3'}
overflow={'visible'}
h={'4px'}
_before={{
...startEndPointStyle,
left: '-5px'
}}
_after={{
...startEndPointStyle,
right: '-5px'
}}
>
<SliderFilledTrack />
</SliderTrack>
<SliderThumb border={'2.5px solid'} borderColor={'blue.500'}></SliderThumb>
</Slider>
);
};
export default MySlider;