frontend for model runtime (#1861)

Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
zxhlyh
2024-01-03 00:05:08 +08:00
committed by GitHub
parent d069c668f8
commit d70d61b1cb
29 changed files with 1442 additions and 917 deletions

View File

@@ -347,7 +347,6 @@ const Debug: FC<IDebug> = ({
}
},
onMessageEnd: (messageEnd) => {
// TODO
if (messageEnd.metadata?.annotation_reply) {
responseItem.id = messageEnd.id
responseItem.annotation = ({
@@ -382,27 +381,6 @@ const Debug: FC<IDebug> = ({
onMessageReplace: (messageReplace) => {
responseItem.content = messageReplace.answer
},
onAnnotationReply: (annotationReply) => {
// TODO: temp debug
responseItem.id = annotationReply.id
responseItem.content = annotationReply.answer
responseItem.annotation = ({
id: annotationReply.annotation_id,
authorName: annotationReply.annotation_author_name,
} as AnnotationType)
const newListWithAnswer = produce(
getChatList().filter(item => item.id !== responseItem.id && item.id !== placeholderAnswerId),
(draft) => {
if (!draft.find(item => item.id === questionId))
draft.push({ ...questionItem })
draft.push({
...responseItem,
id: annotationReply.id,
})
})
setChatList(newListWithAnswer)
},
onError() {
setResponsingFalse()
// role back placeholder answer