feat: add api-based extension & external data tool & moderation (#1459)
This commit is contained in:
@@ -368,7 +368,7 @@ const Main: FC<IMainProps> = ({
|
||||
const isNotNewConversation = allConversations.some(item => item.id === _conversationId)
|
||||
setAllConversationList(allConversations)
|
||||
// fetch new conversation info
|
||||
const { user_input_form, opening_statement: introduction, suggested_questions_after_answer, speech_to_text, retriever_resource }: any = appParams
|
||||
const { user_input_form, opening_statement: introduction, suggested_questions_after_answer, speech_to_text, retriever_resource, sensitive_word_avoidance }: any = appParams
|
||||
const prompt_variables = userInputsFormToPromptVariables(user_input_form)
|
||||
if (siteInfo.default_language)
|
||||
changeLanguage(siteInfo.default_language)
|
||||
@@ -555,6 +555,22 @@ const Main: FC<IMainProps> = ({
|
||||
setChatList(newListWithAnswer)
|
||||
}
|
||||
: undefined,
|
||||
onMessageReplace: (messageReplace) => {
|
||||
if (isInstalledApp) {
|
||||
responseItem.content = messageReplace.answer
|
||||
}
|
||||
else {
|
||||
setChatList(produce(
|
||||
getChatList(),
|
||||
(draft) => {
|
||||
const current = draft.find(item => item.id === messageReplace.id)
|
||||
|
||||
if (current)
|
||||
current.content = messageReplace.answer
|
||||
},
|
||||
))
|
||||
}
|
||||
},
|
||||
onError() {
|
||||
setResponsingFalse()
|
||||
// role back placeholder answer
|
||||
|
Reference in New Issue
Block a user