Skip to content

Commit

Permalink
Merge pull request #38 from AGIUI/dev0.3.4-shadow
Browse files Browse the repository at this point in the history
Dev0.3.4 shadow
  • Loading branch information
shadowcz007 committed Jun 11, 2023
2 parents 81b81fd + c4fa827 commit bf37190
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/ChatbotMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ const sendMessageToBackground = {
'api-run': (data: any) => sendMessageCanRetry('api-run', data, console.log),
'open-options-page': (data: any) => sendMessageCanRetry('open-options-page', data, console.log),
'hi': (data: any) => sendMessageCanRetry('hi', data, console.log),

}


Expand Down Expand Up @@ -589,7 +590,8 @@ class Main extends React.Component<{
})
} else if (cmd == 'chat-bot-init-result') {
this.initChatBot(false);
}
}


sendResponse('我是content,已收到消息')
return true;
Expand Down Expand Up @@ -1376,14 +1378,15 @@ class Main extends React.Component<{
promptJson = { ...promptJson, ...await promptBindUserClipboard(promptJson.userInput) }
} else if (prompt.input == 'nodeInput') {
// 从上一节点获取文本,prompt的输入从上一个节点输入
console.log('从上一节点获取文本', prompt, prompt.nodeInputId, nTalks)
console.log('从上一节点获取文本', prompt.nodeInputId, nTalks)
if (!prompt.nodeInputId) {
let lastTalk: any = Talks.getLastTalk([...nTalks]);
promptJson = { ...promptJson, ...promptUseLastTalk(promptJson.userInput, lastTalk) }
} else {
let talk: any = Talks.getTalkByPromptId(prompt.nodeInputId, [...nTalks]);
promptJson = { ...promptJson, ...promptUseLastTalk(promptJson.userInput, talk) }
}
console.log('从上一节点获取文本', prompt.nodeInputId, promptJson.context)
}

// translate的处理
Expand Down
4 changes: 3 additions & 1 deletion src/components/background/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/

import { fetchImage } from '../Utils'


class Common {
constructor(json, chatBot, Agent, Credit) {
Expand Down Expand Up @@ -275,7 +277,7 @@ class Common {
Credit.getPoints(token, apiName).then(res => {
chrome.storage.sync.set({ myPoints: res })
})
}
};
sendResponse('我是后台,已收到消息:' + JSON.stringify(request))
return true
}
Expand Down

0 comments on commit bf37190

Please sign in to comment.