feat: send question with retrieval api #2247 (#2272)

### What problem does this PR solve?
feat: send question with retrieval api #2247

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-09-05 19:32:55 +08:00
committed by GitHub
parent 9377192859
commit 6ae0da92cb
17 changed files with 264 additions and 78 deletions

View File

@ -1,19 +0,0 @@
import { api_host } from '@/utils/api';
interface IImage {
id: string;
className: string;
}
const Image = ({ id, className, ...props }: IImage) => {
return (
<img
{...props}
src={`${api_host}/document/image/${id}`}
alt=""
className={className}
/>
);
};
export default Image;

View File

@ -0,0 +1,10 @@
.image {
width: 100px;
object-fit: contain;
}
.imagePreview {
display: block;
max-width: 45vw;
max-height: 40vh;
}

View File

@ -0,0 +1,33 @@
import { api_host } from '@/utils/api';
import { Popover } from 'antd';
import styles from './index.less';
interface IImage {
id: string;
className: string;
}
const Image = ({ id, className, ...props }: IImage) => {
return (
<img
{...props}
src={`${api_host}/document/image/${id}`}
alt=""
className={className}
/>
);
};
export default Image;
export const ImageWithPopover = ({ id }: { id: string }) => {
return (
<Popover
placement="left"
content={<Image id={id} className={styles.imagePreview}></Image>}
>
<Image id={id} className={styles.image}></Image>
</Popover>
);
};