mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Allow users to enter text in the middle of a chat #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -377,7 +377,7 @@ export const useSelectDerivedMessages = () => {
|
||||
if (idx !== -1) {
|
||||
return pre.map((x) => {
|
||||
if (x.id === answer.id) {
|
||||
return { ...x, content: answer.answer };
|
||||
return { ...x, ...answer, content: answer.answer };
|
||||
}
|
||||
return x;
|
||||
});
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { Authorization } from '@/constants/authorization';
|
||||
import { BeginQuery } from '@/pages/agent/interface';
|
||||
import api from '@/utils/api';
|
||||
import { getAuthorization } from '@/utils/authorization-util';
|
||||
import { EventSourceParserStream } from 'eventsource-parser/stream';
|
||||
@ -31,6 +32,12 @@ export interface INodeData {
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
export interface IInputData {
|
||||
content: string;
|
||||
inputs: Record<string, BeginQuery>;
|
||||
tips: string;
|
||||
}
|
||||
|
||||
export interface IMessageData {
|
||||
content: string;
|
||||
}
|
||||
@ -39,6 +46,8 @@ export type INodeEvent = IAnswerEvent<INodeData>;
|
||||
|
||||
export type IMessageEvent = IAnswerEvent<IMessageData>;
|
||||
|
||||
export type IInputEvent = IAnswerEvent<IInputData>;
|
||||
|
||||
export type IChatEvent = INodeEvent | IMessageEvent;
|
||||
|
||||
export type IEventList = Array<IChatEvent>;
|
||||
|
||||
Reference in New Issue
Block a user