From bce4ff63896547344c032b15cdbe6ef2122d4f93 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Mon, 3 Jul 2023 16:31:44 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit promptJson.model promptJson.temperature --- src/components/ChatbotMain.tsx | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/components/ChatbotMain.tsx b/src/components/ChatbotMain.tsx index e526d4f..3ce3c54 100644 --- a/src/components/ChatbotMain.tsx +++ b/src/components/ChatbotMain.tsx @@ -1565,15 +1565,26 @@ class Main extends React.Component<{ if (this.state.chatBotStyle && this.state.chatBotStyle.value) promptJson.temperature = this.state.chatBotStyle.value; } - // role 给调试用 + if ([ 'prompt', - 'promptCustom', + 'promptCustom' + ].includes(promptJson.type)) { + + if (!promptJson.model) promptJson.model = this.state.chatBotType; + if (!promptJson.temperature && this.state.chatBotStyle && this.state.chatBotStyle.value) promptJson.temperature = this.state.chatBotStyle.value; + + this._llmRun(promptJson, newTalk); + + }; + + // role 给调试用 + if ([ 'role', ].includes(promptJson.type)) { - if (!promptJson.prompt.model) promptJson.prompt.model = this.state.chatBotType; - if (!promptJson.prompt.temperature && this.state.chatBotStyle && this.state.chatBotStyle.value) promptJson.prompt.temperature = this.state.chatBotStyle.value; + promptJson.model = this.state.chatBotType; + if (this.state.chatBotStyle && this.state.chatBotStyle.value) promptJson.temperature = this.state.chatBotStyle.value; this._llmRun(promptJson, newTalk); From f49688371f256205fb00ae26f74687a78259a938 Mon Sep 17 00:00:00 2001 From: shadowcz007 Date: Mon, 3 Jul 2023 16:32:03 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/flow/Sidebar/index.tsx | 5 +- src/components/flow/Workflow.tsx | 2 +- .../flow/nodeComponents/APINode.tsx | 17 ++- src/components/flow/nodeComponents/Base.tsx | 106 ++++++++------ .../flow/nodeComponents/CustomPromptNode.tsx | 12 +- .../flow/nodeComponents/FilePPTCreateNode.tsx | 4 +- .../flow/nodeComponents/PromptNode.tsx | 24 ++-- .../flow/nodeComponents/QueryClickNode.tsx | 98 ++++++------- .../flow/nodeComponents/QueryDefaultNode.tsx | 136 +++++++++++------- .../flow/nodeComponents/QueryInputNode.tsx | 114 ++++++++------- .../flow/nodeComponents/QueryReadNode.tsx | 100 ++++++------- .../flow/nodeComponents/UserInputTextNode.tsx | 45 ++---- src/components/flow/nodeComponents/index.tsx | 1 - src/config/app.json | 2 +- src/locales/en.json | 13 +- src/locales/zh.json | 12 +- 16 files changed, 378 insertions(+), 313 deletions(-) diff --git a/src/components/flow/Sidebar/index.tsx b/src/components/flow/Sidebar/index.tsx index b0cd72e..63ec643 100644 --- a/src/components/flow/Sidebar/index.tsx +++ b/src/components/flow/Sidebar/index.tsx @@ -30,7 +30,7 @@ export default (props: any) => { onChange={onChange} style={{ width: 180, userSelect: 'none', - background: 'white' + background: 'white', }}>

{i18n.t('component')}

{ @@ -39,8 +39,9 @@ export default (props: any) => {