feat: new dbgpts modules (#1910)

Co-authored-by: 途杨 <tuyang.yhj@antgroup.com>
Co-authored-by: lhwan <1017484907@qq.com>
This commit is contained in:
明天
2024-08-28 21:31:42 +08:00
committed by GitHub
parent bb5d2d1f3d
commit d7a893e1a7
289 changed files with 3533 additions and 901 deletions

View File

@@ -10,10 +10,11 @@ import { useAsyncEffect } from 'ahooks';
import { Modal } from 'antd';
import { cloneDeep } from 'lodash';
import { useSearchParams } from 'next/navigation';
import React, { useContext, useMemo, useState } from 'react';
import React, { useContext, useMemo, useState, useEffect, useRef } from 'react';
import { v4 as uuid } from 'uuid';
const ChatCompletion: React.FC = () => {
const scrollableRef = useRef<HTMLDivElement>(null);
const searchParams = useSearchParams();
const chatId = searchParams?.get('id') ?? '';
@@ -64,8 +65,14 @@ const ChatCompletion: React.FC = () => {
}
}, [chatId, currentDialogInfo]);
useEffect(() => {
setTimeout(() => {
scrollableRef.current?.scrollTo(0, scrollableRef.current?.scrollHeight);
}, 50);
}, [history]);
return (
<div className="flex flex-col w-5/6 mx-auto">
<div className="flex flex-col w-5/6 mx-auto" ref={scrollableRef}>
{!!showMessages.length &&
showMessages.map((content) => {
return (