Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
classfang committed Mar 6, 2024
1 parent e8601f0 commit bdeb8f7
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const sendQuestion = async (event?: KeyboardEvent) => {
// 大模型调用
try {
await useBigModel(data.currentSessionId)
await useBigModel()
} catch (e: any) {
Logger.error('big model error: ', e?.message)
const errMsg = e ? e + '' : t(`chatWindow.error.${data.currentAssistant.provider}`)
Expand All @@ -143,7 +143,7 @@ const sendQuestion = async (event?: KeyboardEvent) => {
}
// 使用大模型
const useBigModel = async (currentSessionId: string) => {
const useBigModel = async () => {
// 检查大模型配置
let configErrorFlag = false
switch (data.currentAssistant.provider) {
Expand Down Expand Up @@ -234,15 +234,15 @@ const useBigModel = async (currentSessionId: string) => {
// 大模型通用选项
const chat2bigModelOption: CommonChatOption = {
sessionId: currentSessionId,
sessionId: data.currentSessionId,
model: data.currentAssistant.model,
instruction: data.currentAssistant.instruction,
inputMaxTokens: data.currentAssistant.inputMaxTokens,
maxTokens: data.currentAssistant.maxTokens,
contextSize: data.currentAssistant.contextSize,
messages: data.currentAssistant.chatMessageList,
startAnswer: (sessionId: string, content?: string) => {
if (currentSessionId != sessionId) {
if (data.currentSessionId != sessionId) {
return
}
data.currentAssistant.chatMessageList.push({
Expand All @@ -256,7 +256,7 @@ const useBigModel = async (currentSessionId: string) => {
data.waitAnswer = false
},
appendAnswer: (sessionId: string, content: string) => {
if (currentSessionId != sessionId) {
if (data.currentSessionId != sessionId) {
return
}
data.currentAssistant.chatMessageList[
Expand All @@ -265,7 +265,7 @@ const useBigModel = async (currentSessionId: string) => {
scrollToBottom()
},
end: (sessionId: string, errMsg: any) => {
if (currentSessionId != sessionId) {
if (data.currentSessionId != sessionId) {
return
}
if (errMsg != null) {
Expand Down Expand Up @@ -294,7 +294,7 @@ const useBigModel = async (currentSessionId: string) => {
imageQuality: data.currentAssistant.imageQuality,
imageStyle: data.currentAssistant.imageStyle,
imageGenerated: (sessionId: string, imageUrl: string) => {
if (currentSessionId != sessionId) {
if (data.currentSessionId != sessionId) {
return
}
data.currentAssistant.chatMessageList.push({
Expand Down Expand Up @@ -326,7 +326,7 @@ const useBigModel = async (currentSessionId: string) => {
imagePrompt: question,
imageSize: data.currentAssistant.imageSize,
imageGenerated: (sessionId: string, imageUrl: string) => {
if (currentSessionId != sessionId) {
if (data.currentSessionId != sessionId) {
return
}
data.currentAssistant.chatMessageList.push({
Expand Down Expand Up @@ -358,7 +358,7 @@ const useBigModel = async (currentSessionId: string) => {
imageStyle: data.currentAssistant.imageStyle,
abortCtr,
imageGenerated: (sessionId: string, imageUrl: string) => {
if (currentSessionId != sessionId) {
if (data.currentSessionId != sessionId) {
return
}
data.currentAssistant.chatMessageList.push({
Expand Down

0 comments on commit bdeb8f7

Please sign in to comment.