Skip to content

Commit

Permalink
Merge pull request #48 from nowscott/development
Browse files Browse the repository at this point in the history
fix:修复改变模型时出现的错误api调用
  • Loading branch information
nowscott authored Jul 22, 2024
2 parents 49370ca + c8474f9 commit e0a5bc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ChatAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const ChatAPI = ({
topP,
topK,
frequencyPenalty,
fullSystemPrompt, // 作为依赖项
fullSystemPrompt,
onContentUpdate,
onTokenUpdate,
onCompletion,
Expand Down
6 changes: 5 additions & 1 deletion src/pages/ChatPage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// src/pages/ChatPage.js
import React, { useState, useCallback } from 'react';
import React, { useState, useCallback, useEffect } from 'react';
import ChatAPI from 'components/ChatAPI';
import NavBar from 'components/layout/NavBar';
import MessageList from 'components/layout/MessageList';
Expand All @@ -17,6 +17,10 @@ const ChatPage = () => {
const [isMessageComplete, setIsMessageComplete] = useState(false);
const [shouldSubmit, setShouldSubmit] = useState(false);

useEffect(() => {
setShouldSubmit(false);
}, [settings]);

const handleContentUpdate = useCallback((newContent) => {
if (!isMessageComplete) {
updateMessage(aiMessageMid, prevMessage => ({
Expand Down

0 comments on commit e0a5bc8

Please sign in to comment.