|
|
@@ -617,37 +617,37 @@ export function ChatActions(props: {
|
|
|
}
|
|
|
}, [chatStore, currentModel, models]);
|
|
|
|
|
|
- const fetchGuessList = async (record: { content: string; role: string }) => {
|
|
|
- try {
|
|
|
- const data = {
|
|
|
- appId: session.appId,
|
|
|
- messages: [
|
|
|
- {
|
|
|
- content: record.content,
|
|
|
- role: record.role,
|
|
|
- }
|
|
|
- ],
|
|
|
- chat_id: session.chat_id,
|
|
|
- }
|
|
|
- let url = '';
|
|
|
- if (chatStore.chatMode === 'LOCAL') {
|
|
|
- url = '/deepseek/api/async/completions';
|
|
|
- } else {
|
|
|
- url = '/bigmodel/api/async/completions';
|
|
|
- }
|
|
|
- const res = await api.post(url, data);
|
|
|
- setGuessList(res.data);
|
|
|
- } catch (error) {
|
|
|
- console.error(error);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- useEffect(() => {
|
|
|
- setGuessList([]);
|
|
|
- if (chatStore.message.content) {
|
|
|
- fetchGuessList(chatStore.message);
|
|
|
- }
|
|
|
- }, [chatStore.message]);
|
|
|
+ // const fetchGuessList = async (record: { content: string; role: string }) => {
|
|
|
+ // try {
|
|
|
+ // const data = {
|
|
|
+ // appId: session.appId,
|
|
|
+ // messages: [
|
|
|
+ // {
|
|
|
+ // content: record.content,
|
|
|
+ // role: record.role,
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ // chat_id: session.chat_id,
|
|
|
+ // }
|
|
|
+ // let url = '';
|
|
|
+ // if (chatStore.chatMode === 'LOCAL') {
|
|
|
+ // url = '/deepseek/api/async/completions';
|
|
|
+ // } else {
|
|
|
+ // url = '/bigmodel/api/async/completions';
|
|
|
+ // }
|
|
|
+ // const res = await api.post(url, data);
|
|
|
+ // setGuessList(res.data);
|
|
|
+ // } catch (error) {
|
|
|
+ // console.error(error);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // useEffect(() => {
|
|
|
+ // setGuessList([]);
|
|
|
+ // if (chatStore.message.content) {
|
|
|
+ // fetchGuessList(chatStore.message);
|
|
|
+ // }
|
|
|
+ // }, [chatStore.message]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (props.isClickStop) {
|
|
|
@@ -659,45 +659,45 @@ export function ChatActions(props: {
|
|
|
return (
|
|
|
<div className={styles["chat-input-actions"]}>
|
|
|
{
|
|
|
- props.sendStatus &&
|
|
|
- <div style={{ color: '#8096ca', fontSize: 13, overflowX: 'auto' }}>
|
|
|
- <div>
|
|
|
- 你还可以尝试提问:
|
|
|
- </div>
|
|
|
- {
|
|
|
- guessList.length === 0 ?
|
|
|
- <Space style={{ margin: '10px 0' }}>
|
|
|
- <Skeleton.Button size="small" active={true} />
|
|
|
- <Skeleton.Button size="small" active={true} />
|
|
|
- <Skeleton.Button size="small" active={true} />
|
|
|
- </Space>
|
|
|
- :
|
|
|
- <div style={{ display: 'flex', margin: '10px 0', overflowX: 'auto' }}>
|
|
|
- {
|
|
|
- guessList.map((item, index) => {
|
|
|
- return (
|
|
|
- <div
|
|
|
- style={{
|
|
|
- padding: '5px 10px',
|
|
|
- background: '#f2f4f8',
|
|
|
- borderRadius: 5,
|
|
|
- margin: '0 10px 10px 0',
|
|
|
- cursor: 'pointer',
|
|
|
- }}
|
|
|
- onClick={() => {
|
|
|
- props.setUserInput(item);
|
|
|
- props.doSubmit(item)
|
|
|
- }}
|
|
|
- key={index}
|
|
|
- >
|
|
|
- {item}
|
|
|
- </div>
|
|
|
- )
|
|
|
- })
|
|
|
- }
|
|
|
- </div>
|
|
|
- }
|
|
|
- </div>
|
|
|
+ // props.sendStatus &&
|
|
|
+ // <div style={{ color: '#8096ca', fontSize: 13, overflowX: 'auto' }}>
|
|
|
+ // <div>
|
|
|
+ // 你还可以尝试提问:
|
|
|
+ // </div>
|
|
|
+ // {
|
|
|
+ // guessList.length === 0 ?
|
|
|
+ // <Space style={{ margin: '10px 0' }}>
|
|
|
+ // <Skeleton.Button size="small" active={true} />
|
|
|
+ // <Skeleton.Button size="small" active={true} />
|
|
|
+ // <Skeleton.Button size="small" active={true} />
|
|
|
+ // </Space>
|
|
|
+ // :
|
|
|
+ // <div style={{ display: 'flex', margin: '10px 0', overflowX: 'auto' }}>
|
|
|
+ // {
|
|
|
+ // guessList.map((item, index) => {
|
|
|
+ // return (
|
|
|
+ // <div
|
|
|
+ // style={{
|
|
|
+ // padding: '5px 10px',
|
|
|
+ // background: '#f2f4f8',
|
|
|
+ // borderRadius: 5,
|
|
|
+ // margin: '0 10px 10px 0',
|
|
|
+ // cursor: 'pointer',
|
|
|
+ // }}
|
|
|
+ // onClick={() => {
|
|
|
+ // props.setUserInput(item);
|
|
|
+ // props.doSubmit(item)
|
|
|
+ // }}
|
|
|
+ // key={index}
|
|
|
+ // >
|
|
|
+ // {item}
|
|
|
+ // </div>
|
|
|
+ // )
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // </div>
|
|
|
+ // }
|
|
|
+ // </div>
|
|
|
}
|
|
|
{/* {couldStop && (
|
|
|
<ChatAction
|
|
|
@@ -2159,7 +2159,7 @@ function _Chat() {
|
|
|
<p style={{ textAlign: 'center' }}>
|
|
|
{getDesc()}
|
|
|
</p>
|
|
|
- <p>我猜您可能想问:</p>
|
|
|
+ {/* <p>我猜您可能想问:</p>
|
|
|
{
|
|
|
questionList.map((item, index) => {
|
|
|
return (
|
|
|
@@ -2188,7 +2188,7 @@ function _Chat() {
|
|
|
</div>
|
|
|
)
|
|
|
})
|
|
|
- }
|
|
|
+ } */}
|
|
|
</div>
|
|
|
</>
|
|
|
}
|